Chapter 6. Your first distributed Akka app


In this chapter

  • Introducing scaling out
  • Distributing the app
  • Distributing actors with the remote module
  • Testing distributed actor systems

So far we’ve only looked at building an Akka actor system on one node. This chapter will serve as an introduction to scaling out Akka applications. You’ll build your first distributed Akka app right here. We’ll take the app from chapter 2 and scale it out.

We’ll start off with some common terminology and a quick look at the different approaches Akka takes to scale out. You’ll be introduced to the akka-remote module and how it provides an elegant solution for communicating between actors across the network. We’ll scale the app out to two nodes: a frontend and a backend server. You’ll find out how you can unit test the app using the multi-JVM test kit.

This chapter will just get you acquainted with scaling out your apps; later chapters will round out your knowledge. For example, in chapter 9 we’ll use routers to distribute the load over several actors that can be remote actors, and chapter 13 will introduce you to clustering. Chapter 13 will dive into the details of scaling out once you’re more familiar with how to build a real-world Akka application.

6.1. Scaling out

6.2. Scaling out with remoting

6.3. Summary