@ITCAMPRO
Azure Microservices in Practice
Solution Architect , Microsoft Azure MVP
iQuest Technologies
@Radu Vunvulea
@ITCAMPRO
@ITCAMPRO
RADU VUNVULEA MCTS MCP BANK HOME AUTOMATION
MVP ENTERPRISE
AUTOMOTIVE PHARMA
LEAN AND AGILE E-COMMERCE
WEB iQuest
AZURE JAVASCRIPT VUNVULEARADU.BLOGSPOT.COM
MOBILE DOTNET @RaduVunvulea
WCF WPF ENTHUSIASTIC
@ITCAMPRO
Scope
@ITCAMPRO
WHAT ARE MICROSERVICES?
@ITCAMPRO
@ITCAMPRO
Software architecture style in which complex
applications are composed of small, independent
processes communicating with each other using
language-agnostic APIs
Microservices
@ITCAMPRO
WHY WE SHOULD USE
MICROSERVICES?
@ITCAMPRO
If we need a system that has components that are…
High decoupled
Small
Easy to replace
Focus on doing a small task
Independent deployment units
Symmetrical architecture
@ITCAMPRO
Evolution
Maintenance
is hard
Adding new
features is slow
Changes are
expensive
Technology
becomes the
obstacle rather
than enabler
App Modernization
@ITCAMPRO
(AZURE) SERVICE FABRIC
@ITCAMPRO
• Service Fabric
• Azure Service Fabric
Why we have two different things?
?
@ITCAMPRO
Service Fabric | Azure Service Fabric
Microservices
Cloud
Azure
Azure Service
Fabric
AWS Service Fabric
On-premises Service Fabric
@ITCAMPRO
Overview
Service Fabric
Azure
Windows
Server
Linux
On-premises
Windows
Server
Linux
Hosted clouds
Windows
Server
Linux
Micros
ervice
Micros
ervice
Micros
ervice
Micros
ervice
Micros
ervice
@ITCAMPRO
SERVICE TYPE
@ITCAMPRO
ReliableService •Classical
service
•Reliable
•Available
•Scalable
Actor
•State
•Turn-base
access
•Single
thread
•Reentrancy
@ITCAMPRO
Stateless •No state
persisted
between
calls
Stateful
•‘A’ state
is
persisted
between
calls
@ITCAMPRO
@ITCAMPRO
What can we run in Service Fabric?
Service Fabric
Web Sites
Application
Custom
logic
@ITCAMPRO
• Multiple programing languages (C# & Java)
• Support different commucation mechanisms:
–HTTP(s)
–WCF
–TCP
–UDP
• Any protocol and communication stack is supported
• Capable to run a guest executable
How
@ITCAMPRO
@ITCAMPRO
SERVICE LIFECYCLE
@ITCAMPRO
Reliable
Services Actors
Stateful
Stateless
State
StateState
First call…
Reliable
Collections
@ITCAMPRO
Reliable
Services Actors
Stateful
Stateless
State
State
… after the call is executed
State
@ITCAMPRO
Reliable
Services Actors
Stateful
Stateless
State
State
… when GC is triggered
State
@ITCAMPRO
@ITCAMPRO
One UI for all environments
@ITCAMPRO
DEBUGGING AND TRACING
@ITCAMPRO
• Local debugging like any other .NET application
• Attach debugger to any Service Fabric Application
(on-premises or cloud)
• Diagnostic Events persistent in Cluster
• Real time Streaming Traces (Diagnostics Events)
Debugging and tracing
@ITCAMPRO
@ITCAMPRO
• Low latency
• High-throughput
• Transactional
• Can be used only
with Reliable Services
Reliable Collections
Dictionary
and
Queue
Replicat
ed
Persiste
d
In-
memory
<<servic
e
instance
>>
Asynchr
onous
Transacti
onal
@ITCAMPRO
Where collection are stored
@ITCAMPRO
• Different instances of the same
service can access the same
Reliable Collection
• Instances from different
services cannot access the
same collection
Reliable Collection – visibility
@ITCAMPRO
@ITCAMPRO
TIMERS AND REMINDERS
@ITCAMPRO
Timers and Reminders
Timers
Similar with .NET
Called at a specific
time interval
Reminders
Timer with
persistence
Trigered in all
circumstances
(deactivations and
failovers)
Concurrency
Turn based
concurrency
Stateful Actos only
@ITCAMPRO
• Context: Multiple calls to the same Reliable Actor
Concurrency
@ITCAMPRO
Concurrency
@ITCAMPRO
Concurrency
@ITCAMPRO
Execution flow:
• Reminder Trigger
• SetPrice
• SetStock
Concurrency
@ITCAMPRO
@ITCAMPRO
Events
• Send events and
notifications from
services to caller
• Allows us be notified at
different steps on when
an exception occurs
• Can be used only for
actor-client
communication
@ITCAMPRO
• On Actor:
– IActorEvents
– Trigger our custom events
• On source:
– Implement callback (Event Handler)
– Subscribe our Event Handler
Events
@ITCAMPRO
@ITCAMPRO
TRACING AND DEBUGING
@ITCAMPRO
BEHIND THE SCENE
@ITCAMPRO
Partition and Replication
@ITCAMPRO
Fault Domains and Upgrade Domains
@ITCAMPRO
Where we can control them
Application
• Partitioning
• Replication
Cluster
• Fault Domain
• Upgrade Domain
• Naming Service
• Resource
Balancer
• Failover Manager
@ITCAMPRO
@ITCAMPRO
Question
Answers
@ITCAMPRO
{
“name” : “Radu Vunvulea,
“blog” : “vunvulearadu.blogspot.com”,
“email” : ”vunvulear@outlook.com”,
“socialMedia” :
{
“twitter” : “@RaduVunvulea”,
“fb” : “radu.vunvulea”
}
}

Azure Microservices in Practice - Radu Vunvulea ITCamp Community Timisoara 07/12/2016