SlideShare a Scribd company logo
Build distributed, highly scalable applications
in .NET using Microsoft Orleans
Agenda
Introduction – Microsoft Orleans1
Grains and Grain Persistence2
Cluster Management3
Streaming, Observers, Reentrancy4
Q & A5
Implementation is based on
the Actor Model
Actor
Model
Orleans grains are virtual
actors
Orleans
Grains
Physical instantiations of
grains are completely
abstracted away and are
automatically managed by
the Orleans runtime
Physical
Instantiations
Virtual Actor Model - High-
scale dynamic workloads
like cloud services
Virtual
Actor Model
Build distributed high-scale computing applications without the need to learn and
apply complex concurrency or other scaling patterns
Introduction
Introduction
Typical stateless n-tier model
Orleans as a Stateful middle tier
Stateful 3-tier Architecture
State
Event
Stream
System
WEB hosts
with
Orleans clients
Orleans cluster
Grains
What is a
grain
Grain
Identity
• Primitives of the Orleans programming model.
• Building blocks of an Orleans application, they are atomic units of
isolation, distribution, and persistence.
• Objects that represent application entities.
• An individual grain is a uniquely addressable instance of a grain
type (class).
• Each grain has a unique identity, also referred to as a grain key,
within its type.
• Grain identity within its type can be a long integer, a GUID, a string,
or a combination of a long+string or GUID+string
Grains
Accessing a
Grain
Grains
Active in
Memory
Deactivating
Persisted
Activating
Grain
Lifecycle
Activation
• Constructor of the grain is executed leveraging
Dependency Injection, if applicable
• If Declarative Persistence is used, the grain state
is read from storage
• If overridden, OnActivateAsync is called
Deactivation
• The grain remains idle for some time
• Silo runtime decides to deactivate the grain
• Silo runtime calls OnDeactivateAsync, if
overridden
• Silo runtime removes the grain from memory
Grain Persistence
Orleans provides different type of storage providers for persisting the
grain state
AzureTableGrainStorage AzureBlobGrainStorage DynamoDBGrainStorage
MemoryGrainStorage AdoNetGrainStorage
SQL Server
MySQL/MariaDB
PostgreSQL
Oracle
Cluster Management
Orleans provides cluster management via a built-in membership protocol, which we sometimes
refer to as Silo Membership. The goal of this protocol is for all silos (Orleans servers) to agree on
the set of currently alive silos, detect failed silos, and allow new silos to join the cluster.
Azure
Table Storage
Apache
Zookeeper
Consul IO AWS
Dynamo DB
In memory emulation
for development setup
Membership Table Implementations
Streaming
Streaming extensions provide a set of abstractions and APIs that make
thinking about and working with streams simpler and more robust
Makes the programming model compatible with and portable across a
wide range of existing queuing technologies, such as Event Hubs,
ServiceBus, Azure Queues, and Apache Kafka
No need to write special code or run dedicated processes to interact with
such queues
For receiving data from streams implicit/explicit subscriptions can be
used
Reentrancy
Grain activations are single-threaded and,
by default, process each request from
beginning to completion before the next
request can begin being processing.
In some circumstances, it may be desirable
for an activation to process other requests
while one request is waiting for an
asynchronous operation to complete
• The grain class is marked as [Reentrant]
• The interface method is marked as
[AlwaysInterleave]
• The requests within the same call chain
• The grain's MayInterleave predicate returns true
Other Core Concepts
1 Timers and Reminders
2 Request Context
3 Event Sourcing
4 Grain Services
5 Interceptors
6 External Tasks and Grains
7 Stateless Worker Grains
Demo
Q & A
• Website: www.winwire.com
• Email: marketing@winwire.com
• Blog: http://www.winwire.com/blog/
• Twitter: @winwire

More Related Content

Similar to Build distributed, highly scalable applications in .NET using Microsoft Orleans (14)

PPTX
A Brief Intro to Microsoft Orleans
Uri Goldstein
 
PPTX
Project Orleans - Actor Model framework
Neil Mackenzie
 
PPTX
Massively Scaleable .NET Web Services with Project Orleans
Newman Hunter
 
PPTX
Actors Set the Stage for Project Orleans
cjmyers
 
PPTX
Orleans Cloud Computing
Huzaifa zafar
 
PPTX
Orleans – a “cloud native” runtime built for #azure
Brisebois
 
PDF
Антон Молдован "Building data intensive stateful services with Orleans"
Fwdays
 
PDF
Orleans: Cloud Computing for Everyone - SOCC 2011
Jorgen Thelin
 
PDF
Orleans gdc2019
Crystin Cox
 
PPTX
Scalable game-servers-tgc
Ashkan Saeedi Mazdeh
 
PPTX
Walk In a Distributed Systems Park with Microsoft Orleans
Yevhen Bobrov
 
PPTX
Developing Actors in Azure with .net
Marco Parenzan
 
PPTX
"Walk in a distributed systems park with Orleans" Евгений Бобров
Fwdays
 
PPTX
Akka.net versus microsoft orleans
Bill Tulloch
 
A Brief Intro to Microsoft Orleans
Uri Goldstein
 
Project Orleans - Actor Model framework
Neil Mackenzie
 
Massively Scaleable .NET Web Services with Project Orleans
Newman Hunter
 
Actors Set the Stage for Project Orleans
cjmyers
 
Orleans Cloud Computing
Huzaifa zafar
 
Orleans – a “cloud native” runtime built for #azure
Brisebois
 
Антон Молдован "Building data intensive stateful services with Orleans"
Fwdays
 
Orleans: Cloud Computing for Everyone - SOCC 2011
Jorgen Thelin
 
Orleans gdc2019
Crystin Cox
 
Scalable game-servers-tgc
Ashkan Saeedi Mazdeh
 
Walk In a Distributed Systems Park with Microsoft Orleans
Yevhen Bobrov
 
Developing Actors in Azure with .net
Marco Parenzan
 
"Walk in a distributed systems park with Orleans" Евгений Бобров
Fwdays
 
Akka.net versus microsoft orleans
Bill Tulloch
 

More from WinWire Technologies Inc (20)

PDF
Accelerate Application Innovation Journey with Azure Kubernetes Service
WinWire Technologies Inc
 
PDF
CRM Technology Trends to Watch in 2020
WinWire Technologies Inc
 
PDF
Azure Synapse Analytics
WinWire Technologies Inc
 
PDF
Azure Arc - Managing Hybrid and Multi-Cloud Platforms
WinWire Technologies Inc
 
PPTX
Build a Modern Workplace using Microsoft Teams
WinWire Technologies Inc
 
PDF
Getting Started with Infrastructure as Code
WinWire Technologies Inc
 
PDF
Box to OneDrive Migration
WinWire Technologies Inc
 
PDF
Secure Your Cloud Environment with Azure Active Directory (AD)
WinWire Technologies Inc
 
PDF
Building Hybrid Cloud Apps with Azure and Azure stack
WinWire Technologies Inc
 
PPTX
Microsoft Teams – The Future of Teamwork in Office 365
WinWire Technologies Inc
 
PPTX
Designing Resilient Applications on Microsoft Azure/Disaster Recovery of Appl...
WinWire Technologies Inc
 
PDF
Getting Ready for Hybrid SharePoint – SharePoint On-Premise, Office 365 & Az...
WinWire Technologies Inc
 
PDF
Azure Serverless with Functions, Logic Apps, and Event Grid
WinWire Technologies Inc
 
PPT
Drive Your Digital Transformation with Microsoft Dynamics 365
WinWire Technologies Inc
 
PDF
Modernize Your Infrastructure and Apps with Microsoft Azure
WinWire Technologies Inc
 
PPTX
Modern Data Security for the Enterprises – SQL Server & Azure SQL Database
WinWire Technologies Inc
 
PDF
Migration from eRoom to office 365
WinWire Technologies Inc
 
PDF
Building Intelligent Cloud with Microsoft Azure
WinWire Technologies Inc
 
PPTX
ASP.NET Core 1.0: Understanding ASP.NET Core 1.0 (ASP.NET 5)
WinWire Technologies Inc
 
PPT
DevOps and Visual Studio Team Services
WinWire Technologies Inc
 
Accelerate Application Innovation Journey with Azure Kubernetes Service
WinWire Technologies Inc
 
CRM Technology Trends to Watch in 2020
WinWire Technologies Inc
 
Azure Synapse Analytics
WinWire Technologies Inc
 
Azure Arc - Managing Hybrid and Multi-Cloud Platforms
WinWire Technologies Inc
 
Build a Modern Workplace using Microsoft Teams
WinWire Technologies Inc
 
Getting Started with Infrastructure as Code
WinWire Technologies Inc
 
Box to OneDrive Migration
WinWire Technologies Inc
 
Secure Your Cloud Environment with Azure Active Directory (AD)
WinWire Technologies Inc
 
Building Hybrid Cloud Apps with Azure and Azure stack
WinWire Technologies Inc
 
Microsoft Teams – The Future of Teamwork in Office 365
WinWire Technologies Inc
 
Designing Resilient Applications on Microsoft Azure/Disaster Recovery of Appl...
WinWire Technologies Inc
 
Getting Ready for Hybrid SharePoint – SharePoint On-Premise, Office 365 & Az...
WinWire Technologies Inc
 
Azure Serverless with Functions, Logic Apps, and Event Grid
WinWire Technologies Inc
 
Drive Your Digital Transformation with Microsoft Dynamics 365
WinWire Technologies Inc
 
Modernize Your Infrastructure and Apps with Microsoft Azure
WinWire Technologies Inc
 
Modern Data Security for the Enterprises – SQL Server & Azure SQL Database
WinWire Technologies Inc
 
Migration from eRoom to office 365
WinWire Technologies Inc
 
Building Intelligent Cloud with Microsoft Azure
WinWire Technologies Inc
 
ASP.NET Core 1.0: Understanding ASP.NET Core 1.0 (ASP.NET 5)
WinWire Technologies Inc
 
DevOps and Visual Studio Team Services
WinWire Technologies Inc
 
Ad

Recently uploaded (20)

PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
Advancing WebDriver BiDi support in WebKit
Igalia
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
July Patch Tuesday
Ivanti
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
Advancing WebDriver BiDi support in WebKit
Igalia
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
July Patch Tuesday
Ivanti
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
Ad

Build distributed, highly scalable applications in .NET using Microsoft Orleans

  • 1. Build distributed, highly scalable applications in .NET using Microsoft Orleans
  • 2. Agenda Introduction – Microsoft Orleans1 Grains and Grain Persistence2 Cluster Management3 Streaming, Observers, Reentrancy4 Q & A5
  • 3. Implementation is based on the Actor Model Actor Model Orleans grains are virtual actors Orleans Grains Physical instantiations of grains are completely abstracted away and are automatically managed by the Orleans runtime Physical Instantiations Virtual Actor Model - High- scale dynamic workloads like cloud services Virtual Actor Model Build distributed high-scale computing applications without the need to learn and apply complex concurrency or other scaling patterns Introduction
  • 4. Introduction Typical stateless n-tier model Orleans as a Stateful middle tier
  • 5. Stateful 3-tier Architecture State Event Stream System WEB hosts with Orleans clients Orleans cluster
  • 6. Grains What is a grain Grain Identity • Primitives of the Orleans programming model. • Building blocks of an Orleans application, they are atomic units of isolation, distribution, and persistence. • Objects that represent application entities. • An individual grain is a uniquely addressable instance of a grain type (class). • Each grain has a unique identity, also referred to as a grain key, within its type. • Grain identity within its type can be a long integer, a GUID, a string, or a combination of a long+string or GUID+string
  • 8. Grains Active in Memory Deactivating Persisted Activating Grain Lifecycle Activation • Constructor of the grain is executed leveraging Dependency Injection, if applicable • If Declarative Persistence is used, the grain state is read from storage • If overridden, OnActivateAsync is called Deactivation • The grain remains idle for some time • Silo runtime decides to deactivate the grain • Silo runtime calls OnDeactivateAsync, if overridden • Silo runtime removes the grain from memory
  • 9. Grain Persistence Orleans provides different type of storage providers for persisting the grain state AzureTableGrainStorage AzureBlobGrainStorage DynamoDBGrainStorage MemoryGrainStorage AdoNetGrainStorage SQL Server MySQL/MariaDB PostgreSQL Oracle
  • 10. Cluster Management Orleans provides cluster management via a built-in membership protocol, which we sometimes refer to as Silo Membership. The goal of this protocol is for all silos (Orleans servers) to agree on the set of currently alive silos, detect failed silos, and allow new silos to join the cluster. Azure Table Storage Apache Zookeeper Consul IO AWS Dynamo DB In memory emulation for development setup Membership Table Implementations
  • 11. Streaming Streaming extensions provide a set of abstractions and APIs that make thinking about and working with streams simpler and more robust Makes the programming model compatible with and portable across a wide range of existing queuing technologies, such as Event Hubs, ServiceBus, Azure Queues, and Apache Kafka No need to write special code or run dedicated processes to interact with such queues For receiving data from streams implicit/explicit subscriptions can be used
  • 12. Reentrancy Grain activations are single-threaded and, by default, process each request from beginning to completion before the next request can begin being processing. In some circumstances, it may be desirable for an activation to process other requests while one request is waiting for an asynchronous operation to complete • The grain class is marked as [Reentrant] • The interface method is marked as [AlwaysInterleave] • The requests within the same call chain • The grain's MayInterleave predicate returns true
  • 13. Other Core Concepts 1 Timers and Reminders 2 Request Context 3 Event Sourcing 4 Grain Services 5 Interceptors 6 External Tasks and Grains 7 Stateless Worker Grains
  • 14. Demo
  • 15. Q & A • Website: www.winwire.com • Email: [email protected] • Blog: http://www.winwire.com/blog/ • Twitter: @winwire