a fundamental formula for microservices using docker
TRANSCRIPT
A Fundamental Formula for Microservices using Docker
Ian PhilpotSr. Developer Evangelist@tripdubroot
Ian Philpot
Contact.Me(“Ian Philpot”);• http://tripdubroot.com • @tripdubroot• http://linkedin.com/in/ianphilpot • [email protected]• Try Azure Today: http://aka.ms/mshosting
Open Source
Agenda Microservices Docker Architecture Demos
Microservices
What
Small autonomous, independently deployable services that work together –Sam Newman
Who Netflix Amazon Uber Ebay
Why Greater flexibility & scalability More readily and easily evolvable systems Independently deployable parts Improved technical agility Independent development teams
Also… Resilience. A failure in one service shouldn’t wipe out the whole system.
Tech stack flexibility. Right tool for the right job. Smaller services are easier to understand and maintain.
A potential migration approach for legacy systems
This is hard!
For realz… This isn’t ment to be easy… and it’s not. Over engineering??? Eventual consistency… probably haven’t thought like this
Debuggin… across many services
Architecture
Goals Independent, loosely coupled services Cheap to replace, easy to scale Fault tolerant, version tolerant services
Things to think about… Database per service… Transactions across services Authentication and Authorization Etc.
Docker & ACS
Docker… or Containers Unit of deployment Same environment through DevOps pipes
Azure Container Service Create cluster with orchestration Swarm, DC/OS, Kubernetes Lays down infrastructure Your Bill?
Details…
Service Discovery Loose coupling implies no hard coded URLs. Service discovery isn’t new (remember UDDI?) Microservices need a discovery mechanism. E.g. Consul.io & Microphone https://github.com/rogeralsing/Microphone
Duplicate Data It’s Okay!
Patterns Domain Driven Design – Align services to Domain Contexts, Aggregates & Services
CQRS – Command Query Responsibility Separation. Scale reads and writes independently.
SQL/NoSQL – Persistent, easily rebuilt caches for query services.
Also…Message Bus – Reliable, async comms. Optimistic Concurrency – No locking!Event Sourcing – Persist events, not state. Avoid 2-PC hassles.Application Services – encapsulate access to microservices; optimise for client needs.
Application Services (Gateway/Edge Svc)
UI Request (HTTP)
Read Model Microservice
Storage
Overall Approach Commands & Queries
EventStore
Domain MicroService
Service Bus
Commands Queries
Event Sourcing Domain EventsPrecomputedResults
Demo
© 2015 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.