SlideShare a Scribd company logo
The Cloud-Natives
are RESTless
Konrad `@ktosopl` Malawski
Akka Core,
Akka Persistence,
Akka HTTP,
Reactive Streams
The concurrent & distributed applications toolkit
Akka is a toolkit and runtime for building highly
concurrent, distributed, and resilient message-driven
applications on the JVM
The concurrent & distributed applications toolkit
Akka is a toolkit and runtime for building highly
concurrent, distributed, and resilient message-driven
applications on the JVM
Actors – Concurrency / high perf. messaging
Cluster – Location transparent, resilient clusters
Persistence – EventSourcing support (many DBs)
HTTP – Fully Async & Reactive Http Server
and much more (kafka, cassandra, testing, …)
http://cidrdb.org/cidr2005/papers/P12.pdf
“Data on the Outside,
versus Data on the Inside”
Pat Helland
“Communication on the Outside,
versus Communication on the Inside”
”The actor model in computer science is a
mathematical model of concurrent computation
that treats actors as the universal primitives of
concurrent computation. ”
Wikipedia
The Actor Model
An Actor
and acts on them by:
• Sending messages
• Changing its state / behaviour
• Creating more actors
receives messages
An Actor
A concurrency and distribution construct.
an addressable, location-transparent, entity
Show diagram showing people interacting with each other.
Not Only Server-Client
HTTP/2 “push” still needs a “pull”
https://blog.cloudflare.com/announcing-support-for-http-2-server-push-2
Clusters, direct, p2p communication
Clusters, direct, p2p communication
Clusters, direct, p2p communication
Clusters, direct, p2p communication
Not Only JSON
“The Internet is running in debug mode.”
— Rüdiger Möller
http://java-is-the-new-c.blogspot.de/2014/10/why-protocols-are-messy-concept.html
Not Only JSON: Example data
MediaContent {
media = Media {
uri = "http://javaone.com/keynote.mpg"
title = "Javaone Keynote"
width = 640
height = 480
format = "video/mpg4"
duration = 18000000
size = 58982400
bitrate = 262144
persons = ["Bill Gates", "Steve Jobs"]
player = JAVA
copyright = null
}
}
images = [
Image {
uri = "http://javaone.com/keynote_large.jpg"
title = "Javaone Keynote"
width = 1024
height = 768
size = LARGE
}
Image {
uri = "http://javaone.com/keynote_small.jpg"
title = "Javaone Keynote"
width = 320
height = 240
size = SMALL
}
]
Not Only JSON create ser deser total size
protostuff 68 433 634 1067ns 239bytes
protobuf 121 1173 719 1891 239
kryo-serializer 53 1480 1331 2810 286
thrift 95 1455 731 2186 349
. . .
json/jackson/manual 52 1039 1228 2267 468
json/jackson/databind 54 1164 1866 3030 485
json/gson/databind 56 4667 4403 9070 486
xml/xstream+c-aalto 54 3310 6732 10042 525
xml/JAXB 54 4354 141333 145686 719
java-built-in 53 5046 23279 28325 889
Slide only to illustrate order-of-magniture differences. Don’t over-focus on numbers.
All details here: https://github.com/eishay/jvm-serializers/wiki
Not Only JSON create ser deser total size
protostuff 68 433 634 1067ns 239bytes
protobuf 121 1173 719 1891 239
kryo-serializer 53 1480 1331 2810 286
thrift 95 1455 731 2186 349
. . .
json/jackson/manual 52 1039 1228 2267 468
json/jackson/databind 54 1164 1866 3030 485
json/gson/databind 56 4667 4403 9070 486
xml/xstream+c-aalto 54 3310 6732 10042 525
xml/JAXB 54 4354 141333 145686 719
java-built-in 53 5046 23279 28325 889
Slide only to illustrate order-of-magniture differences. Don’t over-focus on numbers.
All details here: https://github.com/eishay/jvm-serializers/wiki
Not Only JSON create ser deser total size
protostuff 68 433 634 1067ns 239bytes
protobuf 121 1173 719 1891 239
kryo-serializer 53 1480 1331 2810 286
thrift 95 1455 731 2186 349
. . .
json/jackson/manual 52 1039 1228 2267 468
json/jackson/databind 54 1164 1866 3030 485
json/gson/databind 56 4667 4403 9070 486
xml/xstream+c-aalto 54 3310 6732 10042 525
xml/JAXB 54 4354 141333 145686 719
java-built-in 53 5046 23279 28325 889
Slide only to illustrate order-of-magniture differences. Don’t over-focus on numbers.
All details here: https://github.com/eishay/jvm-serializers/wiki
Actually solving a real problem for fun and profit.
Reactive Streams
Reactive Streams – why it all started
Reactive Streams – why it all started
Reactive Streams – why it all started
~2013:
Reactive Programming
becoming widely adopted on JVM.
- Play introduced “Iteratees”
- Akka (2009) had Akka-IO (TCP etc.)
- Ben starts work on RxJava
http://blogs.msdn.com/b/rxteam/archive/2009/11/17/announcing-reactive-extensions-rx-for-net-silverlight.aspx
http://infoscience.epfl.ch/record/176887/files/DeprecatingObservers2012.pdf - Ingo Maier, Martin Odersky
https://github.com/ReactiveX/RxJava/graphs/contributors
https://github.com/reactor/reactor/graphs/contributors
https://medium.com/@viktorklang/reactive-streams-1-0-0-interview-faaca2c00bec#.69st3rndy
Teams discuss need for back-pressure
in simple user API.
Play’s Iteratee / Akka’s NACK in IO.
} }A lot more people join
discussions, Reactive Streams
are born.
Advantages of Async Messaging
Time holding Connection
Time holding Connection
Time holding Connection
Time holding Connection
AFAIK:
Addressed by HTTP/2,
since you can open “subStreams.”
Long running task, sync vs. async
Long running task, sync vs. async
Long running task, sync vs. async
Back-pressure in Action
Streaming from Akka HTTP
Streaming from Akka HTTP
No demand from TCP
=
No demand upstream
=
Source won’t generate tweets
Streaming from Akka HTTP
No demand from TCP
=
No demand upstream
=
Source won’t generate tweets
=>
Streaming from Akka HTTP
No demand from TCP
=
No demand upstream
=
Source won’t generate tweets
=>
Bounded memory
stream processing!
Only the tip of the iceberg
Akka Cluster
and cluster tools
Akka Streams
async & back-pressured
More tools in the toolbox
Further reading:
Reactive Streams: reactive-streams.org
Akka documentation: akka.io/docs
Free O’Reilly report – very out soon.
Get involved:
sources: github.com/akka/akka
mailing list: akka-user @ google groups
gitter channel: https://gitter.im/akka/akka
Contact:
Konrad ktoso@lightbend.com Malawski
http://kto.so / @ktosopl

More Related Content

PDF
[Japanese] How Reactive Streams and Akka Streams change the JVM Ecosystem @ R...
PDF
End to End Akka Streams / Reactive Streams - from Business to Socket
PDF
Reactive integrations with Akka Streams
PDF
Akka Streams in Action @ ScalaDays Berlin 2016
PDF
How Reactive Streams & Akka Streams change the JVM Ecosystem
PDF
Reactive Streams, j.u.concurrent & Beyond!
PDF
State of Akka 2017 - The best is yet to come
PDF
Not Only Streams for Akademia JLabs
[Japanese] How Reactive Streams and Akka Streams change the JVM Ecosystem @ R...
End to End Akka Streams / Reactive Streams - from Business to Socket
Reactive integrations with Akka Streams
Akka Streams in Action @ ScalaDays Berlin 2016
How Reactive Streams & Akka Streams change the JVM Ecosystem
Reactive Streams, j.u.concurrent & Beyond!
State of Akka 2017 - The best is yet to come
Not Only Streams for Akademia JLabs

What's hot (20)

PDF
The Need for Async @ ScalaWorld
PDF
Akka-chan's Survival Guide for the Streaming World
PDF
ScalaSwarm 2017 Keynote: Tough this be madness yet theres method in't
PDF
The things we don't see – stories of Software, Scala and Akka
PDF
Need for Async: Hot pursuit for scalable applications
PDF
Building a Reactive System with Akka - Workshop @ O'Reilly SAConf NYC
PDF
Networks and Types - the Future of Akka @ ScalaDays NYC 2018
PDF
Reactive Streams: Handling Data-Flow the Reactive Way
PDF
[Tokyo Scala User Group] Akka Streams & Reactive Streams (0.7)
PDF
Fresh from the Oven (04.2015): Experimental Akka Typed and Akka Streams
PDF
2014 akka-streams-tokyo-japanese
PDF
Building reactive distributed systems with Akka
PPTX
Akka Actor presentation
PDF
Reactive Stream Processing with Akka Streams
PDF
Reactive Web-Applications @ LambdaDays
PDF
Introduction to akka actors with java 8
PDF
Putting the 'I' in IoT - Building Digital Twins with Akka Microservices
PPTX
Developing distributed applications with Akka and Akka Cluster
PDF
Understanding Akka Streams, Back Pressure, and Asynchronous Architectures
PDF
Streaming all the things with akka streams
The Need for Async @ ScalaWorld
Akka-chan's Survival Guide for the Streaming World
ScalaSwarm 2017 Keynote: Tough this be madness yet theres method in't
The things we don't see – stories of Software, Scala and Akka
Need for Async: Hot pursuit for scalable applications
Building a Reactive System with Akka - Workshop @ O'Reilly SAConf NYC
Networks and Types - the Future of Akka @ ScalaDays NYC 2018
Reactive Streams: Handling Data-Flow the Reactive Way
[Tokyo Scala User Group] Akka Streams & Reactive Streams (0.7)
Fresh from the Oven (04.2015): Experimental Akka Typed and Akka Streams
2014 akka-streams-tokyo-japanese
Building reactive distributed systems with Akka
Akka Actor presentation
Reactive Stream Processing with Akka Streams
Reactive Web-Applications @ LambdaDays
Introduction to akka actors with java 8
Putting the 'I' in IoT - Building Digital Twins with Akka Microservices
Developing distributed applications with Akka and Akka Cluster
Understanding Akka Streams, Back Pressure, and Asynchronous Architectures
Streaming all the things with akka streams
Ad

Viewers also liked (16)

PDF
100th SCKRK Meeting - best software engineering papers of 5 years of SCKRK
PDF
DDDing Tools = Akka Persistence
PDF
Reactive Streams / Akka Streams - GeeCON Prague 2014
PDF
Akka persistence == event sourcing in 30 minutes
PDF
Krakow communities @ 2016
PDF
Distributed Consensus A.K.A. "What do we eat for lunch?"
PDF
Practical Akka HTTP - introduction
ODP
An Introduction to Akka http
PDF
Securing Microservices using Play and Akka HTTP
PDF
Building scalable rest service using Akka HTTP
PDF
Zen of Akka
PPTX
Discovery
PDF
scalaphx-akka-http
PPTX
Scala + Akka + ning/async-http-client - Vancouver Scala meetup February 2015
PDF
Codemotion akka persistence, cqrs%2 fes y otras siglas del montón
PDF
Akka persistence webinar
100th SCKRK Meeting - best software engineering papers of 5 years of SCKRK
DDDing Tools = Akka Persistence
Reactive Streams / Akka Streams - GeeCON Prague 2014
Akka persistence == event sourcing in 30 minutes
Krakow communities @ 2016
Distributed Consensus A.K.A. "What do we eat for lunch?"
Practical Akka HTTP - introduction
An Introduction to Akka http
Securing Microservices using Play and Akka HTTP
Building scalable rest service using Akka HTTP
Zen of Akka
Discovery
scalaphx-akka-http
Scala + Akka + ning/async-http-client - Vancouver Scala meetup February 2015
Codemotion akka persistence, cqrs%2 fes y otras siglas del montón
Akka persistence webinar
Ad

Similar to The Cloud-natives are RESTless @ JavaOne (20)

PDF
Reactive streams processing using Akka Streams
PDF
Reactive stream processing using Akka streams
PDF
Akka streams - Umeå java usergroup
PDF
Reactive Streams 1.0 and Akka Streams
PDF
## Introducing a reactive Scala-Akka based system in a Java centric company
PDF
[PDF Download] Akka in Action 1st Edition Raymond Roestenburg fulll chapter
PDF
Asynchronous stream processing with Akka Streams
PDF
Exploring Reactive Integrations With Akka Streams, Alpakka And Apache Kafka
PPTX
Reactive Streams - László van den Hoek
PDF
Mirco Dotta - Akka Streams
PDF
Akka in Action 1st Edition Raymond Roestenburg download pdf
PDF
An introduction to Reactive applications, Reactive Streams, and options for t...
PDF
Building Stateful Microservices With Akka
PPTX
A Deeper Look Into Reactive Streams with Akka Streams 1.0 and Slick 3.0
PDF
Build Real-Time Streaming ETL Pipelines With Akka Streams, Alpakka And Apache...
PDF
Scala usergroup stockholm - reactive integrations with akka streams
PDF
Akka Revealed: A JVM Architect's Journey From Resilient Actors To Scalable Cl...
PDF
Akka and AngularJS – Reactive Applications in Practice
PDF
Akka streams scala italy2015
PDF
Akka Streams and HTTP
Reactive streams processing using Akka Streams
Reactive stream processing using Akka streams
Akka streams - Umeå java usergroup
Reactive Streams 1.0 and Akka Streams
## Introducing a reactive Scala-Akka based system in a Java centric company
[PDF Download] Akka in Action 1st Edition Raymond Roestenburg fulll chapter
Asynchronous stream processing with Akka Streams
Exploring Reactive Integrations With Akka Streams, Alpakka And Apache Kafka
Reactive Streams - László van den Hoek
Mirco Dotta - Akka Streams
Akka in Action 1st Edition Raymond Roestenburg download pdf
An introduction to Reactive applications, Reactive Streams, and options for t...
Building Stateful Microservices With Akka
A Deeper Look Into Reactive Streams with Akka Streams 1.0 and Slick 3.0
Build Real-Time Streaming ETL Pipelines With Akka Streams, Alpakka And Apache...
Scala usergroup stockholm - reactive integrations with akka streams
Akka Revealed: A JVM Architect's Journey From Resilient Actors To Scalable Cl...
Akka and AngularJS – Reactive Applications in Practice
Akka streams scala italy2015
Akka Streams and HTTP

Recently uploaded (20)

PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Approach and Philosophy of On baking technology
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Advanced Soft Computing BINUS July 2025.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Empathic Computing: Creating Shared Understanding
PPT
Teaching material agriculture food technology
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
GamePlan Trading System Review: Professional Trader's Honest Take
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Cloud computing and distributed systems.
PDF
Advanced IT Governance
PDF
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf
PDF
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
PDF
Machine learning based COVID-19 study performance prediction
Review of recent advances in non-invasive hemoglobin estimation
Advanced methodologies resolving dimensionality complications for autism neur...
Approach and Philosophy of On baking technology
Chapter 3 Spatial Domain Image Processing.pdf
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Advanced Soft Computing BINUS July 2025.pdf
Network Security Unit 5.pdf for BCA BBA.
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Empathic Computing: Creating Shared Understanding
Teaching material agriculture food technology
Reach Out and Touch Someone: Haptics and Empathic Computing
Diabetes mellitus diagnosis method based random forest with bat algorithm
GamePlan Trading System Review: Professional Trader's Honest Take
Dropbox Q2 2025 Financial Results & Investor Presentation
Cloud computing and distributed systems.
Advanced IT Governance
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
Machine learning based COVID-19 study performance prediction

The Cloud-natives are RESTless @ JavaOne

  • 2. Konrad `@ktosopl` Malawski Akka Core, Akka Persistence, Akka HTTP, Reactive Streams
  • 3. The concurrent & distributed applications toolkit Akka is a toolkit and runtime for building highly concurrent, distributed, and resilient message-driven applications on the JVM
  • 4. The concurrent & distributed applications toolkit Akka is a toolkit and runtime for building highly concurrent, distributed, and resilient message-driven applications on the JVM
  • 5. Actors – Concurrency / high perf. messaging Cluster – Location transparent, resilient clusters Persistence – EventSourcing support (many DBs) HTTP – Fully Async & Reactive Http Server and much more (kafka, cassandra, testing, …)
  • 6. http://cidrdb.org/cidr2005/papers/P12.pdf “Data on the Outside, versus Data on the Inside” Pat Helland
  • 7. “Communication on the Outside, versus Communication on the Inside”
  • 8. ”The actor model in computer science is a mathematical model of concurrent computation that treats actors as the universal primitives of concurrent computation. ” Wikipedia The Actor Model
  • 9. An Actor and acts on them by: • Sending messages • Changing its state / behaviour • Creating more actors receives messages
  • 10. An Actor A concurrency and distribution construct. an addressable, location-transparent, entity Show diagram showing people interacting with each other.
  • 12. HTTP/2 “push” still needs a “pull” https://blog.cloudflare.com/announcing-support-for-http-2-server-push-2
  • 13. Clusters, direct, p2p communication
  • 14. Clusters, direct, p2p communication
  • 15. Clusters, direct, p2p communication
  • 16. Clusters, direct, p2p communication
  • 17. Not Only JSON “The Internet is running in debug mode.” — Rüdiger Möller http://java-is-the-new-c.blogspot.de/2014/10/why-protocols-are-messy-concept.html
  • 18. Not Only JSON: Example data MediaContent { media = Media { uri = "http://javaone.com/keynote.mpg" title = "Javaone Keynote" width = 640 height = 480 format = "video/mpg4" duration = 18000000 size = 58982400 bitrate = 262144 persons = ["Bill Gates", "Steve Jobs"] player = JAVA copyright = null } } images = [ Image { uri = "http://javaone.com/keynote_large.jpg" title = "Javaone Keynote" width = 1024 height = 768 size = LARGE } Image { uri = "http://javaone.com/keynote_small.jpg" title = "Javaone Keynote" width = 320 height = 240 size = SMALL } ]
  • 19. Not Only JSON create ser deser total size protostuff 68 433 634 1067ns 239bytes protobuf 121 1173 719 1891 239 kryo-serializer 53 1480 1331 2810 286 thrift 95 1455 731 2186 349 . . . json/jackson/manual 52 1039 1228 2267 468 json/jackson/databind 54 1164 1866 3030 485 json/gson/databind 56 4667 4403 9070 486 xml/xstream+c-aalto 54 3310 6732 10042 525 xml/JAXB 54 4354 141333 145686 719 java-built-in 53 5046 23279 28325 889 Slide only to illustrate order-of-magniture differences. Don’t over-focus on numbers. All details here: https://github.com/eishay/jvm-serializers/wiki
  • 20. Not Only JSON create ser deser total size protostuff 68 433 634 1067ns 239bytes protobuf 121 1173 719 1891 239 kryo-serializer 53 1480 1331 2810 286 thrift 95 1455 731 2186 349 . . . json/jackson/manual 52 1039 1228 2267 468 json/jackson/databind 54 1164 1866 3030 485 json/gson/databind 56 4667 4403 9070 486 xml/xstream+c-aalto 54 3310 6732 10042 525 xml/JAXB 54 4354 141333 145686 719 java-built-in 53 5046 23279 28325 889 Slide only to illustrate order-of-magniture differences. Don’t over-focus on numbers. All details here: https://github.com/eishay/jvm-serializers/wiki
  • 21. Not Only JSON create ser deser total size protostuff 68 433 634 1067ns 239bytes protobuf 121 1173 719 1891 239 kryo-serializer 53 1480 1331 2810 286 thrift 95 1455 731 2186 349 . . . json/jackson/manual 52 1039 1228 2267 468 json/jackson/databind 54 1164 1866 3030 485 json/gson/databind 56 4667 4403 9070 486 xml/xstream+c-aalto 54 3310 6732 10042 525 xml/JAXB 54 4354 141333 145686 719 java-built-in 53 5046 23279 28325 889 Slide only to illustrate order-of-magniture differences. Don’t over-focus on numbers. All details here: https://github.com/eishay/jvm-serializers/wiki
  • 22. Actually solving a real problem for fun and profit. Reactive Streams
  • 23. Reactive Streams – why it all started
  • 24. Reactive Streams – why it all started
  • 25. Reactive Streams – why it all started ~2013: Reactive Programming becoming widely adopted on JVM. - Play introduced “Iteratees” - Akka (2009) had Akka-IO (TCP etc.) - Ben starts work on RxJava http://blogs.msdn.com/b/rxteam/archive/2009/11/17/announcing-reactive-extensions-rx-for-net-silverlight.aspx http://infoscience.epfl.ch/record/176887/files/DeprecatingObservers2012.pdf - Ingo Maier, Martin Odersky https://github.com/ReactiveX/RxJava/graphs/contributors https://github.com/reactor/reactor/graphs/contributors https://medium.com/@viktorklang/reactive-streams-1-0-0-interview-faaca2c00bec#.69st3rndy Teams discuss need for back-pressure in simple user API. Play’s Iteratee / Akka’s NACK in IO. } }A lot more people join discussions, Reactive Streams are born.
  • 26. Advantages of Async Messaging
  • 30. Time holding Connection AFAIK: Addressed by HTTP/2, since you can open “subStreams.”
  • 31. Long running task, sync vs. async
  • 32. Long running task, sync vs. async
  • 33. Long running task, sync vs. async
  • 36. Streaming from Akka HTTP No demand from TCP = No demand upstream = Source won’t generate tweets
  • 37. Streaming from Akka HTTP No demand from TCP = No demand upstream = Source won’t generate tweets =>
  • 38. Streaming from Akka HTTP No demand from TCP = No demand upstream = Source won’t generate tweets => Bounded memory stream processing!
  • 39. Only the tip of the iceberg
  • 40. Akka Cluster and cluster tools Akka Streams async & back-pressured More tools in the toolbox
  • 41. Further reading: Reactive Streams: reactive-streams.org Akka documentation: akka.io/docs Free O’Reilly report – very out soon. Get involved: sources: github.com/akka/akka mailing list: akka-user @ google groups gitter channel: https://gitter.im/akka/akka Contact: Konrad ktoso@lightbend.com Malawski http://kto.so / @ktosopl