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.

2017.09.09 Orbit - Seattle Code Camp

128 views

Published on

Building high-scale distributed system using Orbit and the virtual actor model

Published in: Software
  • Be the first to comment

  • Be the first to like this

2017.09.09 Orbit - Seattle Code Camp

  1. 1. BUILDING HIGH-SCALE DISTRIBUTED SYSTEMS USING ORBIT AND THE VIRTUAL ACTOR MODEL Victor Hurdugaci
  2. 2. VICTOR HURDUGACI • Romanian • Currently: Electronic Arts, Seattle • Past: Microsoft (ASP.NET, Azure WebJobs/Functions, X++ compiler) • Fell asleep and woke up in a different country • @VictorHurdugaci • http://victorh.info
  3. 3. INTRODUCTION • Data shipping paradigm • Frontend: stateless • Middle-tier: stateless • Data transfer on every request • No data locality Frontend FrontendFrontendFrontendFrontendFrontend Middle-tierMiddle-tierMiddle-tier Storage
  4. 4. INTRODUCTION • Data shipping paradigm • Frontend: stateless • Middle-tier: stateless • Data transfer on every request • No data locality • No semantic and concurrency benefits of storage Frontend FrontendFrontendFrontendFrontendFrontend Middle-tierMiddle-tierMiddle-tier Storage Cache
  5. 5. INTRODUCTION • Function shipping paradigm • Frontend: stateless • Middle-tier: stateful • Performance benefits of cache • Data locality • Semantic and concurrency benefits Frontend FrontendFrontendFrontendFrontendFrontend Middle-tierMiddle-tierMiddle-tier Storage Data Data Data
  6. 6. Foo myVar = new Foo() … myVar.doSomething(42)
  7. 7. DEMO - START
  8. 8. VIRTUAL ACTOR • An actor is a computational entity that, in response to a message it receives, can concurrently: • Send a finite number of messages to other actors • Create a finite number of new actors • Designate the behavior to be used for the next message it receives (change state) -- Wikipedia
  9. 9. ORBIT • Virtual actor framework • OSS • Java/JVM • Microsoft Orleans but for JVM
  10. 10. ORBIT VIRTUAL ACTORS • Java classes • Have an identity (type + string)
  11. 11. ORBIT VIRTUAL ACTORS • Java classes • Have an identity (type + string) • “Single threaded” • Cooperative multitasking • Async
  12. 12. ORBIT VIRTUAL ACTORS • Java classes • Have an identity (type + string) • “Single threaded” • Cooperative multitasking • Async • Perpetual existence • Actors never fail
  13. 13. ACTOR LIFECYCLE • No explicit (de)activation • No explicit placement • Activated: on message • Deactivated: on timeout because no message
  14. 14. ORBIT NODE Server Orbit (java) process Actor Actor Actor Actor
  15. 15. ORBIT CLUSTER Server Orbit (java) process Actor Actor Actor Actor Actor Server Orbit (java) process Actor Actor Actor Actor Server Orbit (java) process Actor Actor Actor Actor Actor Server Orbit (java) process Actor Actor Actor
  16. 16. ORBIT MESSAGING Server Server Server Server
  17. 17. ORBIT MESSAGING Server Server Server Server Client
  18. 18. ORBIT MESSAGING Server Server Server Server Client Redis
  19. 19. ORBIT MESSAGING Server Server Server Server Client Redis
  20. 20. ORBIT MESSAGING Server Server Server Server Client Redis Actor directory Node directory Messaging
  21. 21. ORBIT MESSAGING Server Server Server Server Client Actor directory Node directory Messaging Node directory Actor directory Actor directory Actor directory MessagingMessagingMessagingMessagingMessagingMessaging Messaging
  22. 22. HOST ⇒ CLIENT, CLIENT ⇏ HOST Server/Client Server/Client Server/Client Server/Client Actor directory Node directory Messaging Node directory Actor directory Actor directory Actor directory MessagingMessagingMessagingMessagingMessagingMessaging Messaging Client
  23. 23. EVENTUAL CONSISTENCY • No failure = single activation guarantee • Failure = single activation eventual guarantee • Two activations in two different partitions • One is eventually dropped • Availability over consistency
  24. 24. DEMO – ORBIT
  25. 25. PERSISTENCE • Actor state • No out-of-the-box solution • No checkpoint enforcement • 100% application controlled • Persistence hooks
  26. 26. PERSISTENCE Server/Client Server/Client Server/Client Server/Client Actor directory Node directory Messaging Node directory Actor directory Actor directory Actor directory MessagingMessagingMessagingMessagingMessagingMessaging Messaging Client
  27. 27. PERSISTENCE Server/Client Server/Client Server/Client Server/Client Actor directory Node directory Messaging Node directory Actor directory Actor directory Actor directory MessagingMessagingMessagingMessagingMessagingMessaging Messaging Client Storage Storage Storage
  28. 28. DEMO – ORBIT (PERSISTENCE)
  29. 29. PERFORMANCE CONSIDERATIONS • Small messages, billions of actors • Actor state size • Actor state load time • CPU • Message size
  30. 30. NO FREE LUNCH • Batch operations • Mix of short and long running operations • Cross-actor transactions
  31. 31. THANK YOU! • Orbit: https://github.com/orbit/orbit • Orleans: https://github.com/dotnet/orleans • http://victorh.info • @victorhurdugaci

×