CQRS and Event Sourcing with Akka Clustering: New Activator Template

Activator Template

We (Trivento) proudly announce that we have released an activator template to describe how you can use Akka (with Scala) to build a distributed application that uses the CQRS (Command Query Responsibility Segregation) & Event Sourcing patterns. An Activator Template is a great way to write a tutorial. There are currently 256 templates which describe various topics. Our template can be found at:

CQRS & Event Sourcing

Recently CQRS and Event Sourcing are getting more and more attention. With CQRS you separate the command handling from the query handling and with Event Sourcing you to store all changes to your system as events as opposed to changing state in the database. The main advantage of writing applications in a CQRS style is that is resembles the domain of the business much better than 3-tier applications. I find it to be a very good fit with Domain Driven Design.

Akka

Akka is a great framework to build reactive applications and the Akka Persistence module enables you to write applications that use Event Sourcing. It also has tools to separate the Command and Query side and implement the CQRS pattern. When you try to implement an application with Akka Persistence in a CQRS&Event Sourcing style, you probably run into some “limitations” in processing the events on the read side. Most notably, trying to give an overview over multiple aggregates. In a PersistentView it is only possible to replay the events of a single aggregate in a persistent view.

Please let us now if you have any comments or questions regarding the template. You can contact me directly via the envelope below, or add a comment to this post.

Delen:

Gerelateerd

My goal is to build systems that last! A system that will put a smile on the face of people using it and the people paying for it. In my mind the Typesafe Reactive Platform (Scala, Akka, Play, etc.) will be a big game changer in the coming years. It is giving a boost to Reactive programming. Together with DDD (Domain Driven Design) and CQRS (Command Query Responsibility Segregation) we will be able to implement all business requirements in a way that fits the rapid changing world. Helping the business to realize their needs is what it is all about. I have great interest in software languages and technologies and how to use them to help the business in new and better ways.

2 thoughts on “CQRS and Event Sourcing with Akka Clustering: New Activator Template”

Please make it even better by providing POST commands to exercise the functionality (for instance using HTTPie: https://httpie.org/). It is difficult for developers new to AKKA HTTP to understand the REST interface (This is done bij sending a NewOrder message via de rest client.) Reference the REST interface documentation in akka-persistence-event-sourcing.