This chapter discusses two of the seven tools used to build microservices: Akka Sharding and Akka Persistence. The others are Akka Streams, Persistence Query, Projections, HTTP, and gRPC, which you learn about in chapters 10 and 11.
These Akka tools can be used separately (and are traditionally used that way). However, they are increasingly used as a functional unit: looking at them all together helps us better understand them. We call this functional view Akka microservices (to learn more, see appendix B).
Note
The source code for this chapter is available at www.manning.com/books/akka-in-action-second-edition or https://github.com/franciscolo pezsancho/akka-topics/tree/main/chapter09a. You can find the contents of any snippet or listing in the .scala file with the same name as the class, object, or trait.
Akka cluster sharding distributes the locations of actors; they are called entities when sharding. With cluster sharding, you can ensure that each entity is unique and that there is at most one in the cluster at any given time.