SlideShare a Scribd company logo
1 of 32
http://DOTNETMALAGA.es // 30th Mar 2016
• What is a microservice
• Good things about microservices
you should be using now
• DIY in .NET
• Containers, VMs, self-hosted, …
• Demo
• “Microsoft Microservices”
• Azure Service Fabric
• Demo
About Sequel
We are leading software providers for the insurance market
Heavily investing on R&D (& new offices in Málaga )
55 people in Málaga, 6 scrum teams
140 people in total
Currently hiring in Málaga – @ndsrf for more info
Graphic designers | .NET Architects / AngularJs devs | Testers / Automation www.sequel.com
Disclaimer
This is not a “this is what I did” presentation, but
rather a “this is what I have seen” and open for
discussion presentation.
O:-)
What is a microservice?
Let’s build our definition! link
Our definition of microservices (Created live in
the actual presentation - brainstorming session
30/03/2016)
Principles of microservices
• Autonomous service (decentralise!)
• Code + State (high cohesion)
• Contracts between them (hide
implementation)
• Versioned
• Consistent and available between
failures
• Culture of automation
• Focus on delivery (products not
projects)
• Team collaboration
• Team size “pizza size”
• Lightweight components
• Accesible by any device
• Language & platform transparency
• Smart endpoints / dump pipes
• Unit of deployment
• Implementation of a bound context
(DDD)
• Separated code repositories
• Inmutable infrastructure
• HTTP (REST – HATEOAS) vs others
• Self-healing
• Automatic upgrades / rollback
Good technical practices for microservices
• Discovery, Configuration & Versioning
• Security
• Resilience & autohealing
• Monitoring & Logging
• Composition
• Testing
• Inter service communication
• Data consistency
• Service orchestration
Y
A
X B
Service Discovery + Configuration
• Problem: Hard-code service locations in 100s of microservices?
• Problem: The service discovery needs to be redundant and reliable (this is hard!)
• Discovery services rely on distributed DBs  can be used to store configuration
• Nice to have: Discovery + health check + auto healing
• HATEOAS
Options in .NET
• Microphone (.NET) + Consul (in Production: master on Linux only!)
Service Discovery (Microphone example)
Versioning
• Problem: Not all teams should deliver at the same pace
• Try to avoid dependencies  less management & more happiness 
Concepts
• You still need to deal with old clients of your service relying on previous version
• Do not only distribute a client (distributed monolith!), just rely on contracts (& provide
example implementations if you wish)
• Semantic Romantic Versioning + Minimum required version concept
• URL
• Headers (Accept header)
• API generation / documentation  Swagger, apiary, …
Security (1/2)
• Problem: much greater attack surface
• Problem: Secure all calls  slow / hassle?
Concepts
• Protect just Internet boundary? What happens in a intruder gets in the network?
• Secure communication channels? Services trust each other?
• Tamper proofing, replay protection, principal authorization, weakest link, least privilege
• API gateway pattern (not just for security but…)
• Rate limiting for external APIs (X-Rate-Limit-… headers (Twitter))
Security checklist http://www.grahamlea.com/2015/07/microservices-security-questions/
Security (2/2)
• Authentication, Authorisation, Delegation
• Problem: Once the principal is authenticated, it should only have access to certain
resources, and we should do that in a scalable way
Concepts
• Authorisation server (provides tokens and jwt signed with its PK)
• Resource server (each of the services)
• Delegation  OAuth 2 protocol
• OpenID protocol (JWT – Json Web Token, a signed json doc) to achieve statelessness
• Authentication  Leave that to the OAuth 2 server (token)
• Authorisation  All microservices should consume JWTs (identity)
Resilience
• Problem: If one service is not available, everything crashes
Techniques: retry N times, retry forever, retry and wait, circuit breaker, post execution steps
Circuit breaker: custom fallback, fail silent, fail fast
http://techblog.netflix.com/2011/12/making-netflix-api-more-resilient.html
Autohealing (Consul)
Options in .NET
• Polly
• Problem: You don´t want to have to check N log files, just 1
• Logging framework vs Logging service
• Correlate events
• Log deployments / Orchestration (more on this later)
Options in .NET
• SeriLog + ELK
• App Insights (Azure)
• Runscope for API monitoring (cloud)
• Raygun for error logging (cloud)
• Newrelic (cloud)
Composition
• Problem: Once we have all the small bits and pieces, how do we integrate them to
provide higher level functionality
Options
• Monolithic UI to integrate everything
• API Gateway
• AJAX/Javascript
• IFrames 
• Server Side Includes / Edge Side Includes
• Specific services like Netflix Zuul (Java) or Compoxure (NodeJS)
• Avoid at all costs committing to features that require more than one team to be done in
the same place at the same time in order to make an integrated delivery
• Other teams to do pull requests with tests
(you might not know how your service is really used!)
Options in .NET
• Unit testing
• Contract testing PACT.NET
• Mock services
Inter-service communication
• Problem: As we increase the number of services, the number of calls between them also
increases
• Tools/applications: RestSharp, Akka.Net, RabbitMQ (.NET library available), NATS (.NET lib
available), HAProxy (load balance)
• Message formats: XML (text), JSON (text), Google Protobuf (binary)
One to One One to many
Synchronous Request / response -
Asynchronous Notification
Request / async response
Publish / Subscribe
Publish / Async responses
Y
A
X B
Data consistency
• Problem: Each microservice is made of code + state
• Problem: Distributed transactions are really hard
Polyglot persistence
Options
• Single database
• Another microservice to deal with domain data access
• Event sourcing + pub/sub
• Two phase commit
• Replication
• Eventual consistency
• Business rules
Orchestration
• Problem: How do we deal with 100s of services? Start, stop, move, upgrade…
• A nice option: Containers
• Linux containers (Mono / ASP.NET 5)
• Windows containers
Options for Windows (@ 30th March 2016)
• Docker Compose + Swarm
• Rancher
• Kubernetes
• Mesos + Marathon
• Azure Container Service (Marathon)
• Azure service fabric
• Akka.NET
Orchestration
Rancher (Linux containers) Marathon (Linux containers)
Example – Microcafe app
CQRS, microservices
CQRS
Event sourcing
3 services: front-end + read + write
data writes in event store
data reads from redis (aggregates)
message bus with rabbitmq
Microcafe app by Richard Banks https://github.com/rbanks54/microcafe
Microservices:
• n-Front-End services
• n-Read Services
• n-Write Services
• Event Store cluster
• N-Redis (1 x read service)
• RabbitMQ cluster
• HAProxy cluster
• Consul cluster
Diagram by Gabriel Schenker - https://lostechies.com/gabrielschenker/2015/04/07/cqrs-revisited/
Microcafe app by Richard Banks https://github.com/rbanks54/microcafe
Deal with eventual consistency, baby
Docker on Windows Server Core 2016 TP4
Service Fabric
Microsoft’s take on microservices
What is Service Fabric?
A PaaS for building and running large scale microservice based
applications and services
© Microsoft
Service Fabric programming models
Stateful vs. Stateless
Actors vs. Services
Service Fabric
“my” Key Takeaways
There is no “right way” for doing microservices
Most concepts could be applied to almost any architecture
Orchestration is hard
Service Fabric is nice… but it is “the Microsoft way”
Windows Containers are not ready yet (@ 27th March 2016)
Luckily we have OPEN SOURCE (Mono, ASP.NET 5 and… Linux :-) )
DOTNETMÁLAGA
http://dotnetmalaga.es

More Related Content

What's hot

An Unexpected Solution to Microservices UI Composition
An Unexpected Solution to Microservices UI CompositionAn Unexpected Solution to Microservices UI Composition
An Unexpected Solution to Microservices UI CompositionDr. Arif Wider
 
Software Architectures, Week 3 - Microservice-based Architectures
Software Architectures, Week 3 - Microservice-based ArchitecturesSoftware Architectures, Week 3 - Microservice-based Architectures
Software Architectures, Week 3 - Microservice-based ArchitecturesAngelos Kapsimanis
 
Microservice.net by sergey seletsky
Microservice.net by sergey seletskyMicroservice.net by sergey seletsky
Microservice.net by sergey seletskySergey Seletsky
 
The Microservices world in. NET Core and. NET framework
The Microservices world in. NET Core and. NET frameworkThe Microservices world in. NET Core and. NET framework
The Microservices world in. NET Core and. NET frameworkMassimo Bonanni
 
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
 
Building .NET Microservices
Building .NET MicroservicesBuilding .NET Microservices
Building .NET MicroservicesVMware Tanzu
 
Nats meetup sf 20150826
Nats meetup sf   20150826Nats meetup sf   20150826
Nats meetup sf 20150826Apcera
 
Microservices Patterns and Anti-Patterns
Microservices Patterns and Anti-PatternsMicroservices Patterns and Anti-Patterns
Microservices Patterns and Anti-PatternsCorneil du Plessis
 
Microservices architecture overview v3
Microservices architecture overview v3Microservices architecture overview v3
Microservices architecture overview v3Dmitry Skaredov
 
Tokyo azure meetup #12 service fabric internals
Tokyo azure meetup #12   service fabric internalsTokyo azure meetup #12   service fabric internals
Tokyo azure meetup #12 service fabric internalsTokyo Azure Meetup
 
Microservices architecture
Microservices architectureMicroservices architecture
Microservices architectureAbdelghani Azri
 
Microservices for Enterprises
Microservices for Enterprises Microservices for Enterprises
Microservices for Enterprises Kasun Indrasiri
 
Microservices and Azure App Services
Microservices and Azure App ServicesMicroservices and Azure App Services
Microservices and Azure App ServicesDamir Dobric
 
How to Split Your System into Microservices
How to Split Your System into MicroservicesHow to Split Your System into Microservices
How to Split Your System into MicroservicesEberhard Wolff
 
REST vs. Messaging For Microservices
REST vs. Messaging For MicroservicesREST vs. Messaging For Microservices
REST vs. Messaging For MicroservicesEberhard Wolff
 
Building a Bank out of Microservices (NDC Sydney, August 2016)
Building a Bank out of Microservices (NDC Sydney, August 2016)Building a Bank out of Microservices (NDC Sydney, August 2016)
Building a Bank out of Microservices (NDC Sydney, August 2016)Graham Lea
 
Microservices architecture
Microservices architectureMicroservices architecture
Microservices architectureFaren faren
 

What's hot (20)

An Unexpected Solution to Microservices UI Composition
An Unexpected Solution to Microservices UI CompositionAn Unexpected Solution to Microservices UI Composition
An Unexpected Solution to Microservices UI Composition
 
Software Architectures, Week 3 - Microservice-based Architectures
Software Architectures, Week 3 - Microservice-based ArchitecturesSoftware Architectures, Week 3 - Microservice-based Architectures
Software Architectures, Week 3 - Microservice-based Architectures
 
Microservice.net by sergey seletsky
Microservice.net by sergey seletskyMicroservice.net by sergey seletsky
Microservice.net by sergey seletsky
 
The Microservices world in. NET Core and. NET framework
The Microservices world in. NET Core and. NET frameworkThe Microservices world in. NET Core and. NET framework
The Microservices world in. NET Core and. NET framework
 
Micro services Architecture
Micro services ArchitectureMicro services Architecture
Micro services Architecture
 
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?
 
Building .NET Microservices
Building .NET MicroservicesBuilding .NET Microservices
Building .NET Microservices
 
MicroServices on Azure
MicroServices on AzureMicroServices on Azure
MicroServices on Azure
 
Nats meetup sf 20150826
Nats meetup sf   20150826Nats meetup sf   20150826
Nats meetup sf 20150826
 
Microservices Patterns and Anti-Patterns
Microservices Patterns and Anti-PatternsMicroservices Patterns and Anti-Patterns
Microservices Patterns and Anti-Patterns
 
Eco system apps
Eco system appsEco system apps
Eco system apps
 
Microservices architecture overview v3
Microservices architecture overview v3Microservices architecture overview v3
Microservices architecture overview v3
 
Tokyo azure meetup #12 service fabric internals
Tokyo azure meetup #12   service fabric internalsTokyo azure meetup #12   service fabric internals
Tokyo azure meetup #12 service fabric internals
 
Microservices architecture
Microservices architectureMicroservices architecture
Microservices architecture
 
Microservices for Enterprises
Microservices for Enterprises Microservices for Enterprises
Microservices for Enterprises
 
Microservices and Azure App Services
Microservices and Azure App ServicesMicroservices and Azure App Services
Microservices and Azure App Services
 
How to Split Your System into Microservices
How to Split Your System into MicroservicesHow to Split Your System into Microservices
How to Split Your System into Microservices
 
REST vs. Messaging For Microservices
REST vs. Messaging For MicroservicesREST vs. Messaging For Microservices
REST vs. Messaging For Microservices
 
Building a Bank out of Microservices (NDC Sydney, August 2016)
Building a Bank out of Microservices (NDC Sydney, August 2016)Building a Bank out of Microservices (NDC Sydney, August 2016)
Building a Bank out of Microservices (NDC Sydney, August 2016)
 
Microservices architecture
Microservices architectureMicroservices architecture
Microservices architecture
 

Viewers also liked

Coder sans peur du changement avec la meme pas mal hexagonal architecture
Coder sans peur du changement avec la meme pas mal hexagonal architectureCoder sans peur du changement avec la meme pas mal hexagonal architecture
Coder sans peur du changement avec la meme pas mal hexagonal architectureThomas Pierrain
 
Sortir de notre zone de confort
Sortir de notre zone de confortSortir de notre zone de confort
Sortir de notre zone de confortThomas Pierrain
 
Docker and Windows: The State of the Union
Docker and Windows: The State of the UnionDocker and Windows: The State of the Union
Docker and Windows: The State of the UnionElton Stoneman
 
Decouvrir son sujet grace à l'event storming
Decouvrir son sujet grace à l'event stormingDecouvrir son sujet grace à l'event storming
Decouvrir son sujet grace à l'event stormingThomas Pierrain
 
Faible latence, haut debit PerfUG (Septembre 2014)
Faible latence, haut debit PerfUG (Septembre 2014)Faible latence, haut debit PerfUG (Septembre 2014)
Faible latence, haut debit PerfUG (Septembre 2014)Thomas Pierrain
 
.NET Inside - Microservices, .NET Core e Serverless
.NET Inside - Microservices, .NET Core e Serverless.NET Inside - Microservices, .NET Core e Serverless
.NET Inside - Microservices, .NET Core e ServerlessUlili Emerson Martins Nhaga
 
Culture craft humantalks
Culture craft humantalksCulture craft humantalks
Culture craft humantalksThomas Pierrain
 
Faible latence haut debit Devoxx FR 2014
Faible latence haut debit Devoxx FR 2014Faible latence haut debit Devoxx FR 2014
Faible latence haut debit Devoxx FR 2014Thomas Pierrain
 
Decouvrir CQRS (sans Event sourcing) par la pratique
Decouvrir CQRS (sans Event sourcing) par la pratiqueDecouvrir CQRS (sans Event sourcing) par la pratique
Decouvrir CQRS (sans Event sourcing) par la pratiqueThomas Pierrain
 
TDD is dead?!? Let's do an autospy (ncrafts.io)
TDD is dead?!? Let's do an autospy (ncrafts.io)TDD is dead?!? Let's do an autospy (ncrafts.io)
TDD is dead?!? Let's do an autospy (ncrafts.io)Thomas Pierrain
 
Windows Containers and Docker: Why You Should Care
Windows Containers and Docker: Why You Should CareWindows Containers and Docker: Why You Should Care
Windows Containers and Docker: Why You Should CareElton Stoneman
 
QCONSF - ACID Is So Yesterday: Maintaining Data Consistency with Sagas
QCONSF - ACID Is So Yesterday: Maintaining Data Consistency with SagasQCONSF - ACID Is So Yesterday: Maintaining Data Consistency with Sagas
QCONSF - ACID Is So Yesterday: Maintaining Data Consistency with SagasChris Richardson
 
A Pattern Language for Microservices
A Pattern Language for MicroservicesA Pattern Language for Microservices
A Pattern Language for MicroservicesChris Richardson
 
The Velvet Revolution: Modernizing Traditional ASP.NET Apps with Docker
The Velvet Revolution: Modernizing Traditional ASP.NET Apps with DockerThe Velvet Revolution: Modernizing Traditional ASP.NET Apps with Docker
The Velvet Revolution: Modernizing Traditional ASP.NET Apps with DockerElton Stoneman
 
Ddd reboot (english version)
Ddd reboot (english version)Ddd reboot (english version)
Ddd reboot (english version)Thomas Pierrain
 
CQRS without event sourcing
CQRS without event sourcingCQRS without event sourcing
CQRS without event sourcingThomas Pierrain
 
Solving distributed data management problems in a microservice architecture (...
Solving distributed data management problems in a microservice architecture (...Solving distributed data management problems in a microservice architecture (...
Solving distributed data management problems in a microservice architecture (...Chris Richardson
 
Building and deploying microservices with event sourcing, CQRS and Docker (Be...
Building and deploying microservices with event sourcing, CQRS and Docker (Be...Building and deploying microservices with event sourcing, CQRS and Docker (Be...
Building and deploying microservices with event sourcing, CQRS and Docker (Be...Chris Richardson
 
Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable...
Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable...Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable...
Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable...Chris Richardson
 

Viewers also liked (20)

Coder sans peur du changement avec la meme pas mal hexagonal architecture
Coder sans peur du changement avec la meme pas mal hexagonal architectureCoder sans peur du changement avec la meme pas mal hexagonal architecture
Coder sans peur du changement avec la meme pas mal hexagonal architecture
 
Sortir de notre zone de confort
Sortir de notre zone de confortSortir de notre zone de confort
Sortir de notre zone de confort
 
Docker and Windows: The State of the Union
Docker and Windows: The State of the UnionDocker and Windows: The State of the Union
Docker and Windows: The State of the Union
 
Decouvrir son sujet grace à l'event storming
Decouvrir son sujet grace à l'event stormingDecouvrir son sujet grace à l'event storming
Decouvrir son sujet grace à l'event storming
 
Faible latence, haut debit PerfUG (Septembre 2014)
Faible latence, haut debit PerfUG (Septembre 2014)Faible latence, haut debit PerfUG (Septembre 2014)
Faible latence, haut debit PerfUG (Septembre 2014)
 
.NET Inside - Microservices, .NET Core e Serverless
.NET Inside - Microservices, .NET Core e Serverless.NET Inside - Microservices, .NET Core e Serverless
.NET Inside - Microservices, .NET Core e Serverless
 
Culture craft humantalks
Culture craft humantalksCulture craft humantalks
Culture craft humantalks
 
Faible latence haut debit Devoxx FR 2014
Faible latence haut debit Devoxx FR 2014Faible latence haut debit Devoxx FR 2014
Faible latence haut debit Devoxx FR 2014
 
Decouvrir CQRS (sans Event sourcing) par la pratique
Decouvrir CQRS (sans Event sourcing) par la pratiqueDecouvrir CQRS (sans Event sourcing) par la pratique
Decouvrir CQRS (sans Event sourcing) par la pratique
 
TDD is dead?!? Let's do an autospy (ncrafts.io)
TDD is dead?!? Let's do an autospy (ncrafts.io)TDD is dead?!? Let's do an autospy (ncrafts.io)
TDD is dead?!? Let's do an autospy (ncrafts.io)
 
Async await...oh wait!
Async await...oh wait!Async await...oh wait!
Async await...oh wait!
 
Windows Containers and Docker: Why You Should Care
Windows Containers and Docker: Why You Should CareWindows Containers and Docker: Why You Should Care
Windows Containers and Docker: Why You Should Care
 
QCONSF - ACID Is So Yesterday: Maintaining Data Consistency with Sagas
QCONSF - ACID Is So Yesterday: Maintaining Data Consistency with SagasQCONSF - ACID Is So Yesterday: Maintaining Data Consistency with Sagas
QCONSF - ACID Is So Yesterday: Maintaining Data Consistency with Sagas
 
A Pattern Language for Microservices
A Pattern Language for MicroservicesA Pattern Language for Microservices
A Pattern Language for Microservices
 
The Velvet Revolution: Modernizing Traditional ASP.NET Apps with Docker
The Velvet Revolution: Modernizing Traditional ASP.NET Apps with DockerThe Velvet Revolution: Modernizing Traditional ASP.NET Apps with Docker
The Velvet Revolution: Modernizing Traditional ASP.NET Apps with Docker
 
Ddd reboot (english version)
Ddd reboot (english version)Ddd reboot (english version)
Ddd reboot (english version)
 
CQRS without event sourcing
CQRS without event sourcingCQRS without event sourcing
CQRS without event sourcing
 
Solving distributed data management problems in a microservice architecture (...
Solving distributed data management problems in a microservice architecture (...Solving distributed data management problems in a microservice architecture (...
Solving distributed data management problems in a microservice architecture (...
 
Building and deploying microservices with event sourcing, CQRS and Docker (Be...
Building and deploying microservices with event sourcing, CQRS and Docker (Be...Building and deploying microservices with event sourcing, CQRS and Docker (Be...
Building and deploying microservices with event sourcing, CQRS and Docker (Be...
 
Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable...
Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable...Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable...
Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable...
 

Similar to .Net Microservices with Event Sourcing, CQRS, Docker and... Windows Server 2016! Best practices with microservices (or just services)

John adams talk cloudy
John adams   talk cloudyJohn adams   talk cloudy
John adams talk cloudyJohn Adams
 
Microservices and Serverless for Mega Startups - DevOps IL Meetup
Microservices and Serverless for Mega Startups - DevOps IL MeetupMicroservices and Serverless for Mega Startups - DevOps IL Meetup
Microservices and Serverless for Mega Startups - DevOps IL MeetupBoaz Ziniman
 
Devoxx PL 2018 - Microservices in action at the Dutch National Police
Devoxx PL 2018 - Microservices in action at the Dutch National PoliceDevoxx PL 2018 - Microservices in action at the Dutch National Police
Devoxx PL 2018 - Microservices in action at the Dutch National PoliceBert Jan Schrijver
 
IBM and Node.js - Old Doge, New Tricks
IBM and Node.js - Old Doge, New TricksIBM and Node.js - Old Doge, New Tricks
IBM and Node.js - Old Doge, New TricksDejan Glozic
 
CodeMotion Amsterdam 2018 - Microservices in action at the Dutch National Police
CodeMotion Amsterdam 2018 - Microservices in action at the Dutch National PoliceCodeMotion Amsterdam 2018 - Microservices in action at the Dutch National Police
CodeMotion Amsterdam 2018 - Microservices in action at the Dutch National PoliceBert Jan Schrijver
 
Microservices in action at the Dutch National Police - Bert Jan Schrijver - C...
Microservices in action at the Dutch National Police - Bert Jan Schrijver - C...Microservices in action at the Dutch National Police - Bert Jan Schrijver - C...
Microservices in action at the Dutch National Police - Bert Jan Schrijver - C...Codemotion
 
AWS Serverless Community Day Keynote and Vendia Launch 6-26-2020
AWS Serverless Community Day Keynote and Vendia Launch 6-26-2020AWS Serverless Community Day Keynote and Vendia Launch 6-26-2020
AWS Serverless Community Day Keynote and Vendia Launch 6-26-2020Tim Wagner
 
Netflix oss season 2 episode 1 - meetup Lightning talks
Netflix oss   season 2 episode 1 - meetup Lightning talksNetflix oss   season 2 episode 1 - meetup Lightning talks
Netflix oss season 2 episode 1 - meetup Lightning talksRuslan Meshenberg
 
Microservices: Yes or not?
Microservices: Yes or not?Microservices: Yes or not?
Microservices: Yes or not?Eduard Tomàs
 
Exploring Twitter's Finagle technology stack for microservices
Exploring Twitter's Finagle technology stack for microservicesExploring Twitter's Finagle technology stack for microservices
Exploring Twitter's Finagle technology stack for microservices💡 Tomasz Kogut
 
Microservices - opportunities, dilemmas and problems
Microservices - opportunities, dilemmas and problemsMicroservices - opportunities, dilemmas and problems
Microservices - opportunities, dilemmas and problemsŁukasz Sowa
 
AWS Summit Auckland - Smaller is Better - Microservices on AWS
AWS Summit Auckland - Smaller is Better - Microservices on AWSAWS Summit Auckland - Smaller is Better - Microservices on AWS
AWS Summit Auckland - Smaller is Better - Microservices on AWSAmazon Web Services
 
Bol.com Tech lab September 2017 - Microservices in action at the Dutch Nation...
Bol.com Tech lab September 2017 - Microservices in action at the Dutch Nation...Bol.com Tech lab September 2017 - Microservices in action at the Dutch Nation...
Bol.com Tech lab September 2017 - Microservices in action at the Dutch Nation...Bert Jan Schrijver
 
Serverless without Code (Lambda)
Serverless without Code (Lambda)Serverless without Code (Lambda)
Serverless without Code (Lambda)CloudHesive
 
JavaZone 2017 - Microservices in action at the Dutch National Police
JavaZone 2017 - Microservices in action at the Dutch National PoliceJavaZone 2017 - Microservices in action at the Dutch National Police
JavaZone 2017 - Microservices in action at the Dutch National PoliceBert Jan Schrijver
 
Microservices in action at the Dutch National Police
Microservices in action at the Dutch National PoliceMicroservices in action at the Dutch National Police
Microservices in action at the Dutch National PoliceBert Jan Schrijver
 
OpenValue meetup October 2017 - Microservices in action at the Dutch National...
OpenValue meetup October 2017 - Microservices in action at the Dutch National...OpenValue meetup October 2017 - Microservices in action at the Dutch National...
OpenValue meetup October 2017 - Microservices in action at the Dutch National...Bert Jan Schrijver
 
Stay productive while slicing up the monolith
Stay productive while slicing up the monolithStay productive while slicing up the monolith
Stay productive while slicing up the monolithMarkus Eisele
 

Similar to .Net Microservices with Event Sourcing, CQRS, Docker and... Windows Server 2016! Best practices with microservices (or just services) (20)

John adams talk cloudy
John adams   talk cloudyJohn adams   talk cloudy
John adams talk cloudy
 
Microservices and Serverless for Mega Startups - DevOps IL Meetup
Microservices and Serverless for Mega Startups - DevOps IL MeetupMicroservices and Serverless for Mega Startups - DevOps IL Meetup
Microservices and Serverless for Mega Startups - DevOps IL Meetup
 
Devoxx PL 2018 - Microservices in action at the Dutch National Police
Devoxx PL 2018 - Microservices in action at the Dutch National PoliceDevoxx PL 2018 - Microservices in action at the Dutch National Police
Devoxx PL 2018 - Microservices in action at the Dutch National Police
 
Node.js
Node.jsNode.js
Node.js
 
IBM and Node.js - Old Doge, New Tricks
IBM and Node.js - Old Doge, New TricksIBM and Node.js - Old Doge, New Tricks
IBM and Node.js - Old Doge, New Tricks
 
CodeMotion Amsterdam 2018 - Microservices in action at the Dutch National Police
CodeMotion Amsterdam 2018 - Microservices in action at the Dutch National PoliceCodeMotion Amsterdam 2018 - Microservices in action at the Dutch National Police
CodeMotion Amsterdam 2018 - Microservices in action at the Dutch National Police
 
Microservices in action at the Dutch National Police - Bert Jan Schrijver - C...
Microservices in action at the Dutch National Police - Bert Jan Schrijver - C...Microservices in action at the Dutch National Police - Bert Jan Schrijver - C...
Microservices in action at the Dutch National Police - Bert Jan Schrijver - C...
 
AWS Serverless Community Day Keynote and Vendia Launch 6-26-2020
AWS Serverless Community Day Keynote and Vendia Launch 6-26-2020AWS Serverless Community Day Keynote and Vendia Launch 6-26-2020
AWS Serverless Community Day Keynote and Vendia Launch 6-26-2020
 
Netflix oss season 2 episode 1 - meetup Lightning talks
Netflix oss   season 2 episode 1 - meetup Lightning talksNetflix oss   season 2 episode 1 - meetup Lightning talks
Netflix oss season 2 episode 1 - meetup Lightning talks
 
Microservices: Yes or not?
Microservices: Yes or not?Microservices: Yes or not?
Microservices: Yes or not?
 
Exploring Twitter's Finagle technology stack for microservices
Exploring Twitter's Finagle technology stack for microservicesExploring Twitter's Finagle technology stack for microservices
Exploring Twitter's Finagle technology stack for microservices
 
Microservices - opportunities, dilemmas and problems
Microservices - opportunities, dilemmas and problemsMicroservices - opportunities, dilemmas and problems
Microservices - opportunities, dilemmas and problems
 
AWS Summit Auckland - Smaller is Better - Microservices on AWS
AWS Summit Auckland - Smaller is Better - Microservices on AWSAWS Summit Auckland - Smaller is Better - Microservices on AWS
AWS Summit Auckland - Smaller is Better - Microservices on AWS
 
Bol.com Tech lab September 2017 - Microservices in action at the Dutch Nation...
Bol.com Tech lab September 2017 - Microservices in action at the Dutch Nation...Bol.com Tech lab September 2017 - Microservices in action at the Dutch Nation...
Bol.com Tech lab September 2017 - Microservices in action at the Dutch Nation...
 
Serverless without Code (Lambda)
Serverless without Code (Lambda)Serverless without Code (Lambda)
Serverless without Code (Lambda)
 
JavaZone 2017 - Microservices in action at the Dutch National Police
JavaZone 2017 - Microservices in action at the Dutch National PoliceJavaZone 2017 - Microservices in action at the Dutch National Police
JavaZone 2017 - Microservices in action at the Dutch National Police
 
Microservices in action at the Dutch National Police
Microservices in action at the Dutch National PoliceMicroservices in action at the Dutch National Police
Microservices in action at the Dutch National Police
 
OpenValue meetup October 2017 - Microservices in action at the Dutch National...
OpenValue meetup October 2017 - Microservices in action at the Dutch National...OpenValue meetup October 2017 - Microservices in action at the Dutch National...
OpenValue meetup October 2017 - Microservices in action at the Dutch National...
 
Stay productive while slicing up the monolith
Stay productive while slicing up the monolithStay productive while slicing up the monolith
Stay productive while slicing up the monolith
 
Stackato v2
Stackato v2Stackato v2
Stackato v2
 

Recently uploaded

From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 

Recently uploaded (20)

From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 

.Net Microservices with Event Sourcing, CQRS, Docker and... Windows Server 2016! Best practices with microservices (or just services)

  • 2. • What is a microservice • Good things about microservices you should be using now • DIY in .NET • Containers, VMs, self-hosted, … • Demo • “Microsoft Microservices” • Azure Service Fabric • Demo
  • 3. About Sequel We are leading software providers for the insurance market Heavily investing on R&D (& new offices in Málaga ) 55 people in Málaga, 6 scrum teams 140 people in total Currently hiring in Málaga – @ndsrf for more info Graphic designers | .NET Architects / AngularJs devs | Testers / Automation www.sequel.com
  • 4. Disclaimer This is not a “this is what I did” presentation, but rather a “this is what I have seen” and open for discussion presentation. O:-)
  • 5. What is a microservice? Let’s build our definition! link
  • 6. Our definition of microservices (Created live in the actual presentation - brainstorming session 30/03/2016)
  • 7. Principles of microservices • Autonomous service (decentralise!) • Code + State (high cohesion) • Contracts between them (hide implementation) • Versioned • Consistent and available between failures • Culture of automation • Focus on delivery (products not projects) • Team collaboration • Team size “pizza size” • Lightweight components • Accesible by any device • Language & platform transparency • Smart endpoints / dump pipes • Unit of deployment • Implementation of a bound context (DDD) • Separated code repositories • Inmutable infrastructure • HTTP (REST – HATEOAS) vs others • Self-healing • Automatic upgrades / rollback
  • 8.
  • 9. Good technical practices for microservices • Discovery, Configuration & Versioning • Security • Resilience & autohealing • Monitoring & Logging • Composition • Testing • Inter service communication • Data consistency • Service orchestration
  • 10. Y A X B Service Discovery + Configuration • Problem: Hard-code service locations in 100s of microservices? • Problem: The service discovery needs to be redundant and reliable (this is hard!) • Discovery services rely on distributed DBs  can be used to store configuration • Nice to have: Discovery + health check + auto healing • HATEOAS Options in .NET • Microphone (.NET) + Consul (in Production: master on Linux only!)
  • 12. Versioning • Problem: Not all teams should deliver at the same pace • Try to avoid dependencies  less management & more happiness  Concepts • You still need to deal with old clients of your service relying on previous version • Do not only distribute a client (distributed monolith!), just rely on contracts (& provide example implementations if you wish) • Semantic Romantic Versioning + Minimum required version concept • URL • Headers (Accept header) • API generation / documentation  Swagger, apiary, …
  • 13. Security (1/2) • Problem: much greater attack surface • Problem: Secure all calls  slow / hassle? Concepts • Protect just Internet boundary? What happens in a intruder gets in the network? • Secure communication channels? Services trust each other? • Tamper proofing, replay protection, principal authorization, weakest link, least privilege • API gateway pattern (not just for security but…) • Rate limiting for external APIs (X-Rate-Limit-… headers (Twitter)) Security checklist http://www.grahamlea.com/2015/07/microservices-security-questions/
  • 14. Security (2/2) • Authentication, Authorisation, Delegation • Problem: Once the principal is authenticated, it should only have access to certain resources, and we should do that in a scalable way Concepts • Authorisation server (provides tokens and jwt signed with its PK) • Resource server (each of the services) • Delegation  OAuth 2 protocol • OpenID protocol (JWT – Json Web Token, a signed json doc) to achieve statelessness • Authentication  Leave that to the OAuth 2 server (token) • Authorisation  All microservices should consume JWTs (identity)
  • 15. Resilience • Problem: If one service is not available, everything crashes Techniques: retry N times, retry forever, retry and wait, circuit breaker, post execution steps Circuit breaker: custom fallback, fail silent, fail fast http://techblog.netflix.com/2011/12/making-netflix-api-more-resilient.html Autohealing (Consul) Options in .NET • Polly
  • 16. • Problem: You don´t want to have to check N log files, just 1 • Logging framework vs Logging service • Correlate events • Log deployments / Orchestration (more on this later) Options in .NET • SeriLog + ELK • App Insights (Azure) • Runscope for API monitoring (cloud) • Raygun for error logging (cloud) • Newrelic (cloud)
  • 17. Composition • Problem: Once we have all the small bits and pieces, how do we integrate them to provide higher level functionality Options • Monolithic UI to integrate everything • API Gateway • AJAX/Javascript • IFrames  • Server Side Includes / Edge Side Includes • Specific services like Netflix Zuul (Java) or Compoxure (NodeJS)
  • 18. • Avoid at all costs committing to features that require more than one team to be done in the same place at the same time in order to make an integrated delivery • Other teams to do pull requests with tests (you might not know how your service is really used!) Options in .NET • Unit testing • Contract testing PACT.NET • Mock services
  • 19. Inter-service communication • Problem: As we increase the number of services, the number of calls between them also increases • Tools/applications: RestSharp, Akka.Net, RabbitMQ (.NET library available), NATS (.NET lib available), HAProxy (load balance) • Message formats: XML (text), JSON (text), Google Protobuf (binary) One to One One to many Synchronous Request / response - Asynchronous Notification Request / async response Publish / Subscribe Publish / Async responses
  • 20. Y A X B Data consistency • Problem: Each microservice is made of code + state • Problem: Distributed transactions are really hard Polyglot persistence Options • Single database • Another microservice to deal with domain data access • Event sourcing + pub/sub • Two phase commit • Replication • Eventual consistency • Business rules
  • 21. Orchestration • Problem: How do we deal with 100s of services? Start, stop, move, upgrade… • A nice option: Containers • Linux containers (Mono / ASP.NET 5) • Windows containers Options for Windows (@ 30th March 2016) • Docker Compose + Swarm • Rancher • Kubernetes • Mesos + Marathon • Azure Container Service (Marathon) • Azure service fabric • Akka.NET
  • 22. Orchestration Rancher (Linux containers) Marathon (Linux containers)
  • 23. Example – Microcafe app CQRS, microservices CQRS Event sourcing 3 services: front-end + read + write data writes in event store data reads from redis (aggregates) message bus with rabbitmq
  • 24. Microcafe app by Richard Banks https://github.com/rbanks54/microcafe Microservices: • n-Front-End services • n-Read Services • n-Write Services • Event Store cluster • N-Redis (1 x read service) • RabbitMQ cluster • HAProxy cluster • Consul cluster Diagram by Gabriel Schenker - https://lostechies.com/gabrielschenker/2015/04/07/cqrs-revisited/
  • 25. Microcafe app by Richard Banks https://github.com/rbanks54/microcafe Deal with eventual consistency, baby
  • 26. Docker on Windows Server Core 2016 TP4
  • 28. What is Service Fabric? A PaaS for building and running large scale microservice based applications and services © Microsoft
  • 29. Service Fabric programming models Stateful vs. Stateless Actors vs. Services
  • 31. “my” Key Takeaways There is no “right way” for doing microservices Most concepts could be applied to almost any architecture Orchestration is hard Service Fabric is nice… but it is “the Microsoft way” Windows Containers are not ready yet (@ 27th March 2016) Luckily we have OPEN SOURCE (Mono, ASP.NET 5 and… Linux :-) )

Editor's Notes

  1. http://returnsmart.blogspot.com.es/2015/07/building-microservices-in-net-ian.html https://kf6jna-bn1306.files.1drv.com/y3m-LBl7nt0CQnAZ4MZ081p-oRhqlTAa_gG7TwSJ9VcZQJp7rQxZvCSeZTJsKCtXoh3bqpoWXsetSYqz_oIsbaC4qLOPP1SXxw3JyEJCU7Udr3YR0ouMy6zVOf_S6hKEbpIe1MQDTLBl7U5lZN2kyBqAf7og-BX7PRj6A0dv4sH_Go/Applying%20Microservices%20on%20the%20Microsoft%20Platform%20-%20BASTA%202015%20-%20Ricardo%20Niepel.pdf?psid=1
  2. HATEOAS, an abbreviation for Hypermedia as the Engine of Application State, is a constraint of the REST application architecture that distinguishes it from most other network application architectures. The principle is that a client interacts with a network application entirely through hypermedia provided dynamically by application servers. A REST client needs no prior knowledge about how to interact with any particular application or server beyond a generic understanding of hypermedia. By contrast, in some service-oriented architectures(SOA), clients and servers interact through a fixed interface shared through documentation or an interface description language (IDL). The HATEOAS constraint decouples client and server in a way that allows the server functionality to evolve independently. For example [2] here is a GET request to fetch an Account resource, requesting details in an XML representation: GET /account/12345 HTTP/1.1 Host: somebank.org Accept: application/xml ... Here is the response: HTTP/1.1 200 OK Content-Type: application/xml Content-Length: ... <?xml version="1.0"?> <account> <account_number>12345</account_number> <balance currency="usd">100.00</balance> <link rel="deposit" href="http://somebank.org/account/12345/deposit" /> <link rel="withdraw" href="http://somebank.org/account/12345/withdraw" /> <link rel="transfer" href="http://somebank.org/account/12345/transfer" /> <link rel="close" href="http://somebank.org/account/12345/close" /> </account> Note the response contains 4 possible follow-up links - to make a deposit, a withdrawal, a transfer or to close the account. Some time later the account information is retrieved again, but now the account is overdrawn: HTTP/1.1 200 OK Content-Type: application/xml Content-Length: ... <?xml version="1.0"?> <account> <account_number>12345</account_number> <balance currency="usd">-25.00</balance> <link rel="deposit" href="http://somebank.org/account/12345/deposit" /> </account> Now only one link is available: to deposit more money. In its current state, the other links are not available. Hence the term Engine of Application State. What actions are possible vary as the state of the resource varies.
  3. SEMANTIC VERSIONING Given a version number MAJOR.MINOR.PATCH, increment the: MAJOR version when you make incompatible API changes, MINOR version when you add functionality in a backwards-compatible manner, and PATCH version when you make backwards-compatible bug fixes. Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.
  4. Tamper proofing – no one can sabotage the system by changing messages Replay protection – if I capture a message, and I replay it, does it work? Weakest link – a system is as secure as the weakest of its links Least privilege – a principal should have the least of the privileges to do something
  5. Delegation – client has no idea about the credentials of the user
  6. Custom fallback - in some cases a service’s client library provides a fallback method we can invoke, or in other cases we can use locally available data on an API server (eg, a cookie or local JVM cache) to generate a fallback response Fail silent - in this case the fallback method simply returns a null value, which is useful if the data provided by the service being invoked is optional for the response that will be sent back to the requesting client Fail fast - used in cases where the data is required or there’s no good fallback and results in a client getting a 5xx response. This can negatively affect the device UX, which is not ideal, but it keeps API servers healthy and allows the system to recover quickly when the failing service becomes available again.
  7. http://www.infoq.com/articles/microservices-intro
  8. https://auth0.com/blog/2015/11/07/introduction-to-microservices-part-4-dependencies/
  9. Actors – virtual actors, can be called using a proxy State - It includes the data structures and variables that the service reads and writes to do work. Service Fabric provides the infrastructure to ensure that this state is co-located with the code that manipulates the data, and highly available and fault tolerant in the event of a failure. ActorId actorId = ActorId.NewId(); string applicationName = "fabric:/CalculatorActorApp"; ICalculatorActor calculatorActor = ActorProxy.Create<ICalculatorActor>(actorId, applicationName); double result = calculatorActor.AddAsync(2, 3).Result; RunAsync