Navigation:  Clustering >

Remote Shared Objects

Previous pageReturn to chapter overviewNext page

Remote Shared Object (RSO) is a WebORB feature natively supported by all RTMP clients (Flex, AIR, Flash). An RSO is a specialized data dictionary containing a set of keys with corresponding values. An RSO has a name used by the clients to connect to it. When more than one client connects to the same RSO and makes a change by adding, removing or modifying a key/value pair, all other clients receive an update from the server notifying them about the change. In the context of a single server, WebORB maintains the RTMP connections with all the clients and, as a result, can easily notify the clients about the changes in the RSO. In a clustered environment, the clients no longer need to connect to the same WebORB instance in order to operate on an RSO. A WebORB cluster shares the state of a remote shared object and thus when a client makes a change in an RSO, all other clients receive an update even if they are not connected to the same server as the original client. Consider the following scenario:

 

1.

A cluster consists of two servers running the WebORB RTMP server. There are two RTMP clients: A and B. The servers are identically configured and each has an instance of a remote shared object.

cluster-rso-1

2.

Client A connects to the remote shared object hosted on WebORB Node 1 and retrieves its contents. Client B connects to the RSO on WebORB Node 2 and also gets its contents.

cluster-rso-2

3.

Client A updates a property in its copy of the RSO. The update is sent to WebORB Node 1.

cluster-rso-3

4.

WebORB Node 1 is aware of the clustered environment it runs in and synchronizes the change with the other server in the cluster. WebORB Node 2 receives the update, modifies the remote shared object hosted in that server and delivers the synchronization event to client B connected to the server.

cluster-rso-4

Configuration

A special configuration is required to enable clustering of Remote Shared Objects. An messaging application requiring support for clustered RSOs, must contain the following configuration in the application's configuration file - app.xml:

<sharedObjectService>Weborb.Cluster.SharedObject.ClusterSharedObjectService</sharedObjectService>

The minimal configuration file for a message application with cluster-enabled Remote Shared Objects should look as shown below:

<?xml version="1.0" encoding="utf-8"?>
<configuration>  
  <extensibility>
      <sharedObjectService>Weborb.Cluster.SharedObject.ClusterSharedObjectService</sharedObjectService>  
  </extensibility>
</configuration>