The Next Genera,on of Microservices
Phil Calçado h9p://philcalcado.com @pcalcado
highly distributed applica1on architecture
We can think of microservices as
Highly distributed applica,on architectures are just a flavor of
distributed compu1ng
Technical ChallengesOrganiza,on Challenges
Introducing distribu,on into your architecture brings up new
Introducing distribu,on into your architecture brings up new
The example we will work with today:
Recovering from temporary failure
"I know, let’s use microservices”
Timeouts
Your code looks like this now
Biz Logic
Timeouts
Timeouts
Your code looks like this now
Biz Logic
Timeouts
RPC code
server
client
🔥 🔥 🔥
🔥
wait
☺😰
🔥 🔥
wait
☺ 😰
🔥
☺
☺
☺
☺
☺
☺
☺
☺
"I know, let’s implement circuit breakers and ,meouts”
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
server
client
🔥 🔥 🔥server server serverserver
🔥 🔥 🔥 💩
🤔
Which instance should we talk to?
☺
"I know, let’s have clients keep track of healthy instances”
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 sobware you
can use
Circuit breakers
Timeouts
Biz Logic
Timeouts
Telemetry
RPC code
Distributed state
Client-side Service Discovery
SDK
Applica,on
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
Plaform
Biz Logic
Stability
Service
Plaform
Timeouts
Biz Logic
Stability
Service
Plaform
Capacity Security Availability
Biz LogicService
Plaform
Service Mesh
Allows our services to pretend some of those are true
It’s not that these pa9erns 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 be9er with metadata-rich protocols
It makes it even harder to fully replicate produc,on earlier in the development cycle
Coupled to the plaform
Not everything will be part of the mesh, i.e. the network s,ll isn’t homogeneous
Leaky abstrac,on