Today's Internet-scale services are built using microservices. Service Fabric is a next-generation middleware platform used for building enterprise-class, Tier-1 services. This microservices platform allows us to build scalable, highly available, reliable, and easy to manage solutions. It addresses the significant challenges in developing and managing stateful services. The Reliable Actors API is one of two high-level frameworks provided by Service Fabric, and it is based on the Actor pattern. This API gives us an asynchronous, single-threaded programming model that simplifies our code while still providing the advantages of scalability and reliability guarantees offered by Service Fabric.In this talk, we will run through the what, when and how of various aspects of Service Fabric and Reliable Actors. If time permits, we'll delve into advantages, strategies, patterns and practices that can help you deliver value without reducing your agility.
%in Soweto+277-882-255-28 abortion pills for sale in soweto
Devteach 2016: A practical overview of actors in service fabric
1. A PRACTICAL OVERVIEW
OF ACTORS IN SERVICE
FABRIC
Service Fabric enables you
to build and operate
always-on, hyper-scale
services using the same
technology powering
Microsoft’s Cloud.
3. TODAY WE’RE GOING TO LEARN
ABOUT
Microsoft Azure – a public cloud
Microservices – an architectural pattern
Service Fabric – a hyper-scale microservice
platform
Reliable Actors – a programming model
7/9/2016 3
4. LIVE Q&A
Browse to http://bit.ly/dt-
qna
API : http://liveqna.alexandrebrisebois.com/api
Demo Source: http://bit.ly/git-qna-demo
7/9/2016 4
6. WHAT DO ALL OF THESE HAVE IN
COMMON?
7/9/2016 6
7. • Single monolithic
• database
MICROSERVICES
7/9/2016 7
• Graph of interconnected microservices
• State typically scoped to the microservice
• Variety of technologies used
• Remote Storage for cold data
stateless services
with
separate stores
stateful
services
stateless
presentation
services
Tiers of specific
technologies
8. WHY MICROSERVICES?
Allows us to get closer to the business
Provides the business with agility
Small focussed teams
Reduced time-to-customer
7/9/2016 8
Design/
Develop
Operate
Upgrade
9. SERVICE FABRIC
Service Fabric enables you
to build and operate
always-on, hyper-scale
services using the same
technology powering
Microsoft’s Cloud.
7/9/2016 9
10. SERVICE FABRIC
7/9/2016 10
• 1 instance per VM
• Uneven utilization
• Low density
• Slow deployment & upgrade (bound
to VM)
• Slow scaling and failure recovery
• Limited fault tolerance
• Many microservices per VM
• Even Utilization (by default,
customizable)
• High density (customizable)
• Fast deployment & upgrade
• Fast scaling of independent
microservices
• Tunable fast fault tolerance
Conventional Services
Service Fabric
12. SERVICE FABRIC
7/9/2016 12
Service discovery Reliability,
Availability,
Replication, Service
Orchestration
Application lifecycle
Fault Inject,
Test in production
Federates a set of nodes to form a consistent scalable fabric
Secure point-to-point communication
Deployment,
Upgrade and
Monitoring
13. WHY SERVICE FABRIC?
Scalability – support variable demand
High Availability – always on
Reliability – predictable outcomes
Resiliency – self healing (adapts to
adversity)
Durability – guarantees data
persistence
7/9/2016 13
14. SERVICE FABRIC – PROGRAMMING
MODELS
7/9/2016 14
Guest Executables
• Bring any exe
• Any language
• Any programming model
• Packaged as Application
• Gets versioning,
upgrade, monitoring,
health, etc.
Reliable Services
• Stateless & stateful
services
• Concurrent, granular
state changes
• Use of the Reliable
Collections
• Transactions across
collections
• Full platform integration
Reliable Actors
• Stateless & Stateful actor
objects
• Simplified programming
model
• Single Threaded model
• Great for scaled out
compute and state
15. SERVICE FABRIC – RELIABLE
ACTORS
Independent units of compute and
state
Large number of processes executing
in parallel
Communicates using asynchronous
messaging
Single threaded execution
Automatically created and dehydrated7/9/2016 15
16. SERVICE FABRIC – CATTLE NOT
PETS!
7/9/2016 16
Node 5Node 4Node 3 Node 6Node 2Node 1
P2
S
S
S
P4
S
P1
S
P3S
S
S
Service partitions are striped across
machines in the cluster.
Replicas automatically scale out & in
on cluster changes
17. LIVE QNA MICROSERVICE
ARCHITECTURE
7/9/2016 17
Session
Transcript
Transcript View4.2) Update
4.1) Register
4.3) Reminder
Participant
Participant
Participant
Has
Questions
Has
Session ListHas
Participant
Question
API
1) Register2) List
3) Join
5) Create
6) Add
Question
4) Read
4.4) Reads
Uses
Transcript View
Transcript View
No State
Persistence
Volatile State
Persistence
Persisted to Disk
20. SERVICE FABRIC – ACTOR – STATE
7/9/2016 20
Reads are completed
at the primary
Writes are replicated to
the write quorum of
secondaries
P
S
S
S
S
WriteWrite
WriteWrite
AckAck Ack
Ack
Read
Value
Write
Ack
40. SERVICE FABRIC – RELIABLE
ACTORS
Do not use Reliable Actors
when
You need distributed
transactions
You want to control
concurrency, partitioning
and communication
If you need reliable
collections
7/9/2016 40
41. SERVICE FABRIC – RELIABLE
ACTOR FAILOVER
7/9/2016 41
Types of reconfiguration
Primary failover
Removing a failed secondary
Adding recovered replica
Building a new secondary
Replica States
None
Idle Secondary
Active Secondary
Primary
P
S
S
S
S
S
Must be safe in the
presence of cascading
failures
B P
X
Failed
X
Failed
42. MONITORING YOUR SERVICES
7/9/2016 42
Performance and stress response
•Rich built-in metrics for Actors and Services programming
models
•Easy to add custom application performance metrics
Health status monitoring
•Built-in health status for cluster and services
•Flexible and extensible health store for custom app health
reporting
•Allows continuous monitoring for real-time alerting on
problems in production
43. DIAGNOSTICS AND
TROUBLESHOOTING
7/9/2016 43
•Repair suggestions. Examples: Slow RunAsync cancellations,
RunAsync failures
•All important events logged. Examples: App creation, deploy
and upgrade records. All Actor method calls.
Detailed
System
Optics
•ETW == Fast Industry Standard Logging Technology
•Works across environments. Same tracing code runs on
devbox and also on production clusters on Azure.
•Easy to add and system appends all the needed metadata
such as node, app, service, and partition.
Custom
Applicatio
n Tracing
•Visual Studio Diagnostics Events Viewer
•Windows Event Viewer
•Windows Azure Diagnostics + Operational Insights
•Easy to plug in your preferred tools: Kibana, Elasticsearch
and more
Choice of
Tools
44. SERVICE FABRIC – ACTOR –
SCENARIOS
Highly available services
Scalable services
Computation on nonstatic data
Source: https://azure.microsoft.com/en-
us/documentation/articles/service-fabric-application-scenarios/
7/9/2016 44
45. SERVICE FABRIC – ACTOR –
SCENARIOS
Session-based interactive
applications
Distributed graph processing
Data analytics and workflows
Source: https://azure.microsoft.com/en-
us/documentation/articles/service-fabric-application-scenarios/
7/9/2016 45