Akka and AngularJS – Reactive Applications in Practice

Roland Kuhn
Roland KuhnCTO at Actyx AG
Akka and AngularJS 
Reactive Applications in Practice 
Dr. Roland Kuhn 
Akka Tech Lead 
@rolandkuhn
The Four Reactive Traits 
Reactive 
Applications 
2 
http://reactivemanifesto.org/
Akka 
! 
A fully Reactive toolkit on the JVM
The Actor Model 
• fully message-driven: an Actor can react by 
• sending messages to other Actors 
• creating Actors 
• denominating behavior for the next message 
• Actors are effectively single-threaded 
• failures are contained and escalated within the 
supervisor hierarchy 
• scaling up & out through location transparency 
4
Persistence Model: Event Sourcing 
• based on storing change instead of updating state 
• persistent Actors generate events: 
• historic facts that do not change thereafter 
• storage is append-only log 
• current Actor state is updated by consuming events 
• Actor can revisit the past by replaying events 
• events contain more business information than 
current state snapshot 
5
Command Query Responsibility Segregation 
6 
Events 
Client 
write-! 
side 
read-! 
side 
Command Reply Query Reply
Command Query Responsibility Segregation 
• persistent Actors on write-side generate events 
• read-side independently consumes event streams 
• read model is fully decoupled from write model 
• queries are served from optimal storage: 
• SQL store 
• graph database 
• in-memory live view 
• new read model can be generated on demand 
7
Spray / Akka HTTP 
! 
An Actor-Based Web Toolkit
Web-Server made Simple 
• HTTP requests and responses are Actor messages 
• powerful routing DSL turns Actor into Web-Server 
• not a web framework: 
• just expose Actors as web endpoints 
• nicely suited for RESTful APIs 
9
Important Disclaimer 
• I know a lot about Akka, but … 
• I am not a web developer 
10
Gabbler: The Write-Side 
11 
Log Router 
Gabbler Replayer 
Journal 
Input 
POST 
201
Gabbler: The Read-Side 
12 
Log Router 
Gabbler Replayer 
Journal 
Input 
GET 
Replay 
200
Gabbler: The Whole Thing 
13 
Log Router 
Gabbler Replayer 
Journal 
Input
Further Information 
• Code at https://github.com/hseeberger/gabbler 
• currently a pull request 
• See also http://akka.io 
14
©Typesafe 2014 – All Rights Reserved
1 of 15

More Related Content

What's hot(20)

CQRS + ES with Scala and AkkaCQRS + ES with Scala and Akka
CQRS + ES with Scala and Akka
Bharadwaj N2.2K views
AzkabanAzkaban
Azkaban
Anatoliy Nikulin1.7K views
Apache Curator: Past, Present and FutureApache Curator: Past, Present and Future
Apache Curator: Past, Present and Future
Jordan Zimmerman2.9K views
Introduction to akka actors with java 8Introduction to akka actors with java 8
Introduction to akka actors with java 8
Johan Andrén11.8K views
Introducing Kubernetes Introducing Kubernetes
Introducing Kubernetes
VikRam S98 views
Zeppelin meetup 2016 madridZeppelin meetup 2016 madrid
Zeppelin meetup 2016 madrid
Jongyoul Lee189 views

Similar to Akka and AngularJS – Reactive Applications in Practice(20)

Mastering react with reduxMastering react with redux
Mastering react with redux
Gaurav Singh45 views
React js Online TrainingReact js Online Training
React js Online Training
Learntek1169 views
Web applicationsWeb applications
Web applications
Peter Berezny449 views
Progressive Web Apps and ReactProgressive Web Apps and React
Progressive Web Apps and React
Mike Melusky813 views
Benefits of developing single page web applications using angular jsBenefits of developing single page web applications using angular js
Benefits of developing single page web applications using angular js
Harbinger Systems - HRTech Builder of Choice47.1K views
Streaming to a New Jakarta EEStreaming to a New Jakarta EE
Streaming to a New Jakarta EE
J On The Beach214 views
Streaming to a new Jakarta EEStreaming to a new Jakarta EE
Streaming to a new Jakarta EE
Markus Eisele961 views
Isomorphic web applicationIsomorphic web application
Isomorphic web application
Oliver N3K views
Show Some Spine!Show Some Spine!
Show Some Spine!
Geoff Gerrietts582 views
Angular js 1.0-fundamentalsAngular js 1.0-fundamentals
Angular js 1.0-fundamentals
Venkatesh Narayanan491 views
Swagger - Making REST APIs friendlierSwagger - Making REST APIs friendlier
Swagger - Making REST APIs friendlier
Miroslav Resetar1K views
Introduction to weblogicIntroduction to weblogic
Introduction to weblogic
Vishal Srivastava482 views
Building Awesome APIs with LumenBuilding Awesome APIs with Lumen
Building Awesome APIs with Lumen
Kit Brennan1.3K views

More from Roland Kuhn(11)

Recently uploaded(20)

METHOD AND SYSTEM FOR PREDICTING OPTIMAL LOAD FOR WHICH THE YIELD IS MAXIMUM ...METHOD AND SYSTEM FOR PREDICTING OPTIMAL LOAD FOR WHICH THE YIELD IS MAXIMUM ...
METHOD AND SYSTEM FOR PREDICTING OPTIMAL LOAD FOR WHICH THE YIELD IS MAXIMUM ...
Prity Khastgir IPR Strategic India Patent Attorney Amplify Innovation24 views
Web Dev - 1 PPT.pdfWeb Dev - 1 PPT.pdf
Web Dev - 1 PPT.pdf
gdsczhcet49 views
ChatGPT and AI for Web DevelopersChatGPT and AI for Web Developers
ChatGPT and AI for Web Developers
Maximiliano Firtman161 views
Liqid: Composable CXL PreviewLiqid: Composable CXL Preview
Liqid: Composable CXL Preview
CXL Forum120 views
CXL at OCPCXL at OCP
CXL at OCP
CXL Forum203 views

Akka and AngularJS – Reactive Applications in Practice

  • 1. Akka and AngularJS Reactive Applications in Practice Dr. Roland Kuhn Akka Tech Lead @rolandkuhn
  • 2. The Four Reactive Traits Reactive Applications 2 http://reactivemanifesto.org/
  • 3. Akka ! A fully Reactive toolkit on the JVM
  • 4. The Actor Model • fully message-driven: an Actor can react by • sending messages to other Actors • creating Actors • denominating behavior for the next message • Actors are effectively single-threaded • failures are contained and escalated within the supervisor hierarchy • scaling up & out through location transparency 4
  • 5. Persistence Model: Event Sourcing • based on storing change instead of updating state • persistent Actors generate events: • historic facts that do not change thereafter • storage is append-only log • current Actor state is updated by consuming events • Actor can revisit the past by replaying events • events contain more business information than current state snapshot 5
  • 6. Command Query Responsibility Segregation 6 Events Client write-! side read-! side Command Reply Query Reply
  • 7. Command Query Responsibility Segregation • persistent Actors on write-side generate events • read-side independently consumes event streams • read model is fully decoupled from write model • queries are served from optimal storage: • SQL store • graph database • in-memory live view • new read model can be generated on demand 7
  • 8. Spray / Akka HTTP ! An Actor-Based Web Toolkit
  • 9. Web-Server made Simple • HTTP requests and responses are Actor messages • powerful routing DSL turns Actor into Web-Server • not a web framework: • just expose Actors as web endpoints • nicely suited for RESTful APIs 9
  • 10. Important Disclaimer • I know a lot about Akka, but … • I am not a web developer 10
  • 11. Gabbler: The Write-Side 11 Log Router Gabbler Replayer Journal Input POST 201
  • 12. Gabbler: The Read-Side 12 Log Router Gabbler Replayer Journal Input GET Replay 200
  • 13. Gabbler: The Whole Thing 13 Log Router Gabbler Replayer Journal Input
  • 14. Further Information • Code at https://github.com/hseeberger/gabbler • currently a pull request • See also http://akka.io 14
  • 15. ©Typesafe 2014 – All Rights Reserved