Chapter 25 of 27 · Part 11: Organization

Teams and evolutionary architecture

FTGO can split its code and its data into services, but if the teams stay organized the old way, every change still needs a meeting between three groups. This chapter shows how to shape teams so services can change independently, and how an architect keeps the whole system coherent without becoming the bottleneck.

key idea / coordinator service / good path in progress / watch out problem / failure neutral

Where we are

In chapter 24 we moved data out of the monolith's tangled schema: we decided who owns each table, split schema and code in safe steps, and kept both sides in sync while they ran side by side. FTGO now has services with their own data. That left one problem open: the architecture follows the shape of the teams that build it, and FTGO's teams still have the monolith's shape.

This chapter

How should FTGO organize its people so that services stay independent, and who guides the system as a whole? By the end you can explain Conway's law, choose an ownership model, decide what platform and enabling teams are for, and describe how an evolutionary architect steers with principles, standards and a paved road instead of orders.

New services, old teams: coordination eats the gains

Problem

FTGO wants scheduled orders: order at noon, deliver at 7 pm. The code lives in Order, Kitchen and Delivery services, which can deploy independently. But FTGO still has a front-end team, a back-end team and a database team. The feature needs a screen from the first, logic from the second and a schema change from the third. Each team has its own backlog, so the feature waits three sprints for three hand-offs, and all three services ship together on one agreed date.

FTGO paid for a distributed architecture and kept the coordination of the monolith. The test is what a team can do on its own. A loosely coupled team has six abilities:

Six abilities of an autonomous team Change design no permission needed Change design no work for others Finish work no outside coordination Deploy and release on demand Test no shared test env Deploy by day negligible downtime Many of these need behavior change as well as technology: ownership, trust, tooling.
Solution · Stream-aligned teams

Give one team the end-to-end delivery of a valuable slice of the domain, with few hand-offs. At FTGO, a Delivery team owns Delivery Service from screen to database, so it can build, test and ship its part of scheduled orders without waiting for anyone.

Cost

Each team now needs front-end, back-end, data and operations skills, and people lose the comfort of a single specialty. And reorganizing is not cosmetic: the way teams talk to each other decides the shape of the system they build.

The system copies the org: Conway's law

Why did FTGO's layered teams keep pulling the services back into one release? Because of a rule observed long before microservices.

Problem

Even after the split, FTGO's back-end team keeps putting shared logic into one "common" library that every service imports, and the database team keeps one shared schema review for all services. Nobody planned it, but the system drifts toward three layers that must change together, exactly like the three teams.

Melvin Conway observed in 1968 that an organization that designs a system produces a design that copies its own communication structure. Four groups working on a compiler give a four-pass compiler. So loosely coupled organizations tend to build loosely coupled systems, and tightly coupled ones build tangled systems.

Conway's law Org structure teams and talk System shape modules and APIs shapes slowly shapes back Evidence: Loosely coupled orgs wrote more modular software (paired products). Windows Vista: org metrics best predicted error-prone components. Design the org for the architecture you want, or the architecture will copy the org you have.

The evidence in the figure is more than anecdote: in paired products, the loosely coupled organizations wrote the more modular software, and for Windows Vista, organizational measures predicted error-prone components best.

Solution · Design the org for the architecture you want

Draw the team boundaries along the service boundaries you want: one stream-aligned team per slice of the domain (Order, Kitchen, Delivery, Accounting), talking to other teams mainly through service APIs. Then the natural drift of communication pulls the system toward the right shape instead of away from it.

The arrow also runs backward, slowly. In a side example, a print firm's website had an input, a core and an output subsystem. IT divisions grew up around those three parts. When the business wanted to change the system, the org structure held the old design in place, and the company had to change the org before it could change the system.

Geography matters too. When a team spreads across many time zones, meetings get rare and communication turns asynchronous. Coordination gets more expensive, which pushes toward autonomous, loosely coupled teams with clear interfaces between them.
Cost

Reorganizing is slow and disruptive, and getting the boundaries wrong locks the wrong design in place. Even with the right boundaries, FTGO's teams can be too big or too dependent on each other to move fast.

Fewer people per decision: small, autonomous teams

The right boundaries help only if the teams inside them can decide quickly.

Problem

FTGO's Order team has grown to 18 people because Order is the busiest part of the business. Stand-ups take half an hour, every design choice needs a meeting, and management's answer to a late release is to move four more engineers onto it. The release gets later.

Most developers prefer teams of roughly 5 to 10 people, and one study found productivity was worst for projects averaging 9 or more. Adding people does not scale delivery by itself. As Fred Brooks put it, adding manpower to a late project makes it later, because every new person adds lines of communication. The real cost at scale is coordination.

Reducing coordination between teams Tangled work Autonomous teams Team Team Team Team 1 Services Team 2 Services Team 3 Services Few, well-defined interfaces between teams; coordinate only at service boundaries.
Solution · Small teams with few interfaces

Keep each team small and give it its own services, so most decisions stay inside one team. Split a team that grows too big along a domain seam, for example Order placement and Order history, and let the two teams coordinate only through their service APIs.

Well-known examples point the same way:

People first. Developers used to one language and no operations work, or used to handing work over the wall, may find autonomy uncomfortable. Move gradually, start with the people who want it, and do not push faster than people can change.
Cost

More teams means more boundaries, and work still crosses them. Sooner or later the Kitchen team needs a change in Order Service. Who is allowed to make it?

Who may change a service: strong versus collective ownership

Small teams decide fast inside their own services. The friction moves to the edges, where one team needs something from another team's code.

Problem

The Kitchen team needs Order Service to expose the requested delivery time. At FTGO anyone may commit to any repository, so a Kitchen developer adds the field on a Friday. The change breaks an assumption the Order team relied on, and the Order team finds out from a page at 2 am. Next week the Order team starts insisting that everyone use its framework "to keep things consistent".

There are two models:

Consistency versus local optimization Collective ownership high consistency needed Strong ownership room for local choices shift Same tools everywhere, so people can move between services. Teams pick languages and styles; fewer cross-team changes. Collective ownership forces consistency and erodes microservice options.
Solution · Strong ownership between teams, collective inside

Inside a team, collective ownership is healthy: everyone can change the team's code. Between teams, prefer strong ownership, so the Order team decides what goes into Order Service and other teams send requests or pull requests.

Cost

Strong ownership turns the owner into a gate. When one service is needed by many teams, its owner's backlog becomes everyone's bottleneck.

When every team needs the same service

One service per team is the goal. Shared services are still common, and the bottleneck from the last section shows up there first.

Problem

Notification Service sends every SMS, email and push message at FTGO. Order, Kitchen, Delivery and Accounting all need new message types this quarter. The four-person Notification team has a backlog of 40 requests, and scheduled orders wait in line behind a promotional email.

Before fixing a shared service, understand why it is shared:

Why services get shared, and what to do Too hard to split large monolith Cross-cutting change multi-user accounts Delivery bottleneck backlog of changes Options for a bottleneck on one service Wait if it can Split service if it pays off Internal OSS patches via PRs Pluggable plug in modules Pick by how often the service changes and how long the backlog is.

Waiting is cheapest if the requester can wait. Split the service if one part changes far more than the rest. Adding people to the owning team is easier on a standard stack. For the Notification backlog, the strongest option is to let the requesting teams write the change themselves.

Solution · Internal open source

Copy the open source model inside the company. A small group of core committers owns the service and reviews patches from other teams. The Delivery team writes its own "courier is near" message and sends a pull request; the Notification team reviews and merges it.

The core committers must protect quality and consistency, and also be helpful, not gatekeepers who throw their weight around. A few factors decide whether it works:

FactorGuidance
MaturityOpen a service to outside patches once its core is stable and changes are rare. While it is unstable, nobody can say what a good patch looks like.
ToolingPull requests, inline review comments, and easy build and deploy through pipelines and a central artifact store.
ReviewsPeer review gives better results than external approval boards; pairing is the quickest form of review.
Orphaned servicesTeams aligned to bounded contexts still own the quiet services in their context. Small services are cheap to rewrite if knowledge is lost.
Side example: pluggable modules. At a company called FinanceCo, country teams all needed changes in one central service. Instead of queuing, the country teams contributed pluggable modules, or libraries that the central service loads. The catch: the central team still schedules the deployments and may still own the production issues.
Cost

Reviewing outside patches takes the owners' time, and contributors must learn a codebase they do not own. More broadly, every stream-aligned team is now expected to know deployment, logging, security and the rest. Small teams cannot each become experts in all of it.

Autonomous teams still need help: enabling and platform teams

Autonomy moves work onto stream-aligned teams that used to sit with operations or a central group.

Problem

Each FTGO team now runs its own services. The Kitchen team writes its own deployment scripts, the Delivery team builds its own log shipping, and the Accounting team invents its own service-to-service authentication. Four teams solve the same problems four different ways, and two of the solutions are insecure.

Solution · Platform and enabling teams

Surround the stream-aligned teams with a supporting cast whose whole job is to reduce their load: a platform team that offers self-service tools, an enabling team that advises and connects, and communities of practice where peers learn from each other.

Team types around stream-aligned teams Stream-aligned team 1 owns services end to end Stream-aligned team 2 owns services end to end Stream-aligned team 3 owns services end to end Enabling team advice, connecting, spotting gaps Communities of practice peer learning, part-time Platform team: self-service tools for deploy, logs, auth paved road, treats teams as its users Enabling and platform teams exist to reduce the load on stream-aligned teams.
GroupJobTime commitment
Enabling teamSurveys what teams do, connects people, spots shared pain (for example, test data), and helps rebalance local versus global choicesFull-time or ring-fenced
Community of practicePeer sharing and learning across teams, such as an FTGO security guildA few hours a week; fluid membership
Platform teamSelf-service tooling: desired-state deployment, log aggregation, service-to-service authenticationA full team that has users

The platform team's users are FTGO's developers. It should collect their feedback and judge itself by how easy shipping has become, not by how impressive the platform is. One story from the company Uswitch sums it up: they did not change their organization to adopt Kubernetes; they adopted Kubernetes to change their organization.

Guide, do not mandate. Explain the rules and why they exist, and let the platform make following them easy. "You must use this platform" drives people to bypass it, and they lose sight of the reasons behind the rules.

Side example: realestate.com.au (REA). A 2014 snapshot of REA, an example rather than a template, shows structure and architecture aligned:

REA: lines of business, squads and a delivery team Core delivery services enabling team: advice, tooling, automation on AWS LOB: Residential Squad Squad free choice inside LOB: Commercial Squad Squad free choice inside LOB: Overseas Squad Squad free choice inside Between lines of business: async batch only. Squads own services end to end.

Because lines of business integrated only through coarse batch feeds, each could take its own services down at will. Autonomy applied to teams and to parts of the business, and services grew from a handful in 2010 to hundreds by 2014.

Cost

Platform and enabling teams are people not building features, and a platform nobody wants is wasted effort. With dozens of teams each making local choices, someone still has to ask whether the pieces add up to one system.

Who keeps the whole coherent: the evolutionary architect

Autonomous teams optimize their own services. Nobody in them is paid to watch the gaps between services.

Problem

Order exposes REST, Kitchen chose gRPC, and Delivery publishes events in a format of its own. Each choice made sense inside its team. Together they mean every new integration at FTGO needs a different client library, and no one can draw the system on one page.

Architecture is the shape of the system, and it happens by design or by accident. It is also a social construct: the part of the design that the people building it understand and share. Someone has to own the technical vision and see the whole system, not just one facet of it.

Solution · Architect as town planner

Think of the architect as a town planner, not the designer of one building. A planner sets the zones and the roads between them, and does not say which building goes on each plot. At FTGO the zones are service boundaries; the architect cares most about the APIs, monitoring and health between them.

Architect as town planner Microservice boundaries are the zones Zone: Order team chooses inside Zone: Kitchen team chooses inside Zone: Delivery team chooses inside Architect spends most time here: APIs, monitoring, health between the boxes "Be worried about what happens between the boxes, and be liberal in what happens inside."
Cost

One architect cannot sit in on every decision at FTGO, and an architect who tries becomes the new bottleneck. The vision has to travel without the architect in the room.

Steer without being everywhere: goals, principles and the required standard

The architect needs a way to shape hundreds of daily decisions made by people they never meet.

Problem

A new Delivery engineer must choose how to deploy a courier-tracking service. There is a 60-page architecture document, half of it about a cloud vendor FTGO left last year, and it does not say which rules matter most or why.

Solution · Goals, principles and practices

Give people a small framework. Strategic goals say where the business is going. Principles are a few rules, fewer than ten, that serve those goals. Practices are detailed, usually technology-specific ways to follow the principles, and they change more often.

From goals to practices Strategic goals where the business is going Principles fewer than 10; fit on a poster Practices coding rules, central logs, REST by default; change often Goal faster delivery gives principle own life cycle gives practice isolated accounts.
LevelFTGO exampleChanges
GoalCut the time to market for new features such as scheduled ordersRarely
PrincipleTeams control the full life cycle of their services and ship independentlySometimes
PracticeDeploy each service into its own isolated cloud accountOften
ConstraintWe run on one chosen cloud providerHard to change; revisit now and then

A large organization can keep different practices in different places, such as a .NET set and a Java set, under the same principles. To check progress, use fitness functions, an idea from the book Building Evolutionary Architectures: measure a property, such as "order placement responds in under 100 ms", and investigate when it leaves its bounds. Fitness functions support conversations with the people building the system; they do not replace them.

Autonomy has limits. Some things every service must do, so the whole stays cohesive and one bad service cannot hurt everyone: the required standard of a good citizen.

Minimum attributes of a good citizen Monitoring common metrics and logs Interfaces few integration styles Safety timeouts, breakers, codes one system-wide view pagination, versioning honest status codes Keep the inside of the box opaque; standardize what crosses the boundary.
Cost

Writing principles down does not make people follow them. A required standard that is painful to meet gets skipped under deadline pressure, and every team ends up rebuilding the same health checks and logging in slightly different ways.

Make the right thing easy: the paved road, debt and exceptions

Principles say what good looks like. The last step is making good the path of least effort.

Problem

FTGO's principles require metrics, logs, health checks and service authentication. Starting the courier-tracking service, the Delivery team spends two weeks wiring all of that up by hand, gets the log format slightly wrong, and skips authentication "for now" to make the deadline.

Technical governance means agreeing how things are done, making sure people know, and making sure it happens. It works best as a group activity, led by the people doing the work, that reviews the principles and tracks technical risk. Its best tool is not a review board.

Solution · Paved road

Make the right thing the easy thing. Offer a ready path for a new service: real exemplars to copy, a tailored template that comes wired to FTGO's logging, metrics, health checks and pipeline, and a self-service platform to run it on. Teams may leave the road, but then they must rebuild what it gives them.

Making the right thing easy New service Paved road Exemplars real, running Template tailored, wired in Platform self-service Off the road is allowed, but you re-do what the road gives. Imitating good examples gets most teams most of the way.
ToolWhat it isCaution
ExemplarsReal services in production that get things right, for others to imitateUse real, used services, not toy "perfect" examples
Tailored templateA starter such as Spring Boot plus your libraries for health, metrics, auth and the pipeline (the service chassis from chapter 16)Can grow into a mandated monster; keep it optional and open to contributions. Shared code also couples services
Service mesh or sidecarMoves common behavior out of the template into the infrastructureNetflix uses sidecars for its non-JVM services

Netflix (JVM) and Monzo (Go) speed up new services by standardizing on one stack. More languages would need a template each, so templates quietly narrow language choice.

Even with a paved road, the vision sometimes loses to the deadline. That is technical debt: a short-term gain with an ongoing cost, which you want to pay down. Debt also appears when the vision changes and old parts no longer match it. At REA, product owners were judged only on features, so technical debt grew until they were also made accountable for the technical health of their services.

Sometimes a team breaks a rule for a good reason. Record the exception. When exceptions pile up, the rule is wrong, so change it:

Handling exceptions Rule a rule Exception log the decision Pattern emerges many exceptions Update rule change it Example: "always MySQL" becomes "MySQL, but Cassandra for very large growth".
Cost

A paved road is a product: someone must build it, keep it current and listen to its users, or it decays into a mandated template nobody likes. And all of this, from Conway's law to the paved road, is about how to build services. Knowing the theory is not the same as building one.

Practices in this chapter

PracticeProblem it solvesWhat it costs
Stream-aligned teamsFeatures wait on hand-offs between front-end, back-end and database teamsEach team needs a broad mix of skills
Design the org for the architecture (Conway's law)The system drifts back to the shape of the old orgReorganizing is slow; wrong boundaries lock in the wrong design
Small teams with few interfacesLarge teams spend their time coordinating; adding people slows them downMore teams and more boundaries to manage
Strong ownership between teamsOutsiders break a service, or force consistency that removes local choiceThe owner can become a bottleneck
Internal open sourceA shared service's backlog blocks every team that needs itOwners spend time reviewing; contributors learn foreign code
Platform and enabling teams, communities of practiceEvery team solves deployment, logging and security on its ownPeople not building features; a platform must earn its users
Architect as town plannerLocal choices add up to an incoherent systemOne architect cannot be in every decision
Goals, principles, practices and fitness functionsTeams cannot tell which rules matter or whyWritten principles are not followed automatically
Required standardOne badly behaved service hurts monitoring, integration or safety for allLimits autonomy at the service boundary
Paved road (exemplars, templates, platform)Doing the right thing is slow, so teams skip itMust be maintained as a product; templates couple services and narrow language choice
Debt and exception logsShortcuts and rule-breaking pile up unseenUpkeep; the rules must change when exceptions pile up

Recap

Quick check

FTGO has separate front-end, back-end and database teams, and wants to add tipping for couriers. What does Conway's law predict, and what would you change?
Show answer

The feature needs all three teams, with hand-offs and coordination, and the services will drift toward the same three layers, changing and releasing together. Reorganize around slices of the domain, such as a Delivery team that owns Delivery Service from screen to database, so the team can build and ship tipping on its own.

FTGO's platform team announces "every service must use our platform from Monday". Why is that risky, and what works better?
Show answer

If the platform is hard to use or does not fit a team's needs, teams bypass it and lose sight of the reasons behind the rules. Explain the rules and their reasons, treat developers as the platform's users, and make the platform the easiest path: a paved road teams choose because it saves them work.

FTGO wrote down three principles and thirty practices. Then it moves to a different cloud vendor. Which should change first?
Show answer

The practices. They are low-level and technology-specific, so they are expected to change often. The principles, and the goals behind them, should stay stable.

Still open

FTGO now has the patterns, the platform and the team structure for microservices. What it does not have is your hands on the keyboard: the best way to make all of this concrete is to build a small microservices application yourself, one service at a time.

Next: 26 Building your first microservices →