Book Image

Mastering Akka

By : Christian Baxter
Book Image

Mastering Akka

By: Christian Baxter

Overview of this book

For a programmer, writing multi-threaded applications is critical as it is important to break large tasks into smaller ones and run them simultaneously. Akka is a distributed computing toolkit that uses the abstraction of the Actor model, enabling developers to build correct, concurrent, and distributed applications using Java and Scala with ease. The book begins with a quick introduction that simplifies concurrent programming with actors. We then proceed to master all aspects of domain-driven design. We’ll teach you how to scale out with Akka Remoting/Clustering. Finally, we introduce Conductr as a means to deploy to and manage microservices across a cluster.
Table of Contents (17 chapters)
Mastering Akka
Credits
About the Author
Acknowledgments
About the Reviewer
www.PacktPub.com
Preface

Chapter 5. Separating Concerns with CQRS

Within the world of data storage, reading and writing data are really two very distinct things. When writing, you want something that can write quickly and has an efficient storage structure. In the relational db world, this usually leads to normalization of data structures to remove duplication.

If you look at the same problem from the read side, there is a desire to have as many indexes as possible. The more indexes a set of tables has, the faster queries will be against those tables. Also, a highly normalized model, while efficient in storage, can be a burden to query against.

When faced with a problem like this, where you have to satisfy two concerns that are in conflict with their needs, why keep them together in the first place? Wouldn't it be better to separate them into their own storage models and systems, each optimized for their own needs? This kind of approach is at the heart of what we'll cover in this chapter, using a pattern called Command...