@ITCAMPRO #ITCAMP16Community Conference for IT Professionals
Azure Microservices in Practice
Radu Vunvulea
Solution Architect, iQuest Technologies
Microsoft Azure MVP
@RaduVunvulea
@ITCAMPRO #ITCAMP16Community Conference for IT Professionals
Many thanks to our sponsors & partners!
GOLD
SILVER
PARTNERS
PLATINUM
POWERED BY
@ITCAMPRO #ITCAMP16Community Conference for IT Professionals
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 #ITCAMP16Community Conference for IT Professionals
Software architecture style in which complex
applications are composed of small, independent
processes communicating with each other using
language-agnostic APIs
Microservices
@ITCAMPRO #ITCAMP16Community Conference for IT Professionals
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 #ITCAMP16Community Conference for IT Professionals
Evolution
Maintenance
is hard
Adding new
features is slow
Changes are
expensive
Technology
becomes the
obstacle rather
than enabler
App Modernization
@ITCAMPRO #ITCAMP16Community Conference for IT Professionals
• Service Fabric
• Azure Service Fabric
Why we have two different things?
?
@ITCAMPRO #ITCAMP16Community Conference for IT Professionals
Service Fabric | Azure Service Fabric
Microservices
Cloud
AzureAzure Service
Fabric
AWS Service Fabric
On-premises Service Fabric
@ITCAMPRO #ITCAMP16Community Conference for IT Professionals
Overview
Service Fabric
Azure
Windows Server
Linux
On-premises
Windows Server
Linux
Hosted clouds
Windows Server
Linux
Microservice
Microservice
Microservice
Microservice
Microservice
@ITCAMPRO #ITCAMP16Community Conference for IT Professionals
Rel
iab
le S
ervi
ce • Classical service
• Reliable
• Available
• Scalable
Act
or • State
• Turn-base access
• Single thread
• Reentrancy
@ITCAMPRO #ITCAMP16Community Conference for IT Professionals
Stat
eles
s •No state persisted between calls
Stat
efu
l
•‘A’ state is persisted between calls
@ITCAMPRO #ITCAMP16Community Conference for IT Professionals
What can we run in Service Fabric?
Service Fabric
Web Sites
Application
Custom logic
@ITCAMPRO #ITCAMP16Community Conference for IT Professionals
• 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 #ITCAMP16Community Conference for IT Professionals
Reliable
Services Actors
Stateful
Stateless
State
StateState
First call…
Reliable Collections
@ITCAMPRO #ITCAMP16Community Conference for IT Professionals
Reliable
Services Actors
Stateful
Stateless
State
State
… after the call is executed
State
@ITCAMPRO #ITCAMP16Community Conference for IT Professionals
Reliable
Services Actors
Stateful
Stateless
State
State
… when GC is triggered
State
@ITCAMPRO #ITCAMP16Community Conference for IT Professionals
• 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 #ITCAMP16Community Conference for IT Professionals
• Low latency
• High-throughput
• Transactional
• Can be used only
with Reliable Services
Reliable Collections
Dictionary
and
Queue
Replicated
Persisted
In-memory <<servic
e instance
>>
Asynchronous
Transactional
@ITCAMPRO #ITCAMP16Community Conference for IT Professionals
• 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 #ITCAMP16Community Conference for IT Professionals
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 #ITCAMP16Community Conference for IT Professionals
• Context: Multiple calls to the same Reliable Actor
Concurrency
@ITCAMPRO #ITCAMP16Community Conference for IT Professionals
Execution flow:
• Reminder Trigger
• SetPrice
• SetStock
Concurrency
@ITCAMPRO #ITCAMP16Community Conference for IT Professionals
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 #ITCAMP16Community Conference for IT Professionals
• On Actor:
– IActorEvents
– Trigger our custom events
• On source:
– Implement callback (Event Handler)
– Subscribe our Event Handler
Events
@ITCAMPRO #ITCAMP16Community Conference for IT Professionals
Where we can control them
Application
• Partitioning
• Replication
Cluster
• Fault Domain
• Upgrade Domain
• Naming Service
• Resource Balancer
• Failover Manager
@ITCAMPRO #ITCAMP16Community Conference for IT Professionals
{“name” : “Radu Vunvulea,“blog” : “vunvulearadu.blogspot.com”,
“email” : ”[email protected]”,“socialMedia” :
{“twitter” : “@RaduVunvulea”,“fb” : “radu.vunvulea”
}
}
@ITCAMPRO #ITCAMP16Community Conference for IT Professionals
Today: Enjoy ITCamp Day 1Tomorow: Enjoy ITCamp Day 2
Saturday: Take a look on https://github.com/Azure/servicefabric-samples
@ITCAMPRO #ITCAMP16Community Conference for IT Professionals
{“name” : “Radu Vunvulea,“blog” : “vunvulearadu.blogspot.com”,
“email” : ”[email protected]”,“socialMedia” :
{“twitter” : “@RaduVunvulea”,“fb” : “radu.vunvulea”
}
}