SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Was ist angesagt?

DevOps Interview Questions Part - 1 | Devops Interview Questions And Answers ...
DevOps Interview Questions Part - 1 | Devops Interview Questions And Answers ...DevOps Interview Questions Part - 1 | Devops Interview Questions And Answers ...
DevOps Interview Questions Part - 1 | Devops Interview Questions And Answers ...Simplilearn
 
Microservice With Spring Boot and Spring Cloud
Microservice With Spring Boot and Spring CloudMicroservice With Spring Boot and Spring Cloud
Microservice With Spring Boot and Spring CloudEberhard Wolff
 
Introduction to GraalVM
Introduction to GraalVMIntroduction to GraalVM
Introduction to GraalVMSHASHI KUMAR
 
Kubernetes and Prometheus
Kubernetes and PrometheusKubernetes and Prometheus
Kubernetes and PrometheusWeaveworks
 
Discover Quarkus and GraalVM
Discover Quarkus and GraalVMDiscover Quarkus and GraalVM
Discover Quarkus and GraalVMRomain Schlick
 
Microservices, Apache Kafka, Node, Dapr and more - Part Two (Fontys Hogeschoo...
Microservices, Apache Kafka, Node, Dapr and more - Part Two (Fontys Hogeschoo...Microservices, Apache Kafka, Node, Dapr and more - Part Two (Fontys Hogeschoo...
Microservices, Apache Kafka, Node, Dapr and more - Part Two (Fontys Hogeschoo...Lucas Jellema
 
Node.js Меньше сложности, больше надежности Holy.js 2021
Node.js Меньше сложности, больше надежности Holy.js 2021Node.js Меньше сложности, больше надежности Holy.js 2021
Node.js Меньше сложности, больше надежности Holy.js 2021Timur Shemsedinov
 
Solrcloud Leader Election
Solrcloud Leader ElectionSolrcloud Leader Election
Solrcloud Leader Electionravikgiitk
 
Choice router mule
Choice router   muleChoice router   mule
Choice router muleSindhu VL
 
Monitoring kubernetes with prometheus-operator
Monitoring kubernetes with prometheus-operatorMonitoring kubernetes with prometheus-operator
Monitoring kubernetes with prometheus-operatorLili Cosic
 
Introduction to Docker Compose
Introduction to Docker ComposeIntroduction to Docker Compose
Introduction to Docker ComposeAjeet Singh Raina
 
Graal and Truffle: One VM to Rule Them All
Graal and Truffle: One VM to Rule Them AllGraal and Truffle: One VM to Rule Them All
Graal and Truffle: One VM to Rule Them AllThomas Wuerthinger
 
How OpenShift SDN helps to automate
How OpenShift SDN helps to automateHow OpenShift SDN helps to automate
How OpenShift SDN helps to automateIlkka Tengvall
 
DevOps Introduction
DevOps IntroductionDevOps Introduction
DevOps IntroductionRobert Sell
 

Was ist angesagt? (20)

DevOps Interview Questions Part - 1 | Devops Interview Questions And Answers ...
DevOps Interview Questions Part - 1 | Devops Interview Questions And Answers ...DevOps Interview Questions Part - 1 | Devops Interview Questions And Answers ...
DevOps Interview Questions Part - 1 | Devops Interview Questions And Answers ...
 
Microservice With Spring Boot and Spring Cloud
Microservice With Spring Boot and Spring CloudMicroservice With Spring Boot and Spring Cloud
Microservice With Spring Boot and Spring Cloud
 
Introduction to GraalVM
Introduction to GraalVMIntroduction to GraalVM
Introduction to GraalVM
 
Terraform
TerraformTerraform
Terraform
 
Kubernetes and Prometheus
Kubernetes and PrometheusKubernetes and Prometheus
Kubernetes and Prometheus
 
Discover Quarkus and GraalVM
Discover Quarkus and GraalVMDiscover Quarkus and GraalVM
Discover Quarkus and GraalVM
 
Microservices, Apache Kafka, Node, Dapr and more - Part Two (Fontys Hogeschoo...
Microservices, Apache Kafka, Node, Dapr and more - Part Two (Fontys Hogeschoo...Microservices, Apache Kafka, Node, Dapr and more - Part Two (Fontys Hogeschoo...
Microservices, Apache Kafka, Node, Dapr and more - Part Two (Fontys Hogeschoo...
 
Quarkus k8s
Quarkus   k8sQuarkus   k8s
Quarkus k8s
 
Node.js Меньше сложности, больше надежности Holy.js 2021
Node.js Меньше сложности, больше надежности Holy.js 2021Node.js Меньше сложности, больше надежности Holy.js 2021
Node.js Меньше сложности, больше надежности Holy.js 2021
 
Solrcloud Leader Election
Solrcloud Leader ElectionSolrcloud Leader Election
Solrcloud Leader Election
 
Choice router mule
Choice router   muleChoice router   mule
Choice router mule
 
GraalVM
GraalVMGraalVM
GraalVM
 
Monitoring kubernetes with prometheus-operator
Monitoring kubernetes with prometheus-operatorMonitoring kubernetes with prometheus-operator
Monitoring kubernetes with prometheus-operator
 
Introduction to Docker Compose
Introduction to Docker ComposeIntroduction to Docker Compose
Introduction to Docker Compose
 
Graal and Truffle: One VM to Rule Them All
Graal and Truffle: One VM to Rule Them AllGraal and Truffle: One VM to Rule Them All
Graal and Truffle: One VM to Rule Them All
 
intro to DevOps
intro to DevOpsintro to DevOps
intro to DevOps
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
 
How OpenShift SDN helps to automate
How OpenShift SDN helps to automateHow OpenShift SDN helps to automate
How OpenShift SDN helps to automate
 
Terraform
TerraformTerraform
Terraform
 
DevOps Introduction
DevOps IntroductionDevOps Introduction
DevOps Introduction
 

Andere mochten auch

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
 
Akka.net versus microsoft orleans
Akka.net versus microsoft orleansAkka.net versus microsoft orleans
Akka.net versus microsoft orleansBill Tulloch
 
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
 

Andere mochten auch (18)

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
 
Akka.net versus microsoft orleans
Akka.net versus microsoft orleansAkka.net versus microsoft orleans
Akka.net versus microsoft orleans
 
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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Mehr von 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
 

Mehr von 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
 

Kürzlich hochgeladen

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
 
%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 Bahrainmasabamasaba
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2
 
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-learnAmarnathKambale
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...masabamasaba
 
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...Jittipong Loespradit
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...masabamasaba
 
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...WSO2
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in sowetomasabamasaba
 
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...WSO2
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 

Kürzlich hochgeladen (20)

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...
 
%+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 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
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
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
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
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...
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
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...
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
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...
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
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...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 

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