What is XSTM?


XSTM
is an open source library which enables high performance object replication between processes. It is an object oriented Distributed Shared Memory, or a Distributed Object Cache.

Our model is based on object shares, which work like file shares. When an object is added to a share, it appears on the other machines which have the same share opened. Modifications done to the fields of the object are from this point replicated between machines.

Object are modified using transactions (XSTM is an extended software transactional memory).

Read more in the project overview.
XSTM Overview
        JSTM NSTM
  JSTM for GWT
  XSTM is made of three projects. The Java implementation is called JSTM and is the base from which the other versions are derived. An adapted version made with Luciano, the author of GWM, is available for the Google Web Toolkit. It allows this library to be used in a browser. NSTM is a .NET port based on IKVM.

All implementations are compatible with each other so object replication can take place e.g. between a Java server and a .NET Smart Client. 
 

Why XSTM?

Simplicity
A replicated object can replace a complex service, saving you from sending update messages, copying fields from objects to messages and back, handling conflicts etc... For a UI client connected to a server, going from a service architecture to replicating the server's object model to the client dramatically simplifies your system. If the client platform provides data-binding (e.g. WPF), almost all client side code can be removed. It is like UI controls were directly data-bound to the objects on the server. 
Transactions Objects are modified using transactions. If a network failure or conflict occurs while updating an object, the transaction is aborted. Your local objects are cleanly roll-backed to their previous state and remain consistent.

Transactions are fully isolated from each other, which simplifies a lot concurrent and distributed programming. Think of this as source control for objects: starting a transaction takes a snapshot of your objects from which you can work as if there was only one thread or one machine. When you are done, commit the transaction to merge your modifications to the objects. Read more...
Performance For simple transactions like updating an integer field on the local machine, performance is about 500,000 transactions per second. This includes taking a snapshot of the memory and committing updates to modified objects.

When replicating simple updates between two machines, serialization of the transactions adds an overhead and performance is about 20,000 transactions per second.

Benchmark Demo





This demo is based on an early preview of the next version of XSTM (0.4). It shows the number of transactions per second it is possible to achieve on a single machine and between a server and a client.

XSTM 0.4 will be ready in a few days, stay tuned!

Download the demo

Images Demo


This demo shows the compatibility between the Java, GWT and .NET versions of XSTM. It is made of three identical applications written with each platform, which communicate with each other. The first one launched starts a socket server, the next ones connect to it. (It is normal that they show warnings that the socket port is already used)

Each application allows you to drag images on the screen, keeping the positions synchronized with other processes. Have a look!

Source code for this demo is almost the same on each platform and less than 300 lines! (Java, .NET, GWT)
Download the demo
    Three applications in Java, .NET and GWT synchronized with each other.          

Form Demo


Check Dion Almaer's video on Ajaxian.

This demo shows how you can use XSTM to manage data entered through a form. It is implemented as an Ajax application using GWT but it could be done in Java or .NET with almost the same code.

The data entered in the form is automatically replicated on the server. If you launch two browsers and modify the same field concurrently, the conflict is detected and the last modification is cancelled.

The undo button aborts the current transaction, which cancels the modifications that where done to the form.

Download link
Download the demo

Get Started


Links to get started on the main features of XSTM. The first ones show generic concepts and how the demos work, next ones go more in depth on specific topics.
Overview XSTM at a glance.
Samples for Java, .NET, GWT The easiest way to use the samples is to use Eclipse for the Java and GWT versions, and Visual Studio for .NET.
Form Demo Walkthrough How to replicate a basic object between a server and a client. This uses transactions, listeners to be notified of data changes, detects conflicts etc...
Call a Method Tutorial See how to define a method on a replicable object and call it from a remote machine.