SlideShare una empresa de Scribd logo
1 de 25
PROJECT “ORLEANS”
Neil Mackenzie
Who Am I
• Neil Mackenzie
• Azure Lead –Satory Global
• neil.mackenzie@satory.com
• @mknz
• http://convective.wordpress.com
• Author: Microsoft Windows Azure Development Cookbook
• Microsoft MVP forWindows Azure
Agenda
• Actor Model
• Project “Orleans”
• Developing with Orleans
• Demonstration
• Q&A
ACTOR MODEL
Actor Model
• Core concepts:
• Actor – stateful entity
• Message – communication token passed between two Actors
• When an Actor receives a message it can concurrently:
• Send messages to other actors
• Create newActors
• Change its internal state
• No guaranteed order for delivery of concurrent messages
• Created by Hewitt, Bishop and Steiger in the 1970s
• Many implementations including Erlang and Akka
PROJECT “ORLEANS”
Cloud Compute Problems
• Cloud compute uses commodity hardware
• => need to design for failure
• => need to scale horizontally
• Distributed computing is a hard problem
• Need new paradigms to simplify things
• SQL -> NoSQL
• NoSQL stores hide data sharding from developers
• Can we use an Actor Model to simplify distributed compute?
Project “Orleans”
• .NET Implementation of an Actor Model
• Goals:
• Provide easy-to-use distributed compute model for developers
• Provide deployment model scaling from one node to a high-scaleAzure cloud service
• Developed by Microsoft Research
• Currently in public preview
• Used in production by 323 Industries for Halo presence and game statistics
Grains and Silos
• Orleans has the following concepts:
• Silo – deployment host for grains
• One or more silos per compute node
• Grain (Actor)
• Eternal existence – but activated into a silo when invoked
• Automatically garbage collected when not used (and memory pressure on silo)
• Different activations of the same grain may be into different silos
• Messages implemented as proxied method invocation
• Exist in stateless and stateful versions
• Always accessed through a grain reference
Deployment Models
• Orleans provides the following deployment models:
• In-process – development/debugging inVisual Studio
• Single host – development/debugging inVisual Studio
• Multiple hosts – DIY production deployment
• Azure Cloud Service – high-scale production deployments
Use Cases
• Orleans good for:
• Systems with large numbers of simple entities (social, devices)
• Loosely connected systems
• Intelligent caching
• Orleans not good for:
• Strongly-coupled systems
• Compute-intensive tasks
ORLEANS
DEVELOPMENT
Development Model
• Design grain interfaces
• Implement grain interfaces
• Implement deployment model
Grain Interface
• A grain is defined by its grain interface which specifies the messages it can receive
• Grain interface:
• Is derived from IGrain
• Exposes messages as public methods returningTask orTask<T>
• Supports method parameters
• Does not support property set methods (avoid properties)
• Visual Studio tooling creates client proxies from the grain interface
Grain Interface - Example
public interface IDeviceGrain : Orleans.IGrain {
Task<String> GetName();
Task SetName(String deviceName);
Task<Boolean> SetStatus(DeviceStatus deviceStatus);
}
public interface IControllerGrain : Orleans.IGrain {
Task AddDevice(IDeviceGrain device);
}
Grain Implementation
• A grain implementation class:
• Is derived from GrainBase or GrainBase<TGrainState>
• Implements the grain interface
• Base class methods:
• ActivateAsync
• DeactivateAsync
• GetLogger
Grain Implementation - Example
public class DeviceGrain : Orleans.GrainBase, IDeviceGrain {
private String name;
public Task<String> GetName() {
return Task.FromResult(name);
}
public Task SetName(String deviceName) {
name = deviceName;
return TaskDone.Done;
}
}
Referencing Grains
• Orleans tooling creates proxy classes and a factory class for each grain interface
• Use the factory class – GrainInterfaceNameFactory – to access a grain reference
var grain = HelloGrainFactory.GetGrain(0);
String response = grain.SayHello("Walking to New Orleans").Result;
• Orleans runtime provides a transparent distributed locator service
• A grain may be activated on any silo
• Each silo has a grain-location cache
Concurrency Model for Grains
• Orleans uses a cooperative multithreading scheduler
• Scheduler schedules only one message at a time for a grain
• A message is processed completely before another message is scheduled
• A message is processed as a sequence of one or more turns (continuations)
async Task<Boolean> DoThings() {
await serviceGrain.DoSomething;
Boolean success = await serviceGrain.DoSomethingElse();
return success;
}
Turn 1
Turn 2
Turn 3
Grain Persistence
• Orleans provides automated state persistence
• Do the following:
• Define aTGrainState class to hold the persisted state
• Use GrainBase<TGrainState> as the base class for the grain implementation
• State property automatically hydrated when grain is activated – ReadStateAsync()
• State must be persisted programmatically –WriteStateAsync()
• Storage provider named in class definition, configured in Orleans configuration
• Storage providers: in-memory (development), AzureTables
Advanced Grain Features
• Stateless worker grain
• Can be scaled out automatically by Orleans runtime
• Always activated in-silo
• Reentrant grain
• Can have interleaved message turns (i.e., they can be scheduled out of turn)
• Remindable grain
• Can receive scheduled reminders from Orleans runtime
• Observer grain
• Can observe events happening on other grains
UsingTask andTask<T>
• CompletedTask with void return
TaskDone.Done;
• CompletedTask<T> with a specific value:
Task.FromResult(value);
• Fan-outTasks
List<Task> promises = new List<Task>();
for (Int32 i = 0; i < 10; i++) {
var someGrain = SomeGrainFactory.GetGrain(i);
promises.Add(someGrain.DoSomething());
}
awaitTask.WhenAll(promises);
Visual StudioTooling
• Project Orleans provides 3Visual Studio project types
• Orleans Dev/Test Host – creates a console app with an Orleans silo for
development purposes
• Orleans Grain Class Collection – contains the grain class implementations
• Orleans Grain Interface Collection – contains the grain interfaces
Downloads and Documentation
• Download Orleans:
http://aka.ms/orleans
• Samples & Documentation
https://orleans.codeplex.com/
• Microsoft Research page for Project Orleans:
http://research.microsoft.com/en-us/projects/orleans/default.aspx
• Channel 9 discussion on the Actor Model with Hewitt, Meijer and Szyperski
bit.ly/1nOAtW9
Summary
• Project “Orleans” provides:
• A .NET implementation of an Actor Model
• A highly-scalable deployment model
• Development support inVisual Studio
• Deployment support for MicrosoftAzure
• With the goal of simplifying the task of creating distributed systems for
developers not skilled in the art

Más contenido relacionado

La actualidad más candente

TypeScript for Java Developers
TypeScript for Java DevelopersTypeScript for Java Developers
TypeScript for Java DevelopersYakov Fain
 
Stability Patterns for Microservices
Stability Patterns for MicroservicesStability Patterns for Microservices
Stability Patterns for Microservicespflueras
 
Real World Event Sourcing and CQRS
Real World Event Sourcing and CQRSReal World Event Sourcing and CQRS
Real World Event Sourcing and CQRSMatthew Hawkins
 
Etsy Activity Feeds Architecture
Etsy Activity Feeds ArchitectureEtsy Activity Feeds Architecture
Etsy Activity Feeds ArchitectureDan McKinley
 
Intro to DefectDojo at OWASP Switzerland
Intro to DefectDojo at OWASP SwitzerlandIntro to DefectDojo at OWASP Switzerland
Intro to DefectDojo at OWASP SwitzerlandMatt Tesauro
 
How Kubernetes helps Devops
How Kubernetes helps DevopsHow Kubernetes helps Devops
How Kubernetes helps DevopsSreenivas Makam
 
Why Docker
Why DockerWhy Docker
Why DockerdotCloud
 
An Introduction to Prometheus (GrafanaCon 2016)
An Introduction to Prometheus (GrafanaCon 2016)An Introduction to Prometheus (GrafanaCon 2016)
An Introduction to Prometheus (GrafanaCon 2016)Brian Brazil
 
Integrating systems in the age of Quarkus and Camel
Integrating systems in the age of Quarkus and CamelIntegrating systems in the age of Quarkus and Camel
Integrating systems in the age of Quarkus and CamelClaus Ibsen
 
Saving Time By Testing With Jest
Saving Time By Testing With JestSaving Time By Testing With Jest
Saving Time By Testing With JestBen McCormick
 
Building Immutable Machine Images with Packer and Ansible
Building Immutable Machine Images with Packer and AnsibleBuilding Immutable Machine Images with Packer and Ansible
Building Immutable Machine Images with Packer and AnsibleJason Harley
 
OpenAPI 3.0, And What It Means for the Future of Swagger
OpenAPI 3.0, And What It Means for the Future of SwaggerOpenAPI 3.0, And What It Means for the Future of Swagger
OpenAPI 3.0, And What It Means for the Future of SwaggerSmartBear
 
Azure Application insights - An Introduction
Azure Application insights - An IntroductionAzure Application insights - An Introduction
Azure Application insights - An IntroductionMatthias Güntert
 
iOS Application Penetration Testing for Beginners
iOS Application Penetration Testing for BeginnersiOS Application Penetration Testing for Beginners
iOS Application Penetration Testing for BeginnersRyanISI
 
Design principles - SOLID
Design principles - SOLIDDesign principles - SOLID
Design principles - SOLIDPranalee Rokde
 
Connecting Connect with Spring Boot
Connecting Connect with Spring BootConnecting Connect with Spring Boot
Connecting Connect with Spring BootVincent Kok
 
Container Network Interface: Network Plugins for Kubernetes and beyond
Container Network Interface: Network Plugins for Kubernetes and beyondContainer Network Interface: Network Plugins for Kubernetes and beyond
Container Network Interface: Network Plugins for Kubernetes and beyondKubeAcademy
 
Frame - Feature Management for Productive Machine Learning
Frame - Feature Management for Productive Machine LearningFrame - Feature Management for Productive Machine Learning
Frame - Feature Management for Productive Machine LearningDavid Stein
 

La actualidad más candente (20)

TypeScript for Java Developers
TypeScript for Java DevelopersTypeScript for Java Developers
TypeScript for Java Developers
 
Stability Patterns for Microservices
Stability Patterns for MicroservicesStability Patterns for Microservices
Stability Patterns for Microservices
 
Real World Event Sourcing and CQRS
Real World Event Sourcing and CQRSReal World Event Sourcing and CQRS
Real World Event Sourcing and CQRS
 
Etsy Activity Feeds Architecture
Etsy Activity Feeds ArchitectureEtsy Activity Feeds Architecture
Etsy Activity Feeds Architecture
 
Intro to DefectDojo at OWASP Switzerland
Intro to DefectDojo at OWASP SwitzerlandIntro to DefectDojo at OWASP Switzerland
Intro to DefectDojo at OWASP Switzerland
 
How Kubernetes helps Devops
How Kubernetes helps DevopsHow Kubernetes helps Devops
How Kubernetes helps Devops
 
Why Docker
Why DockerWhy Docker
Why Docker
 
An Introduction to Prometheus (GrafanaCon 2016)
An Introduction to Prometheus (GrafanaCon 2016)An Introduction to Prometheus (GrafanaCon 2016)
An Introduction to Prometheus (GrafanaCon 2016)
 
Integrating systems in the age of Quarkus and Camel
Integrating systems in the age of Quarkus and CamelIntegrating systems in the age of Quarkus and Camel
Integrating systems in the age of Quarkus and Camel
 
Saving Time By Testing With Jest
Saving Time By Testing With JestSaving Time By Testing With Jest
Saving Time By Testing With Jest
 
Building Immutable Machine Images with Packer and Ansible
Building Immutable Machine Images with Packer and AnsibleBuilding Immutable Machine Images with Packer and Ansible
Building Immutable Machine Images with Packer and Ansible
 
OpenAPI 3.0, And What It Means for the Future of Swagger
OpenAPI 3.0, And What It Means for the Future of SwaggerOpenAPI 3.0, And What It Means for the Future of Swagger
OpenAPI 3.0, And What It Means for the Future of Swagger
 
Azure Application insights - An Introduction
Azure Application insights - An IntroductionAzure Application insights - An Introduction
Azure Application insights - An Introduction
 
02 api gateway
02 api gateway02 api gateway
02 api gateway
 
iOS Application Penetration Testing for Beginners
iOS Application Penetration Testing for BeginnersiOS Application Penetration Testing for Beginners
iOS Application Penetration Testing for Beginners
 
Design principles - SOLID
Design principles - SOLIDDesign principles - SOLID
Design principles - SOLID
 
Connecting Connect with Spring Boot
Connecting Connect with Spring BootConnecting Connect with Spring Boot
Connecting Connect with Spring Boot
 
Externalized Spring Boot App Configuration
Externalized  Spring Boot App ConfigurationExternalized  Spring Boot App Configuration
Externalized Spring Boot App Configuration
 
Container Network Interface: Network Plugins for Kubernetes and beyond
Container Network Interface: Network Plugins for Kubernetes and beyondContainer Network Interface: Network Plugins for Kubernetes and beyond
Container Network Interface: Network Plugins for Kubernetes and beyond
 
Frame - Feature Management for Productive Machine Learning
Frame - Feature Management for Productive Machine LearningFrame - Feature Management for Productive Machine Learning
Frame - Feature Management for Productive Machine Learning
 

Destacado

Actors Set the Stage for Project Orleans
Actors Set the Stage for Project OrleansActors Set the Stage for Project Orleans
Actors Set the Stage for Project Orleanscjmyers
 
Orleans – a “cloud native” runtime built for #azure
Orleans – a “cloud native” runtime built for #azureOrleans – a “cloud native” runtime built for #azure
Orleans – a “cloud native” runtime built for #azureBrisebois
 
Gaming in the Cloud at Websummit Dublin
Gaming in the Cloud at Websummit DublinGaming in the Cloud at Websummit Dublin
Gaming in the Cloud at Websummit DublinIan Massingham
 
Intro to Git and GitHub
Intro to Git and GitHubIntro to Git and GitHub
Intro to Git and GitHubUri Goldstein
 
Codemotion 2013 Madrid - Modern OOP embedded development with .NET Micro Fram...
Codemotion 2013 Madrid - Modern OOP embedded development with .NET Micro Fram...Codemotion 2013 Madrid - Modern OOP embedded development with .NET Micro Fram...
Codemotion 2013 Madrid - Modern OOP embedded development with .NET Micro Fram...Lorenzo Maiorfi
 
Massively Scaleable .NET Web Services with Project Orleans
Massively Scaleable .NET Web Services with Project OrleansMassively Scaleable .NET Web Services with Project Orleans
Massively Scaleable .NET Web Services with Project OrleansNewman Hunter
 
Akka.NET Fundamentals — #ProgNet15
Akka.NET Fundamentals — #ProgNet15Akka.NET Fundamentals — #ProgNet15
Akka.NET Fundamentals — #ProgNet15petabridge
 
From Zero to the Actor Model (With Akka.Net) - CodeMash2017 - Tamir Dresher
From Zero to the Actor Model (With Akka.Net) - CodeMash2017 - Tamir DresherFrom Zero to the Actor Model (With Akka.Net) - CodeMash2017 - Tamir Dresher
From Zero to the Actor Model (With Akka.Net) - CodeMash2017 - Tamir DresherTamir Dresher
 
Azure service fabric: a gentle introduction
Azure service fabric: a gentle introductionAzure service fabric: a gentle introduction
Azure service fabric: a gentle introductionAlessandro Melchiori
 
Azure Service Fabric and the Actor Model: when did we forget Object Orientation?
Azure Service Fabric and the Actor Model: when did we forget Object Orientation?Azure Service Fabric and the Actor Model: when did we forget Object Orientation?
Azure Service Fabric and the Actor Model: when did we forget Object Orientation?João Pedro Martins
 
Architecting Microservices in .Net
Architecting Microservices in .NetArchitecting Microservices in .Net
Architecting Microservices in .NetRichard Banks
 
Yow Conference Dec 2013 Netflix Workshop Slides with Notes
Yow Conference Dec 2013 Netflix Workshop Slides with NotesYow Conference Dec 2013 Netflix Workshop Slides with Notes
Yow Conference Dec 2013 Netflix Workshop Slides with NotesAdrian Cockcroft
 
Un actor (model) per amico - Alessandro Melchiori - Codemotion Milan 2016
Un actor (model) per amico - Alessandro Melchiori - Codemotion Milan 2016Un actor (model) per amico - Alessandro Melchiori - Codemotion Milan 2016
Un actor (model) per amico - Alessandro Melchiori - Codemotion Milan 2016Codemotion
 

Destacado (17)

Actors Set the Stage for Project Orleans
Actors Set the Stage for Project OrleansActors Set the Stage for Project Orleans
Actors Set the Stage for Project Orleans
 
Orleans – a “cloud native” runtime built for #azure
Orleans – a “cloud native” runtime built for #azureOrleans – a “cloud native” runtime built for #azure
Orleans – a “cloud native” runtime built for #azure
 
Gaming in the Cloud at Websummit Dublin
Gaming in the Cloud at Websummit DublinGaming in the Cloud at Websummit Dublin
Gaming in the Cloud at Websummit Dublin
 
Shouldly
ShouldlyShouldly
Shouldly
 
Intro to Git and GitHub
Intro to Git and GitHubIntro to Git and GitHub
Intro to Git and GitHub
 
Microsoft Orleans & IoT
Microsoft Orleans & IoTMicrosoft Orleans & IoT
Microsoft Orleans & IoT
 
Codemotion 2013 Madrid - Modern OOP embedded development with .NET Micro Fram...
Codemotion 2013 Madrid - Modern OOP embedded development with .NET Micro Fram...Codemotion 2013 Madrid - Modern OOP embedded development with .NET Micro Fram...
Codemotion 2013 Madrid - Modern OOP embedded development with .NET Micro Fram...
 
Massively Scaleable .NET Web Services with Project Orleans
Massively Scaleable .NET Web Services with Project OrleansMassively Scaleable .NET Web Services with Project Orleans
Massively Scaleable .NET Web Services with Project Orleans
 
Akka.NET Fundamentals — #ProgNet15
Akka.NET Fundamentals — #ProgNet15Akka.NET Fundamentals — #ProgNet15
Akka.NET Fundamentals — #ProgNet15
 
From Zero to the Actor Model (With Akka.Net) - CodeMash2017 - Tamir Dresher
From Zero to the Actor Model (With Akka.Net) - CodeMash2017 - Tamir DresherFrom Zero to the Actor Model (With Akka.Net) - CodeMash2017 - Tamir Dresher
From Zero to the Actor Model (With Akka.Net) - CodeMash2017 - Tamir Dresher
 
Azure Service Fabric
Azure Service FabricAzure Service Fabric
Azure Service Fabric
 
Azure service fabric: a gentle introduction
Azure service fabric: a gentle introductionAzure service fabric: a gentle introduction
Azure service fabric: a gentle introduction
 
Azure Service Fabric and the Actor Model: when did we forget Object Orientation?
Azure Service Fabric and the Actor Model: when did we forget Object Orientation?Azure Service Fabric and the Actor Model: when did we forget Object Orientation?
Azure Service Fabric and the Actor Model: when did we forget Object Orientation?
 
Azure Service Fabric Overview
Azure Service Fabric OverviewAzure Service Fabric Overview
Azure Service Fabric Overview
 
Architecting Microservices in .Net
Architecting Microservices in .NetArchitecting Microservices in .Net
Architecting Microservices in .Net
 
Yow Conference Dec 2013 Netflix Workshop Slides with Notes
Yow Conference Dec 2013 Netflix Workshop Slides with NotesYow Conference Dec 2013 Netflix Workshop Slides with Notes
Yow Conference Dec 2013 Netflix Workshop Slides with Notes
 
Un actor (model) per amico - Alessandro Melchiori - Codemotion Milan 2016
Un actor (model) per amico - Alessandro Melchiori - Codemotion Milan 2016Un actor (model) per amico - Alessandro Melchiori - Codemotion Milan 2016
Un actor (model) per amico - Alessandro Melchiori - Codemotion Milan 2016
 

Similar a Project Orleans - Actor Model framework

AWS re:Invent 2016: Development Workflow with Docker and Amazon ECS (CON302)
AWS re:Invent 2016: Development Workflow with Docker and Amazon ECS (CON302)AWS re:Invent 2016: Development Workflow with Docker and Amazon ECS (CON302)
AWS re:Invent 2016: Development Workflow with Docker and Amazon ECS (CON302)Amazon Web Services
 
Oracle Fusion Middleware on Exalogic Best Practises
Oracle Fusion Middleware on Exalogic Best PractisesOracle Fusion Middleware on Exalogic Best Practises
Oracle Fusion Middleware on Exalogic Best PractisesMichel Schildmeijer
 
Scalamen and OT
Scalamen and OTScalamen and OT
Scalamen and OTgetch123
 
The Rise of the Container: The Dev/Ops Technology That Accelerates Ops/Dev
The Rise of the Container:  The Dev/Ops Technology That Accelerates Ops/DevThe Rise of the Container:  The Dev/Ops Technology That Accelerates Ops/Dev
The Rise of the Container: The Dev/Ops Technology That Accelerates Ops/DevRobert Starmer
 
Deploying and managing Solr at scale
Deploying and managing Solr at scaleDeploying and managing Solr at scale
Deploying and managing Solr at scaleAnshum Gupta
 
JLove - Replicating production on your laptop using the magic of containers
JLove - Replicating production on your laptop using the magic of containersJLove - Replicating production on your laptop using the magic of containers
JLove - Replicating production on your laptop using the magic of containersGrace Jansen
 
Rethinking the debugger
Rethinking the debuggerRethinking the debugger
Rethinking the debuggerIulian Dragos
 
Reactive summit 2020 microsoft orleans the easy way
Reactive summit 2020   microsoft orleans the easy wayReactive summit 2020   microsoft orleans the easy way
Reactive summit 2020 microsoft orleans the easy wayJohn Azariah
 
JBCN_Testing_With_Containers
JBCN_Testing_With_ContainersJBCN_Testing_With_Containers
JBCN_Testing_With_ContainersGrace Jansen
 
Cloud Architect Alliance #15: Openstack
Cloud Architect Alliance #15: OpenstackCloud Architect Alliance #15: Openstack
Cloud Architect Alliance #15: OpenstackMicrosoft
 
Containerize all the things!
Containerize all the things!Containerize all the things!
Containerize all the things!Mike Melusky
 
Database as a Service (DBaaS) on Kubernetes
Database as a Service (DBaaS) on KubernetesDatabase as a Service (DBaaS) on Kubernetes
Database as a Service (DBaaS) on KubernetesObjectRocket
 
Architecting for Microservices Part 2
Architecting for Microservices Part 2Architecting for Microservices Part 2
Architecting for Microservices Part 2Elana Krasner
 
Building a document e-signing workflow with Azure Durable Functions
Building a document e-signing workflow with Azure Durable FunctionsBuilding a document e-signing workflow with Azure Durable Functions
Building a document e-signing workflow with Azure Durable FunctionsJoonas Westlin
 
Apache Cayenne for WO Devs
Apache Cayenne for WO DevsApache Cayenne for WO Devs
Apache Cayenne for WO DevsWO Community
 
Groovy concurrency
Groovy concurrencyGroovy concurrency
Groovy concurrencyAlex Miller
 
Innovating faster with SBT, Continuous Delivery, and LXC
Innovating faster with SBT, Continuous Delivery, and LXCInnovating faster with SBT, Continuous Delivery, and LXC
Innovating faster with SBT, Continuous Delivery, and LXCkscaldef
 

Similar a Project Orleans - Actor Model framework (20)

AWS re:Invent 2016: Development Workflow with Docker and Amazon ECS (CON302)
AWS re:Invent 2016: Development Workflow with Docker and Amazon ECS (CON302)AWS re:Invent 2016: Development Workflow with Docker and Amazon ECS (CON302)
AWS re:Invent 2016: Development Workflow with Docker and Amazon ECS (CON302)
 
Oracle Fusion Middleware on Exalogic Best Practises
Oracle Fusion Middleware on Exalogic Best PractisesOracle Fusion Middleware on Exalogic Best Practises
Oracle Fusion Middleware on Exalogic Best Practises
 
Scalamen and OT
Scalamen and OTScalamen and OT
Scalamen and OT
 
The Rise of the Container: The Dev/Ops Technology That Accelerates Ops/Dev
The Rise of the Container:  The Dev/Ops Technology That Accelerates Ops/DevThe Rise of the Container:  The Dev/Ops Technology That Accelerates Ops/Dev
The Rise of the Container: The Dev/Ops Technology That Accelerates Ops/Dev
 
Deploying and managing Solr at scale
Deploying and managing Solr at scaleDeploying and managing Solr at scale
Deploying and managing Solr at scale
 
JLove - Replicating production on your laptop using the magic of containers
JLove - Replicating production on your laptop using the magic of containersJLove - Replicating production on your laptop using the magic of containers
JLove - Replicating production on your laptop using the magic of containers
 
Rethinking the debugger
Rethinking the debuggerRethinking the debugger
Rethinking the debugger
 
TechBeats #2
TechBeats #2TechBeats #2
TechBeats #2
 
Reactive summit 2020 microsoft orleans the easy way
Reactive summit 2020   microsoft orleans the easy wayReactive summit 2020   microsoft orleans the easy way
Reactive summit 2020 microsoft orleans the easy way
 
JBCN_Testing_With_Containers
JBCN_Testing_With_ContainersJBCN_Testing_With_Containers
JBCN_Testing_With_Containers
 
Cloud Architect Alliance #15: Openstack
Cloud Architect Alliance #15: OpenstackCloud Architect Alliance #15: Openstack
Cloud Architect Alliance #15: Openstack
 
Containerize all the things!
Containerize all the things!Containerize all the things!
Containerize all the things!
 
Database as a Service (DBaaS) on Kubernetes
Database as a Service (DBaaS) on KubernetesDatabase as a Service (DBaaS) on Kubernetes
Database as a Service (DBaaS) on Kubernetes
 
Architecting for Microservices Part 2
Architecting for Microservices Part 2Architecting for Microservices Part 2
Architecting for Microservices Part 2
 
Apereo OAE - Bootcamp
Apereo OAE - BootcampApereo OAE - Bootcamp
Apereo OAE - Bootcamp
 
Spinnaker Chadev
Spinnaker ChadevSpinnaker Chadev
Spinnaker Chadev
 
Building a document e-signing workflow with Azure Durable Functions
Building a document e-signing workflow with Azure Durable FunctionsBuilding a document e-signing workflow with Azure Durable Functions
Building a document e-signing workflow with Azure Durable Functions
 
Apache Cayenne for WO Devs
Apache Cayenne for WO DevsApache Cayenne for WO Devs
Apache Cayenne for WO Devs
 
Groovy concurrency
Groovy concurrencyGroovy concurrency
Groovy concurrency
 
Innovating faster with SBT, Continuous Delivery, and LXC
Innovating faster with SBT, Continuous Delivery, and LXCInnovating faster with SBT, Continuous Delivery, and LXC
Innovating faster with SBT, Continuous Delivery, and LXC
 

Más de Neil Mackenzie

Windows Azure Virtual Machines
Windows Azure Virtual MachinesWindows Azure Virtual Machines
Windows Azure Virtual MachinesNeil Mackenzie
 
Node.js on Windows Azure
Node.js on Windows AzureNode.js on Windows Azure
Node.js on Windows AzureNeil Mackenzie
 
Windows Azure HDInsight Service
Windows Azure HDInsight ServiceWindows Azure HDInsight Service
Windows Azure HDInsight ServiceNeil Mackenzie
 
Windows Azure SQL Database Federations
Windows Azure SQL Database FederationsWindows Azure SQL Database Federations
Windows Azure SQL Database FederationsNeil Mackenzie
 
Brokered Messaging in Windows Azure
Brokered Messaging in Windows AzureBrokered Messaging in Windows Azure
Brokered Messaging in Windows AzureNeil Mackenzie
 
Windows Azure Diagnostics
Windows Azure DiagnosticsWindows Azure Diagnostics
Windows Azure DiagnosticsNeil Mackenzie
 
Introduction to Windows Azure AppFabric Applications
Introduction to Windows Azure AppFabric ApplicationsIntroduction to Windows Azure AppFabric Applications
Introduction to Windows Azure AppFabric ApplicationsNeil Mackenzie
 

Más de Neil Mackenzie (8)

Azure DocumentDB
Azure DocumentDBAzure DocumentDB
Azure DocumentDB
 
Windows Azure Virtual Machines
Windows Azure Virtual MachinesWindows Azure Virtual Machines
Windows Azure Virtual Machines
 
Node.js on Windows Azure
Node.js on Windows AzureNode.js on Windows Azure
Node.js on Windows Azure
 
Windows Azure HDInsight Service
Windows Azure HDInsight ServiceWindows Azure HDInsight Service
Windows Azure HDInsight Service
 
Windows Azure SQL Database Federations
Windows Azure SQL Database FederationsWindows Azure SQL Database Federations
Windows Azure SQL Database Federations
 
Brokered Messaging in Windows Azure
Brokered Messaging in Windows AzureBrokered Messaging in Windows Azure
Brokered Messaging in Windows Azure
 
Windows Azure Diagnostics
Windows Azure DiagnosticsWindows Azure Diagnostics
Windows Azure Diagnostics
 
Introduction to Windows Azure AppFabric Applications
Introduction to Windows Azure AppFabric ApplicationsIntroduction to Windows Azure AppFabric Applications
Introduction to Windows Azure AppFabric Applications
 

Último

Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLionel Briand
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfYashikaSharma391629
 
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...Akihiro Suda
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxRTS corp
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 

Último (20)

Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and Repair
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
 
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 

Project Orleans - Actor Model framework

  • 2. Who Am I • Neil Mackenzie • Azure Lead –Satory Global • neil.mackenzie@satory.com • @mknz • http://convective.wordpress.com • Author: Microsoft Windows Azure Development Cookbook • Microsoft MVP forWindows Azure
  • 3. Agenda • Actor Model • Project “Orleans” • Developing with Orleans • Demonstration • Q&A
  • 5. Actor Model • Core concepts: • Actor – stateful entity • Message – communication token passed between two Actors • When an Actor receives a message it can concurrently: • Send messages to other actors • Create newActors • Change its internal state • No guaranteed order for delivery of concurrent messages • Created by Hewitt, Bishop and Steiger in the 1970s • Many implementations including Erlang and Akka
  • 7. Cloud Compute Problems • Cloud compute uses commodity hardware • => need to design for failure • => need to scale horizontally • Distributed computing is a hard problem • Need new paradigms to simplify things • SQL -> NoSQL • NoSQL stores hide data sharding from developers • Can we use an Actor Model to simplify distributed compute?
  • 8. Project “Orleans” • .NET Implementation of an Actor Model • Goals: • Provide easy-to-use distributed compute model for developers • Provide deployment model scaling from one node to a high-scaleAzure cloud service • Developed by Microsoft Research • Currently in public preview • Used in production by 323 Industries for Halo presence and game statistics
  • 9. Grains and Silos • Orleans has the following concepts: • Silo – deployment host for grains • One or more silos per compute node • Grain (Actor) • Eternal existence – but activated into a silo when invoked • Automatically garbage collected when not used (and memory pressure on silo) • Different activations of the same grain may be into different silos • Messages implemented as proxied method invocation • Exist in stateless and stateful versions • Always accessed through a grain reference
  • 10. Deployment Models • Orleans provides the following deployment models: • In-process – development/debugging inVisual Studio • Single host – development/debugging inVisual Studio • Multiple hosts – DIY production deployment • Azure Cloud Service – high-scale production deployments
  • 11. Use Cases • Orleans good for: • Systems with large numbers of simple entities (social, devices) • Loosely connected systems • Intelligent caching • Orleans not good for: • Strongly-coupled systems • Compute-intensive tasks
  • 13. Development Model • Design grain interfaces • Implement grain interfaces • Implement deployment model
  • 14. Grain Interface • A grain is defined by its grain interface which specifies the messages it can receive • Grain interface: • Is derived from IGrain • Exposes messages as public methods returningTask orTask<T> • Supports method parameters • Does not support property set methods (avoid properties) • Visual Studio tooling creates client proxies from the grain interface
  • 15. Grain Interface - Example public interface IDeviceGrain : Orleans.IGrain { Task<String> GetName(); Task SetName(String deviceName); Task<Boolean> SetStatus(DeviceStatus deviceStatus); } public interface IControllerGrain : Orleans.IGrain { Task AddDevice(IDeviceGrain device); }
  • 16. Grain Implementation • A grain implementation class: • Is derived from GrainBase or GrainBase<TGrainState> • Implements the grain interface • Base class methods: • ActivateAsync • DeactivateAsync • GetLogger
  • 17. Grain Implementation - Example public class DeviceGrain : Orleans.GrainBase, IDeviceGrain { private String name; public Task<String> GetName() { return Task.FromResult(name); } public Task SetName(String deviceName) { name = deviceName; return TaskDone.Done; } }
  • 18. Referencing Grains • Orleans tooling creates proxy classes and a factory class for each grain interface • Use the factory class – GrainInterfaceNameFactory – to access a grain reference var grain = HelloGrainFactory.GetGrain(0); String response = grain.SayHello("Walking to New Orleans").Result; • Orleans runtime provides a transparent distributed locator service • A grain may be activated on any silo • Each silo has a grain-location cache
  • 19. Concurrency Model for Grains • Orleans uses a cooperative multithreading scheduler • Scheduler schedules only one message at a time for a grain • A message is processed completely before another message is scheduled • A message is processed as a sequence of one or more turns (continuations) async Task<Boolean> DoThings() { await serviceGrain.DoSomething; Boolean success = await serviceGrain.DoSomethingElse(); return success; } Turn 1 Turn 2 Turn 3
  • 20. Grain Persistence • Orleans provides automated state persistence • Do the following: • Define aTGrainState class to hold the persisted state • Use GrainBase<TGrainState> as the base class for the grain implementation • State property automatically hydrated when grain is activated – ReadStateAsync() • State must be persisted programmatically –WriteStateAsync() • Storage provider named in class definition, configured in Orleans configuration • Storage providers: in-memory (development), AzureTables
  • 21. Advanced Grain Features • Stateless worker grain • Can be scaled out automatically by Orleans runtime • Always activated in-silo • Reentrant grain • Can have interleaved message turns (i.e., they can be scheduled out of turn) • Remindable grain • Can receive scheduled reminders from Orleans runtime • Observer grain • Can observe events happening on other grains
  • 22. UsingTask andTask<T> • CompletedTask with void return TaskDone.Done; • CompletedTask<T> with a specific value: Task.FromResult(value); • Fan-outTasks List<Task> promises = new List<Task>(); for (Int32 i = 0; i < 10; i++) { var someGrain = SomeGrainFactory.GetGrain(i); promises.Add(someGrain.DoSomething()); } awaitTask.WhenAll(promises);
  • 23. Visual StudioTooling • Project Orleans provides 3Visual Studio project types • Orleans Dev/Test Host – creates a console app with an Orleans silo for development purposes • Orleans Grain Class Collection – contains the grain class implementations • Orleans Grain Interface Collection – contains the grain interfaces
  • 24. Downloads and Documentation • Download Orleans: http://aka.ms/orleans • Samples & Documentation https://orleans.codeplex.com/ • Microsoft Research page for Project Orleans: http://research.microsoft.com/en-us/projects/orleans/default.aspx • Channel 9 discussion on the Actor Model with Hewitt, Meijer and Szyperski bit.ly/1nOAtW9
  • 25. Summary • Project “Orleans” provides: • A .NET implementation of an Actor Model • A highly-scalable deployment model • Development support inVisual Studio • Deployment support for MicrosoftAzure • With the goal of simplifying the task of creating distributed systems for developers not skilled in the art