Atmosphere Conference 2015: What we've learned from writing dozens of polyglot micro services

Preview:

Citation preview

How we build systems at WunderlistEmbracing polyglot immutable micro services

🔥

At Wunderlist, we build software that can be thrown away

😢As an industry, we are bad at shipping large systems

💀

When deployment becomes scary, you deploy less often

😤“Mostly green? Ship it”

😱Inertia leads to scary technology updates

🚧Abstractions and Design pattern soup

Not all systems exhibit this problemAt least non-software systems…

HomeostasisTrillions of cells in your body, millions die every second

🐜 Small == Good

Our Rules:

Reduce coupling. Remove fear of deployment. Make change trivial

☕Write services so small that they can be understood over coffee

📣

Write services that document themselves without extensive comments

📈

Test what matters to get the code written, then deploy and watch the metrics

📦

Services own and encapsulate their data

REST everywhereLittle tiny requests and responses

Problem:HTTP connection latency over the open Internet

Solution:Tunnel HTTP over web sockets

HahnOur faucet for web sockets

Websocket Connection

Client Server

{ "method":"GET", "headers": ["Content-Type: "X-Request-ID: 1234"], "request-id":"123456", "path":"/api/v1/lists/32"}

{ "response":200, "headers": ["Content-Type: application/json", "X-Request-ID: 1234"] "body":"[{\"id\":83526310,\"title\":\"Read Later\",\"revision\":10}]"}

Request:

Response:

❔Wait, what about HTTP/2?

Heterogeneous by defaultRuby, Haskell, Scala, Clojure, Go, JavaScript, Java, Lua, Elixir, Erlang, Objective-C, Swift, C#, and more to come…

Websocket

Wunderlist 3.0 BackendA simplified diagram of our micro services at launch last year

*not to scale

HTTP

Business Logic (English) Services

Data Access Logic (German) Services

Databases

Messaging

Wunderlist Backend NowNine months later…

*still not to scale

WebsocketHTTP

Business Logic (English) Services

Data Access Logic (German) Services

Databases

Messaging

🚅

We use Rails for production quality prototyping

✈We use Go, Scala, and Clojure for when we need to fly

🚀

When we need rockets, we’re not afraid to reach for appropriate toolsets and languages

💡

Using multiple languages forces us to keep system interfaces simple

What’s next?

👮Implementing self regulation

💨 Use spot instances

🎭 More actors

📲Apply to client development

♻ Go full circle

Closing Thought

If something is difficult, do it all the time and get good at it

🙏 Thank you