The Playbook
How to read the playbook, the principles behind every standard in it, and a map of the whole book, from HTTP fundamentals to leading the team.
This is the playbook I bring to every team: the decisions I've already made, written down so they don't get re-argued in every new codebase. Little of it is novel. Most of it is a published standard (an RFC, a spec, a practice from Stripe, GitHub or Google) applied consistently, and the consistency is the value.
Each doc makes its own case: the problem, the default, why it beats the alternatives, and what it costs. The sources at the bottom are evidence and further reading, not the argument. If a default can't be defended without "because Stripe does it", it doesn't belong here.
Defaults can be overridden, but an override is a decision, and it gets written down (Decisions & Design Docs). Where this site departs from its own playbook, the departure is an ADR; everywhere else, the playbook is the explanation. CI fails any doc that drops its references, links to a doc that doesn't exist, or wraps JSON in an envelope.
How to Read It#
It reads front to back. The sections run from the shared vocabulary and how the work is decided and written, through designing, building and protecting the system and the money it moves, to how it is tested, shipped and run, what its data teaches you, and how the team behind it grows. Every doc links to the one before and after it.
It also reads by chapter. Each doc stands on its own and links back to anything it builds on, so you can start wherever your problem is.
Principles#
The rest of the playbook is built from these.
- Standards before inventions. If an RFC, a spec or a widely adopted practice already solves it, use that:
Linkfor pagination, RFC 3339 for time,Idempotency-Key,RateLimit,DeprecationandSunset,QUERY. A standard arrives with documentation, client libraries and engineers who already know it. An invention has to earn its place. - HTTP means what it says. Methods carry intent, status codes carry outcome, headers carry metadata. Bodies carry resources: a list is an array, a single resource is an object, and there are no
dataenvelopes. - Make the wrong thing hard. Money is an integer, so it can't drift. State transitions are guarded in the database. Method overrides can only become
QUERY. A guardrail beats a guideline. - Everything retries, so everything is idempotent. Networks fail after the work is done. Keys, dedupe and at-least-once handling are designed in from the start, not added after the first double charge.
- Nothing is rewritten. Financial records, events, decisions and incidents are appended, corrected with new entries, and kept explainable.
- Change is additive. APIs, schemas and events grow without breaking anyone. Breaking changes ship as new versions with a dated, announced sunset.
- Observable by default. Every request has an ID, every log line is structured, every service has an SLO. If you can't see it, you can't own it.
- Small, reversible steps. Small PRs, expand-and-contract migrations, flags and progressive rollouts. The cost of a mistake is how hard it is to undo.
The Map#
Books
The playbook applies anywhere. When one subject needs more than a chapter, like an industry's networks, rules and economics, I write it as a book instead: see Books, starting with Payments, Field Operations and Gaming.
Where to Start#
- Designing an API? API Design Principles, then Errors, Pagination and Versioning.
- Moving money? Money and Idempotency before writing a line of code.
- Building payments into a product? How Card Payments Work, Interchange & Pricing and Payments for Software Platforms.
- Running a business that sends people to customers? The Field Operations Business, then Route Optimization and Billing Recurring Service.
- Building for any industry? Audit Trails, Notifications & Consent and Rules as Data come up in every industry.
- Starting a new codebase? Repositories & Local Development, Documentation and Where to Run It.
- Splitting a system? Service Boundaries and Events.
- Running it in production? Observability and Instrumenting with OpenTelemetry, then SLOs and Incidents & Postmortems.
References#
Specifications
- RFC 9110: HTTP Semantics, the foundation for methods, status codes and headers
- RFC 9205: Building Protocols with HTTP, the IETF's best practice for HTTP APIs
Reference
- MDN: HTTP, the most readable reference for every header, method and status code
In practice
- Stripe: API Reference, the benchmark for payments APIs: idempotency, expansion, versioning
- GitHub Docs: REST API, unwrapped responses,
Linkpagination and conditional requests - Google: API Improvement Proposals, design guidance written as numbered, citable decisions
- Microsoft: Azure REST API Guidelines, long-running operations, paging and concurrency at scale
- Zalando: RESTful API Guidelines, a public, opinionated rulebook in the same spirit
- Heroku: HTTP API Design Guide, concise conventions from the Heroku Platform API
- Google: Site Reliability Engineering, SLOs, error budgets and blameless postmortems