Take this
course

Software Development / Web Development

Learning Akka

Explore the Akka toolkit to build highly scalable and robust applications

Description

About This Video

  • Explore actors to see how Akka handles concurrency
  • Build a fault-tolerant system from the ground up
  • Understand the key concepts through real-life scenarios


In Detail

Akka helps you to build scalable, resilient, and fault-tolerant distributed systems that can provide outstanding performance on local machines as well as over remote networks. Employing the actor model, it is possible to leverage these lightweight entities to program highly available, high performance applications. It delivers a powerful scaffolding that can be used to delegate remoting, service failures, and load management so that you can focus solely on your system logic.


Learning Akka delivers a clear and practical introduction to the Akka toolkit, explaining the key components you need to know to get up and running with developing applications of your own.


We will start by looking at the actor model and how it solves concurrency problems. You will learn about the actor system, how to create hierarchical structures in Akka, and how to make routes in order to send messages to other actors. We will look at other use cases such as building an actor that can change its behavior during runtime. You will then create stateful actors, work with a cluster system, and work with remote actors. This course will also take you through testing the application with Akka testkit and making applications available over the web with Akka HTTP. Finally, we’ll employ best practices and you’ll get to know the common actor patterns used for development with Akka.


By the end of this course, you’ll have a great foundation in Akka that will enable you to develop excellent applications and services with the toolkit.

Full details

Curriculum

  • Exploring the Actor World
    The Course Overview
    This video provides an overview of the entire course.
    3:23
    Understanding the Actor Model
    To start working with Akka and Actors, we need to understand what the Actor Model is and why we use the Actor Model on concurrent programs • Discussing Concurrency programs • Discussing problems of Concurrency • Introducing the Actor Model
    3:21
    Concepts and Terminology
    To get our hands dirty with web development in Akka, we first need to get ourselves introduced to Akka concepts and terminologies. • Discussing Concurrency and Parallelism • Discussing Asynchronous, Synchronous, Non-blocking, and Blocking • Discussing the Race condition
    4:07
    Let's Create Hello World
    In this video, we'll take our first steps in creating our first Akka project. • Creating the Akka project • Creating the Greeter actor and the Greet message • Sending the Greet message to Greeter actor
    3:24
  • Playing with Actors
    Actor System and Hierarchical Structure
    In this video, we will talk about Actor System and the structure for actors to understand the actor relationships better. • Discussing hierarchical structure for Actors • Discussing Actor System • Introducing the Actor System component
    4:36
    Actor Components and Lifecycle
    Like us, every actor has different stages and phases it goes through. We need to master them before going ahead and implementing them in our workflow. • Discussing actor components • Discussing actor lifecycle
    3:37
    Creating an Actor with Props
    We've been introduced to the lifecycle; now let's take this a step further and understand actor creation. • Discussing actor creation and definition • Discussing the Props class • Implementing Apollo actor and Zeus actor
    4:13
    Talking to an Actor
    Communication between actors is what we'll be looking at in this video. • Discussing the Tell pattern • Discussing the Ask pattern • Implementing the Registration use case
    4:58
    Supervision and Monitoring
    We saw how communication between actors works, but let's take a deeper look at dependency relationships and failure responses in this video. • Discussing supervision and supervision strategies • Discussing monitoring • Implementing examples
    6:01
  • Working with Akka Basic Tools
    ActorRef Versus Actor Path Versus Actor Selection
    To be able to work with actors, we need to grasp the basics of how to identify and locate actors. In this video, we will see these methods to do just that. • Explaining the difference between Actor Reference, Actor Path, and Actor Selection • Implementing examples to show the difference between ActorRef and Actor Selection • Implementing an example to get ActorRef from Actor Selection
    5:04
    Sending Messages via Router
    It is important to ensure that a sent message reaches its intended destination without any errors. To know this functionality better, let's get introduced to routing in Akka. • Implementing the Route Actor based on our knowledge • Discussing router types in Akka • Introducing router strategies on Akka
    5:48
    Replacing Actor Behavior via become/unbecome
    We've now come to a stage where it is important to understand change in actor behavior at runtime. We'll do this using become and unbecome. • Introducing become and unbecome • Implementing a user storage example that has two states and are connected to a database and disconnected from a database • Enhancing our example to store messages that are not handled on the current state
    4:49
    Replacing Actor Behavior via FSM
    Let's jump to the next method of changing actor behavior at runtime — FSM. • Introducing FSM • Implementing the user storage example that has two states connected to database and disconnected from database by the FSM style
    4:48
  • Akka Persistence
    Introduction to Akka Persistence
    To increase the efficiency of our actors, we need to understand persistence in Akka. This video is dedicated to get us started on the persistence front. • Discussing Akka Persistence module • Discussing components in Akka Persistence
    4:28
    Creating Persistent Actors
    Let's see how to implement persistence in Akka by implementing a Persistent Actor in this video. • Defining Event and Command messages • Defining Persistent Actor • Running our Persistent Actor to understand the Persistent Actor mechanism
    4:27
    Playing with a Persistent Actor
    The power of persistence lies in how we can recover the state of our actors. Let's play around with snapshots and the recovery mode to understand them better. • Expressing how actor persists its events and how it handles failures • Playing with the recovery mode • Expressing how to take snapshots and how to replay from them
    4:22
    Persistence FSM
    As we go ahead, let's look at the implementation of Persistent Actor that can replace its behavior via FSM. • Defining states and data for Account Actor • Defining commands and events for Account Actor • Implementing Account Actor as PersistentFSM Actor
    6:19
    Persistence Query
    Persistence Query is powerful enough to fulfill the query needs of our app. Let's get introduced to it in this video. • Expressing the CQRS pattern • Discussing Persistence Query • Implementing a simple example
    4:25
  • Working with Akka Cluster
    Playing with Remote Actors
    In real life, your application might get divided in multiple nodes. For this, we need to deal with remote actors. • Introducing Akka Remoting • Implementing the Lookup remote interaction • Implementing the Creation remote interaction
    5:27
    Building a Cluster
    In Scala projects, you need to design your application across a cluster. To do this, we will introduce the Akka cluster and build a simple cluster. • Introducing the Akka Cluster • Configuring our application to support the Akka Cluster • Implementing a simple cluster
    6:11
    Adding Load Balancer to a Cluster Node
    In your cluster, you need to balance work over nodes. So, we will introduce how we can add load balancer to your cluster. • Introducing to load balancer • Introduction to Cluster Metrics • Adding a load balancer
    3:10
    Creating a Singleton Actor in the Cluster
    In some cases, you want to run instances from specific actors. To do so, we will introduce a Cluster Singleton. • Introducing Cluster Singleton • Discussing how it works • Taking a look at the implementation
    5:46
    Cluster Sharding
    Sometimes, you have many stateful actors that together consume more resources, so you need to distribute them across several nodes in the Cluster without having to care about their physical location in the Cluster. • Introducing Cluster Sharding • Discussing how its work • Taking a look at its implementation
    5:50
  • Testing Actors
    How to Test an Actor?
    The Actor class is not like a normal class and actors do their work asynchronously. So, we can't test it like a normal class. Hence, we will introduce some ways to test the actor logic. • Preparing our project for testing • Defining our Counter Actor • Writing test cases for Counter Actor
    5:45
    Testing a Parent-child Relationship
    When you have parent and child actors, you need to test each actor without another actor. So, we will introduce a dependency-injection to test the parent and child actor. • Defining parent and child actors • Writing test cases for child actors • Writing test cases for parent actors
    3:27
    Testing FSM
    When you have an FSM actor in your application, you want to test if you implement state machine correctly or not. So, we will introduce how to test the FSM actor logic. • Recalling the FSM example from section 3 • Writing test cases for our example
    4:25
    Multi Node Testing
    When you implement remote actor's runs on different nodes, you want to test how these nodes will act. So we will introduce Multi Node test kit. • Introducing the Multi Node testing kit • Preparing our project to Multi Node testing • Writing Multi Node tests
    6:32
  • Working with Akka Streams
    Introduction to Akka Streams
    When you start dealing with processing big data, you will face two main problems, Blocking and Back pressure. So, we will introduce Akka Streams to solve your problems. • Discussing problems of a Big data processing • Discussing Akka Stream and how it solves these problems. We will also introduce the Akka Stream terminology. • Implementing a simpler application to make sure we understand the basic terminologies
    5:38
    Reactive Tweets
    To understand the Akka Stream, we will implement the reactive tweets application. • Discussing the application's logic • Implementing the reactive tweets
    4:55
    Testing Streams
    We want to write unit tests for any code line you wrote. So, we will introduce different ways to test your streams. • Testing streams by simple source, sink, and flow. • Testing streams using the Akka test kit • Testing streams using the Akka Streams test kit
    6:03
    Working with Graphs
    Not everything can be expressed as a linear sequence of Akka streams. So, we will introduce Flow Graphs. • Discussing Flow Graphs • Discussing our example • Playing with Flow Graphs DSL to implement our example
    4:57
    Working with Stream IO
    If you want to use files as a source or sink, we will introduce Akka Stream IO. • Discussing Stream IO • Implementing an example that will write streams on consoles and files • Implementing an example that will read streams from files
    4:17
  • Working with Akka HTTP
    Introduction to Akka HTTP
    In some cases, we want your application to interact with the external world. So, we will introduce the Akka HTTP Module. • Discussing the Akka HTTP Module • Discussing the structure for the Akka HTTP Module
    4:05
    Working with Client-side API
    In some cases, your application needs to consume data from external services. So, we will introduce the Akka HTTP Client-side API and the different levels on it. • Discussing Connection-level Client-side API and implementing examples for it • Discussing the Host-level Client-side API and implementing examples for it • Discussing Request-level Client-side API and implementing examples for it
    5:59
    Working with Server-side API
    In some cases, your application wants to provide services for the external world. So, we will introduce the Akka HTTP Server-side API and the different levels on it. • Discussing the Server-side API and two levels on it • Implementing a simple server by using low-level Server-side API • Implementing a simple server by using high-level Server-side API
    5:02
    Let's Implement a REST API
    To understand the server-side API. We will implement more complex examples. • Preparing our project • Defining our models and database operations • Implementing our server
    5:05
    Let's Test Our REST API
    When you provide a service for the external world, you will need to implement test cases for it. So, we will implement test cases for our REST API that was implemented in the previous video as an example of how to use the akka-http-test kit. • Preparing our project for testing • Writing test cases for our REST API
    3:32
  • Working with Common Patterns in Akka
    Balancing Workload Across Nodes
    In this video, we will introduce Balancing Workload Across Nodes pattern. • Revisiting the Balancing Dispatcher router • Getting an overview of patterns • Checking pattern implementations
    5:35
    Throttling Messages
    What if your application sends HTTP requests to an external service and you want to limit the number of requests during a specific period? Here, we will introduce the Throttling Messages pattern to control the rate of messages sent. • Having an overview of the patterns • Taking a quick look at implementations • Implementing a simple app that uses TimerBaseThrottler
    4:27
    Shutdown Patterns
    In Akka, we don't have a flag, configuration setting, or callback function; we can register for it to tell Akka to shutdown the actor system when the app is finished. We will introduce the pattern to control when the actor system should terminate. • Introducing the Shutdown pattern • Quickly viewing the pattern implementation • Implementing a simple example
    3:27
    Ordered Termination
    What if you have children actors and you want to terminate them on a specific order after the parent terminated? We will introduce the Ordered Termination pattern. • Introducing the Ordered Termination pattern • Quickly viewing the pattern implementation • Implementing a simple example
    3:46
    Scheduling Periodic Messages
    If you want to schedule messages that send every interval in actor, we will introduce the scheduling periodic messages pattern. • Introducing the two ways to schedule messages • Quickly viewing the first approach to schedule messages on the constructor • Quickly viewing the second approach to schedule messages on receipt
    2:58

Skills

  • Web Application Development

Similar Courses

More Courses by this Instructor