This is a Akka Realization reactive DDD Open source project , Click the title to enter , Compared to traditional architectures , DDD Models can divide complex business domains into manageable components , So as to consider the requirements of scalability and consistency . It means , The bounded context it brings , Transaction boundaries and event based communication DDD and CQRS And so on can greatly promote the construction of scalable software .
At present, most systems are based on relational database and global transaction , Specifically, it refers to services (banq notes ：EJB or Spring The services of the organization ), This very limited architecture is not suitable for building scalable software .
By global transaction ( such as JTA JavaEE Provided by the server ) Ensure the continuity and consistency of basic data , Should not be considered a standard requirement for any enterprise class system . It's just that we're all used to it , But it can not solve the actual needs of customers .
In order to learn from DDD / CQRS Full benefit from the architecture , We should change the underlying technology . Today we have a choice . There's a lot of NoSQL database , And there are some platforms that address scalability as a primary concern . about JVM ,Akka Is the most powerful open source platform , For building event driven applications . lately Akka The persistence module has been released , Able to handle long-running/persistable Process care （ It's related to aggregate roots and Sagas It's all about ） . It's a great function , adopt Akka Can be used as a complete platform for building enterprise applications .
In this source code DDD/CQRS EventSourcing Technology , Use Akka Establish the aggregate root of the event source （AR）. The idea is simple . The aggregation root should be modeled as a Actor actor . because Actor Actors are message driven , We can send command information directly to the aggregation root , avoid “ Command to call the method ”.
Akka Persistent modules akka-persistence Provides a way to achieve Actor Persistence / The necessary components of state . The key components are akka.persistence.Processor Trait .Processor Is to be able to reincarnate （Actor Start or restart ） One that restores its state Actor actor . The underlying storage type is pluggable only .
[ The quilt admin On 2014-04-16 09:25 A modified ]