Top Banner
Deployment Nirvana Deployment Nirvana Deployment Nirvana Adrian Pike @adrianpike
36
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: Deployment Nirvana

Deployment NirvanaDeployment NirvanaDeployment NirvanaAdrian Pike @adrianpike

Page 2: Deployment Nirvana

The Web is changing.

Monolithic Apps Services

Page 3: Deployment Nirvana

The Web is changing.Scaling hardware is “easy”! 😊

Page 4: Deployment Nirvana

The Web is changing.Scaling people is really really hard.

Page 5: Deployment Nirvana

The Web is changing.

Complex app, simple deployments

Page 6: Deployment Nirvana

The Web is changing.Simple apps, complex deployments

Page 7: Deployment Nirvana

Hi, I'm Adrian

Page 8: Deployment Nirvana

Hi, I'm Adrian

Page 9: Deployment Nirvana

Hi, I'm Adrian. 🙌

• Stride

• Moz

• Welltok

That guy.

Page 10: Deployment Nirvana

In the beginning, we wanted to build a software.

In the beginning, we wanted to build a software.

Page 11: Deployment Nirvana

Moz Local

• Primarily about transforming API data.

• Parallel IO —> node.js!

• Large pile of independent services.

Page 12: Deployment Nirvana

Why SoA

• Team scaling vs. performance scaling.

• Minimize cognitive load.

• Composability!

Page 13: Deployment Nirvana

Why not SoA• Complex Interdependencies.

• Reliability.

• Debugging.

• Toolchains.

• Integration testing.

• Deployment.

Page 14: Deployment Nirvana

A decision was made.

Page 15: Deployment Nirvana

The descent into madness.🌀

Page 16: Deployment Nirvana

The descent into madness.🌀

• Circus.

• Collateral flapping.

• Deploys result in downtime.

• Service-level versioning.

Page 17: Deployment Nirvana

Problem 0: Circus

Today’s hard lesson - vet your tools.

Page 18: Deployment Nirvana

Problem 1: Collateral Flap

• We sucked at node.

• Domains weren’t a thing.

• Crashes happened a lot.

Page 19: Deployment Nirvana

Problem 1: Collateral Flap

• Multiple instances of a given backend.

• Service registry and an HTTP proxy.

We “solved”

it!

Page 20: Deployment Nirvana

Problem 2: Deployment Downtime

• Well now that we’ve got a port registry…

Page 21: Deployment Nirvana

Problem 2: Deployment Downtime

• Fire up a new backend that registers itself.

• Cleanly reap old backends, they finish their tea, crumpets, and requests and go away.

We “solved”

it!

Page 22: Deployment Nirvana

DMV + Seaport + Viaduct• Pile of home-rolled, loosely coupled services.

Page 23: Deployment Nirvana

DMV + Seaport + Viaduct is the greatest thing.

• Shields crashes!

• Zero-downtime deploys!

• Lots of control!

Page 24: Deployment Nirvana

DMV + Seaport + Viaduct is the worst thing ever.

• Client tooling is immature.

• Development is basicallytorture.

• Inter-service versioning is unsolved.

Page 25: Deployment Nirvana

Service versioning• “Solved” problem.

• URL Versioning

• Query Params

• Timestamps

• Inter-service dependencies are real, and require our attention.

• Is there a better way?

Page 26: Deployment Nirvana

Service versioning redux

• git commit -m “replaced cats with dogs, life’s better now”

• b8d825ddd9eb63336f1da4ec46b1a47eecab7427

• That looks suspiciously like a version.

Page 27: Deployment Nirvana

Routing layer versioning• We’ve got a HTTP proxy already.

• Let’s extend it to route to git SHA’s as versions.

• We route domains to default SHAs.

production.foo.com 5e3… Service!

staging.foo.com 61a…A

different service!

Page 28: Deployment Nirvana

Routing Layer Versioning• Advantages:

• As an engineer, I don’t have to build versioning.

• We can test multiple releases simultaneously.

• Disadvantages:

• Deployed services have to be SHA reflective.

• We have to run multiple instances of a given service.

• Inter-service versioning.

Page 29: Deployment Nirvana

Inter-service versioning

• Service A is dependent on Service B.

• Think a business logic service (A) and a data layer service (B).

• They might need to change in lockstep.

A

B

Page 30: Deployment Nirvana

Inter-service versioning• We build a “Release version” to encapsulate all

our services at a given revision.

A

B

V1

A

B’

V2

Page 31: Deployment Nirvana

Inter-service Communication• When A communicates with B, it’s got to specify a

version.

• Three ways;

• I have to think about it. (Use API versioning or some such)

• Lock at deploy time.

• Pass a header.

Page 32: Deployment Nirvana

Client Tooling

• Developer environment

• Just use Foreman.

• Assets and such.

• Just 12factorize.

Page 33: Deployment Nirvana

Lessons learned

• Inter-service versioning is unsolved.

• Rolling deployments are required.

• Shielding engineers from complexity.

• Caveat: Without magic.

Page 34: Deployment Nirvana

Let’s deploy better. 🌅

• Focus on engineer happiness.

• Better tooling.

• Minimize moving parts.

• 4 daemons + 2 persistence layers == wat

• Make it pluggable.

Page 35: Deployment Nirvana

One more thing…☝️

Page 36: Deployment Nirvana

http://adrianpike.github.io/harbor