Distributed Shared Memory A labs.ericsson.com API http://labs.ericsson.com/apis/distributed-shared-memory/
May 28, 2015
Distributed
Shared
Memory
A labs.ericsson.com APIhttp://labs.ericsson.com/apis/distributed-shared-memory/
© Ericsson AB 2010 | Page 2
ericsson labs APIs
Maps & positioning
Mobile Mobile
LocationLocationMobile Mobile
MapsMaps
Web Web
MapsMaps
communication
AsyncAsync
VoiceVoice
SMS Send & SMS Send &
ReceiveReceiveMobile Mobile
PushPushGroup Voice Group Voice
MixerMixer
security
Mobile Web Security Mobile Web Security
BootstrapBootstrap CAPTCHACAPTCHAOauth2 Oauth2
FrameworkFramework
Identity Management Identity Management
FrameworkFrameworkKey Management Key Management
ServiceService
Web technologies
Web Web
ConnectivityConnectivity EventSourceEventSourceWeb Background Web Background
ServiceService
Web Device Web Device
ConnectivityConnectivityDistributed Distributed
Shared MemoryShared Memory
Web RealWeb Real--Time Time
CommunicationCommunication
Mobile Mobile
IdentificationIdentification
User & network information
Mobile Network Mobile Network
LookLook--upup
Network Network
ProbeProbe
Machine learning
Cluster Cluster
ConstructorConstructor
Media and graphics
Face Face
DetectorDetector TextText--toto--SpeechSpeech
Tag ToolTag ToolMobile Sensor Mobile Sensor
Actuator LinkActuator Link
NFC & sensors
Sensor NetworkingSensor Networking
Application PlatformApplication Platform
© Ericsson AB 2010 | Page 3
Distributed shared memory
› Distributed Shared Memory enables a distributed in-memory database for JavaScript applications
– Get a replica of a DSM storage with a specified address from a DSM server
– Register a listener and be notified when data is changes by other users
– Modify data locally and synchronize changes in the background with other replicas
› Merge conflicts are automatically resolved
© Ericsson AB 2010 | Page 4
Why distributed shared memory?
› Let web developers focus on developing highly interactive and responsive web-based collaboration software without having to deal with complicated issues such as – networking protocols
– database management
– concurrency control
› Also, using a local replica where data can be modified directly without a lock or blocking improves user experience
› Synchronizing application states among multiple clients
› Implement group-wares or collaborative web services supporting simultaneous real-time interactions
© Ericsson AB 2010 | Page 5
Main Features
› Makes it possible for multiple JavaScript clients to address andmanipulate the same data at the same
› Plain JavaScript Lib (no browser plug-in required)
› High performance and low delay
› Optimistic replication to resolve merge conflicts
› Event-driven (register a listener and be notified when data change)
› Support for both ordered arrays/lists and unordered key-value hash tables
› Support for both persistent storage (disk) and transient data (RAM)
› Automatic garbage collection
› Time-to-live (specify how long time a value should be stored)
› Possibility to link DSM storages to build graph databases
© Ericsson AB 2010 | Page 6
Use cases
Examples of usage
› E-learning
› Tele-care, e.g. remote health care and specialist consultation, remote monitoring etc.
› Call center support
› Collaborative work, e.g. a shared whiteboard or other collaborative editing systems etc.
© Ericsson AB 2010 | Page 7
› All clients (and servers) DSM SW contains predefined rules how to resolve conflicts
“Adjust” or transform
incoming operation to
match local changes
Merge conflicts are resolved
© Ericsson AB 2010 | Page 8
// get a replica of hash://simpleTest
var hash = memCtrl.get(“hash://simpleTest”);
// update the web page when the replica is cloned
hash.onReady = function () {
document.getElementById(“myTextfield”).value = hash.get(“myKey”);
};
// handle changes to the replica
hash.onUpdate = function (op) {
document.getElementById(“myTextfield”).value = op.value;
};
// update the local replica
hash.set(“myKey”, “myValue”);
// send the operation to all other replica clients in the background
hash.submit();
JavaScript API
› Simple and easy to use to API
© Ericsson AB 2010 | Page 9
Example applications
Collaborative WorkspacesShared Whiteboards
Shared JavaScript Apps, e.g. a Shared Map Widget
© Ericsson AB 2010 | Page 10