Writing persistent and clustered services
Another advantage of using Lagom is the ease of having persistent and cluster services. Persistent and clustered services are possible thanks to Akka persistence, Akka cluster, and Akka cluster sharding. Traditionally, developers have used the well-known CRUD operations to implement persistence for their data. Lagom, however, adopts event sourcing and Command Query Responsibility Segregation (CQRS) as the techniques to implement persistence. Event sourcing and CQRS is a pattern to achieve persistence by storing state changes as historical events instead of the actual modified state. These changes are immutable and only get appended to the data store, which improves the write performance. There is no modification of the stored data. This brings in a new set of advantages, such as the possibility to restore state just by executing the ordered list of changes or having a complete log about what happened in the lifetime of an object and not just the...