SlideShare a Scribd company logo
Akka Cluster vs Kubernetes
Clustering Solutions Showdown
About us
Fabio Tiriticco
@ticofab
Scala & Akka consultant Kubernetes consultant
Ádám Sándor
@adamsand0r
Reactive
Distributed
Systems
Reactive Programming
Actors
Async Messaging
Non-blocking IO
Deployment
Streaming
Transparent clustering
Resource Provisioning
Zero-downtime deployments
Networking
Docker Containers
Service Discovery
Microservices
Reactive Community Kubernetes Community
Development+ +
@ticofab
@adamsand0rQuestions we try to answer
1. Can Kubernetes make an application reactive?

2. If so, what value does Akka Cluster provide on top of Kubernetes?

3. Is Akka Cluster suitable for a microservice architecture?

4. How can Akka Cluster and Kubernetes work together?
@ticofab
@adamsand0r
Reactive Systems
@ticofab
@adamsand0rThe Reactive Manifesto
2013, J. Boner, R. Kuhn, D. Farley, M. Thompson
VALUE
MEANS
FORM
@ticofab
@adamsand0rThe key to Elasticity is Distribution
Scale UP
Scale OUT
Limited by the
speed of light!
🌍
The key to Distribution is Location Transparency
MESSAGE DRIVEN
=
LOCATION TRANSPARENCY
@ticofab
@adamsand0r
Fault Tolerance Resilience
“The component is being hit
but keeps going, possibly
with reduced functionality”
“Upon failure, a component
is able to jump back to a
fully functional fresh state”
What is Resilience?
@ticofab
@adamsand0r
Akka
@ticofab
@adamsand0rWhat is Akka?
Reactive
Principles
Reactive
Design
Patterns
Reactive
Building
Blocks
JVM / application level
@ticofab
@adamsand0rHow does Akka help us achieve elasticity?
T1000
Actor

“John”
“John”
target?
• contains its own state
• can only communicate
via async messaging
t1000.getTarget()
Single JVMJVM 1
JVM 2
• unit of computation
Akka’s building
blocks are Actors
target:
Sarah
Actor

• contains behaviour
@ticofab
@adamsand0rAkka Cluster
JVM
JVM
JVMJVM
JVM
@ticofab
@adamsand0rHow does Akka help us achieve resilience?
Supervisor Actor
Actor
Every actor:
is created by a supervisor,
to whom failure handling is
delegated
USING A COMPONENT
≠
HANDLING ITS FAILURES
@ticofab
@adamsand0rHow does Akka help us achieve resilience?
Skynet

actor
T1000
actor
TooManyHolesException
X
Fresh
restart
try {
walk();
} catch (OutOfLegsException e) {
}
legsAvailable = false;
pullWithArms();
T800

instance
walk();
@ticofab
@adamsand0r
Kubernetes and its significance
@ticofab
@adamsand0rWhat is Kubernetes?
11.8.2.12
11.8.2.4
11.8.2.1
11.8.2.7
11.8.2.6 11.8.2.5
11.8.2.8
11.8.2.3
11.8.2.2
11.8.2.10
11.8.2.11
VM VM VMVM
@ticofab
@adamsand0rK8s creates nodes and helps form cluster
JVM JVM
pod-1 pod-2 pod-3 pod-4
vm-1 vm-2
Actor Actor ActorActor Actor ActorActors
JVM

Akka Cluster node
Pods
VM

Kubernetes node
JVMJVM
@ticofab
@adamsand0rLots of cloud providers
Google Kubernetes Engine

GKE
Azure Kubernetes Service

AKS
Elastic Container
Service for Kubernetes

EKS
( )
@ticofab
@adamsand0r
Can Kubernetes make an
application reactive?
Question 1
11.8.2.12
11.8.2.4
11.8.2.1
11.8.2.7
11.8.2.6 11.8.2.5
11.8.2.8
11.8.2.3
11.8.2.2
11.8.2.9
11.8.2.10
11.8.2.11
UI 11.8.2.22
backend
11.8.2.23
processing
11.8.2.24
Does Kubernetes help us achieve elasticity?
11.8.2.12
11.8.2.4
11.8.2.1
11.8.2.7
11.8.2.6
11.8.2.8
11.8.2.3
11.8.2.2
11.8.2.9
11.8.2.10
11.8.2.11
UI 11.8.2.22
backend
11.8.2.23
processing
11.8.2.24
Does Kubernetes help us achieve resilience?
11.8.2.5
11.8.2.18
@ticofab
@adamsand0r
What value does Akka Cluster
provide on top of Kubernetes?
Question 2
Fabio’s first journey in the Reactive World (2013)
@ticofab
@adamsand0rDevice matching use case (1)
@ticofab
@adamsand0rDevice matching use case (2)
@ticofab
@adamsand0rDevice matching use case (3)
@ticofab
@adamsand0rEngine requirements
🔄 Allow a FAST bi-directional channel between paired devices

👥 Manage many devices concurrently

📱 Hold state for each device (location, matched devices..)
21
@ticofab
@adamsand0rStateless Microservice Architecture
Phone
1
Phone
Service
instance 1
Websocket
Listener
1
2
3
Phone
Service
instance 2
Phone
Service
instance 3
Phone
3
@ticofab
@adamsand0rActor-based architecture (single node)
WS
Listener
Phone
Manager
1
Phone 1
Phone 2
Phone 3
2
3
match 3 match 1
New phone
connected!
New phone
connected!
Do you match
with phone 2 ?
Do you match
with phone 3 ? Do you match
with phone 3 ?
New phone
connected!
You matched
with me!
@ticofab
@adamsand0rActor-based architecture (multi node)
WS
Listener
Phone
Manager
Phone 1
Phone 2
Phone 3
1
6
3
Phone
Manager
Phone 4
Phone 5
Phone 6
Phone
Manager
Phone 7
Phone 8
Phone 9
9
match 9
You matched
with me!
match 6
@ticofab
@adamsand0r
Phone service
instance 2
Phone service
instance 1
Stateful Microservice Architecture
Gateway service instance Actor messaging
Phone
1
Phone
3
1
2
3
Akka Cluster
@ticofab
@adamsand0rDistributed workload
Worker 1
Master
Worker 2
Worker N
….
Master
@ticofab
@adamsand0rDistributed workload
Akka Cluster
Deployment
Deployment
• Less performance (HTTP)

• Multiple technologies
• High performance (actor msg)

• Actor programming model

• Mono-technology
Worker 1 (pod)
Master
(pod) Worker 2 (pod)
Worker N (pod)
….
Deployment
Deployment
Worker 1 (pod)
Master
(pod) Worker 2 (pod)
Worker N (pod)
….
Service
Master
(pod)
Master
(pod)
@ticofab
@adamsand0r
Is Akka Cluster suitable for a
microservice architecture?
Question 3
@ticofab
@adamsand0rConfusion
https://doc.akka.io/docs/akka/current/cluster-usage.html
https://tech.iheart.com/why-we-picked-akka-cluster-as-
our-microservice-framework-bbf3019a3217
iHeart blog post, 2016
Akka docs, summer 2018
@ticofab
@adamsand0r
@ticofab
@adamsand0r
Actor 

in Akka Cluster
Microservice 

on Kubernetes
Location transparency ✅ ✅
Resilience ✅ ✅
Scalability ✅ ✅
Independently deployable ❌ ✅
@ticofab
@adamsand0rOne codebase - One cluster
Device
1
1
2
3 WS
GW
Device
3
Device
2
Device
4
Phone Service Instance 1 (pod)
Phone
1
WS
Gateway
Phone
3
Phone
2
Phone
4
Phone Service Instance 2 (pod)
Phone
5
WS
Gateway
Phone
7
Phone
6
Phone
8
Akka Cluster
@ticofab
@adamsand0rSeparate codebase - One cluster
1
2
3
Actor
Messaging
WS GW
Instance 2 (pod)
WS
Gateway
WS GW
Instance 1 (pod)
WS
Gateway
Phone Service Instance 1 (pod)
Phone
1
Phone
3
Phone
2
Phone
4
Phone Service Instance 2 (pod)
Phone
5
Phone
7
Phone
6
Phone
8
Akka Cluster
@ticofab
@adamsand0rSeparate codebase - Separate clusters
Actor
Messaging
Phone Service Instance 1 (pod)
Phone
1
Phone
3
Phone
2
Phone
4
Akka Cluster
Phone Service Instance 2 (pod)
Phone
5
Phone
7
Phone
6
Phone
8
WS GW
Instance 1 (pod)
WS
Gateway
WS GW
Instance 1 (pod)
WS
Gateway
Akka Cluster
Actor
Messaging
HTTP /
event queue
HTTP /
event queue
1
2
3
@ticofab
@adamsand0r
How can Akka Cluster and
Kubernetes work together?
Question 4
@ticofab
@adamsand0r
K8S
API
K8s creates nodes and helps form cluster
11.8.2.1
Node 3

cluster: mycluster
11.8.2.6
Node 2

cluster: mycluster
11.8.3.2
Node 4

cluster: mycluster
Node 1

cluster: mycluster
11.8.3.3
@ticofab
@adamsand0rCluster on top of cluster
?BOTH
@ticofab
@adamsand0r
Pod 1
Deployment
Controller
Pod 2
Resilience at different levels
Actor 2
Supervisor
Actor 1
Restart
💀
👀
Restart
💀
👀
@ticofab
@adamsand0rScale of resilience
JVM Exceptions JVM Errors Hardware failure
Skynet attack

Meteorite hits
Akka
Actors{ } Kubernetes[ ]Akka
Cluster{ }
@ticofab
@adamsand0rLocation transparency at different levels
VM 1
VM 2
No need to know VM IP address
Actor 2Actor 1
Pod 2
Pod 1
Pod 3
@ticofab
@adamsand0rConclusions
Kubernetes is a great
infrastructure choice for your
clustered application
⚙
It provides location
transparency with cluster
formation
🖇
It introduces resilience at
an infrastructure level
+
Akka has a great
programming model, ready
to scale up from day 1
📬
Akka Cluster enables direct
communication between
stateful services
📟
And resilience is
built in your service
.
@ticofab
@adamsand0rConclusion
Akka & Kubernetes together give you superpowers.
Superman is a ™ of DC Comics
@ticofab
@adamsand0rReferences
Jonas Bonér: Reactive Microservices Architecture (O'Reilly)

Sam Newman: Building Microservices (O’Reilly)

Jamie Allen, “Reactive is a Product”, React Sphere 2018

Akka docs (https://goo.gl/MJ1o41)

iHeart blog post (https://goo.gl/h2eN7X)

Wade Waldron, Cognitive Class, Introduction to Reactive Systems
Q&A
Thanks!
@ticofab

@adamsand0r
@ticofab
@adamsand0rDevice matching use case (4) - 2018
😓
• Watch the video and see where we can shorten (50 min is too long)

• Add a couple of cases where Akka Cluster can be superseded by K8S
(like if you need distributed working with stateless services). 

• See if we can have an equal amount of speaking time and maybe
rebalance

• Add more jokes

• Microservices architecture from Neal Ford slides

• Add 3d-thing “cluster on top of cluster”

• Remove the solar system

• Remove one of the CloudMatch videos

•

More Related Content

PDF
Fabio Tiriticco - Ádám Sándor - Akka Cluster versus Kubernetes: Clustering...
PDF
Yavaconf 2021 building io t digital twins with java and akka
PDF
Read ebook Kubernetes Cookbook: Building Cloud Native Applications Full Access
PDF
Quarkus@Code Garden
PPTX
Kubernetes Security
PPTX
DevOps with Kubernetes and Helm - Jenkins World Edition
PDF
How to build megaservices mind7 2021 June 29
PDF
Continuous (Non-)Functional Testing of Microservices on K8s
Fabio Tiriticco - Ádám Sándor - Akka Cluster versus Kubernetes: Clustering...
Yavaconf 2021 building io t digital twins with java and akka
Read ebook Kubernetes Cookbook: Building Cloud Native Applications Full Access
Quarkus@Code Garden
Kubernetes Security
DevOps with Kubernetes and Helm - Jenkins World Edition
How to build megaservices mind7 2021 June 29
Continuous (Non-)Functional Testing of Microservices on K8s

What's hot (20)

PDF
Kubernetes (and OpenShift) for developers
PDF
Data protection in a kubernetes-native world
PDF
Introduction to Kubernetes Security (Aqua & Weaveworks)
PPTX
Managing Kubernetes from Python using Kube
PDF
Zero downtime-java-deployments-with-docker-and-kubernetes
PDF
Spring Cloud Kubernetes - Ryan Baxter
PPTX
Comprehensive Container Based Service Monitoring with Kubernetes and Istio
PDF
Configuring OpenStack to Use the Xen Project Hypervisor
PDF
Day 2 Kubernetes - Tools for Operability (HashiConf)
PDF
Day 2 Kubernetes - Tools for Operability (QConSF)
PPTX
10 tips for Cloud Native Security
PDF
Day 2 Kubernetes - Tools for Operability (Velocity London Meetup)
PDF
Kubernetes - security you need to know about it
PDF
Containers & Kubernetes
PDF
Controlling your race with Micrometer, Spring Boot and Cloud Foundry
PDF
Controlling your race with Micrometer, Spring Boot and Cloud Foundry @Geekle
PDF
PDF
Kubernetes: Learning from Zero to Production
PPTX
Infrasturcure-as-code with Kubernetes and Rancher - September 2019 Online Meetup
PDF
How Akka Works: Visualize And Demo Akka With A Raspberry-Pi Cluster
Kubernetes (and OpenShift) for developers
Data protection in a kubernetes-native world
Introduction to Kubernetes Security (Aqua & Weaveworks)
Managing Kubernetes from Python using Kube
Zero downtime-java-deployments-with-docker-and-kubernetes
Spring Cloud Kubernetes - Ryan Baxter
Comprehensive Container Based Service Monitoring with Kubernetes and Istio
Configuring OpenStack to Use the Xen Project Hypervisor
Day 2 Kubernetes - Tools for Operability (HashiConf)
Day 2 Kubernetes - Tools for Operability (QConSF)
10 tips for Cloud Native Security
Day 2 Kubernetes - Tools for Operability (Velocity London Meetup)
Kubernetes - security you need to know about it
Containers & Kubernetes
Controlling your race with Micrometer, Spring Boot and Cloud Foundry
Controlling your race with Micrometer, Spring Boot and Cloud Foundry @Geekle
Kubernetes: Learning from Zero to Production
Infrasturcure-as-code with Kubernetes and Rancher - September 2019 Online Meetup
How Akka Works: Visualize And Demo Akka With A Raspberry-Pi Cluster
Ad

Similar to Fabio Tiriticco - Ádám Sándor - Akka Cluster versus Kubernetes: Clustering solutions showdown - Codemotion Berlin 2018 (20)

PDF
We all need friends and Akka just found Kubernetes
PDF
Akka and Kubernetes: Reactive From Code To Cloud
PDF
Cloud native akka and kubernetes holy grail to elasticity
PDF
Cloud Native Akka & Kubernetes: the holy grail to elasticity?
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
Akka A to Z: A Guide To The Industry’s Best Toolkit for Fast Data and Microse...
PDF
Akka Revealed: A JVM Architect's Journey From Resilient Actors To Scalable Cl...
PDF
Akka and Kubernetes, the beginning of a beautiful relationship - Container Da...
PPTX
Clustersoftware
PDF
[PDF Download] Akka in Action 1st Edition Raymond Roestenburg fulll chapter
PDF
Building Reactive applications with Akka
PDF
Akka in Action 1st Edition Raymond Roestenburg download pdf
PPTX
Developing distributed applications with Akka and Akka Cluster
PDF
Aws ug dxb 2021 container series iv
PDF
A quick introduction to AKS
PDF
Akka at Enterprise Scale: Performance Tuning Distributed Applications
PPTX
Global azurebootcamp2019vancouver aks_presentation_by_ashprasad_arjavprasad
We all need friends and Akka just found Kubernetes
Akka and Kubernetes: Reactive From Code To Cloud
Cloud native akka and kubernetes holy grail to elasticity
Cloud Native Akka & Kubernetes: the holy grail to elasticity?
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
Akka A to Z: A Guide To The Industry’s Best Toolkit for Fast Data and Microse...
Akka Revealed: A JVM Architect's Journey From Resilient Actors To Scalable Cl...
Akka and Kubernetes, the beginning of a beautiful relationship - Container Da...
Clustersoftware
[PDF Download] Akka in Action 1st Edition Raymond Roestenburg fulll chapter
Building Reactive applications with Akka
Akka in Action 1st Edition Raymond Roestenburg download pdf
Developing distributed applications with Akka and Akka Cluster
Aws ug dxb 2021 container series iv
A quick introduction to AKS
Akka at Enterprise Scale: Performance Tuning Distributed Applications
Global azurebootcamp2019vancouver aks_presentation_by_ashprasad_arjavprasad
Ad

More from Codemotion (20)

PDF
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
PDF
Pompili - From hero to_zero: The FatalNoise neverending story
PPTX
Pastore - Commodore 65 - La storia
PPTX
Pennisi - Essere Richard Altwasser
PPTX
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
PPTX
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
PPTX
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
PPTX
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
PDF
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
PDF
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
PDF
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
PDF
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
PDF
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
PDF
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
PPTX
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
PPTX
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
PDF
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
PDF
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
PDF
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
PDF
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Pompili - From hero to_zero: The FatalNoise neverending story
Pastore - Commodore 65 - La storia
Pennisi - Essere Richard Altwasser
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019

Recently uploaded (20)

DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
A Presentation on Artificial Intelligence
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Approach and Philosophy of On baking technology
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Encapsulation theory and applications.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Empathic Computing: Creating Shared Understanding
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
The AUB Centre for AI in Media Proposal.docx
sap open course for s4hana steps from ECC to s4
Digital-Transformation-Roadmap-for-Companies.pptx
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Building Integrated photovoltaic BIPV_UPV.pdf
A Presentation on Artificial Intelligence
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
NewMind AI Weekly Chronicles - August'25-Week II
Programs and apps: productivity, graphics, security and other tools
Approach and Philosophy of On baking technology
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Encapsulation theory and applications.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Unlocking AI with Model Context Protocol (MCP)
Advanced methodologies resolving dimensionality complications for autism neur...
Empathic Computing: Creating Shared Understanding
Spectral efficient network and resource selection model in 5G networks
Chapter 3 Spatial Domain Image Processing.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”

Fabio Tiriticco - Ádám Sándor - Akka Cluster versus Kubernetes: Clustering solutions showdown - Codemotion Berlin 2018