Elastically scalable architectures with microservices. The end of the monolith?

35
The end of the monolith? Elastically scalable architectures with microservices.

Transcript of Elastically scalable architectures with microservices. The end of the monolith?

Page 1: Elastically scalable architectures with microservices. The end of the monolith?

The end of the monolith?

Elastically scalable architectures with

microservices.

Page 2: Elastically scalable architectures with microservices. The end of the monolith?

Monolithic architecture

Feel the pain

intro

Netflix, PayPal, Twitter, Amazon… What do they have in common?

Are monolithic architectures dead?

Distributed architecture with smaller services

Page 3: Elastically scalable architectures with microservices. The end of the monolith?

about me

Javier Arias, senior software engineer at Telefonica.

Working during last year with a microservices in EyeOS, helping to create an VDI (Virtual Desktop Infrastructure) platform.

@javier_ariloshttp://about.me/javier.arilos

Page 4: Elastically scalable architectures with microservices. The end of the monolith?

Back to the question

Objective: To discuss about microservices

concepts & misconceptions

Are monolithic architectures dead?

Page 5: Elastically scalable architectures with microservices. The end of the monolith?

A brief history of architectures

Mainframes, Client/server (2 and then 3 tiers)SOAMicroservices

Page 6: Elastically scalable architectures with microservices. The end of the monolith?

Mainframe, Client/Server, SOA,

Microservices…

They tried to solve architectural problems

And the history repeats

but… there is no silver bullet

Page 7: Elastically scalable architectures with microservices. The end of the monolith?

The catalysts

Page 8: Elastically scalable architectures with microservices. The end of the monolith?

Agile everything

The catalysts (I)

Page 9: Elastically scalable architectures with microservices. The end of the monolith?

Cloud and containers

The catalysts (II)

Page 10: Elastically scalable architectures with microservices. The end of the monolith?

Continuous Integration and

Delivery

Automate QA and Deployment,

Feedback

The catalysts (III)

Page 11: Elastically scalable architectures with microservices. The end of the monolith?

Microservices

And we, software

engineers are fashion

victims.

Microservices are

trendy, since 2014.

Page 12: Elastically scalable architectures with microservices. The end of the monolith?

Microservices definition

Loosely coupledservice oriented architecture

with bounded contexts.(Adrian Cockcroft)

Page 13: Elastically scalable architectures with microservices. The end of the monolith?

Loosely coupled

released & upgraded independently

no shared database

avoid complex middlewares (SOA)

Page 14: Elastically scalable architectures with microservices. The end of the monolith?

service oriented architecture

run as standalone processes

talk via APIs, semantic versioning

Page 15: Elastically scalable architectures with microservices. The end of the monolith?

with bounded contexts

size & responsibilities matter a

lot.

organized around business

capabilities

Domain Driven Design & bounded

contxts

Page 16: Elastically scalable architectures with microservices. The end of the monolith?

Microservice characteristics

Page 17: Elastically scalable architectures with microservices. The end of the monolith?

microservice anatomy

persistence & languagespoiled by choice?

be careful when adding technologies

Page 18: Elastically scalable architectures with microservices. The end of the monolith?

microservices talking to microservices

API + lightweight communications

HTTP vs lightweight message bus

Page 19: Elastically scalable architectures with microservices. The end of the monolith?

are your microservices good citizens?

stateless: key for scalabilityfailure ready: death or dependency failureidempotent: repeated reqs yield same resultoperations ready: logging, correlation...

Page 20: Elastically scalable architectures with microservices. The end of the monolith?

we know how to develop microservices

Page 21: Elastically scalable architectures with microservices. The end of the monolith?

microservices are dynamic

services start / stop all the time

where are my services?

service discovery

DNS vs Database Query

failure detection

Page 22: Elastically scalable architectures with microservices. The end of the monolith?

scalingmicroservices: stateless, discoverable

manual scale is boring let’s go dynamic

how we decide on scaling?Information, from:

serverschannel

Page 23: Elastically scalable architectures with microservices. The end of the monolith?

still awake?

please wake up your buddies

around!

just 10 slides to go… :-)

Page 24: Elastically scalable architectures with microservices. The end of the monolith?

monolith vs microservices: the essence

deploy many collaborating processes

vsdeploy single platform of

components

Page 25: Elastically scalable architectures with microservices. The end of the monolith?

simpler to deploymore difficult to scale, specially deployment

monolith vs microservices: deploy

more complexityscales better (software, teams and deployment)

microservices: many processes 2 deploy

monolith: one single ‘thing’ 2 deploy

Page 26: Elastically scalable architectures with microservices. The end of the monolith?

prone to coupling: code, databasein-process callsmuch easier to refactor and test

monolith vs microservices: distributed

computing

decoupled by deploymentdistributed computing is hard: failure-ready, many moving parts, testing

microservices: distributed computing

monolith: no distributed computing

Page 27: Elastically scalable architectures with microservices. The end of the monolith?

consistency, simpleroperations are simpler

monolith vs microservices: platform

best tool for the job, more freedom, more complexityoperations are more complex

microservices: many technoligies

monolith: constrained technologies

Page 28: Elastically scalable architectures with microservices. The end of the monolith?

size

cost

microservices

monolith

New project: monolith or microservices?

WHY DON’T WE FOLLOW THEHAPPY PATH?

Page 29: Elastically scalable architectures with microservices. The end of the monolith?
Page 30: Elastically scalable architectures with microservices. The end of the monolith?

wrong monolith

what is really wrong with monoliths?

bad designed monoliths

Page 31: Elastically scalable architectures with microservices. The end of the monolith?

well designed monoliths

lower coupling, design for change

DDD with bounded

contextsAPI:

Facade Design PatternNo

database

sharing

Page 32: Elastically scalable architectures with microservices. The end of the monolith?

size

cost

microservices

monolith

can we now follow the happy path?

Page 33: Elastically scalable architectures with microservices. The end of the monolith?

remember...

whatever your problems are...

there is no silver bullet

Page 34: Elastically scalable architectures with microservices. The end of the monolith?

references

Page 35: Elastically scalable architectures with microservices. The end of the monolith?

talk abstract

In the last years the microservices architecture style has been gaining traction with some companies such as Netflix, Yelp, Gilt, PayPal. Many of that companies abandoned their previous monolithic architecture and moved to a microservices approach.

Does that mean that monolithic architectures are a thing of the past?

In this talk we will review some key microservices concepts (and misconceptions), search for the essence of microservices architectures and discuss about different approaches to implement them from the industry, including how we implemented it in EyeOS.