Microservices are a team decision first

September 11, 2017

Key takeaway: Before splitting a monolith, measure where a small change waits on its way to customers, and fix a slow deploy first.

Microservices only pay off if each team can ship its service on its own. Draw the service lines along team lines. Otherwise you’ve paid for a network in the middle of your monolith and got nothing back.

An NGINX blog post, Microservices at Netflix: Lessons for Team and Process Design, puts the goal as “learning about your customers and giving them what they want at a faster pace than your competitors.” That sentence doesn’t mention services. It’s about how often you can ship, watch, and adjust. A monolith a team deploys twenty times a day is closer to that goal than fifty services that go out together once a month.

Services cost something every day. Method calls become network calls that time out. Data splits across databases, so you lose joins and transactions. Every service needs its own pipeline, monitoring, and on-call. The only thing you get for that cost is independence.

The test I’d use: can a team ship a change to its own service this afternoon without asking another team for anything? If not, look for the coupling. It’s usually a shared database, a client library everyone has to upgrade the same week, a release checklist of versions that go out together, or a shared staging environment that has to be green for everyone.

Conway’s law says systems mirror how the organization communicates. If you split the code and leave the teams alone, the system ends up shaped like the org chart anyway. Start with the teams. Give each team a part of the business, plus the code, the pipeline, the data, and the pager. Werner Vogels called Amazon’s version “you build it, you run it.”

If your time goes to an hour-long test suite or a scary monthly deploy, services won’t help. You’ll have the same slow pipeline once per service. Fix the deploy in the monolith first. You may not need to split it at all.