SlideShare a Scribd company logo
Hugh McKee (@mckeeh3), Developer Advocate
Building Stateful Clustered Microservices
with Java, Actors, and Kubernetes
Hugh McKee (@mckeeh3), Developer Advocate
Hugh McKee (@mckeeh3), Developer Advocate
Hugh McKee (@mckeeh3), Developer Advocate
The actor model in computer science is a mathematical model of
concurrent computation that treats "actors" as the universal primitives
of concurrent computation. In response to a message that it receives,
an actor can: make local decisions, create more actors, send more
messages, and determine how to respond to the next message
received. Actors may modify their own private state, but can only affect
each other through messages (avoiding the need for any locks).
Wikipedia
The actor model in computer science is a mathematical model of
concurrent computation that treats "actors" as the universal primitives
of concurrent computation. In response to a message that it receives,
an actor can: make local decisions, create more actors, send more
messages, and determine how to respond to the next message
received. Actors may modify their own private state, but can only affect
each other through messages (avoiding the need for any locks).
Wikipedia
The actor model in computer science is a mathematical model of
concurrent computation that treats "actors" as the universal primitives
of concurrent computation. In response to a message that it receives,
an actor can: make local decisions, create more actors, send more
messages, and determine how to respond to the next message
received. Actors may modify their own private state, but can only affect
each other through messages (avoiding the need for any locks).
Wikipedia
The actor model in computer science is a mathematical model of
concurrent computation that treats "actors" as the universal primitives
of concurrent computation. In response to a message that it receives,
an actor can: make local decisions, create more actors, send more
messages, and determine how to respond to the next message
received. Actors may modify their own private state, but can only affect
each other through messages (avoiding the need for any locks).
Wikipedia
The actor model in computer science is a mathematical model of
concurrent computation that treats "actors" as the universal primitives
of concurrent computation. In response to a message that it receives,
an actor can: make local decisions, create more actors, send more
messages, and determine how to respond to the next message
received. Actors may modify their own private state, but can only affect
each other through messages (avoiding the need for any locks).
Wikipedia
The actor model in computer science is a mathematical model of
concurrent computation that treats "actors" as the universal primitives
of concurrent computation. In response to a message that it receives,
an actor can: make local decisions, create more actors, send more
messages, and determine how to respond to the next message
received. Actors may modify their own private state, but can only affect
each other through messages (avoiding the need for any locks).
Wikipedia
The actor model in computer science is a mathematical model of
concurrent computation that treats "actors" as the universal primitives
of concurrent computation. In response to a message that it receives,
an actor can: make local decisions, create more actors, send more
messages, and determine how to respond to the next message
received. Actors may modify their own private state, but can only affect
each other through messages (avoiding the need for any locks).
Wikipedia
The actor model in computer science is a mathematical model of
concurrent computation that treats "actors" as the universal primitives
of concurrent computation. In response to a message that it receives,
an actor can: make local decisions, create more actors, send more
messages, and determine how to respond to the next message
received. Actors may modify their own private state, but can only affect
each other through messages (avoiding the need for any locks).
Wikipedia
The actor model in computer science is a mathematical model of
concurrent computation that treats "actors" as the universal primitives
of concurrent computation. In response to a message that it receives,
an actor can: make local decisions, create more actors, send more
messages, and determine how to respond to the next message
received. Actors may modify their own private state, but can only affect
each other through messages (avoiding the need for any locks).
Wikipedia
The actor model in computer science is a mathematical model of
concurrent computation that treats "actors" as the universal primitives
of concurrent computation. In response to a message that it receives,
an actor can: make local decisions, create more actors, send more
messages, and determine how to respond to the next message
received. Actors may modify their own private state, but can only affect
each other through messages (avoiding the need for any locks).
Wikipedia
The actor model in computer science is a mathematical model of
concurrent computation that treats "actors" as the universal primitives
of concurrent computation. In response to a message that it receives,
an actor can: make local decisions, create more actors, send more
messages, and determine how to respond to the next message
received. Actors may modify their own private state, but can only affect
each other through messages (avoiding the need for any locks).
Wikipedia
The actor model in computer science is a mathematical model of
concurrent computation that treats "actors" as the universal primitives
of concurrent computation. In response to a message that it receives,
an actor can: make local decisions, create more actors, send more
messages, and determine how to respond to the next message
received. Actors may modify their own private state, but can only affect
each other through messages (avoiding the need for any locks).
Wikipedia
Kubernetes (K8s) is an open-source system for
automating deployment, scaling, and management
of containerized applications.
Kubernetes (K8s) is an open-source system for
automating deployment, scaling, and management
of containerized applications.
elastic
resilient
Akka cluster and Kubernetes
Live demo
“Crop Circle”
Shows
Running Pods / JVMs
“Crop Circle”
Shows
Running Pods / JVMs
POD / JVM
POD / JVM
POD / JVM
Entity
Shard
Singleton
HTTP Server
Pod
Entities added as needed
Inactive entities shutdown
Microservice Application
Microservice
Resilience and Scale Demo
The enabler of these characteristics is a Cloud-Ready Message Driven Model.
Lightbend codified these principles into the Reactive Manifesto in 2013; 24,000+ signatories around the world so far.
Responsive Resilient Elastic
React to
Users
React to
Failures
React to
Load Variance
Low latency / High
performance
Real-time / NRT
Graceful, Non-catastrophic
Recovery
Self-Healing
Responsive in the face of
changing loads
Reactive Systems
The enabler of these characteristics is a Cloud-Ready Message Driven Model.
Lightbend codified these principles into the Reactive Manifesto in 2013; 24,000+ signatories around the world so far.
Responsive Resilient Elastic
React to
Users
React to
Failures
React to
Load Variance
Low latency / High
performance
Real-time / NRT
Graceful, Non-catastrophic
Recovery
Self-Healing
Responsive in the face of
changing loads
Reactive Systems
Java Maven K8
Project Review
Clustered Entity Actors
You
entity 64
Load Balancer
Me
entity 17
Other
entity 76
You
entity 64
Load Balancer
Me
entity 17
Other
entity 76
Clustered Entity Actors
Code Review
Load Balancer
Pod 1
Load Balancer
Pod 2Pod 1 Pod 3
Load Balancer
Pod 2Pod 1 Pod 3
Building Stateful Clustered Microservices with Java, Actors, and Kubernetes
Distributed Actors
Cluster Aware
Actors
Distributed Actors
Cluster Aware
Actors
Distributed Actors
Cluster Aware
Actors
Distributed Actors
Cluster Aware
Actors
Distributed Actors
Cluster Aware
Actors
Distributed Actors
Cluster Aware
Actors
Cluster Aware Actors
Code Review
Shard Distribution
Akka Cluster Singleton
Shard Distribution
Akka Cluster Singleton
Shard Distribution
Akka Cluster Singleton
Entity Distributed Sharding
Akka Cluster Sharding
Entity Distributed
Sharding
Akka Cluster Sharding
Event Sourcing & CQRS
Akka Persistence & Persistence Query
Event Sourcing & CQRS
Akka Persistence &
Persistence Query
User ID Time Event
You 64 08:11 Add Item 1567
Me 17 08:15 Add Item 3254
Other 76 08:16 Add Item 8359
You 64 08:20 Add Item 2632
Me 17 08:20 Add Item 4983
Other 76 08:24 Change Item 8359
You 64 08:25 Remove Item 1567
You 64 08:26 Add shipping address
Other 76 08:30 Add Item 2438
Me 17 08:33 Add shipping address
Me 17 08:33 Add billing address
You 64 08:35 Add billing address
Event Sourcing & CQRS
You
entity 64
Load Balancer
Me
entity 17
Other
entity 76
Akka Reactive Systems and Kubernetes
Responsive Resilient Elastic
React to
Users
React to
Failures
React to
Load Variance
Low latency / High
performance
Real-time / NRT
Graceful, Non-catastrophic
Recovery
Self-Healing
Responsive in the face of
changing loads
a beautiful relationship
/akka-java-cluster-kubernetes
/akka-java-cluster.git
/akka-java-cluster-aware.git
/akka-java-cluster-singleton.git
/akka-java-cluster-sharding.git
/akka-java-cluster-persistence.git
/akka-java-cluster-persistence-query.git
https://github.com/mckeeh3…
Upgrade your grey matter!

Get the free O’Reilly book by Hugh McKee, 

Developer Advocate at Lightbend
https://www.lightbend.com/ebooks
Hugh McKee (@mckeeh3), Developer Advocate
hugh.mckee@lightbend.com
Akka and Kubernetes:
The beginning of a beautiful relationship
Building Stateful Clustered Microservices with Java, Actors, and Kubernetes

More Related Content

PDF
Akka and Kubernetes, the beginning of a beautiful relationship - Container Da...
PDF
Akka and Kubernetes: A Symbiotic Love Story
PDF
Akka and Kubernetes, the beginning of a beautiful relationship
PDF
Introducing Akka
PDF
Introducingakkajavazone2012 120914094033-phpapp02
PDF
Actor model : A Different Concurrency Approach
PPTX
Actor Model & Reactive Manifesto
PDF
Un actor (model) per amico - Alessandro Melchiori - Codemotion Milan 2016
Akka and Kubernetes, the beginning of a beautiful relationship - Container Da...
Akka and Kubernetes: A Symbiotic Love Story
Akka and Kubernetes, the beginning of a beautiful relationship
Introducing Akka
Introducingakkajavazone2012 120914094033-phpapp02
Actor model : A Different Concurrency Approach
Actor Model & Reactive Manifesto
Un actor (model) per amico - Alessandro Melchiori - Codemotion Milan 2016

Similar to Building Stateful Clustered Microservices with Java, Actors, and Kubernetes (20)

PDF
Actor, an elegant model for concurrent and distributed computation
PDF
Take a Look at Akka+Java (English version)
PPTX
Reactive Programming using Actor Model in Akka
PDF
Reactive applications and Akka intro used in the Madrid Scala Meetup
PDF
Actor model in F# and Akka.NET
PDF
Introduction to the Actor Model
KEY
Akka london scala_user_group
PPTX
Actors drammen
KEY
Introduction to Actor Model and Akka
PDF
Reactive applications using Akka
PDF
Actors evolved- Rotem Hermon
PDF
Actors: Not Just for Movies Anymore
PDF
Akka lsug skills matter
PDF
Scaling Web Apps with Akka
PDF
Model with actors and implement with Akka
PDF
Spring Boot Microservices vs Akka Actor Cluster
PDF
Akka (1)
PDF
PDF
A gentle introduction into AKKA and the actor model
PDF
Haufe #msaday - The Actor model: an alternative approach to concurrency By Lo...
Actor, an elegant model for concurrent and distributed computation
Take a Look at Akka+Java (English version)
Reactive Programming using Actor Model in Akka
Reactive applications and Akka intro used in the Madrid Scala Meetup
Actor model in F# and Akka.NET
Introduction to the Actor Model
Akka london scala_user_group
Actors drammen
Introduction to Actor Model and Akka
Reactive applications using Akka
Actors evolved- Rotem Hermon
Actors: Not Just for Movies Anymore
Akka lsug skills matter
Scaling Web Apps with Akka
Model with actors and implement with Akka
Spring Boot Microservices vs Akka Actor Cluster
Akka (1)
A gentle introduction into AKKA and the actor model
Haufe #msaday - The Actor model: an alternative approach to concurrency By Lo...
Ad

More from Hugh McKee (15)

PDF
The End of the Data Ice Age.pdf
PDF
How Secure Serverless Microservice Platforms Completely Change Dev & Ops.pdf
PDF
From Monolithic Microservices to Micro Streams.pdf
PDF
Microservice design patterns
PDF
How to build megaservices mind7 2021 June 29
PDF
Yavaconf 2021 building io t digital twins with java and akka
PDF
7 Reasons why your microservices should use Event Sourcing & CQRS
PDF
The Evolution From Monolith to Microservices to Serverless and Beyond
PDF
7 reasons-why-es-cqrs
PDF
Akka and Kubernetes, the beginning of a beautiful relationship - JEEConf 19 Kiev
PDF
Akka and Kubernetes, the beginning of a beautiful relationship
PDF
Akka and Kubernetes, the beginning of a beautiful relationship
PDF
Akka and-kubernetes
PDF
7 Reasons why your microservices should use Event Sourcing & CQRS
PDF
Akka java-es-cqrs
The End of the Data Ice Age.pdf
How Secure Serverless Microservice Platforms Completely Change Dev & Ops.pdf
From Monolithic Microservices to Micro Streams.pdf
Microservice design patterns
How to build megaservices mind7 2021 June 29
Yavaconf 2021 building io t digital twins with java and akka
7 Reasons why your microservices should use Event Sourcing & CQRS
The Evolution From Monolith to Microservices to Serverless and Beyond
7 reasons-why-es-cqrs
Akka and Kubernetes, the beginning of a beautiful relationship - JEEConf 19 Kiev
Akka and Kubernetes, the beginning of a beautiful relationship
Akka and Kubernetes, the beginning of a beautiful relationship
Akka and-kubernetes
7 Reasons why your microservices should use Event Sourcing & CQRS
Akka java-es-cqrs
Ad

Recently uploaded (20)

PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PPTX
L1 - Introduction to python Backend.pptx
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PPTX
Transform Your Business with a Software ERP System
PPTX
Computer Software and OS of computer science of grade 11.pptx
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PPTX
assetexplorer- product-overview - presentation
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
System and Network Administration Chapter 2
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
How to Migrate SBCGlobal Email to Yahoo Easily
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Understanding Forklifts - TECH EHS Solution
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
L1 - Introduction to python Backend.pptx
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Wondershare Filmora 15 Crack With Activation Key [2025
wealthsignaloriginal-com-DS-text-... (1).pdf
Transform Your Business with a Software ERP System
Computer Software and OS of computer science of grade 11.pptx
Which alternative to Crystal Reports is best for small or large businesses.pdf
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
assetexplorer- product-overview - presentation
CHAPTER 2 - PM Management and IT Context
System and Network Administration Chapter 2
2025 Textile ERP Trends: SAP, Odoo & Oracle
Odoo Companies in India – Driving Business Transformation.pdf
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Embracing Complexity in Serverless! GOTO Serverless Bengaluru

Building Stateful Clustered Microservices with Java, Actors, and Kubernetes

  • 1. Hugh McKee (@mckeeh3), Developer Advocate Building Stateful Clustered Microservices with Java, Actors, and Kubernetes
  • 2. Hugh McKee (@mckeeh3), Developer Advocate
  • 3. Hugh McKee (@mckeeh3), Developer Advocate
  • 4. Hugh McKee (@mckeeh3), Developer Advocate
  • 5. The actor model in computer science is a mathematical model of concurrent computation that treats "actors" as the universal primitives of concurrent computation. In response to a message that it receives, an actor can: make local decisions, create more actors, send more messages, and determine how to respond to the next message received. Actors may modify their own private state, but can only affect each other through messages (avoiding the need for any locks). Wikipedia
  • 6. The actor model in computer science is a mathematical model of concurrent computation that treats "actors" as the universal primitives of concurrent computation. In response to a message that it receives, an actor can: make local decisions, create more actors, send more messages, and determine how to respond to the next message received. Actors may modify their own private state, but can only affect each other through messages (avoiding the need for any locks). Wikipedia
  • 7. The actor model in computer science is a mathematical model of concurrent computation that treats "actors" as the universal primitives of concurrent computation. In response to a message that it receives, an actor can: make local decisions, create more actors, send more messages, and determine how to respond to the next message received. Actors may modify their own private state, but can only affect each other through messages (avoiding the need for any locks). Wikipedia
  • 8. The actor model in computer science is a mathematical model of concurrent computation that treats "actors" as the universal primitives of concurrent computation. In response to a message that it receives, an actor can: make local decisions, create more actors, send more messages, and determine how to respond to the next message received. Actors may modify their own private state, but can only affect each other through messages (avoiding the need for any locks). Wikipedia
  • 9. The actor model in computer science is a mathematical model of concurrent computation that treats "actors" as the universal primitives of concurrent computation. In response to a message that it receives, an actor can: make local decisions, create more actors, send more messages, and determine how to respond to the next message received. Actors may modify their own private state, but can only affect each other through messages (avoiding the need for any locks). Wikipedia
  • 10. The actor model in computer science is a mathematical model of concurrent computation that treats "actors" as the universal primitives of concurrent computation. In response to a message that it receives, an actor can: make local decisions, create more actors, send more messages, and determine how to respond to the next message received. Actors may modify their own private state, but can only affect each other through messages (avoiding the need for any locks). Wikipedia
  • 11. The actor model in computer science is a mathematical model of concurrent computation that treats "actors" as the universal primitives of concurrent computation. In response to a message that it receives, an actor can: make local decisions, create more actors, send more messages, and determine how to respond to the next message received. Actors may modify their own private state, but can only affect each other through messages (avoiding the need for any locks). Wikipedia
  • 12. The actor model in computer science is a mathematical model of concurrent computation that treats "actors" as the universal primitives of concurrent computation. In response to a message that it receives, an actor can: make local decisions, create more actors, send more messages, and determine how to respond to the next message received. Actors may modify their own private state, but can only affect each other through messages (avoiding the need for any locks). Wikipedia
  • 13. The actor model in computer science is a mathematical model of concurrent computation that treats "actors" as the universal primitives of concurrent computation. In response to a message that it receives, an actor can: make local decisions, create more actors, send more messages, and determine how to respond to the next message received. Actors may modify their own private state, but can only affect each other through messages (avoiding the need for any locks). Wikipedia
  • 14. The actor model in computer science is a mathematical model of concurrent computation that treats "actors" as the universal primitives of concurrent computation. In response to a message that it receives, an actor can: make local decisions, create more actors, send more messages, and determine how to respond to the next message received. Actors may modify their own private state, but can only affect each other through messages (avoiding the need for any locks). Wikipedia
  • 15. The actor model in computer science is a mathematical model of concurrent computation that treats "actors" as the universal primitives of concurrent computation. In response to a message that it receives, an actor can: make local decisions, create more actors, send more messages, and determine how to respond to the next message received. Actors may modify their own private state, but can only affect each other through messages (avoiding the need for any locks). Wikipedia
  • 16. The actor model in computer science is a mathematical model of concurrent computation that treats "actors" as the universal primitives of concurrent computation. In response to a message that it receives, an actor can: make local decisions, create more actors, send more messages, and determine how to respond to the next message received. Actors may modify their own private state, but can only affect each other through messages (avoiding the need for any locks). Wikipedia
  • 17. Kubernetes (K8s) is an open-source system for automating deployment, scaling, and management of containerized applications.
  • 18. Kubernetes (K8s) is an open-source system for automating deployment, scaling, and management of containerized applications. elastic resilient
  • 19. Akka cluster and Kubernetes Live demo
  • 21. “Crop Circle” Shows Running Pods / JVMs POD / JVM POD / JVM POD / JVM
  • 23. Entities added as needed Inactive entities shutdown
  • 26. The enabler of these characteristics is a Cloud-Ready Message Driven Model. Lightbend codified these principles into the Reactive Manifesto in 2013; 24,000+ signatories around the world so far. Responsive Resilient Elastic React to Users React to Failures React to Load Variance Low latency / High performance Real-time / NRT Graceful, Non-catastrophic Recovery Self-Healing Responsive in the face of changing loads Reactive Systems
  • 27. The enabler of these characteristics is a Cloud-Ready Message Driven Model. Lightbend codified these principles into the Reactive Manifesto in 2013; 24,000+ signatories around the world so far. Responsive Resilient Elastic React to Users React to Failures React to Load Variance Low latency / High performance Real-time / NRT Graceful, Non-catastrophic Recovery Self-Healing Responsive in the face of changing loads Reactive Systems
  • 49. Event Sourcing & CQRS Akka Persistence & Persistence Query
  • 50. Event Sourcing & CQRS Akka Persistence & Persistence Query
  • 51. User ID Time Event You 64 08:11 Add Item 1567 Me 17 08:15 Add Item 3254 Other 76 08:16 Add Item 8359 You 64 08:20 Add Item 2632 Me 17 08:20 Add Item 4983 Other 76 08:24 Change Item 8359 You 64 08:25 Remove Item 1567 You 64 08:26 Add shipping address Other 76 08:30 Add Item 2438 Me 17 08:33 Add shipping address Me 17 08:33 Add billing address You 64 08:35 Add billing address Event Sourcing & CQRS
  • 53. Akka Reactive Systems and Kubernetes Responsive Resilient Elastic React to Users React to Failures React to Load Variance Low latency / High performance Real-time / NRT Graceful, Non-catastrophic Recovery Self-Healing Responsive in the face of changing loads a beautiful relationship
  • 55. Upgrade your grey matter!
 Get the free O’Reilly book by Hugh McKee, 
 Developer Advocate at Lightbend https://www.lightbend.com/ebooks
  • 56. Hugh McKee (@mckeeh3), Developer Advocate hugh.mckee@lightbend.com Akka and Kubernetes: The beginning of a beautiful relationship