Fieldpine Logo Documentation Home  

Mesh Memory

Mesh Memory provides a public addressable space that applications can read and write freely. This permits disparate clients behind different firewalls to potentially discover each other.

Mesh Memory has a particular design niche, possible alternatives may include dweet.io or Azure Queue Storage

Under the MeshMemory umbrella there are three different types of storage available.

  1. MeshMemory. A read/write storage address where each address holds one piece of information.
  2. MeshQueue. A read/write storage address where items that are "added" can be retrieved and removed individually.
  3. MeshTable. A read/write storage address that holds a complete table of data. The rows can be individually selected with simple predicates.

MeshMemory_Example - a worked example showing how mesh memory can be used in web pages to provide simple messaging between end users


Mesh Memory

Each server offers a public address space where applications can read and write information. An application selects a long random address name and writes information to it. Any other program that knows the address name can then read the information.

Writing to the address "myRandomName"

/mesh/memory/write/public/myRandomName?Hello-This-Is-Alice
	

Once written, any other application can then read this message

/mesh/memory/read/public/myRandomName
	
Server returns "Hello-This-Is-Alice"

As the information is shared, clients reading mesh memory should take excessive care to verify both the structure and content of the returned data.

The server does not enforce any special requirements on the information written. Whatever Content-Type is used during the write operation will be returned for the read.

Server Operation

  1. For public messages the server makes no guarantees about whether messages can be stored or how long they will be stored.
  2. The server may impose maximum lengths of stored information.
  3. Servers will apply various rate limiting controls so that applications cannot simply scan billions of possible addresses trying to find valid data.
  4. You should use SSL connections when reading and writing information.
  5. Public messages are totally public. They may be shared with third parties without warning.
  6. You may store encrypted data

Mesh Queue

A Mesh Queue is an extension to mesh memory where a single address can store multiple messages that can be retrieved individually. This might be used by a device that needs to report multiple records, such as temperature readings every few minutes, and allows servers to retrieve all the records at a later stage

Writing two messages to the queue "myFirstQueueHH76qe34"

/mesh/queue/add/public/myFirstQueueHH76qe34?temp=34.3,Name=Bob
/mesh/queue/add/public/myFirstQueueHH76qe34?temp=18.7,Name=Alice
	

Once written, any other application can then read this message

/mesh/queue/read/public/myFirstQueueHH76qe34
	
Server returns "temp=34.3,Name=Bob"

Mesh Table

A Mesh Table provides a distributed table like structure. The table structure is

A two row table with columns A and B might appear as

<ARAY>
  <ROWH>
    <IPv4>192.192.0.0</IPv4>
    <DATA>
	  <A>123</A>
	  <B>Welcome</B>
    </DATA>
  </ROWH>

  <ROWH>
    <IPv4>10.20.0.0</IPv4>
    <DATA>
	  <A>9981</A>
	  <B>Hello</B>
    </DATA>
  </ROWH>
</ARAY>

Rows are added with /mesh/table/insert/public/myTable123

Rows are read with

/mesh/table/read/public/myTable123

As reading can take many forms, the actual format is /mesh/table/read [ ,arg ...] /public/myTable123 [ ? query ] where arg can be from the following list

Exampe
/mesh/table/read,json,noheader/public/myTable123

Practical Use

To use mesh memory for sharing information across a public namespace you can use a private password and HMAC signing. Mesh memory itself does not control how you select the addresses to be read and written it simply provides a large addressable space. The large addressable space does not provide security for any address, it simply ensures that the chance of conflict for a random address is very low. You must encrypt or otherwise validate data read from mesh memory.