running microservice environments is no free lunch

39
Running micro service environments is no free lunch Dynatrace – Alois Mayr B2W digital – Alexander Ramos

Upload: alois-mayr

Post on 23-Feb-2017

760 views

Category:

Software


3 download

TRANSCRIPT

Page 1: Running microservice environments is no free lunch

Running micro service environments is no free lunch

Dynatrace – Alois MayrB2W digital – Alexander Ramos

Page 2: Running microservice environments is no free lunch

@alexander__ @mayralois

Page 3: Running microservice environments is no free lunch

@alexander__ @mayralois

Enterprises often still run traditional monolithic applications

Page 4: Running microservice environments is no free lunch

@alexander__ @mayralois

Deliver value at the speed of business

700 deployments / YEAR

10 + deployments / DAY

50 – 60 deployments / DAY

Every 11.6 SECONDS

Page 5: Running microservice environments is no free lunch

@alexander__ @mayralois

-1000ms +2%

Response Time Conversions

-1000ms +10%

+100ms -1%

Not only fast delivered but also delivering fast

Page 6: Running microservice environments is no free lunch

@alexander__ @mayralois

Not only technical metrics count…

Page 7: Running microservice environments is no free lunch

@alexander__ @mayralois

…but also business metrics

Page 8: Running microservice environments is no free lunch

@alexander__ @mayralois

Page 9: Running microservice environments is no free lunch

@alexander__ @mayralois

Page 10: Running microservice environments is no free lunch

@alexander__ @mayralois

Biggest LatAm e-commerce company

R$ 10+ billion revenue(~ U$ 3 billion)

Americanas, SubmarinoShoptime, Soubarato

Rio de Janeiro and São Paulo, Brazil

Page 11: Running microservice environments is no free lunch

@alexander__ @mayralois

Why are we doing micro services?

Page 12: Running microservice environments is no free lunch

@alexander__ @mayralois

July 2014The Night of Darkness

Page 13: Running microservice environments is no free lunch

@alexander__ @mayralois

What exactly was broken?

Page 14: Running microservice environments is no free lunch

@alexander__ @mayralois

We didn’t know fast enough

Something in the monolith!

Page 15: Running microservice environments is no free lunch

@alexander__ @mayralois

Who’s involved in fixing it?

Devs write bugfixesOps had to act like heroesduring incidents

Page 16: Running microservice environments is no free lunch

@alexander__ @mayralois

What we have changed!

Page 17: Running microservice environments is no free lunch

@alexander__ @mayralois

Page 18: Running microservice environments is no free lunch

@alexander__ @mayralois

Change responsibilities! Code business rules into micro services

Each dev team owns its micro services

You developed it, you operate it in production

Dev teams have on call rotation too

Ops keep the platform, the databases, and facilities (logging, authorization, etc)

Page 19: Running microservice environments is no free lunch

@alexander__ @mayralois

Change communication!

Unified chat room and alerting system

Transparency is key

More and Faster deployments(~50/day)

Page 20: Running microservice environments is no free lunch

@alexander__ @mayralois

How we did it?

Page 21: Running microservice environments is no free lunch

@alexander__ @mayralois

Empower your developers! Devs need to be responsible for running services in production

Devs know the business domain

Devs know who should fix each service

Page 22: Running microservice environments is no free lunch

@alexander__ @mayralois

From monolith to micro services

Monolith

cart freight

skuinventory

Micro services

cart freight

sku inventory

Page 23: Running microservice environments is no free lunch

@alexander__ @mayralois

Dynatrace Ruxit service flow makes micro services visible

Page 24: Running microservice environments is no free lunch

@alexander__ @mayralois

Dynatrace Ruxit service flow makes micro services visible

Page 25: Running microservice environments is no free lunch

@alexander__ @mayralois

The Platform

Page 26: Running microservice environments is no free lunch

@alexander__ @mayralois

server server server server server server server server server server server server

Apache Mesos

Marathon Framework

Run micro servicesAuto-healing

Service discovery

Chronos Framework

Run batch jobsRetry

Orchestration API

CI / CD

One PaaS to run all micro services

Page 27: Running microservice environments is no free lunch

@alexander__ @mayralois

Which technology a micro service is built?

We don’t care!

Page 28: Running microservice environments is no free lunch

@alexander__ @mayralois

Page 29: Running microservice environments is no free lunch

@alexander__ @mayralois

What have we learned?

Page 30: Running microservice environments is no free lunch

@alexander__ @mayralois

#1 – From monolith to bad app First services didn’t scale well

It’s all about resource sharing- File descriptors- Connection pools- Docker image sizes

If it needs local state, it is a bug

Page 31: Running microservice environments is no free lunch

@alexander__ @mayralois

#2 – Legacy systems Most of your bad apps are legacy systems We keep legacy systems aside from Mesos Do Ops teams own legacy systems?

- 99.99% of the time the answer is yes- So, don’t mess with them- Write as many monitors as possible- Ops team should invest some time in auto remediation

Don’t treat legacy systems like micro services

Page 32: Running microservice environments is no free lunch

@alexander__ @mayralois

Datacenter BDatacenter A

#3 – Multi datacenter PaaS

server server server server server server server server server server

Apache Mesos

Marathon Framework

Chronos Framework

Orchestration API

CI / CD

Marathon Framework

Chronos Framework

(failover)

Apache MesosDon’t put all your eggs in one basket

Page 33: Running microservice environments is no free lunch

@alexander__ @mayralois

Filters wrongHTTP Methods (415)

HTTP Cachingpolicy (304)

Throttling (503)

Request/responsetransforming

#4 – Seriously, you need an API Gateway

Edge balancer

Api gateway

Api gateway

Api gateway

Edg

e tra

ffic

Cart

Freight

Sku

Inventory

Build micro service architecture with API Gateway

Page 34: Running microservice environments is no free lunch

@alexander__ @mayralois

#5 – Databases Flexibility is overrated when talking about databases Databases need state and overcommit Keep your database clusters isolated per application Right tool for the right problem (don’t throw everything on relational DB or on MongoDB) Run databases out of Mesos cluster. It is not that hard

Manage state isolated on the PaaS

Page 35: Running microservice environments is no free lunch

@alexander__ @mayralois

#6 – DevOps? Dev and Ops need to work closely together Ops own the platform but not the services running on it As long as Ops simplify Devs workflows, the job is good enough If Devs don’t like what Ops are doing, Ops are doing it wrong The platform’s sole purpose is to turn Devs life easier

Devs should think like Ops and Ops should think like Devs

Devs are the stars of the show

Page 36: Running microservice environments is no free lunch

@alexander__ @mayralois

Black Friday?

Page 37: Running microservice environments is no free lunch

@alexander__ @mayralois

We survived Black Friday

Page 38: Running microservice environments is no free lunch

@alexander__ @mayralois

Page 39: Running microservice environments is no free lunch

Thanks!Questions?