In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
In this issue, the editor will bring you about what the .NET Actor model Orleans is like. The article is rich in content and analyzes and describes it from a professional point of view. I hope you can get something after reading this article.
Orleans is an Actor model similar to Scala Akka by Microsoft. Orleans is built on .NET and is designed to facilitate programmers to develop cloud services that require large-scale expansion, which can be used to implement DDD+EventSourcing/CQRS systems.
The traditional three-tier architecture includes a stateless front end, and the stateless middle tier and storage tier are limited in scalability, which has an impact on each user request because of the latency and throughput limitations of the storage layer. The usual approach is to add a cache layer between the middle tier and the storage tier to improve performance. However, caching loses most of the concurrency and 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.
Whether or not caching is used, the stateless middle tier does not provide local data because it uses the data loading paradigm: for each request, the data comes from the storage tier or the cache is added to the middle tier, if it is a social graph, a request will activate the associated many sub-entity objects, which poses a greater challenge to cache consistency.
The Actor model provides an attractive functional loading paradigm to solve these challenges. Actor allows the establishment of a stateful middle layer, and the performance advantages of caching and encapsulated data locality are coordinated by application-specific business entity encapsulation (the aggregation root of DDD guards the state with behavior, the aggregation root is saved in the cache, and the state fields of the aggregation root entity are also in the cache, and the state fields can only be operated through entity behavior to ensure state consistency). In addition, Actor is easy to achieve horizontal, "social", entity-to-entity relationships in the middle tier.
Another view of distributed system programming is object-oriented programming (OOP). Although OOP is an intuitive way to model complex systems, it is marginalized by the popular service-oriented architecture (SOA). Of course, people can still benefit from the OOP implementation of service components. However, at the system level, developers must consider loosely coupled partition services, which usually leads to 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. The Actor model brings OOP back to system-level development, where developers are much like models of objects that are familiar with interaction.
For example, Erlang and Akka's Actor platform is a step forward in simplifying distributed system programming. However, they still bear the complexity of many distributed systems because developers face a relatively low level of abstraction and system services. The key challenge is to develop code that manages the Actor lifecycle. Handling distributed contention, handling failures and recovering Actor, and distributed resource management are all complex, so if you build an application that must solve these problems correctly, the developer must be a distributed system expert (too difficult).
To avoid these complexities, Microsoft Research built a programming model for Orleans, which increases the level of abstraction of Actor at runtime. Orleans is not aimed at expert-level developers in distributed systems, although our expert customers find it attractive. It is essentially different from the existing actor-based platform in that it regards Actor as a virtual entity rather than an actual physical one.
First of all, an Actor for Orleans always exists, but it cannot be explicitly created or destroyed. It exists beyond the life cycle of any instance in memory and thus beyond the life cycle of any particular server.
Second, Orleans Actor is automatically instantiated: if there is no Actor instance in memory, it is automatically created, and a message sent to Actor is to create a new instance on the current server. An unused Actor instance is automatically recycled as part of runtime resource management. An actor instance never fails: if server S crashes, the next message sent to the Actor in that S is automatically instantiated to another server A, eliminating the need for the application to monitor and artificially code to explicitly rebuild the failed Actor.
Third, the location instance of Actor is transparent to the application code, which greatly simplifies programming.
Fourth, Orleans can automatically create multiple instances of the same stateless Actor,Actor that can be extended seamlessly.
Orleans gives developers a virtual "Actor space", similar to virtual memory, enabling them to call any Actor in the system, whether it exists in memory or not. Virtualization indirectly depends on the mapping from virtual Actor to actual Actor. This level of indirect addressing provides opportunities for the runtime to solve many distributed system problems, otherwise developers must directly solve these complex problems, such as Actor positioning and load balancing, deactivating unused Actor, and reviving Actor due to server failure, which is notoriously difficult. Therefore, the virtual Actor method greatly simplifies the programming model. It also allows runtime loading and transparent recovery from failures.
This is what the .NET Actor model Orleans is like. If you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.