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

PPTX
Introduction To Big Data with Hadoop and Spark - For Batch and Real Time Proc...
PDF
AWS Tag Management for Cost Allocation
PPTX
Spam detection using machine learning based binary classifier_043660
PDF
AWS CodeCommit, CodeDeploy & CodePipeline
PDF
Part 1 of 'Introduction to Linux for bioinformatics': Introduction
PDF
A brief introduction to OCR (Optical character recognition)
PDF
Amazon EKS 그리고 Service Mesh (김세호 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018
PPT
Shopzilla On Concurrency
Introduction To Big Data with Hadoop and Spark - For Batch and Real Time Proc...
AWS Tag Management for Cost Allocation
Spam detection using machine learning based binary classifier_043660
AWS CodeCommit, CodeDeploy & CodePipeline
Part 1 of 'Introduction to Linux for bioinformatics': Introduction
A brief introduction to OCR (Optical character recognition)
Amazon EKS 그리고 Service Mesh (김세호 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018
Shopzilla On Concurrency

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

PPTX
Azure basics
PPTX
Microservices with Azure Service Fabric
PDF
NetflixOSS Open House Lightning talks
PPTX
Understand oracle real application cluster
PPTX
Microservices deck
PPTX
Akka.Net Overview
PPTX
Apache mesos
PDF
Scenic City Summit (2021): Real-Time Streaming in any and all clouds, hybrid...
PPTX
Azure serverless architectures
PPT
Mule esb intoduction
PPT
Shopzilla On Concurrency
PDF
Orleans: Cloud Computing for Everyone - SOCC 2011
PDF
Presentation on Oracle Application Server
PPTX
Orleans Cloud Computing
PDF
Stay productive_while_slicing_up_the_monolith
PPTX
Zookeeper Tutorial for beginners
PDF
Introduction to Windows Azure
PDF
Big data conference europe real-time streaming in any and all clouds, hybri...
PDF
Whats new in Autonomous Database in 2022
PDF
Introduction to Axon FrameWork with CQRS pattern
Azure basics
Microservices with Azure Service Fabric
NetflixOSS Open House Lightning talks
Understand oracle real application cluster
Microservices deck
Akka.Net Overview
Apache mesos
Scenic City Summit (2021): Real-Time Streaming in any and all clouds, hybrid...
Azure serverless architectures
Mule esb intoduction
Shopzilla On Concurrency
Orleans: Cloud Computing for Everyone - SOCC 2011
Presentation on Oracle Application Server
Orleans Cloud Computing
Stay productive_while_slicing_up_the_monolith
Zookeeper Tutorial for beginners
Introduction to Windows Azure
Big data conference europe real-time streaming in any and all clouds, hybri...
Whats new in Autonomous Database in 2022
Introduction to Axon FrameWork with CQRS pattern
Ad

More from WinWire Technologies Inc (20)

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

Recently uploaded (20)

PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Cloud computing and distributed systems.
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
sap open course for s4hana steps from ECC to s4
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Machine learning based COVID-19 study performance prediction
PDF
Chapter 3 Spatial Domain Image Processing.pdf
Review of recent advances in non-invasive hemoglobin estimation
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Building Integrated photovoltaic BIPV_UPV.pdf
Spectral efficient network and resource selection model in 5G networks
Digital-Transformation-Roadmap-for-Companies.pptx
Cloud computing and distributed systems.
Reach Out and Touch Someone: Haptics and Empathic Computing
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Dropbox Q2 2025 Financial Results & Investor Presentation
NewMind AI Weekly Chronicles - August'25 Week I
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Network Security Unit 5.pdf for BCA BBA.
sap open course for s4hana steps from ECC to s4
MIND Revenue Release Quarter 2 2025 Press Release
Machine learning based COVID-19 study performance prediction
Chapter 3 Spatial Domain Image Processing.pdf

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: marketing@winwire.com • Blog: http://www.winwire.com/blog/ • Twitter: @winwire