1 Introducing Akka


This chapter covers

  • Why scaling is hard
  • Write once, scale anywhere
  • Introduction to the actor programming model
  • Akka actors
  • What is Akka?

In this book, you learn how the Akka toolkit provides a single simple programming model for coding concurrent and distributed applications: the actor programming model. Actors are nothing new in and of themselves. What’s unique is the way actors are provided in Akka to scale applications both up and out on the Java virtual machine (JVM). As you’ll see, Akka uses resources efficiently and makes it possible to keep complexity relatively low while an application scales.

Akka’s primary goal is to make it simpler to build applications that are deployed in the cloud or run on devices with many cores and that efficiently take advantage of the full capacity of the computing power available. It’s a toolkit that provides the actor programming model, a runtime, and the necessary tools for building scalable applications. This chapter discusses the context in which Akka was created, the problem it is designed to solve, and its key architectural components.

1.1 What is Akka?

1.2 Actors: A quick overview

1.3 Two approaches to scaling: Setting up the example

1.4 Traditional scaling

1.4.1 Traditional scaling and durability: Moving everything to the database

1.4.2 Traditional scaling and interactive use: Polling

1.4.3 Traditional scaling: Transactions

1.5 Scaling with Akka

1.5.1 Scaling with Akka and durability: Sending and receiving messages

1.5.2 Scaling with Akka and interactive use: Pushing messages

1.5.3 Scaling with Akka and failure: Asynchronous decoupling

1.5.4 The Akka approach: Sending and receiving messages