Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
BUILDING
APPLICATIONS
WITH AKKA.NET
ANTHONY BROWN
@BRUINBROWN93
Hi, i’m Anthony
university student
me@anthonyjbrown.co.uk
@bruinbrown93
moore’s law
now we need
concurrency…
…but concurrency is hard
MULTITHREADING
THEORY
PRACTICE
CHECK OUT
MY MULTITHREADED CODE
HOW MANY THREADS
DOES IT TAKE TO CHANGE A LIGHTBULB?
application requirements
have changed
Credit: http://www.theawl.com/wp-content/uploads/2010/08/Screen-shot-2010-08-17-at-2.11.10-PM.png
Common language to define
new style of architecture
Reactive
systems
RESPONSIVE
RESILIENT ELASTIC
MESSAGE PASSING
responsive
users want the best possible experience
reactive applications react
to the world around them
Message driven
architecture
decouples components
the actor
model
concurrency
model
STORAGE
isolate mutable state
processing
reacting to changes
Communication
messaging as a requirement
an actor is
A mailbox behaviour state
an actor can…
set it’s behaviour
for the next message
an actor can…
send a finite number
of messages
an actor can…
spawn a finite
number of actors
looking at the
original
erlang
99.9999999% uptime
erlang example
introducing the
akka.net way
step 1
define an actor
class	
  GreetingActor	
  :	
  ReceiveActor	
  
{	
  
	
  	
  	
  	
  public	
  GreetingActor()	
  
	
  	
  	
  	
  {	
  
...
step 2
create an actor
var	
  system	
  =	
  ActorSystem.Create(“GreeterSystem”);	
  
var	
  greeterActor	
  =	
  system.ActorOf<GreeterActor>();
greeteractor isn’t
something you can call
normally
it’s a reference to an actor
where is my
actual actor?
AKKA.net
root actor
your
actors
Addressable like a file
system or web site
akka://Greetersystem/user/parent/child
step 3
send a message
greeter.Tell(“DDDSW”);
step 4
change behaviour
Visual studio
based demo
resilience in
reactive systems
WE want
applications to
ISOLATE ERRORS
SELF HEAL
your users don’t
want to see THIS
Service aService B
supervisor
Request
Response
user error
error action
scalability in
reactive systems
scale up has a
ceiling
scale out doesn't
and it’s easy
if you share nothing
how do we handle
increased load?
pools of actors
visual studio
based demo
how do we use
akka.net
the internet of
things
what is the Iot?
pointless
A security nightmare
i really don’t want to be facebook
friends with my toaster
managing farms
some things we
saw
actors are cheap
DON’t worry about having too many
Always take back
pressure seriously
LIBRARIES LIKE POLLY HELP
LET IT CRASH
don’t worry about catching all
exceptions
message passing is
harder to debug
use akka.testkit to comprehensively
test
understand message
delivery guarantees
at most once is default
at least once is an option
IN conclusion
akka.net gives us
lots
Auto-scaling
Service discovery
SELF HEALING
CLUSTERING SUPPORT
CQRS
MESSAGE PASSING LOCATION TRANSP...
MAKES IT EASIER TO
build reactive systems
understand the
difficulties
where next?
WANT TO
contribute?
github.com/akkadotnet/akka.net
gitter.im/akkadotnet/akka.net
want some help?
https://petabridge.com
HTTPS://github.com/petabridge/akka-bootcamp
read the book
http://manning.com/brown2
coming later this year
Q&A
Building applications with akka.net
Building applications with akka.net
Building applications with akka.net
Upcoming SlideShare
Loading in …5
×

Building applications with akka.net

2,550 views

Published on

This was a talk from DDDSW on Akka.Net, the actor model, concurrency and reactive. It covered what they are as well as an example use case and the lessons learned when running in that use case.

Published in: Technology

Building applications with akka.net

  1. 1. BUILDING APPLICATIONS WITH AKKA.NET ANTHONY BROWN @BRUINBROWN93
  2. 2. Hi, i’m Anthony university student me@anthonyjbrown.co.uk @bruinbrown93
  3. 3. moore’s law
  4. 4. now we need concurrency…
  5. 5. …but concurrency is hard
  6. 6. MULTITHREADING THEORY PRACTICE
  7. 7. CHECK OUT MY MULTITHREADED CODE
  8. 8. HOW MANY THREADS DOES IT TAKE TO CHANGE A LIGHTBULB?
  9. 9. application requirements have changed
  10. 10. Credit: http://www.theawl.com/wp-content/uploads/2010/08/Screen-shot-2010-08-17-at-2.11.10-PM.png
  11. 11. Common language to define new style of architecture
  12. 12. Reactive systems
  13. 13. RESPONSIVE RESILIENT ELASTIC MESSAGE PASSING
  14. 14. responsive users want the best possible experience
  15. 15. reactive applications react to the world around them
  16. 16. Message driven architecture decouples components
  17. 17. the actor model
  18. 18. concurrency model
  19. 19. STORAGE isolate mutable state
  20. 20. processing reacting to changes
  21. 21. Communication messaging as a requirement
  22. 22. an actor is A mailbox behaviour state
  23. 23. an actor can… set it’s behaviour for the next message
  24. 24. an actor can… send a finite number of messages
  25. 25. an actor can… spawn a finite number of actors
  26. 26. looking at the original
  27. 27. erlang 99.9999999% uptime
  28. 28. erlang example
  29. 29. introducing the akka.net way
  30. 30. step 1 define an actor
  31. 31. class  GreetingActor  :  ReceiveActor   {          public  GreetingActor()          {                  Receive<string>(                          s  =>  Console.WriteLine(“Hello  ”  +  s));          }   }
  32. 32. step 2 create an actor
  33. 33. var  system  =  ActorSystem.Create(“GreeterSystem”);   var  greeterActor  =  system.ActorOf<GreeterActor>();
  34. 34. greeteractor isn’t something you can call normally it’s a reference to an actor
  35. 35. where is my actual actor? AKKA.net root actor your actors
  36. 36. Addressable like a file system or web site akka://Greetersystem/user/parent/child
  37. 37. step 3 send a message
  38. 38. greeter.Tell(“DDDSW”);
  39. 39. step 4 change behaviour
  40. 40. Visual studio based demo
  41. 41. resilience in reactive systems
  42. 42. WE want applications to ISOLATE ERRORS SELF HEAL
  43. 43. your users don’t want to see THIS
  44. 44. Service aService B supervisor Request Response user error error action
  45. 45. scalability in reactive systems
  46. 46. scale up has a ceiling scale out doesn't
  47. 47. and it’s easy if you share nothing
  48. 48. how do we handle increased load?
  49. 49. pools of actors
  50. 50. visual studio based demo
  51. 51. how do we use akka.net
  52. 52. the internet of things
  53. 53. what is the Iot? pointless A security nightmare i really don’t want to be facebook friends with my toaster
  54. 54. managing farms
  55. 55. some things we saw
  56. 56. actors are cheap DON’t worry about having too many
  57. 57. Always take back pressure seriously LIBRARIES LIKE POLLY HELP
  58. 58. LET IT CRASH don’t worry about catching all exceptions
  59. 59. message passing is harder to debug use akka.testkit to comprehensively test
  60. 60. understand message delivery guarantees at most once is default at least once is an option
  61. 61. IN conclusion
  62. 62. akka.net gives us lots Auto-scaling Service discovery SELF HEALING CLUSTERING SUPPORT CQRS MESSAGE PASSING LOCATION TRANSPARENCY CONFIGURATION
  63. 63. MAKES IT EASIER TO build reactive systems
  64. 64. understand the difficulties
  65. 65. where next?
  66. 66. WANT TO contribute? github.com/akkadotnet/akka.net gitter.im/akkadotnet/akka.net
  67. 67. want some help? https://petabridge.com HTTPS://github.com/petabridge/akka-bootcamp
  68. 68. read the book http://manning.com/brown2 coming later this year
  69. 69. Q&A

×