Distributed Shared Memory

What you get

The Distributed Shared Memory (DSM) service allows you to develop highly interactive and responsive web-based groupwares without having to deal with complicated issues such as networking protocols, database management and concurrency control.

The DSM service is a distributed in-memory database for JavaScript applications. Since each database or DSM storage is assigned an addressable identifier it is possible to check out a local replica of a particular memory space just by knowing the address.

All changes applied on a DSM storage are always done locally and then synchronized in the background with other replica clients. This procedure is called optimistic replication and is done almost instantly. Typically, it takes less than a millisecond to synchronize a replica, depending on network delay.

Merge conflicts are automatically resolved using Operational Transformation, which is a framework for consistency management commonly used in groupwares, including Google Docs and Google Wave.

What can it be used for?

Although the DSM service is designed specifically to implement Collaborative workspaces capable of supporting simultaneous real-time interactions, we believe the DSM service can be applied in many other solutions areas.

Examples of usage:

  • Telecare, e.g. remote health care and specialist consultation
  • E-learning
  • Call center support
  • Collaborative work, e.g. shared whiteboard or other collaborative editing systems

Below is a short YouTube clip showing an example of a collaborative web application we have developed using the DSM service and a modified WebKit browser supporting conversational HTML5 audio/video components.

The YouTube clip below gives a short technical introduction to the DSM service and shows some more prototype applications we have developed.

To demonstrate how the DSM service can be used, we have developed a simple shared map application based on Ericsson Web Maps.

In order to test the application, open two or more browser windows, move around the map and then move the mouse around. A tutorial is available here.

How it works

The DSM service is available as a JavaScript library and a hosted (DSM) server. It works without any plug-ins. After a replica has been modified, all applied operations are sent in bulk to the DSM server, which transforms the operations using Operational Transformation and then forwards the transformed operations to other connected clients. These clients will then transform the received operations yet another time to match changes done to their local replica.

A client can register an event listener to a replica and be notified when a specific value is changed or when a new value has been added. This makes it possible to develop an event-driven system for synchronizing DOM elements on web pages. The same mechanism can also be used to set up media or handle presence information in video conferencing systems.

// get a replica of hash://simpleTest 
hash = memCtrl.get("hash://simpleTest"); 
 
// update the web page when the replica is cloned
hash.onReady = function() {
   document.getElementById("id").value = hash.get("key"); 
};
 
// handle changes to the replica
hash.onUpdate = function(op) {                                                                                                                                                                     
  document.getElementById("textfield").value = op.value; 
};
 
// update the local replica 
hash.set("key", "hello world");
 
// send the operation to all other replica clients
hash.submit();

To start using the DSM service, click on the Request API KEY button to the left to register an API Key. We also provide a development tool where you can control and debug your DSM server as well as visualize stored data. Log in using your Ericsson Labs credentials.

See the documentation for more information about the API and other technical details.