the next generation of microservices — yow 2017 brisbane

52
The Next Generation of Microservices Phil Calçado http://philcalcado.com @pcalcado

Upload: phil-calcado

Post on 18-Mar-2018

384 views

Category:

Software


68 download

TRANSCRIPT

The Next Generation of Microservices

Phil Calçadohttp://philcalcado.com@pcalcado

highly distributed application architecture

We can think of microservices as

Highly distributed application architectures are just a flavor of

distributed computing

Technical Challenges

Organization Challenges

Introducing distribution into your architecture brings up new

Introducing distribution into your architecture brings up new

The example we will work with today:

Recovering from temporary failure

Back in 2013…

"I know, let’s use microservices”

Timeouts

Your code looks like this now

Biz Logic

Timeouts

server

client

Timeouts

Your code looks like this now

Biz Logic

Timeouts

RPC code

server

client

 🔥 🔥 🔥

 🔥

wait

☺😰

 🔥 🔥

wait

☺ 😰

 🔥

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

Circuit breakersTimeouts

Your code looks like this now

Biz Logic

Timeouts

Telemetry

RPC code

server

client client client client client client

 🔥

wait

☺😰

 🔥 🔥

wait

☺ 😰

 🔥

 🔥

wait

☺ 😰

 🔥  🔥

wait

😰 ☺

 🔥  🔥

wait

😰 ☺

 🔥  🔥

wait

😰 ☺

 🔥  🔥

🔥

🗑

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

"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?"

Circuit breakersTimeouts

Your code looks like this now

Biz Logic

Timeouts

Telemetry

RPC code

Distributed state

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

server

client

 🔥 🔥 🔥server server serverserver

 🔥 🔥 🔥 💩

 🤔

Which instance should we talk to?

 ☺

DNS be like…

'

Circuit breakersTimeouts

Your code looks like this now

Biz Logic

Timeouts

Telemetry

RPC code

Distributed state

Client-side Service Discovery

And that’s just for RPC reliability.

What makes 2017 different?

Experience reports

Open-source software you

can use

Circuit breakers

Timeouts

Biz Logic

Timeouts

Telemetry

RPC code

Distributed state

Client-side Service Discovery

SDK

Application

Transport

Internet

Network

Circuit breakers

Telemetry

RPC code

Distributed state

Client-side Service Discovery

} TCP/IP

}?

One way to think about it

But how does one go about adding a new layer

to the TCP/IP stack?

Sidecars to the rescue

Circuit breakers

Timeouts

Biz Logic

Timeouts

Telemetry

RPC code

Distributed state

Client-side Service Discovery

SCARY OUTSIDE WORLD

Sidecars to the rescue

Circuit breakers

Timeouts

Biz Logic

Timeouts

Telemetry

RPC code

Distributed state

Client-side Service Discovery

SCARY OUTSIDE WORLDSidecar

Sidecars to the rescue

How does that impact your service?

Circuit breakers

Timeouts

Biz Logic

Timeouts

Telemetry

RPC code

Distributed state

Client-side Service Discovery

Service

Platform

Biz Logic

Stability

Service

Platform

Timeouts

Biz Logic

Stability

Service

Platform

Capacity Security Availability

Biz LogicService

Platform

Service Mesh

Allows our services to pretend some of those are true

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

dumb work moved down the stack.

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

Works better with metadata-rich protocols

It makes it even harder to fully replicate production earlier in the development cycle

Coupled to the platform

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

Leaky abstraction

Q&A