Top Banner
The Next Genera,on of Microservices Phil Calçado h9p://philcalcado.com @pcalcado
52

The Next Generation of Microservices

Mar 18, 2018

Download

Software

Phil Calçado
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: The Next Generation of Microservices

The Next Genera,on of Microservices

Phil Calçado h9p://philcalcado.com @pcalcado

Page 2: The Next Generation of Microservices
Page 3: The Next Generation of Microservices

highly distributed applica1on architecture

We can think of microservices as

Page 4: The Next Generation of Microservices

Highly distributed applica,on architectures are just a flavor of

distributed compu1ng

Page 5: The Next Generation of Microservices

Technical ChallengesOrganiza,on Challenges

Introducing distribu,on into your architecture brings up new

Page 6: The Next Generation of Microservices

Introducing distribu,on into your architecture brings up new

Page 7: The Next Generation of Microservices
Page 8: The Next Generation of Microservices

The example we will work with today:

Recovering from temporary failure

Page 9: The Next Generation of Microservices

Back in 2013…

Page 10: The Next Generation of Microservices
Page 11: The Next Generation of Microservices

"I know, let’s use microservices”

Page 12: The Next Generation of Microservices

Timeouts

Your code looks like this now

Biz Logic

Timeouts

Page 13: The Next Generation of Microservices

server

client

Page 14: The Next Generation of Microservices

Timeouts

Your code looks like this now

Biz Logic

Timeouts

RPC code

Page 15: The Next Generation of Microservices

server

client

🔥 🔥 🔥

Page 16: The Next Generation of Microservices
Page 17: The Next Generation of Microservices

🔥

wait

☺😰

🔥 🔥

wait

☺ 😰

🔥

Page 18: The Next Generation of Microservices

"I know, let’s implement circuit breakers and ,meouts”

Page 19: The Next Generation of Microservices

Circuit breakersTimeouts

Your code looks like this now

Biz Logic

Timeouts

Telemetry

RPC code

Page 20: The Next Generation of Microservices

server

client client client client client client

Page 21: The Next Generation of Microservices

🔥

wait

☺😰

🔥 🔥

wait

☺ 😰

🔥

Page 22: The Next Generation of Microservices

🔥

wait

☺ 😰

🔥 🔥

wait

😰 ☺

🔥 🔥

wait

😰 ☺

🔥 🔥

wait

😰 ☺

🔥 🔥

Page 23: The Next Generation of Microservices

🔥

🗑

Page 24: The Next Generation of Microservices

"I know, let’s have all circuit breakers share state”

Page 25: The Next Generation of Microservices

"I know, let’s have all circuit breakers share state”

Answer to the question “how did my application ended up importing a Zookeeper library again?"

Page 26: The Next Generation of Microservices

Circuit breakersTimeouts

Your code looks like this now

Biz Logic

Timeouts

Telemetry

RPC code

Distributed state

Page 27: The Next Generation of Microservices

server

client

🔥 🔥 🔥server server serverserver

🔥 🔥 🔥 💩

🤔

Which instance should we talk to?

Page 28: The Next Generation of Microservices

DNS be like…

'

Page 29: The Next Generation of Microservices

"I know, let’s have clients keep track of healthy instances”

Page 30: The Next Generation of Microservices

Circuit breakersTimeouts

Your code looks like this now

Biz Logic

Timeouts

Telemetry

RPC code

Distributed state

Client-side Service Discovery

Page 31: The Next Generation of Microservices

And that’s just for RPC reliability.

Page 32: The Next Generation of Microservices

What makes 2017 different?

Page 33: The Next Generation of Microservices

Experience reports

Open-source sobware you

can use

Page 34: The Next Generation of Microservices

Circuit breakers

Timeouts

Biz Logic

Timeouts

Telemetry

RPC code

Distributed state

Client-side Service Discovery

SDK

Page 35: The Next Generation of Microservices

Applica,on

Transport

Internet

Network

Circuit breakers

Telemetry

RPC code

Distributed state

Client-side Service Discovery

} TCP/IP

} ?

One way to think about it

Page 36: The Next Generation of Microservices

But how does one go about adding a new layer to the

TCP/IP stack?

Page 37: The Next Generation of Microservices

Sidecars to the rescue

Circuit breakers

Timeouts

Biz Logic

Timeouts

Telemetry

RPC code

Distributed state

Client-side Service Discovery

SCARY OUTSIDE WORLD

Page 38: The Next Generation of Microservices

Sidecars to the rescue

Circuit breakers

Timeouts

Biz Logic

Timeouts

Telemetry

RPC code

Distributed state

Client-side Service Discovery

SCARY OUTSIDE WORLDSidecar

Page 39: The Next Generation of Microservices

Sidecars to the rescue

Page 40: The Next Generation of Microservices
Page 41: The Next Generation of Microservices

How does that impact your service?

Page 42: The Next Generation of Microservices

Circuit breakers

Timeouts

Biz Logic

Timeouts

Telemetry

RPC code

Distributed state

Client-side Service Discovery

Service

Plaform

Page 43: The Next Generation of Microservices

Biz Logic

Stability

Service

Plaform

Page 44: The Next Generation of Microservices
Page 45: The Next Generation of Microservices

Timeouts

Biz Logic

Stability

Service

Plaform

Capacity Security Availability

Page 46: The Next Generation of Microservices

Biz LogicService

Plaform

Service Mesh

Page 47: The Next Generation of Microservices

Allows our services to pretend some of those are true

Page 48: The Next Generation of Microservices

It’s not that these pa9erns aren’t used anymore, it’s just that the

dumb work moved down the stack.

Page 49: The Next Generation of Microservices

New, optmised, protocols are quite opaque (e.g. gRPC and friends)

Works be9er with metadata-rich protocols

Page 50: The Next Generation of Microservices

It makes it even harder to fully replicate produc,on earlier in the development cycle

Coupled to the plaform

Page 51: The Next Generation of Microservices

Not everything will be part of the mesh, i.e. the network s,ll isn’t homogeneous

Leaky abstrac,on

Page 52: The Next Generation of Microservices

Q&A