Tips for 《Orleans Cloud Computing for Everyone》

1.Orleans is based on distributed actor-like components called grains, which are isolated units of state and computation that communicate through asynchronous messages. 

2.The Orleans programming model is based on asynchronous, isolated, distributed actors. Actors can be automatically replicated to enhance scalability and availability. An actor’s state can be persisted to shared, durable storage, where a reconciliation mechanism allows actors to lazily merge their state changes.

3.Actors within Orleans are called grains and are the basic programming unit. All code that a developer writes for Orleans runs within a grain. A system runs many grains concurrently. Grains, however, do not share memory or other transient state. They are internally single-threaded and process each request fully before handling the next one. Cloud services achieve high throughput by processing multiple, independent requests concurrently. Grains support this architecture with a single-threaded execution model that provides mechanisms such as isolation, consistency, and asynchrony to exploit concurrency among servers, while avoiding the error-prone difficulties of multithreading and synchronization.

4.Grains interact entirely through asynchronous message passing. 

5.Unlike most RPC models, which block until a result arrives, Orleans message calls return immediately with a promise (Section 2.1) for a future result.An application can bind code to the promise which will execute when a result arrives, or it can treat the promise like a future and explicitly wait for a result. Promises resolve the impedance mismatch between synchronous method calls and asynchronous message passing and are well suited to coordinating concurrent computations [1, 2]. In Orleans, the primary use of promises is to allow a grain to start one or more operations in other grains and to schedule a handler to execute when the operations complete. Unpredictable timing introduces non-deterministic interleavings among handlers, but it is limited to promises, where it is clearly delimited and easily understood.

6.In order to provide higher system throughput to handle increased load, Orleans automatically creates multiple instantiations, called activations, of a busy grain to handle its simultaneous requests. The activations process independent requests for the grain, possibly across multiple servers. If necessary, Orleans can obtain additional machines from the underlying elastic cloud service to run the new activations. Grains are logical programming abstractions and activations are run-time execution units. For the most part, a developer can assume a single logical entity in the system processes all messages sent to a grain. Each activation of the grain runs independently of and in isolation from the other activations. 

7.Orleans integrates persistence into grains, which are containers of application state. A grain’s state is persistent by default. A grain may exist only in durable storage – i.e., no activations on any server – when no requests for the grain are pending. In this case, when a request arrives, the Orleans runtime selects a server and creates an activation for the grain. The new activation is initialized with the grain’s persistent state.

猜你喜欢

转载自www.cnblogs.com/xueqiuqiu/p/12292617.html