a fundamental formula for microservices using docker

27
A Fundamental Formula for Microservices using Docker Ian Philpot Sr. Developer Evangelist @tripdubroot

Upload: ian-philpot

Post on 06-Apr-2017

127 views

Category:

Internet


0 download

TRANSCRIPT

Page 1: A Fundamental Formula for Microservices using Docker

A Fundamental Formula for Microservices using Docker

Ian PhilpotSr. Developer Evangelist@tripdubroot

Page 2: A Fundamental Formula for Microservices using Docker

Ian Philpot

Page 3: A Fundamental Formula for Microservices using Docker

Contact.Me(“Ian Philpot”);• http://tripdubroot.com • @tripdubroot• http://linkedin.com/in/ianphilpot • [email protected]• Try Azure Today: http://aka.ms/mshosting

Page 4: A Fundamental Formula for Microservices using Docker
Page 5: A Fundamental Formula for Microservices using Docker

Open Source

Page 6: A Fundamental Formula for Microservices using Docker

Agenda Microservices Docker Architecture Demos

Page 7: A Fundamental Formula for Microservices using Docker

Microservices

Page 8: A Fundamental Formula for Microservices using Docker

What

Small autonomous, independently deployable services that work together –Sam Newman

Page 9: A Fundamental Formula for Microservices using Docker

Who Netflix Amazon Uber Ebay

Page 10: A Fundamental Formula for Microservices using Docker

Why Greater flexibility & scalability More readily and easily evolvable systems Independently deployable parts Improved technical agility Independent development teams

Page 11: A Fundamental Formula for Microservices using Docker

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

Page 12: A Fundamental Formula for Microservices using Docker

This is hard!

Page 13: A Fundamental Formula for Microservices using Docker

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

Page 14: A Fundamental Formula for Microservices using Docker

Architecture

Page 15: A Fundamental Formula for Microservices using Docker

Goals Independent, loosely coupled services Cheap to replace, easy to scale Fault tolerant, version tolerant services

Page 16: A Fundamental Formula for Microservices using Docker

Things to think about… Database per service… Transactions across services Authentication and Authorization Etc.

Page 17: A Fundamental Formula for Microservices using Docker

Docker & ACS

Page 18: A Fundamental Formula for Microservices using Docker

Docker… or Containers Unit of deployment Same environment through DevOps pipes

Page 19: A Fundamental Formula for Microservices using Docker

Azure Container Service Create cluster with orchestration Swarm, DC/OS, Kubernetes Lays down infrastructure Your Bill?

Page 20: A Fundamental Formula for Microservices using Docker

Details…

Page 21: A Fundamental Formula for Microservices using Docker

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

Page 22: A Fundamental Formula for Microservices using Docker

Duplicate Data It’s Okay!

Page 23: A Fundamental Formula for Microservices using Docker

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.

Page 24: A Fundamental Formula for Microservices using Docker

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.

Page 25: A Fundamental Formula for Microservices using Docker

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

Page 26: A Fundamental Formula for Microservices using Docker

Demo

Page 27: A Fundamental Formula for Microservices using Docker

© 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.