42
Microservices at Amazon Chris Munns Business Development Manager - DevOps

I Love APIs 2015: Microservices at Amazon

  • Upload
    apigee

  • View
    11.966

  • Download
    0

Embed Size (px)

Citation preview

Page 1: I Love APIs 2015: Microservices at Amazon

Microservices at Amazon Chris Munns Business Development Manager - DevOps

Page 2: I Love APIs 2015: Microservices at Amazon

About me: Chris Munns - [email protected], @chrismunns

– Business Development Manager – DevOps – New Yorker – Previously:

•  AWS Solutions Architect 2011-2014 •  Lead of Infrastructure/DevOps @hingeapp •  Formerly on operations teams @Etsy and @Meetup •  Little time at a hedge fund, Xerox and others

– Rochester Institute of Technology: Applied Networking and Systems Administration ’05

– Internet infrastructure geek

Page 3: I Love APIs 2015: Microservices at Amazon

The Micro-elephant in the room

https://www.flickr.com/photos/davidrosenphotography/14711027415/

Page 4: I Love APIs 2015: Microservices at Amazon

Microservices “is a software architecture style in which complex applications are composed of small, independent processes communicating with each other using

language-agnostic APIs. These services are small, highly decoupled and focus on doing a small task, facilitating a modular approach to

system-building.” - Wikipedia

https://en.wikipedia.org/wiki/Microservices

Page 5: I Love APIs 2015: Microservices at Amazon

Microservices Smart people are talking about it: • Sam Newman - book “Building

Microservices” O’Reilly Publishing • Adrian Cockcroft – numerous talks,

presentations, blog posts “Loosely coupled service oriented

architecture with bounded contexts” • Martin Fowler – numerous blog posts •  2 sessions at AWS Re:Invent 2014 •  ~8 sessions at AWS Re:Invent 2015

Page 6: I Love APIs 2015: Microservices at Amazon

But is it just a fad? Phil Calcado(ex-SoundCloud) in his Sept 8th post entitled “How we ended up with microservices.” highlighted the recent growth of the term:

Data from Google Trends http://philcalcado.com/2015/09/08/how_we_ended_up_with_microservices.html

Page 7: I Love APIs 2015: Microservices at Amazon

But is it just a fad? As they say in dramatic police dramas….Let’s ENHANCE!:

Data from Google Trends

Page 8: I Love APIs 2015: Microservices at Amazon

Lots of folks are doing it • Gilt: “From Monolith Ruby App to Distributed Scala Micro-

Services” NYC Tech Talks • Nike: “Nike’s Journey to Microservices” – AWS Re:Invent

2014 • SoundCloud: ”Building Products at SoundCloud—Part III:

Microservices in Scala and Finagle” • Capital One: “Lack Of Legacy Lets Capital One Build

Nimble Infrastructure” – ThePlatform.net • Hailo: “A Journey into Microservices” – sudo.hailoapp.com

Page 9: I Love APIs 2015: Microservices at Amazon

Brilliant folks are sharing tools for it • Netflix: Dozens of tools - https://netflix.github.io/ • Airbnb: SmartStack - http://nerds.airbnb.com/smartstack-service-discovery-cloud/

• Twitter: Mesos - https://mesos.apache.org/ • LinkedIn: Rest.li - https://github.com/linkedin/rest.li

Page 10: I Love APIs 2015: Microservices at Amazon
Page 11: I Love APIs 2015: Microservices at Amazon

Monolith development lifecycle

developers

release test build

delivery pipeline app

Page 12: I Love APIs 2015: Microservices at Amazon

•  Single-purpose

•  Connect only through APIs

•  Connect over HTTPS •  Largely “black

boxes” to each other

•  “Microservices”

Page 13: I Love APIs 2015: Microservices at Amazon

Microservices vs. SOA Wikipedia: “distinct from a Service-oriented architecture (SOA) in that the latter aims at integrating various (business) applications whereas several microservices belong to one application only” Martin Fowler: “This common manifestation of SOA has led some microservice advocates to reject the SOA label entirely, although others consider microservices to be one form of SOA” Oracle: “The picture that emerges is not of microservices as an alternative to SOA, but rather as a way to restore flexibility that may have been lost in SOAs that became too rigid and monolithic.”

https://en.wikipedia.org/wiki/Microservices http://martinfowler.com/articles/microservices.html#MicroservicesAndSoa

http://www.oracle.com/technetwork/issue-archive/2015/15-mar/o25architect-2458702.html

Page 14: I Love APIs 2015: Microservices at Amazon

Microservices: •  Many very small components •  Business logic lives inside of

single service domain •  Simple wire protocols(HTTP

with XML/JSON) •  API driven with SDKs/Clients

SOA: •  Fewer more sophisticated

components •  Business logic can live across

domains •  Enterprise Service Bus like

layers between services •  Middleware

Microservices vs. SOA

14

Page 15: I Love APIs 2015: Microservices at Amazon

•  Two-pizza teams

•  Full ownership

•  Full accountability

•  Aligned incentives

•  “DevOps”

Page 16: I Love APIs 2015: Microservices at Amazon

Wait, now we’re talking about

Pizza? 16 ©2015 Apigee. All Rights Reserved. Image By: Chris Munns – [email protected]

Page 17: I Love APIs 2015: Microservices at Amazon

How do Two Pizza Teams work?

We call them “Service teams” • Own the “primitives” they build:

– Product planning (roadmap) – Development work – Operational/Client support work

• “You build it, you run it” • Part of a larger concentrated org (Amazon.com, AWS, Prime, etc)

17

Page 18: I Love APIs 2015: Microservices at Amazon

Who Does QA?

18

The Two Pizza Team

Page 19: I Love APIs 2015: Microservices at Amazon

Who Does On Call?

19 Image By: Chris Munns – [email protected]

The Two Pizza Team

Page 20: I Love APIs 2015: Microservices at Amazon

What does Ops Do?

20

Not Exist

Page 21: I Love APIs 2015: Microservices at Amazon

What about Ops/QA/Etc?

Everyone exists on a “service team” focused on their primitive(s): • SDE’s focused on developing • PM’s focused on product direction • TPM’s help drive development • SE’s focused on infra/tooling • SDET’s focused on test excellence throughout the organization

Some folks are shared across the org, some on individual teams

21

Page 22: I Love APIs 2015: Microservices at Amazon

Boy, that sounds like a lot of freedom?

It is! Teams are empowered and also held to high standards: • Thorough onboarding/training • Patterns/practices defined at scale and with 20+ years of organizational knowledge

• Regular technical and business metric reviews • Regular sharing of new tools, services, technologies, etc, by internal subject matter experts

22

Page 23: I Love APIs 2015: Microservices at Amazon

Missing tools

developers delivery pipeline services

???

Page 24: I Love APIs 2015: Microservices at Amazon

•  Self-service

•  Technology-agnostic

•  Encourage best practices

•  Single-purpose services

Page 25: I Love APIs 2015: Microservices at Amazon

•  Deployment service

•  No downtime deployments

•  Health checking

•  Versioned artifacts and rollbacks

Page 26: I Love APIs 2015: Microservices at Amazon

•  Continuous delivery

•  From check-in to production

•  Automated actions and transitions

•  >90% of teams

Pipelines

Page 27: I Love APIs 2015: Microservices at Amazon

Microservice development lifecycle

developers delivery pipelines services

release test build

release test build

release test build

release test build

release test build

release test build

Page 28: I Love APIs 2015: Microservices at Amazon

= 50 million deployments a year

Thousands of teams × Microservice architecture

× Continuous delivery × Multiple environments

Page 29: I Love APIs 2015: Microservices at Amazon

I’m sold, how do I make my own

pizza? 29 ©2015 Apigee. All Rights Reserved. Image By: Chris Munns – [email protected]

Page 30: I Love APIs 2015: Microservices at Amazon

How to make pizza?

• Yeast • Water • Sugar • Olive oil • Tomato sauce • Cheese • <insert favorite toppings here>

30

Page 31: I Love APIs 2015: Microservices at Amazon

No Chris, I mean in the organizational/

technological sense 31 ©2015 Apigee. All Rights Reserved. Image By: Chris Munns – [email protected]

Page 32: I Love APIs 2015: Microservices at Amazon

The keys to your own Two Pizza teams & Microservices

Culture Practices Tools

32

Page 33: I Love APIs 2015: Microservices at Amazon

The keys to your own Two Pizza teams & Microservices Culture

– Ownership & Accountability go hand in hand – Larger teams typically move slower than smaller teams – Insist on standards of excellence, but be flexible on the how

Practices – Continuous Integration & Delivery – Simplify operational tasks

Tools – CI & CD tools – Infrastructure management – Metrics/Monitoring/Logging – Communication and Collaboration

33

Page 34: I Love APIs 2015: Microservices at Amazon

The keys to your own Two Pizza teams & Microservices Culture

– Ownership & Accountability go hand in hand – Larger teams typically move slower than smaller teams – Insist on standards of excellence, but be flexible on the how

Practices – Continuous Integration & Delivery – Simplify operational tasks

Tools – CI & CD tools – Infrastructure management – Metrics/Monitoring/Logging – Communication and Collaboration

34

Page 35: I Love APIs 2015: Microservices at Amazon

The keys to your own Two Pizza teams & Microservices Culture

– Ownership & Accountability go hand in hand – Larger teams typically move slower than smaller teams – Insist on standards of excellence, but be flexible on the how

Practices – Continuous Integration & Delivery – Simplify operational tasks

Tools – CI & CD tools – Infrastructure management – Metrics/Monitoring/Logging – Communication and Collaboration

35

Page 36: I Love APIs 2015: Microservices at Amazon

The keys to your own Two Pizza teams & Microservices Culture

– Ownership & Accountability go hand in hand – Larger teams typically move slower than smaller teams – Insist on standards of excellence, but be flexible on the how

Practices – Continuous Integration & Delivery – Simplify operational tasks

Tools – CI & CD tools – Infrastructure management – Metrics/Monitoring/Logging – Communication and Collaboration

36

Internal “Service teams” should own, support, train, drive excellence

of these tools

Page 37: I Love APIs 2015: Microservices at Amazon

Apollo and Pipelines as AWS Services:

CodePipeline launched July 2015

CodeDeploy launched Nov 2014

Page 38: I Love APIs 2015: Microservices at Amazon

Establishing a pattern for services and clients

It’s important that the organization isn’t reinventing the wheel on every new service: •  How are clients going to communicate? •  What cross service authorization requirements are there? •  How do services prevent abuse? •  How do you quickly build clients against a service? •  How do services handle discovery of others services and resources?

Page 39: I Love APIs 2015: Microservices at Amazon

Use an API Gateway!

Internet

Mobile Apps

Websites

Services

API Gateway

AWS Lambda functions

API Gateway Cache

Endpoints on Amazon EC2

Any other publicly accessible endpoint

Amazon CloudWatch Monitoring

Amazon CloudFront

Page 40: I Love APIs 2015: Microservices at Amazon

HOST METRICS

SERVICE METRICS

LOG ANALYSIS

BUILD METRICS

Page 41: I Love APIs 2015: Microservices at Amazon

FIN, ACK This is a big topic that is hard to cover in a single session, day, week! Key pointers: • Microservices patterns are changing how we are building APIs

and our applications in general • Team structure plays an incredible role in building, running,

scaling Microservices • Focusing on flexible tooling that provides standards can help an

organization focus on what matters • Enable the smart people you hire to do great things by giving

them both ownership and accountability on those things success

41

Page 42: I Love APIs 2015: Microservices at Amazon

Thank you

42