Orleans is a Microsoft-launched Actor modellike the Scala Akka ,Orleans is a built-in . NET , the goal of the design is to facilitate programmers to develop cloud services that require large scale expansion , which can be used to implement DDD+EVENTSOURCING/CQRS System.
traditional three-tier architecture includes a stateless front end , The non-stateful middle tier and storage tiers are limited in terms of scalability, and this has an impact on each user request because of the latency and throughput limitations of the storage tier. The usual approach is to add a cache layer between the middle tier and the storage tier to improve performance. However, the cache loses most of its concurrency and the semantic guarantees of the underlying storage layer. To prevent inconsistent updates between the cache and the storage pool, the application or cache manager needs to implement a concurrency control protocol.
The stateless middle tier does not provide local data, regardless of whether the cache is used, because it uses the data loading paradigm : for each request, the data is from the storage layer or the cache is added to the middle tier, and if it is a social graph, a request will activate the Association of many child entity objects, which poses a greater challenge to cache consistency.
actor The model provides an attractive paradigm for the loading of functions that address these challenges. actor Allows the creation of a stateful middle layer, The performance benefits of caching and encapsulated data locality are encapsulated by application-specific business entities ( ddd ,actor
Another view of distributed system programming is object-oriented programming (OOP) oop oop When implementing serviced components. However, at the system level Developers must consider loosely coupled partitioning services, Often results in a mismatch with the conceptual business objects of the application, which makes it very difficult for developers to build distributed systems in the current mainstream direction. actor model will oop
For example Erlang and akka actor platform is a step forward in simplifying the programming of distributed systems. However They still bear the complexities of many distributed systems, Because developers face relatively low levels of abstraction and system services. The key challenge is to develop a code that manages the actor life cycle, dealing with distributed competition, Handling failures and recoveries actor
orleans The programming model of actor orleans The goal is not a distributed system expert-level developer, While our expert clients find it attractive. and existing based on the actor platform is fundamentally different, it is the Span style= "Font-family:verdana" >actor as a virtual entity
First, a Orleans of the Actor always exists, but it cannot be explicitly created or destroyed. Its existence transcends the life cycle of any instance in memory, thus exceeding the life cycle of any particular server.
Second,Orleans Actoris an automatic instantiation of:If the memory is notActorinstance, it is automatically created, sent toActorA message is that a new instance is created on the current server. A non-usedActorinstances are automatically reclaimed as part of run-time resource management. Aactorinstances never fail: if the serverScrashes, Sent to thisSinActorthe next message will be automatically instantiated to another serverA, eliminating the need for the application to be supervised and artificially coded to explicitly rebuild the failedActor.
thirdly, Actor the location instance is transparent to the application code , This greatly simplifies the programming.
Four, Orleans you can automatically create multiple instances of the same stateless Actor , Actor allows seamless geothermal expansion.
Orleansgive developers a virtual "ActorSpace ",similar to virtual memory, enabling them to invoke any of the system'sActor, regardless of whether it exists in memory. Virtualization indirectly relies on the virtualActorto the actualActorthe mapping. This level of indirection presents an opportunity for the runtime to solve many distributed system problems, or the developer must address these complex issues directly, such asActorlocating and load balancing, deactivation of unusedActor,recovery due to server failureActor,This is a name for the difficulty. So,VirtualActormethod greatly simplifies the programming model. Both the runtime is allowed to load and recover transparently from the failure.
?
Orleans Official Documents : Https://github.com/dotnet/orleans/wiki
Orleans White papers : http://research.microsoft.com/pubs/210931/Orleans-MSR-TR-2014-41.pdf
. NET Actor Model implementations differ in approach
Http://www.cnblogs.com/liwt/category/642869.html
. NET Actor Model: Orleans