From Leonard Richardson's 2008 QCon talk Justice Will Take Us Millions Of Intricate Moves, whose third act sets out the maturity heuristic, which Martin Fowler's 2010 article Richardson Maturity Model made widely known.
Grades the design of a web service on four levels by how much of the web's own machinery it uses: one endpoint, then separate resources, then HTTP verbs, then hypermedia links that tell clients what they can do next.
Eight features of a shipment-booking service, placed on the level of the maturity model they belong to
The four levels run from one endpoint, to separate resources, to the web's verbs, to links that tell the client what it can do next. Select a feature, then the level that first needs it. The level lights and says what it adds and what it removes from the client's burden. Show the sort to compare yours. Illustrative.
- Not placedPlacedOne endpointSeparate resourcesThe web's verbsLinks for next steps
- Not placedPlacedOne endpointSeparate resourcesThe web's verbsLinks for next steps
- Not placedPlacedOne endpointSeparate resourcesThe web's verbsLinks for next steps
- Not placedPlacedOne endpointSeparate resourcesThe web's verbsLinks for next steps
- Not placedPlacedOne endpointSeparate resourcesThe web's verbsLinks for next steps
- Not placedPlacedOne endpointSeparate resourcesThe web's verbsLinks for next steps
- Not placedPlacedOne endpointSeparate resourcesThe web's verbsLinks for next steps
- Not placedPlacedOne endpointSeparate resourcesThe web's verbsLinks for next steps
Service features
Level of the model
Your sort matched 0 of 8.Your sort matched 1 of 8.Your sort matched 2 of 8.Your sort matched 3 of 8.Your sort matched 4 of 8.Your sort matched 5 of 8.Your sort matched 6 of 8.Your sort matched 7 of 8.Your sort matched 8 of 8.
- One endpoint
- HTTP carries messages to a single address, and the client names the action in the message. Every client must know every operation.
- Separate resources
- Each shipment has its own address, so a client talks to a particular booking. The service stops being a single opaque door.
- The web's verbs
- GET reads safely, POST or PUT changes, and status codes report what happened, so caches and gateways can do their work.
- Links for next steps
- Responses carry links and forms for the actions now allowed. Clients follow them and do not hard-code the rules.
The sort
- POST all to /service: One endpoint. Level zero uses HTTP as a transport only. Each client must know every operation.
- Action named in the body: One endpoint. When the action lives in the message, the web's own structure is unused: level zero.
- Own address per shipment: Separate resources. Separate resources with their own addresses are what level one adds.
- Booking found by its URL: Separate resources. Naming each thing is the first step off the single endpoint.
- GET reads, safe to cache: The web's verbs. Safe reads separated from changes are the second level.
- 409 on a double booking: The web's verbs. Status codes that report what happened are a level-two use of HTTP.
- Links to allowed actions: Links for next steps. Hypermedia controls tell the client what it can do next. This is level three.
- Rules change, clients don't: Links for next steps. Following links instead of hard-coding rules is what lets the server change. It is the payoff of level three.
An example
A logistics company exposed a shipment-booking service to forty partner companies, and every change to its rules broke someone's integration. The platform team asked its architects to grade the service. At the first level, one endpoint received XML messages that named the action inside the message. The team had moved to the second level the year before, giving each shipment its own address. Reads and writes still went through the same POST.
The architects set a target of two steps up. First, use the web's verbs as intended: GET for reads that proxies could cache, POST and PUT for changes, and proper status codes for refusals such as a double booking. Then, at the top level, every response would carry links to the actions currently allowed: a booked shipment offered cancel and amend, a dispatched one offered only track. When the company changed its amendment rules the next spring, thirty-one partners kept working without a code change, because their clients followed the links the server sent.
The core idea
The model grades a web service design on four levels. At level zero the service uses HTTP as a transport only. Clients send messages to a single endpoint, in a remote-procedure style. At level one the service exposes separate resources, each with its own address, so a client talks to a particular booking instead of to a general service. At level two it uses HTTP verbs as intended: GET for safe reads, POST or PUT for changes, with status codes that say what happened. At level three responses carry hypermedia controls, links and forms that tell the client what it can do next.
Richardson's own framing is a crude heuristic that counts how many layers of the web's technology stack a service uses: addresses, HTTP, and hypermedia. The insight is that each level removes a kind of coupling between client and server, and the top level lets the server change without breaking clients, since they follow links instead of hard-coding rules.
The thinking behind it
Leonard Richardson Leonard Richardson wrote RESTful Web Services with Sam Ruby, published by O'Reilly in May 2007, arguing that web services should use the architecture of the web itself, HTTP, addresses, and REST, in place of heavier remote-procedure standards. On November 20, 2008 he gave a talk at QCon in San Francisco called Justice Will Take Us Millions Of Intricate Moves, built in three acts like a radio episode. The third act, titled The Maturity Heuristic, judges services crudely by whether they use zero, one, two, or three of the web's technologies. Martin Fowler's 2010 article, Richardson Maturity Model, brought it to wide notice and presented it as a way to learn REST's ideas.
Where it sits in the layers
The model sits in Layer 7, Assessment and Maturity Models, because it rates a design against ordered steps, and each step names what to add next. It takes for granted a platform stance from Layer 6 such as Platform Engineering, where internal services are products with users. It is put to work in Layer 8 by approaches such as Domain-Driven Design, which decides what the resources are, and in Layer 10 by the Code Review, where an API change is judged. The common mistake is asking it to decide whether to build an API at all, or what its resources should be. It grades the form of an interface. It does not say whether the interface serves anyone.
How organizations put it to work
A platform or architecture group usually owns it, with product teams applying it to their own interfaces. Adoption is light: the group writes a short checklist for each level, grades the existing services once, and sets a target level for each by how many outside parties depend on it. It changes decisions by turning an argument about style into a question about coupling, and it changes routines by adding an interface review before release. Measures follow: the number of partner integrations that break on each release, and the time it takes a partner to connect.
Sustaining it takes a review that stays short and a policy that a higher level is justified by the cost of breaking clients instead of by taste. In the first year, a leader should expect most services to grade at one or two, debate about whether the top level is worth its cost for internal services with a single consumer, and early gains from the second level, which lets caches and gateways do their work. The return is fewer breakages for partners, a service that can change its rules without a campaign of partner updates, and less dependence on the few engineers who know every client.
Where it goes wrong
The first failure is grading as a score. Fowler is explicit that the model is a way to learn the ideas of REST, and neither defines nor measures it, and teams that chase level three for its own sake build links nobody follows. The sign is hypermedia in the responses and clients that still hard-code every address.
The second is applying the top level where it pays nothing. A service with one internal consumer maintained by the same team gains little from decoupling. The sign is weeks of work on a feature whose only reader is the team that wrote it.
The third is mistaking the model for architecture. Resources can be well formed at every level and still map badly to the business. The sign is a graceful interface to a muddled domain, with clients forced to call six resources to do one thing.
Related and rival frameworks
- Domain-Driven Design. Decides what the business's concepts are and where their boundaries lie. Pick it first, since the maturity model grades how those concepts are exposed.
- Twelve-Factor App. A set of rules for building services that deploy and scale cleanly. It covers how an application is run, where the maturity model covers how its interface is shaped.
- Platform Engineering. Treats the internal platform as a product for developers. It is the better pick when the question is who owns interface standards across many teams.
Go to the source
- Justice Will Take Us Millions Of Intricate Moves, QCon San Francisco, November 20, 2008, 2008
- Richardson Maturity Model, Martin Fowler's website, March 18, 2010 (Fowler), 2010
- RESTful Web Services, O'Reilly (Richardson and Ruby), 2007