Does anyone know what remote shared object is? I have asked this question many times in various presentations to .net, java and flex user groups. In many cases, unless there are AdobeFlashers in the group, the answer is “no”. This is not surprising, Adobe have kept this hidden jewel pretty close to its chest, making the feature available exclusively to the users of Flash Media Server. In my opinion the feature is amazing and in many use-cases is essential for building interactive online, multi-user applications. So what is a remote shared object (RSO)? I find it easier to understand RSO if you think about it as a dictionary or a hashmap or just a map with a collection of key/value pairs. Every key is a string and the corresponding value is an object of any type – primitive, string, date, typed/untyped object or an array of anything previously listed. RSOs reside on the server-side and are managed by an RTMP server. Every RSO has a logical name which the client applications use to connect to it. More than one client can connect to the same RSO and that’s when the magic happens. Since it is a dictionary of key/value pairs, any client can update a value for any key, create a new pair, or delete the contents of the RSO. Whenever any of these actions happen, all other clients connected to the same RSO are immediately notified of the change. The server keeps track of all the key/value pairs as well as the client connections to the RSO and pushes updates to all the connected clients. This simple client/server interaction makes it possible to implement some very sophisticated use-cases with just a few lines of code. For instance, creating a chat application using RSO can be done without any custom server-side code at all. All the client app needs to do is to put the chat message sent by the user into an RSO and all other users (client app instances) get notified about that update. Additionally, the RSO can also be modified by the server-side code, thus making it trivially easy to deliver data to multiple users at once.
As I mentioned earlier, in the Adobe’s world, the only server capable of supporting this feature is Flash Media Server targeting exclusively Flash/Flex apps. Since both WebORB for .NET and WebORB for Java implement the RTMP protocol, we have extended this feature to iOS (iPhone/iPad), Windows Phone, Silverlight, native Java and .NET apps in addition to Flash and Flex. On top of this, we made it super simple to push RSO updates from Java and .NET apps into all connected client applications. To see an example of this feature in action, please visit the following link (open the link in two or more browser windows to experience the example):
I plan to post a few follow-on posts with examples on using RSOs from iOS, Windows Phone, Silverlight, Java and .NET clients.
