What shared state distributed systems exist which can handle objects in the native language?
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
In the realm of distributed systems, managing shared state effectively is crucial for performance, consistency, and scalability. Shared state distributed systems that can handle objects in the native language of the developer are particularly appealing because they simplify the complexities involved in multi-threaded programming environments. Such systems offer the capability to manage data across multiple nodes, ensuring that data inconsistencies and conflicts are minimized. Here we discuss several systems designed to manage shared state efficiently, focusing on those that facilitate object manipulation in a programmer's native language.
Erlang OTP
One of the most prominent examples of shared state distributed systems is the Erlang Open Telecom Platform (OTP). Erlang, a programming language developed for highly reliable and concurrent systems, uses an actor model for managing state. Each actor, or process in Erlang's terminology, is a lightweight, isolated state with a mailbox to receive messages. These processes can be distributed across multiple nodes, and since they do not share memory, they communicate asynchronously via message passing.
Erlang's approach is unique because state is not shared directly; instead, each process contains its state and interacts with other processes through message passing, minimizing data conflicts and the necessity for locks. This makes it inherently suitable for distributed applications where high availability and low latency are crucial.
Java's Distributed Objects
Java offers several technologies for managing shared state in a distributed environment, including Remote Method Invocation (RMI) and the more recent JavaSpaces. Java RMI allows an object residing in one Java Virtual Machine (JVM) to invoke methods on an object in another JVM. This is useful in developing distributed applications where objects need to interact across different systems, treating remote objects as local to the programmer.
JavaSpaces, part of the Jini technology suite, provides a more decentralized approach. It's essentially a shared, distributed, associative memory. Objects, referred to as entries, are written into the space and can be read or taken (read and removed) using template matching. This model supports distributed transactions, enabling complex operations across multiple objects that preserve consistency.
Microsoft Orleans
Designed for use in the .NET ecosystem, Microsoft Orleans is a framework for building distributed applications with virtual actors that abstract persistent state management. Orleans implements a virtual actor model, where each actor is a .NET object and manages its state, transparent to the programmer.
Actors in Orleans are automatically distributed across a cluster and are activated on demand. This approach abstracts many intricacies of distributed systems (like location transparency and horizontal scaling) from developers, letting them focus on business logic. The state of each actor can be persistently stored and reliably recovered, ensuring consistency even in the event of failures.
Akka Framework
Similar to Orleans, Akka is a toolkit and runtime for building concurrent, distributed, and resilient message-driven applications on the JVM. Akka actors encapsulate state and behavior, guaranteeing that each instance is isolated from others. Akka supports distributing these actors across a cluster, managing their lifecycle and routing messages efficiently.
Comparison Table
| System | Language | Model | Key Features |
| Erlang OTP | Erlang | Actor | Fault tolerance, lightweight processes, message passing |
| Java RMI | Java | Remote objects | Method invocation across JVMs, object serialization |
| JavaSpaces | Java | Associative memory | Decentralized, transaction support, template matching |
| Microsoft Orleans | .NET | Virtual actors | Abstracts away distribution, persistence, auto-scalability |
| Akka | Scala/Java | Actor | Typed actors, clustered systems, reactive streams |
Conclusion
Choosing the right shared state distributed system depends significantly on the application requirements, such as latency needs, fault tolerance, and scalability, and the familiarity of the development team with the underlying technology. Each system offers different advantages and models for handling distributed objects in a way that abstracts much of the complexity involved in distributed computing. By leveraging these modern technologies, developers can focus more on delivering business value and less on the intricacies of the underlying infrastructure.

