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

Closing comments


There are a few final comments that I wanted to make about the code that we refactored in this chapter. I feel that these things needed a little further explanation, so you're not left scratching your head.

The first thing that I wanted to comment on is the fact that I did not do the single-entity lookup inside the read model even though this is technically a lookup operation. I felt that the single-entity lookup, by ID, should always return the most current state of that entity, and the read model won't guarantee this. It's always possible that the read model is slightly behind the write model due to the nature of how it's built. This was a judgment call that I made, going for being pragmatic versus being a purist.

The purist would say that all lookups go to the read model. The pragmatist in me however thought that single entity lookups should always give you the most up-to-date info, avoiding potential read model lag in these cases. This is a decision you can certainly change...