Your SlideShare is downloading. ×
0
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Akka in Action: Heiko Seeburger

1,868

Published on

Scalable systems make us face challenges like concurrency, distribution, fault tolerance, elasticity, etc. Akka not only steps up to meet these, but it makes writing scalable software particularly …

Scalable systems make us face challenges like concurrency, distribution, fault tolerance, elasticity, etc. Akka not only steps up to meet these, but it makes writing scalable software particularly easy. We will demo Akka's most important tool, the actor model, using a vivid example and live coding.

0 Comments
7 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,868
On Slideshare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
0
Comments
0
Likes
7
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Akka in action JAX London 2012 Heiko Seeberger
  • 2. What is scalability?
  • 3. What is scalability?• Ability of a system to handle growing work or
  • 4. What is scalability?• Ability of a system to handle growing work or• its ability to be enlarged to accommodate growth.
  • 5. Why should wecare about scalability?
  • 6. Because of the human nature
  • 7. So how can we build scalable systems?
  • 8. Scaling up
  • 9. Concurrency Scaling up
  • 10. Scaling out
  • 11. DistributionScaling out
  • 12. So how can we easily build scalable systems?
  • 13. Akka’s vision
  • 14. Akka’s vision• Simpler concurrency (scale up)
  • 15. Akka’s vision• Simpler concurrency (scale up)• Simpler distribution (scale out)
  • 16. Akka’s vision• Simpler concurrency (scale up)• Simpler distribution (scale out)• Simpler fault-tolerance (self healing)
  • 17. Akka’s vision• Simpler concurrency (scale up)• Simpler distribution (scale out)• Simpler fault-tolerance (self healing)• All of that with a single unified programming model
  • 18. The Akka toolkit
  • 19. The Akka toolkit• Akka runs on the JVM
  • 20. The Akka toolkit• Akka runs on the JVM• Akka can be used from Java and Scala
  • 21. The Akka toolkit• Akka runs on the JVM• Akka can be used from Java and Scala• Akka can be integrated with common infrastructure, e.g. Spring, Camel, ZeroMQ, etc.
  • 22. What’s inside the toolbox?
  • 23. What’s inside the toolbox?• Actors
  • 24. What’s inside the toolbox?• Actors• Agents
  • 25. What’s inside the toolbox?• Actors• Agents• Dataflow concurrency
  • 26. What’s inside the toolbox?• Actors• Agents• Dataflow concurrency• STM
  • 27. What is an actor?
  • 28. What is an actor?• Carl Hewitt (1973): Fundamental unit of computation
  • 29. What is an actor?• Carl Hewitt (1973): Fundamental unit of computation • Behavior - react on messages it receives
  • 30. What is an actor?• Carl Hewitt (1973): Fundamental unit of computation • Behavior - react on messages it receives • State - shielded from the rest of the world, no need for synchronization
  • 31. What is an actor?• Carl Hewitt (1973): Fundamental unit of computation • Behavior - react on messages it receives • State - shielded from the rest of the world, no need for synchronization • Communication - interact with other actors exclusively via messages
  • 32. What is an actor?• Carl Hewitt (1973): Fundamental unit of computation • Behavior - react on messages it receives • State - shielded from the rest of the world, no need for synchronization • Communication - interact with other actors exclusively via messages• “One actor is no actor” - they come in systems
  • 33. Other notions of an actor
  • 34. Other notions of an actor• Implementation of message passing concurrency
  • 35. Other notions of an actor• Implementation of message passing concurrency• Isolated lightweight processes
  • 36. Other notions of an actor• Implementation of message passing concurrency• Isolated lightweight processes• Asynchronous and non-blocking
  • 37. The Akka Actor
  • 38. The Akka Actor
  • 39. The Akka Actor
  • 40. The Akka Actor
  • 41. Receive messages
  • 42. Receive messagespublic class Hello extends UntypedActor { @Override public void onReceive(Object message) { System.out.println("Hello, world!"); }}
  • 43. Receive messagespublic class Hello extends UntypedActor { public int count = 0; @Override public void onReceive(Object message) { count += 1; System.out.println( "Hello for the " + count + " time!" ); }}
  • 44. Receive messagespublic class Hello extends UntypedActor { public int count = 0; One at a time @Override public void onReceive(Object message) { count += 1; System.out.println( "Hello for the " + count + " time!" ); }}
  • 45. Send messages
  • 46. Send messages ActorRef hello = ... hello.tell("Hi!");
  • 47. Send messagesAsynchronous and ActorRef hello = ... hello.tell("Hi!"); nonblocking
  • 48. The Akka ActorSystem
  • 49. The Akka ActorSystem
  • 50. The Akka ActorSystem
  • 51. Create an actor system
  • 52. Create an actor system ActorSystem system = ActorSystem.create("hello");
  • 53. Create a top-level actor
  • 54. Create a top-level actor ActorRef hello = system.actorOf(new Props(new Hello()));
  • 55. Create a child actor
  • 56. Create a child actorActorRef child = context().actorOf(new Props(new Child()));
  • 57. Embrace failure
  • 58. Embrace failure• Let it crash!
  • 59. Embrace failure• Let it crash!• Supervision: Like in real life, parents supervise their children
  • 60. Embrace failure• Let it crash!• Supervision: Like in real life, parents supervise their children• Depending on the parent’s supervisor strategy, failing actors can get stopped, restarted or resumed
  • 61. HakkyHour demo
  • 62. The HakkyHour bar
  • 63. The HakkyHour bar• Our drinks: Akkarita, MaiPlay, PinaScalada
  • 64. The HakkyHour bar• Our drinks: Akkarita, MaiPlay, PinaScalada• Our actors: guests, waiters, head waiter, barkeepers
  • 65. The HakkyHour bar• Our drinks: Akkarita, MaiPlay, PinaScalada• Our actors: guests, waiters, head waiter, barkeepers• Our messages: Order, drink served, complaint, etc.
  • 66. The HakkyHour bar• Our drinks: Akkarita, MaiPlay, PinaScalada• Our actors: guests, waiters, head waiter, barkeepers• Our messages: Order, drink served, complaint, etc.• Our failures: Guest drunk, waiter frustrated
  • 67. HakkyHour actor system
  • 68. HakkyHour messages
  • 69. HakkyHour messages
  • 70. HakkyHour messages
  • 71. HakkyHour messages
  • 72. HakkyHour messages
  • 73. HakkyHour messages
  • 74. HakkyHour messages
  • 75. Live demo ...
  • 76. Why does Akka make building scalable systems easy?
  • 77. Benefits of using Akka actors
  • 78. Benefits of using Akka actors• You don’t have to deal with concurrency details
  • 79. Benefits of using Akka actors• You don’t have to deal with concurrency details• You can manage failures easily
  • 80. Benefits of using Akka actors• You don’t have to deal with concurrency details• You can manage failures easily• Distribution is just a deployment decision (not covered here)
  • 81. Questions?
  • 82. Thank you!Twitter: @hseeberger

×