SlideShare ist ein Scribd-Unternehmen logo
1 von 49
ORLEANS
Distributed Virtual Actors for Programmability and Scalability
Philip A. Bernstein, Sergey Bykov, Alan Geller, Gabriel Kliot, Jorgen Thelin
Victor Hurdugaci
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
INTRODUCTION
• Building interactive services that are scalable and reliable is hard
INTRODUCTION
• Frontend: stateless
• Middle-tier: stateless
Frontend FrontendFrontendFrontendFrontendFrontend
Middle-tierMiddle-tierMiddle-tier
Storage
INTRODUCTION
• Frontend: stateless
• Middle-tier: stateless
• Limited scalability of storage Frontend FrontendFrontendFrontendFrontendFrontend
Middle-tierMiddle-tierMiddle-tier
Storage
INTRODUCTION
• Frontend: stateless
• Middle-tier: stateless
• Limited scalability of storage Frontend FrontendFrontendFrontendFrontendFrontend
Middle-tierMiddle-tierMiddle-tier
Storage
Cache
INTRODUCTION
• Frontend: stateless
• Middle-tier : stateless
• Limited scalability of storage
• Win:
• Latency
• Throughput
Frontend FrontendFrontendFrontendFrontendFrontend
Middle-tierMiddle-tierMiddle-tier
Storage
Cache
INTRODUCTION
• Frontend: stateless
• Middle-tier : stateless
• Limited scalability of storage
• Win:
• Latency
• Throughput
• Loss:
• Concurrency
• Semantic guarantees
Frontend FrontendFrontendFrontendFrontendFrontend
Middle-tierMiddle-tierMiddle-tier
Storage
Cache
INTRODUCTION
• Frontend: stateless
• Middle-tier : stateless
• Limited scalability of storage
• Win:
• Latency
• Throughput
• Loss:
• Concurrency
• Semantic guarantees
• Custom concurrency control protocol
Frontend FrontendFrontendFrontendFrontendFrontend
Middle-tierMiddle-tierMiddle-tier
Storage
Cache
INTRODUCTION
• Data shipping paradigm: on
every request, the data is shipped
from cache/storage to middle tier
• It does not provide data locality Frontend FrontendFrontendFrontendFrontendFrontend
Middle-tierMiddle-tierMiddle-tier
Storage
Cache
INTRODUCTION
• Function shipping paradigm
• Stateful middle tier
• Performance benefits of cache
• Data locality
• Semantic and consistency benefits
Frontend FrontendFrontendFrontendFrontendFrontend
Middle-tierMiddle-tierMiddle-tier
Storage
Data Data Data
INTRODUCTION
• OOP – intuitive way to model complex systems
• Marginalized in SOA
• Loosely-coupled partitioned services don’t often match objects
• The actor model brings OOP back to system level
VIRTUAL ACTORS
• 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
OTHER SYSTEMS
• Erlang and Akka
• No lifecycle management
• Distributed races
• No failure management
• Distributed resource management
ORLEANS VIRTUAL ACTORS
• Always exists
• No explicitly creation/destruction
• Automatic resource management
• Never fail
• Location is transparent to application code
LOCATION TRANSPARENCY
Foo x = new Foo(42)
…
x.DoSomething(43)
2.1. VIRTUAL ACTORS
• Actor identity: type + 128 bit GUID
• Behavior
• State
• Actors are isolated from each other
2.1. VIRTUAL ACTORS
1. Perpetual existence
2. Automatic instantiation (activation)
3. Location transparency
4. Automatic scale out
• Stateful – single instance
• Stateless – scale automatically (up to a limit)
2.2. ACTOR INTERFACES
• Strong type interfaces
• All methods must be async
1 public interface IGameActor: IActor
2 {
3 Task<string> GameName { get; }
4 Task<List> CurrentPlayers { get; }
5 Task JoinGame(IPlayerActor game);
6 Task LeaveGame(IPlayerActor game);
7 }
2.3. ACTOR REFERENCES
• Strongly typed proxy
• “GetActor” method is generated at compile time
• Request by primary key (GUID)
• References can be passed as arguments (!)
1 public static class GameActorFactory
2 {
3 public static IGameActor GetActor(Guid gameId);
4 }
2.4. PROMISES
• No blocking calls
• Promise states: unresolved, fulfilled, broken
• Closure/continuation
• .NET: System.Threading.Tasks.Task<T>
• C#: async/await
1 IGameActor gameActor = GameActorFactory.GetActor(gameId);
2 try{
3 string name = await gameActor.GameName;
4 Console.WriteLine(“Game name is ” + name);
5 } catch(Exception) {
6 Console.WriteLine(“The call to actor failed”);
7 }
2.5. TURNS
• Activations are single threaded
• Work in chunks: turns
• Turns (from different actors) can be interleaved
• [Reentrant] attribute
2.6 TURNS
From: http://martintrojer.github.io/clojure/2013/07/07/coreasync-and-blocking-io
2.6 TURNS
From: http://martintrojer.github.io/clojure/2013/07/07/coreasync-and-blocking-io
2.6. PERSISTENCE
• State = property bag interface
1 public interface IGameState: IState
2 {
3 GameStatus Status { get; set }
4 List Players { get; set;}
5 }
6 public class GameActor: ActorBase<IGameState>, IGameActor
7 {
8 Task JoinGame(IPlayerActor game) {
9 this.State.Players.Add(IPlayerActor);
10 this.State.WriteStateAsync();
11 }
12 }
2.6. PERSISTENCE
• Application controlled
• Persistence providers: SQL, Azure Storage, etc
3.1 RUNTIME IMPLEMENTATION
Orleans cluster
Server
Orleans process
Actor Actor Actor
Actor Actor
Server
Orleans process
Actor Actor Actor
Actor
Server
Orleans process
Actor Actor Actor
Actor Actor
Server
Orleans process
Actor Actor Actor
3.1 RUNTIME IMPLEMENTATION
Orleans process
Messaging Hosting Execution
• 1 TCP connection between
each pair of servers
• Multiplex messages
• Actor placement
• Actor lifecycle
• Resource management
• Actor code execution
• Reentrancy
• Single threading
3.2. DISTRIBUTED DIRECTORY
A
C
B
D
Act.1244 -> Hello
3.2. DISTRIBUTED DIRECTORY
• Maps actor id <-> location
• One-hop distributed hash table
• Each server holds a partition of the directory
• Actor partitioning: consistent hashing
A
C
[Act.1234, A]
[Act.1244, C]
[Act.1254, D]
[Act.1235, F]
[Act.1245, A]
[Act.1255, E]
B
D
Act.1244 -> Hello
3.2. DISTRIBUTED DIRECTORY
• Maps actor id <-> location
• One-hop distributed hash table
• Each server holds a partition of the directory
• Actor partitioning: consistent hashing
A
C
1. Act.1244 ?
[Act.1234, A]
[Act.1244, C]
[Act.1254, D]
[Act.1235, F]
[Act.1245, A]
[Act.1255, E]
B
D
Act.1244 -> Hello
3.2. DISTRIBUTED DIRECTORY
• Maps actor id <-> location
• One-hop distributed hash table
• Each server holds a partition of the directory
• Actor partitioning: consistent hashing
A
C
1. Act.1244 ?
[Act.1234, A]
[Act.1244, C]
[Act.1254, D]2. C
[Act.1235, F]
[Act.1245, A]
[Act.1255, E]
B
D
Act.1244 -> Hello
3.2. DISTRIBUTED DIRECTORY
• Maps actor id <-> location
• One-hop distributed hash table
• Each server holds a partition of the directory
• Actor partitioning: consistent hashing
A
C
1. Act.1244 ?
[Act.1234, A]
[Act.1244, C]
[Act.1254, D]2. C
3. Hello
[Act.1235, F]
[Act.1245, A]
[Act.1255, E]
B
D
Act.1244 -> Hello
3.2. DISTRIBUTED DIRECTORY
• Maps actor id <-> location
• One-hop distributed hash table
• Each server holds a partition of the directory
• Actor partitioning: consistent hashing
• (De)Activations update records in the table
• Directory enforces single-activations
A
C
1. Act.1244 ?
[Act.1234, A]
[Act.1244, C]
[Act.1254, D]2. C
3. Hello
[Act.1235, F]
[Act.1245, A]
[Act.1255, E]
B
D
Act.1244 -> Hello
3.2. DISTRIBUTED DIRECTORY
• Maps actor id <-> location
• One-hop distributed hash table
• Each server holds a partition of the directory
• Actor partitioning: consistent hashing
• (De)Activations update records in the table
• Directory enforces single-activations
• Avoid extra hop: large (millions) cache of recent activations
A
C
1. Act.1244 ?
[Act.1234, A]
[Act.1244, C]
[Act.1254, D]2. C
3. Hello
[Act.1235, F]
[Act.1245, A]
[Act.1255, E]
B
D
Act.1244 -> Hello
3.3. STRONG ISOLATION
• Actors don’t share state and communication is always message based
• Method arguments & return values are deep copied
• Guarantees immutability
3.8. RELIABILITY
• Orleans manages everything except persistence
• Failure detection: heartbeats
• Membership view is eventual consistent (30-60s on production servers)
• A “dead” actor is activated on a different server
• Actor lifespan not linked to server lifespan
• No checkpoint strategy (depends on application)
• Misrouted messages are sent to the right destination and sender is notified
3.9. 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
3.10. MESSAGING GUARANTEES
• At-least-once message guarantee
• Exactly-once can be implemented at application level (request id)
• No FIFO guarantees (sender: A, B, C; receiver: B, A, C)
4.1 HALO 4 PRESENCE SERVICE
4.2. HALO 4 STATISTICS SERVICE
5.1. SYNTHETIC MICRO BENCHMARKS
5.1. SYNTHETIC MICRO BENCHMARKS
*test server had 8 cores
5.1. SYNTHETIC MICRO BENCHMARKS
5.2 HALO PRESENCE
PERFORMANCE EVALUATION
5.2 HALO PRESENCE
PERFORMANCE EVALUATION
ORLEANS DRAWBACKS
• Bulk operations
• Large number of actors (billions) + no temporal locality
• No cross-actor transactions
6.2. OTHER ACTOR FRAMEWORKS
• Akka http://akka.io/
• Erlang https://www.erlang.org/
Not in the paper:
• Orbit (Java/JVM) https://github.com/orbit/orbit
Victor Hurdugaci
http://victorh.info

Weitere ähnliche Inhalte

Ähnlich wie 2017.09.07 Orleans - PWL Seattle

Concurrency (Fisher Syer S2GX 2010)
Concurrency (Fisher Syer S2GX 2010)Concurrency (Fisher Syer S2GX 2010)
Concurrency (Fisher Syer S2GX 2010)Dave Syer
 
Lagom - Mircoservices "Just Right"
Lagom - Mircoservices "Just Right"Lagom - Mircoservices "Just Right"
Lagom - Mircoservices "Just Right"Markus Jura
 
VoltDB and Erlang - Tech planet 2012
VoltDB and Erlang - Tech planet 2012VoltDB and Erlang - Tech planet 2012
VoltDB and Erlang - Tech planet 2012Eonblast
 
MesosCon EU 2017 - Criteo - Operating Mesos-based Infrastructures
MesosCon EU 2017 - Criteo - Operating Mesos-based InfrastructuresMesosCon EU 2017 - Criteo - Operating Mesos-based Infrastructures
MesosCon EU 2017 - Criteo - Operating Mesos-based Infrastructurespierrecdn -
 
The impact of cloud NSBCon NY by Yves Goeleven
The impact of cloud NSBCon NY by Yves GoelevenThe impact of cloud NSBCon NY by Yves Goeleven
The impact of cloud NSBCon NY by Yves GoelevenParticular Software
 
Racsig rac internals
Racsig rac internalsRacsig rac internals
Racsig rac internalspv_narayanan
 
Introduction to Akka - Atlanta Java Users Group
Introduction to Akka - Atlanta Java Users GroupIntroduction to Akka - Atlanta Java Users Group
Introduction to Akka - Atlanta Java Users GroupRoy Russo
 
Reasonable RPC with Remotely
Reasonable RPC with RemotelyReasonable RPC with Remotely
Reasonable RPC with RemotelyTimothy Perrett
 
Slides for the Apache Geode Hands-on Meetup and Hackathon Announcement
Slides for the Apache Geode Hands-on Meetup and Hackathon Announcement Slides for the Apache Geode Hands-on Meetup and Hackathon Announcement
Slides for the Apache Geode Hands-on Meetup and Hackathon Announcement VMware Tanzu
 
Typesafe stack - Scala, Akka and Play
Typesafe stack - Scala, Akka and PlayTypesafe stack - Scala, Akka and Play
Typesafe stack - Scala, Akka and PlayLuka Zakrajšek
 
Gustavo Garnica: Evolución de la Plataforma Java y lo que Significa para Ti
Gustavo Garnica: Evolución de la Plataforma Java y lo que Significa para TiGustavo Garnica: Evolución de la Plataforma Java y lo que Significa para Ti
Gustavo Garnica: Evolución de la Plataforma Java y lo que Significa para TiSoftware Guru
 
Deploying microservices on AWS
Deploying microservices on AWSDeploying microservices on AWS
Deploying microservices on AWSMichael Haberman
 
Orchestrating Linux Containers while tolerating failures
Orchestrating Linux Containers while tolerating failuresOrchestrating Linux Containers while tolerating failures
Orchestrating Linux Containers while tolerating failuresDocker, Inc.
 
Playtrip: a CQRS/ES architecture in Erlang.
Playtrip: a CQRS/ES architecture in Erlang.Playtrip: a CQRS/ES architecture in Erlang.
Playtrip: a CQRS/ES architecture in Erlang.Nicola Fiorillo
 
Always on in sql server 2017
Always on in sql server 2017Always on in sql server 2017
Always on in sql server 2017Gianluca Hotz
 

Ähnlich wie 2017.09.07 Orleans - PWL Seattle (20)

Concurrency (Fisher Syer S2GX 2010)
Concurrency (Fisher Syer S2GX 2010)Concurrency (Fisher Syer S2GX 2010)
Concurrency (Fisher Syer S2GX 2010)
 
Lagom - Mircoservices "Just Right"
Lagom - Mircoservices "Just Right"Lagom - Mircoservices "Just Right"
Lagom - Mircoservices "Just Right"
 
VoltDB and Erlang - Tech planet 2012
VoltDB and Erlang - Tech planet 2012VoltDB and Erlang - Tech planet 2012
VoltDB and Erlang - Tech planet 2012
 
MesosCon EU 2017 - Criteo - Operating Mesos-based Infrastructures
MesosCon EU 2017 - Criteo - Operating Mesos-based InfrastructuresMesosCon EU 2017 - Criteo - Operating Mesos-based Infrastructures
MesosCon EU 2017 - Criteo - Operating Mesos-based Infrastructures
 
Akka.Net Overview
Akka.Net OverviewAkka.Net Overview
Akka.Net Overview
 
The impact of cloud NSBCon NY by Yves Goeleven
The impact of cloud NSBCon NY by Yves GoelevenThe impact of cloud NSBCon NY by Yves Goeleven
The impact of cloud NSBCon NY by Yves Goeleven
 
Racsig rac internals
Racsig rac internalsRacsig rac internals
Racsig rac internals
 
Introduction to Akka - Atlanta Java Users Group
Introduction to Akka - Atlanta Java Users GroupIntroduction to Akka - Atlanta Java Users Group
Introduction to Akka - Atlanta Java Users Group
 
Reasonable RPC with Remotely
Reasonable RPC with RemotelyReasonable RPC with Remotely
Reasonable RPC with Remotely
 
Slides for the Apache Geode Hands-on Meetup and Hackathon Announcement
Slides for the Apache Geode Hands-on Meetup and Hackathon Announcement Slides for the Apache Geode Hands-on Meetup and Hackathon Announcement
Slides for the Apache Geode Hands-on Meetup and Hackathon Announcement
 
Geode introduction
Geode introductionGeode introduction
Geode introduction
 
Typesafe stack - Scala, Akka and Play
Typesafe stack - Scala, Akka and PlayTypesafe stack - Scala, Akka and Play
Typesafe stack - Scala, Akka and Play
 
Gustavo Garnica: Evolución de la Plataforma Java y lo que Significa para Ti
Gustavo Garnica: Evolución de la Plataforma Java y lo que Significa para TiGustavo Garnica: Evolución de la Plataforma Java y lo que Significa para Ti
Gustavo Garnica: Evolución de la Plataforma Java y lo que Significa para Ti
 
InfectNet Technical
InfectNet TechnicalInfectNet Technical
InfectNet Technical
 
Deploying microservices on AWS
Deploying microservices on AWSDeploying microservices on AWS
Deploying microservices on AWS
 
Software Defined Networking: Primer
Software Defined Networking: Primer Software Defined Networking: Primer
Software Defined Networking: Primer
 
Orchestrating Linux Containers while tolerating failures
Orchestrating Linux Containers while tolerating failuresOrchestrating Linux Containers while tolerating failures
Orchestrating Linux Containers while tolerating failures
 
Playtrip: a CQRS/ES architecture in Erlang.
Playtrip: a CQRS/ES architecture in Erlang.Playtrip: a CQRS/ES architecture in Erlang.
Playtrip: a CQRS/ES architecture in Erlang.
 
Always on in sql server 2017
Always on in sql server 2017Always on in sql server 2017
Always on in sql server 2017
 
Alwayson in sqlserver2017
Alwayson in sqlserver2017Alwayson in sqlserver2017
Alwayson in sqlserver2017
 

Kürzlich hochgeladen

Prompt Engineering - an Art, a Science, or your next Job Title?
Prompt Engineering - an Art, a Science, or your next Job Title?Prompt Engineering - an Art, a Science, or your next Job Title?
Prompt Engineering - an Art, a Science, or your next Job Title?Maxim Salnikov
 
Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024Andreas Granig
 
Microsoft365_Dev_Security_2024_05_16.pdf
Microsoft365_Dev_Security_2024_05_16.pdfMicrosoft365_Dev_Security_2024_05_16.pdf
Microsoft365_Dev_Security_2024_05_16.pdfMarkus Moeller
 
^Clinic ^%[+27788225528*Abortion Pills For Sale In birch acres
^Clinic ^%[+27788225528*Abortion Pills For Sale In birch acres^Clinic ^%[+27788225528*Abortion Pills For Sale In birch acres
^Clinic ^%[+27788225528*Abortion Pills For Sale In birch acreskasambamuno
 
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCAOpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCAShane Coughlan
 
Software Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements EngineeringSoftware Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements EngineeringPrakhyath Rai
 
Jax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined DeckJax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined DeckMarc Lester
 
A Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdfA Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdfICS
 
How to install and activate eGrabber JobGrabber
How to install and activate eGrabber JobGrabberHow to install and activate eGrabber JobGrabber
How to install and activate eGrabber JobGrabbereGrabber
 
Weeding your micro service landscape.pdf
Weeding your micro service landscape.pdfWeeding your micro service landscape.pdf
Weeding your micro service landscape.pdftimtebeek1
 
[GeeCON2024] How I learned to stop worrying and love the dark silicon apocalypse
[GeeCON2024] How I learned to stop worrying and love the dark silicon apocalypse[GeeCON2024] How I learned to stop worrying and love the dark silicon apocalypse
[GeeCON2024] How I learned to stop worrying and love the dark silicon apocalypseTomasz Kowalczewski
 
The Strategic Impact of Buying vs Building in Test Automation
The Strategic Impact of Buying vs Building in Test AutomationThe Strategic Impact of Buying vs Building in Test Automation
The Strategic Impact of Buying vs Building in Test AutomationElement34
 
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...OnePlan Solutions
 
^Clinic ^%[+27788225528*Abortion Pills For Sale In witbank
^Clinic ^%[+27788225528*Abortion Pills For Sale In witbank^Clinic ^%[+27788225528*Abortion Pills For Sale In witbank
^Clinic ^%[+27788225528*Abortion Pills For Sale In witbankkasambamuno
 
how-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdfhow-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdfMehmet Akar
 
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdfStrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdfsteffenkarlsson2
 
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit MilanWorkshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit MilanNeo4j
 
Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024Henry Schreiner
 
Sinoville Clinic ](+27832195400*)[🏥Abortion Pill Prices Sinoville ● Women's A...
Sinoville Clinic ](+27832195400*)[🏥Abortion Pill Prices Sinoville ● Women's A...Sinoville Clinic ](+27832195400*)[🏥Abortion Pill Prices Sinoville ● Women's A...
Sinoville Clinic ](+27832195400*)[🏥Abortion Pill Prices Sinoville ● Women's A...Abortion Clinic
 

Kürzlich hochgeladen (20)

Prompt Engineering - an Art, a Science, or your next Job Title?
Prompt Engineering - an Art, a Science, or your next Job Title?Prompt Engineering - an Art, a Science, or your next Job Title?
Prompt Engineering - an Art, a Science, or your next Job Title?
 
Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024
 
Microsoft365_Dev_Security_2024_05_16.pdf
Microsoft365_Dev_Security_2024_05_16.pdfMicrosoft365_Dev_Security_2024_05_16.pdf
Microsoft365_Dev_Security_2024_05_16.pdf
 
^Clinic ^%[+27788225528*Abortion Pills For Sale In birch acres
^Clinic ^%[+27788225528*Abortion Pills For Sale In birch acres^Clinic ^%[+27788225528*Abortion Pills For Sale In birch acres
^Clinic ^%[+27788225528*Abortion Pills For Sale In birch acres
 
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCAOpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
 
Software Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements EngineeringSoftware Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements Engineering
 
Jax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined DeckJax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined Deck
 
A Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdfA Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdf
 
How to install and activate eGrabber JobGrabber
How to install and activate eGrabber JobGrabberHow to install and activate eGrabber JobGrabber
How to install and activate eGrabber JobGrabber
 
Weeding your micro service landscape.pdf
Weeding your micro service landscape.pdfWeeding your micro service landscape.pdf
Weeding your micro service landscape.pdf
 
[GeeCON2024] How I learned to stop worrying and love the dark silicon apocalypse
[GeeCON2024] How I learned to stop worrying and love the dark silicon apocalypse[GeeCON2024] How I learned to stop worrying and love the dark silicon apocalypse
[GeeCON2024] How I learned to stop worrying and love the dark silicon apocalypse
 
The Strategic Impact of Buying vs Building in Test Automation
The Strategic Impact of Buying vs Building in Test AutomationThe Strategic Impact of Buying vs Building in Test Automation
The Strategic Impact of Buying vs Building in Test Automation
 
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
 
^Clinic ^%[+27788225528*Abortion Pills For Sale In witbank
^Clinic ^%[+27788225528*Abortion Pills For Sale In witbank^Clinic ^%[+27788225528*Abortion Pills For Sale In witbank
^Clinic ^%[+27788225528*Abortion Pills For Sale In witbank
 
how-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdfhow-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdf
 
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdfStrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
 
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit MilanWorkshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
 
Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024
 
Abortion Clinic Pretoria ](+27832195400*)[ Abortion Clinic Near Me ● Abortion...
Abortion Clinic Pretoria ](+27832195400*)[ Abortion Clinic Near Me ● Abortion...Abortion Clinic Pretoria ](+27832195400*)[ Abortion Clinic Near Me ● Abortion...
Abortion Clinic Pretoria ](+27832195400*)[ Abortion Clinic Near Me ● Abortion...
 
Sinoville Clinic ](+27832195400*)[🏥Abortion Pill Prices Sinoville ● Women's A...
Sinoville Clinic ](+27832195400*)[🏥Abortion Pill Prices Sinoville ● Women's A...Sinoville Clinic ](+27832195400*)[🏥Abortion Pill Prices Sinoville ● Women's A...
Sinoville Clinic ](+27832195400*)[🏥Abortion Pill Prices Sinoville ● Women's A...
 

2017.09.07 Orleans - PWL Seattle

  • 1. ORLEANS Distributed Virtual Actors for Programmability and Scalability Philip A. Bernstein, Sergey Bykov, Alan Geller, Gabriel Kliot, Jorgen Thelin Victor Hurdugaci
  • 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. INTRODUCTION • Building interactive services that are scalable and reliable is hard
  • 4. INTRODUCTION • Frontend: stateless • Middle-tier: stateless Frontend FrontendFrontendFrontendFrontendFrontend Middle-tierMiddle-tierMiddle-tier Storage
  • 5. INTRODUCTION • Frontend: stateless • Middle-tier: stateless • Limited scalability of storage Frontend FrontendFrontendFrontendFrontendFrontend Middle-tierMiddle-tierMiddle-tier Storage
  • 6. INTRODUCTION • Frontend: stateless • Middle-tier: stateless • Limited scalability of storage Frontend FrontendFrontendFrontendFrontendFrontend Middle-tierMiddle-tierMiddle-tier Storage Cache
  • 7. INTRODUCTION • Frontend: stateless • Middle-tier : stateless • Limited scalability of storage • Win: • Latency • Throughput Frontend FrontendFrontendFrontendFrontendFrontend Middle-tierMiddle-tierMiddle-tier Storage Cache
  • 8. INTRODUCTION • Frontend: stateless • Middle-tier : stateless • Limited scalability of storage • Win: • Latency • Throughput • Loss: • Concurrency • Semantic guarantees Frontend FrontendFrontendFrontendFrontendFrontend Middle-tierMiddle-tierMiddle-tier Storage Cache
  • 9. INTRODUCTION • Frontend: stateless • Middle-tier : stateless • Limited scalability of storage • Win: • Latency • Throughput • Loss: • Concurrency • Semantic guarantees • Custom concurrency control protocol Frontend FrontendFrontendFrontendFrontendFrontend Middle-tierMiddle-tierMiddle-tier Storage Cache
  • 10. INTRODUCTION • Data shipping paradigm: on every request, the data is shipped from cache/storage to middle tier • It does not provide data locality Frontend FrontendFrontendFrontendFrontendFrontend Middle-tierMiddle-tierMiddle-tier Storage Cache
  • 11. INTRODUCTION • Function shipping paradigm • Stateful middle tier • Performance benefits of cache • Data locality • Semantic and consistency benefits Frontend FrontendFrontendFrontendFrontendFrontend Middle-tierMiddle-tierMiddle-tier Storage Data Data Data
  • 12. INTRODUCTION • OOP – intuitive way to model complex systems • Marginalized in SOA • Loosely-coupled partitioned services don’t often match objects • The actor model brings OOP back to system level
  • 13. VIRTUAL ACTORS • 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
  • 14. OTHER SYSTEMS • Erlang and Akka • No lifecycle management • Distributed races • No failure management • Distributed resource management
  • 15. ORLEANS VIRTUAL ACTORS • Always exists • No explicitly creation/destruction • Automatic resource management • Never fail • Location is transparent to application code
  • 16. LOCATION TRANSPARENCY Foo x = new Foo(42) … x.DoSomething(43)
  • 17. 2.1. VIRTUAL ACTORS • Actor identity: type + 128 bit GUID • Behavior • State • Actors are isolated from each other
  • 18. 2.1. VIRTUAL ACTORS 1. Perpetual existence 2. Automatic instantiation (activation) 3. Location transparency 4. Automatic scale out • Stateful – single instance • Stateless – scale automatically (up to a limit)
  • 19. 2.2. ACTOR INTERFACES • Strong type interfaces • All methods must be async 1 public interface IGameActor: IActor 2 { 3 Task<string> GameName { get; } 4 Task<List> CurrentPlayers { get; } 5 Task JoinGame(IPlayerActor game); 6 Task LeaveGame(IPlayerActor game); 7 }
  • 20. 2.3. ACTOR REFERENCES • Strongly typed proxy • “GetActor” method is generated at compile time • Request by primary key (GUID) • References can be passed as arguments (!) 1 public static class GameActorFactory 2 { 3 public static IGameActor GetActor(Guid gameId); 4 }
  • 21. 2.4. PROMISES • No blocking calls • Promise states: unresolved, fulfilled, broken • Closure/continuation • .NET: System.Threading.Tasks.Task<T> • C#: async/await 1 IGameActor gameActor = GameActorFactory.GetActor(gameId); 2 try{ 3 string name = await gameActor.GameName; 4 Console.WriteLine(“Game name is ” + name); 5 } catch(Exception) { 6 Console.WriteLine(“The call to actor failed”); 7 }
  • 22. 2.5. TURNS • Activations are single threaded • Work in chunks: turns • Turns (from different actors) can be interleaved • [Reentrant] attribute
  • 25. 2.6. PERSISTENCE • State = property bag interface 1 public interface IGameState: IState 2 { 3 GameStatus Status { get; set } 4 List Players { get; set;} 5 } 6 public class GameActor: ActorBase<IGameState>, IGameActor 7 { 8 Task JoinGame(IPlayerActor game) { 9 this.State.Players.Add(IPlayerActor); 10 this.State.WriteStateAsync(); 11 } 12 }
  • 26. 2.6. PERSISTENCE • Application controlled • Persistence providers: SQL, Azure Storage, etc
  • 27. 3.1 RUNTIME IMPLEMENTATION Orleans cluster Server Orleans process Actor Actor Actor Actor Actor Server Orleans process Actor Actor Actor Actor Server Orleans process Actor Actor Actor Actor Actor Server Orleans process Actor Actor Actor
  • 28. 3.1 RUNTIME IMPLEMENTATION Orleans process Messaging Hosting Execution • 1 TCP connection between each pair of servers • Multiplex messages • Actor placement • Actor lifecycle • Resource management • Actor code execution • Reentrancy • Single threading
  • 30. 3.2. DISTRIBUTED DIRECTORY • Maps actor id <-> location • One-hop distributed hash table • Each server holds a partition of the directory • Actor partitioning: consistent hashing A C [Act.1234, A] [Act.1244, C] [Act.1254, D] [Act.1235, F] [Act.1245, A] [Act.1255, E] B D Act.1244 -> Hello
  • 31. 3.2. DISTRIBUTED DIRECTORY • Maps actor id <-> location • One-hop distributed hash table • Each server holds a partition of the directory • Actor partitioning: consistent hashing A C 1. Act.1244 ? [Act.1234, A] [Act.1244, C] [Act.1254, D] [Act.1235, F] [Act.1245, A] [Act.1255, E] B D Act.1244 -> Hello
  • 32. 3.2. DISTRIBUTED DIRECTORY • Maps actor id <-> location • One-hop distributed hash table • Each server holds a partition of the directory • Actor partitioning: consistent hashing A C 1. Act.1244 ? [Act.1234, A] [Act.1244, C] [Act.1254, D]2. C [Act.1235, F] [Act.1245, A] [Act.1255, E] B D Act.1244 -> Hello
  • 33. 3.2. DISTRIBUTED DIRECTORY • Maps actor id <-> location • One-hop distributed hash table • Each server holds a partition of the directory • Actor partitioning: consistent hashing A C 1. Act.1244 ? [Act.1234, A] [Act.1244, C] [Act.1254, D]2. C 3. Hello [Act.1235, F] [Act.1245, A] [Act.1255, E] B D Act.1244 -> Hello
  • 34. 3.2. DISTRIBUTED DIRECTORY • Maps actor id <-> location • One-hop distributed hash table • Each server holds a partition of the directory • Actor partitioning: consistent hashing • (De)Activations update records in the table • Directory enforces single-activations A C 1. Act.1244 ? [Act.1234, A] [Act.1244, C] [Act.1254, D]2. C 3. Hello [Act.1235, F] [Act.1245, A] [Act.1255, E] B D Act.1244 -> Hello
  • 35. 3.2. DISTRIBUTED DIRECTORY • Maps actor id <-> location • One-hop distributed hash table • Each server holds a partition of the directory • Actor partitioning: consistent hashing • (De)Activations update records in the table • Directory enforces single-activations • Avoid extra hop: large (millions) cache of recent activations A C 1. Act.1244 ? [Act.1234, A] [Act.1244, C] [Act.1254, D]2. C 3. Hello [Act.1235, F] [Act.1245, A] [Act.1255, E] B D Act.1244 -> Hello
  • 36. 3.3. STRONG ISOLATION • Actors don’t share state and communication is always message based • Method arguments & return values are deep copied • Guarantees immutability
  • 37. 3.8. RELIABILITY • Orleans manages everything except persistence • Failure detection: heartbeats • Membership view is eventual consistent (30-60s on production servers) • A “dead” actor is activated on a different server • Actor lifespan not linked to server lifespan • No checkpoint strategy (depends on application) • Misrouted messages are sent to the right destination and sender is notified
  • 38. 3.9. 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
  • 39. 3.10. MESSAGING GUARANTEES • At-least-once message guarantee • Exactly-once can be implemented at application level (request id) • No FIFO guarantees (sender: A, B, C; receiver: B, A, C)
  • 40. 4.1 HALO 4 PRESENCE SERVICE
  • 41. 4.2. HALO 4 STATISTICS SERVICE
  • 42. 5.1. SYNTHETIC MICRO BENCHMARKS
  • 43. 5.1. SYNTHETIC MICRO BENCHMARKS *test server had 8 cores
  • 44. 5.1. SYNTHETIC MICRO BENCHMARKS
  • 47. ORLEANS DRAWBACKS • Bulk operations • Large number of actors (billions) + no temporal locality • No cross-actor transactions
  • 48. 6.2. OTHER ACTOR FRAMEWORKS • Akka http://akka.io/ • Erlang https://www.erlang.org/ Not in the paper: • Orbit (Java/JVM) https://github.com/orbit/orbit