SlideShare una empresa de Scribd logo
1 de 16
Descargar para leer sin conexión
Drinking
from the
Firehose
With Virtual Streams & Virtual Actors
Sergey Bykov
Microsoft, @sergeybykov
Event Streaming
Compute
Storage
Typical Workloads
User X
Event
User X
State
Updated
User X
State
User X
Event
User X
Event
Processing an Event
Challenges
Y X X Z X Z Y Z
C A C B B B A C
D E F F DD D E
B A C E F D Z A
Z X X Z X Z Y X
A A B C C C B A
E D E F F F E D
A Y Z C F D B A
Storage
High volume of events
▪Need multiple servers
Each event requires context
▪Load state from storage
▪Write results to storage
Uncoordinated IO is expensive
▪Caching
▪Write conflicts
Servers may go down
▪Clustering / coordination needed
User X
Event
User X
Event
Processing an Event
User X
Event
User X
State
Updated
User X
State
User X
Event
User X
State
Updated
User X
State
Benefits of Single Processor
User X
Event
User X
Event
User Y
Event
User Y
Event
User Y
Event
User Z
Event
User Z
Event
User Z
Event
Orleans Architecture
Frontends Orleans Cluster Storage
Grain
Persisted
Activating
Active
in memory
Deactivating
Challenges
Y X X Z X Z Y Z
C A C B B B A C
D E F F DD D E
B A C E F D Z A
Z X X Z X Z Y X
A A B C C C B A
E D E F F F E D
A Y Z C F D B A
Storage
High volume of events
▪Need multiple servers
Each event requires context
▪Load state from storage
▪Write results to storage
Uncoordinated IO is expensive
▪Caching
▪Write conflicts
Servers may go down
▪Clustering / coordination needed
PA PA PA PA
Messaging
Cluster Membership
Grain Directory
PA PA PA PA
Messaging
Cluster Membership
Grain Directory
Pulling Agents
Y X X Z X Z Y Z
C A C B B B A C
D E F F DD D E
B A C E F D Z A
Z X X Z X Z Y X
A A B C C C B A
E D E F F F E D
A Y Z C F D B A
Virtual Streams
A A A A A A A A
B B B B B B B B
C C C C C C C C
A A A A A A A A
B B B B B B B B
C C C C C C C C
A B B C B C A A A B B C A B B B C A A C A B B A
DD E F E E D F D E F F DD E E F F E F D E DD
X Y Y Z Y Z X X X Y Y Z X Y Y Y Z X X Z X Y Y X
A
B
C
D
D
Logical (Virtual) Streams
1000s to Ms to Bs
Physical Persistent Queues
10s to 1000s
Programming Model
public class UserGrain : Grain, IAsyncObserver<GameEvent>
{
public async Task Initialize()
{
var provider = GetStreamProvider(“EventHub Provider”);
var stream = provider.GetStream<GameEvent>(userId, “PlayerEvents”);
await stream.Subscribe(this);
}
public async Task OnNext(GameEvent event)
{
// Processing logic
...
await AwardAchievement(Achievements.MasterChief);
}
...
public async Task AwardAchievement(Achievements achievement)
{
var stream = provider.GetStream<Achievements>(streamId, “Achievements”);
await stream.OnNext(achievement);
}
}
// Rx-like interface to implement
public interface IAsyncObserver<T>
{
Task OnNext(T event);
Task OnComplete();
Task OnError();
}
Event Streaming is a powerful paradigm
Routing events to affected entity’s state is much better
▪ Reduces read and write load on storage
▪ Can serve RPC calls from same in-memory state
Virtual Actors are natural fit for processing events
▪ Cluster objects with stable identities
▪ Automatic resource management
Virtual Streams provide a simple but powerful model
▪ Orleans code is open source (MIT license)
▪ Runs on Windows, Linux, MacOS (via .NET Core)
Takeaways
Muchas Gracias!
Sergey Bykov
Microsoft, @sergeybykov

Más contenido relacionado

Similar a Drinking from the firehose, with virtual streams and virtual actors

Similar a Drinking from the firehose, with virtual streams and virtual actors (20)

Event Sourcing - what could possibly go wrong?
Event Sourcing - what could possibly go wrong?Event Sourcing - what could possibly go wrong?
Event Sourcing - what could possibly go wrong?
 
Flink Forward Berlin 2018: Steven Wu - "Failure is not fatal: what is your re...
Flink Forward Berlin 2018: Steven Wu - "Failure is not fatal: what is your re...Flink Forward Berlin 2018: Steven Wu - "Failure is not fatal: what is your re...
Flink Forward Berlin 2018: Steven Wu - "Failure is not fatal: what is your re...
 
Event sourcing - what could possibly go wrong ? Devoxx PL 2021
Event sourcing  - what could possibly go wrong ? Devoxx PL 2021Event sourcing  - what could possibly go wrong ? Devoxx PL 2021
Event sourcing - what could possibly go wrong ? Devoxx PL 2021
 
線上遊戲與雲端運算
線上遊戲與雲端運算線上遊戲與雲端運算
線上遊戲與雲端運算
 
dSS API by example
dSS API by exampledSS API by example
dSS API by example
 
Cross the streams thanks to Kafka and Flink (Christophe Philemotte, Digazu) K...
Cross the streams thanks to Kafka and Flink (Christophe Philemotte, Digazu) K...Cross the streams thanks to Kafka and Flink (Christophe Philemotte, Digazu) K...
Cross the streams thanks to Kafka and Flink (Christophe Philemotte, Digazu) K...
 
Streaming Dataflow with Apache Flink
Streaming Dataflow with Apache Flink Streaming Dataflow with Apache Flink
Streaming Dataflow with Apache Flink
 
Going Reactive with Relational Databases
Going Reactive with Relational DatabasesGoing Reactive with Relational Databases
Going Reactive with Relational Databases
 
Event Sourcing - what could go wrong - Jfokus 2022
Event Sourcing - what could go wrong - Jfokus 2022Event Sourcing - what could go wrong - Jfokus 2022
Event Sourcing - what could go wrong - Jfokus 2022
 
CQRS and Event Sourcing: A DevOps perspective
CQRS and Event Sourcing: A DevOps perspectiveCQRS and Event Sourcing: A DevOps perspective
CQRS and Event Sourcing: A DevOps perspective
 
XPDS14 - Scaling Xen's Aggregate Storage Performance - Felipe Franciosi, Citrix
XPDS14 - Scaling Xen's Aggregate Storage Performance - Felipe Franciosi, CitrixXPDS14 - Scaling Xen's Aggregate Storage Performance - Felipe Franciosi, Citrix
XPDS14 - Scaling Xen's Aggregate Storage Performance - Felipe Franciosi, Citrix
 
Comet from JavaOne 2008
Comet from JavaOne 2008Comet from JavaOne 2008
Comet from JavaOne 2008
 
Voxxed Banff 2018 : Containers & Integration tests
Voxxed Banff 2018 : Containers & Integration testsVoxxed Banff 2018 : Containers & Integration tests
Voxxed Banff 2018 : Containers & Integration tests
 
Android RenderScript on LLVM
Android RenderScript on LLVMAndroid RenderScript on LLVM
Android RenderScript on LLVM
 
Flink Forward SF 2017: Stefan Richter - Improvements for large state and reco...
Flink Forward SF 2017: Stefan Richter - Improvements for large state and reco...Flink Forward SF 2017: Stefan Richter - Improvements for large state and reco...
Flink Forward SF 2017: Stefan Richter - Improvements for large state and reco...
 
The Netflix API Platform for Server-Side Scripting
The Netflix API Platform for Server-Side ScriptingThe Netflix API Platform for Server-Side Scripting
The Netflix API Platform for Server-Side Scripting
 
Edge architecture ieee international conference on cloud engineering
Edge architecture   ieee international conference on cloud engineeringEdge architecture   ieee international conference on cloud engineering
Edge architecture ieee international conference on cloud engineering
 
iRODS/DDN User Group 20140908 Sanger
iRODS/DDN User Group 20140908 SangeriRODS/DDN User Group 20140908 Sanger
iRODS/DDN User Group 20140908 Sanger
 
YolactEdge Review [cdm]
YolactEdge Review [cdm]YolactEdge Review [cdm]
YolactEdge Review [cdm]
 
Dive into sentry
Dive into sentryDive into sentry
Dive into sentry
 

Más de J On The Beach

Acoustic Time Series in Industry 4.0: Improved Reliability and Cyber-Security...
Acoustic Time Series in Industry 4.0: Improved Reliability and Cyber-Security...Acoustic Time Series in Industry 4.0: Improved Reliability and Cyber-Security...
Acoustic Time Series in Industry 4.0: Improved Reliability and Cyber-Security...
J On The Beach
 
Axon Server went RAFTing
Axon Server went RAFTingAxon Server went RAFTing
Axon Server went RAFTing
J On The Beach
 
Madaari : Ordering For The Monkeys
Madaari : Ordering For The MonkeysMadaari : Ordering For The Monkeys
Madaari : Ordering For The Monkeys
J On The Beach
 
Machine Learning: The Bare Math Behind Libraries
Machine Learning: The Bare Math Behind LibrariesMachine Learning: The Bare Math Behind Libraries
Machine Learning: The Bare Math Behind Libraries
J On The Beach
 

Más de J On The Beach (20)

Massively scalable ETL in real world applications: the hard way
Massively scalable ETL in real world applications: the hard wayMassively scalable ETL in real world applications: the hard way
Massively scalable ETL in real world applications: the hard way
 
Big Data On Data You Don’t Have
Big Data On Data You Don’t HaveBig Data On Data You Don’t Have
Big Data On Data You Don’t Have
 
Acoustic Time Series in Industry 4.0: Improved Reliability and Cyber-Security...
Acoustic Time Series in Industry 4.0: Improved Reliability and Cyber-Security...Acoustic Time Series in Industry 4.0: Improved Reliability and Cyber-Security...
Acoustic Time Series in Industry 4.0: Improved Reliability and Cyber-Security...
 
Pushing it to the edge in IoT
Pushing it to the edge in IoTPushing it to the edge in IoT
Pushing it to the edge in IoT
 
How do we deploy? From Punched cards to Immutable server pattern
How do we deploy? From Punched cards to Immutable server patternHow do we deploy? From Punched cards to Immutable server pattern
How do we deploy? From Punched cards to Immutable server pattern
 
Java, Turbocharged
Java, TurbochargedJava, Turbocharged
Java, Turbocharged
 
When Cloud Native meets the Financial Sector
When Cloud Native meets the Financial SectorWhen Cloud Native meets the Financial Sector
When Cloud Native meets the Financial Sector
 
The big data Universe. Literally.
The big data Universe. Literally.The big data Universe. Literally.
The big data Universe. Literally.
 
Streaming to a New Jakarta EE
Streaming to a New Jakarta EEStreaming to a New Jakarta EE
Streaming to a New Jakarta EE
 
The TIPPSS Imperative for IoT - Ensuring Trust, Identity, Privacy, Protection...
The TIPPSS Imperative for IoT - Ensuring Trust, Identity, Privacy, Protection...The TIPPSS Imperative for IoT - Ensuring Trust, Identity, Privacy, Protection...
The TIPPSS Imperative for IoT - Ensuring Trust, Identity, Privacy, Protection...
 
Pushing AI to the Client with WebAssembly and Blazor
Pushing AI to the Client with WebAssembly and BlazorPushing AI to the Client with WebAssembly and Blazor
Pushing AI to the Client with WebAssembly and Blazor
 
Axon Server went RAFTing
Axon Server went RAFTingAxon Server went RAFTing
Axon Server went RAFTing
 
The Six Pitfalls of building a Microservices Architecture (and how to avoid t...
The Six Pitfalls of building a Microservices Architecture (and how to avoid t...The Six Pitfalls of building a Microservices Architecture (and how to avoid t...
The Six Pitfalls of building a Microservices Architecture (and how to avoid t...
 
Madaari : Ordering For The Monkeys
Madaari : Ordering For The MonkeysMadaari : Ordering For The Monkeys
Madaari : Ordering For The Monkeys
 
Servers are doomed to fail
Servers are doomed to failServers are doomed to fail
Servers are doomed to fail
 
Interaction Protocols: It's all about good manners
Interaction Protocols: It's all about good mannersInteraction Protocols: It's all about good manners
Interaction Protocols: It's all about good manners
 
A race of two compilers: GraalVM JIT versus HotSpot JIT C2. Which one offers ...
A race of two compilers: GraalVM JIT versus HotSpot JIT C2. Which one offers ...A race of two compilers: GraalVM JIT versus HotSpot JIT C2. Which one offers ...
A race of two compilers: GraalVM JIT versus HotSpot JIT C2. Which one offers ...
 
Leadership at every level
Leadership at every levelLeadership at every level
Leadership at every level
 
Machine Learning: The Bare Math Behind Libraries
Machine Learning: The Bare Math Behind LibrariesMachine Learning: The Bare Math Behind Libraries
Machine Learning: The Bare Math Behind Libraries
 
Getting started with Deep Reinforcement Learning
Getting started with Deep Reinforcement LearningGetting started with Deep Reinforcement Learning
Getting started with Deep Reinforcement Learning
 

Último

The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
chiefasafspells
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 

Último (20)

Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 

Drinking from the firehose, with virtual streams and virtual actors

  • 1. Drinking from the Firehose With Virtual Streams & Virtual Actors Sergey Bykov Microsoft, @sergeybykov
  • 2.
  • 5. User X Event User X State Updated User X State User X Event User X Event Processing an Event
  • 6. Challenges Y X X Z X Z Y Z C A C B B B A C D E F F DD D E B A C E F D Z A Z X X Z X Z Y X A A B C C C B A E D E F F F E D A Y Z C F D B A Storage High volume of events ▪Need multiple servers Each event requires context ▪Load state from storage ▪Write results to storage Uncoordinated IO is expensive ▪Caching ▪Write conflicts Servers may go down ▪Clustering / coordination needed
  • 7. User X Event User X Event Processing an Event User X Event User X State Updated User X State
  • 8. User X Event User X State Updated User X State Benefits of Single Processor User X Event User X Event User Y Event User Y Event User Y Event User Z Event User Z Event User Z Event
  • 9. Orleans Architecture Frontends Orleans Cluster Storage Grain Persisted Activating Active in memory Deactivating
  • 10. Challenges Y X X Z X Z Y Z C A C B B B A C D E F F DD D E B A C E F D Z A Z X X Z X Z Y X A A B C C C B A E D E F F F E D A Y Z C F D B A Storage High volume of events ▪Need multiple servers Each event requires context ▪Load state from storage ▪Write results to storage Uncoordinated IO is expensive ▪Caching ▪Write conflicts Servers may go down ▪Clustering / coordination needed
  • 11. PA PA PA PA Messaging Cluster Membership Grain Directory PA PA PA PA Messaging Cluster Membership Grain Directory Pulling Agents Y X X Z X Z Y Z C A C B B B A C D E F F DD D E B A C E F D Z A Z X X Z X Z Y X A A B C C C B A E D E F F F E D A Y Z C F D B A
  • 12. Virtual Streams A A A A A A A A B B B B B B B B C C C C C C C C A A A A A A A A B B B B B B B B C C C C C C C C A B B C B C A A A B B C A B B B C A A C A B B A DD E F E E D F D E F F DD E E F F E F D E DD X Y Y Z Y Z X X X Y Y Z X Y Y Y Z X X Z X Y Y X A B C D D Logical (Virtual) Streams 1000s to Ms to Bs Physical Persistent Queues 10s to 1000s
  • 13. Programming Model public class UserGrain : Grain, IAsyncObserver<GameEvent> { public async Task Initialize() { var provider = GetStreamProvider(“EventHub Provider”); var stream = provider.GetStream<GameEvent>(userId, “PlayerEvents”); await stream.Subscribe(this); } public async Task OnNext(GameEvent event) { // Processing logic ... await AwardAchievement(Achievements.MasterChief); } ... public async Task AwardAchievement(Achievements achievement) { var stream = provider.GetStream<Achievements>(streamId, “Achievements”); await stream.OnNext(achievement); } } // Rx-like interface to implement public interface IAsyncObserver<T> { Task OnNext(T event); Task OnComplete(); Task OnError(); }
  • 14. Event Streaming is a powerful paradigm Routing events to affected entity’s state is much better ▪ Reduces read and write load on storage ▪ Can serve RPC calls from same in-memory state Virtual Actors are natural fit for processing events ▪ Cluster objects with stable identities ▪ Automatic resource management Virtual Streams provide a simple but powerful model ▪ Orleans code is open source (MIT license) ▪ Runs on Windows, Linux, MacOS (via .NET Core) Takeaways
  • 15.