Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A sinatra based associative memory system by David ten Have.
JavaScript Ruby
branch: master

Heterocera Server

A sinatra based associative memory system by David ten Have.


Heterocera is an implementation of an associative memory system. It is inspired by the concept of a tuple space and by the work of David Gelernter (outlined in his book Mirror Worlds).

Heterocera is designed to enable easy communication in heterogeneous environments (e.g. Arduino applications and web applications). This is done by treating the memory space as a web server - where address locations are URLs. Heterocera will handle single values, rich JSON structures and files.

By reducing all interactions to HTTP GET and POST requests even simple platforms can record and retrieve data.

This is not meant to be a NoSQL system. It is designed to:

  • simplify and decouple communications between a range of systems of varying capability
  • enable sensor ecosystems


Heterocera handles data in the following manner (note that the data element is optional):

[address_element1, address_element2, ... address_elementN] = data

A real world example might be data from a water meter:

[sensor_location, data_stream_id, time] = data

["upper_landing_strip", "water_tank_level", "1325206004"] = 400

This is combined with the standard READ, WRITE and TAKE actions allowed in a tuple space to generate URLs.

  • WRITE is used to save a value into the space.
  • READ is used to passively retrieve data.
  • TAKE retrieves data and deletes data from the space.

To WRITE into the space:


To READ data from the space:


To TAKE data from the space:


WRITE and TAKE operations require explicit URLs. READ operations will accept wild cards in the URL. The '*' character is used as a wild card. To continue the above example if you wanted to read all the stored values for the water meter over time:


If you wanted to read all the values for all the data streams at a given time:


Data types

By default Heterocera returns data as JSON. So the following READ:



  "id": "a93120f9d1ac1b148e52d25e60306bd5",
  "value": "400",
  "created_at": "2011-12-30T14:30:57+13:00",
  "tags": [
    "value": "upper_landing_strip",
    "order": 1
    "value": "water_tank_level",
    "order": 2
    "value": "1325206004",
    "order": 3

Heterocera supports:

  • JSON (.json)
  • XML (.xml)
  • HTML (.html)
  • GZip (.gz)
  • Zip (.zip)

Alternative data formats are accessed by appending the relevant file extension. So the following READ:



<tuples type="array">
    <created_at>2011-12-30 14:30:57 +1300</created_at>

System Chit-chat

All communication occurs over HTTP. TAKE and READ operations are GET only. WRITE operations can by executed using GET, POST and PUT.

WRITE operations rely on a 'value' parameter. If using a multi-part form is it possible upload a file into the space. To retrieve the file contents append READ operations with .gz (a tar gz archive) or .zip (zip archive) file extensions, any other extensions will display the file name in the 'value' field.

Support Tools


There is a ruby gem that can be used to communicate with a Heterocera Server.


bundle install rake db:migrate ruby application.rb


Yes please!

Something went wrong with that request. Please try again.