API Design Patterns
JJ Geewax
  • MEAP began June 2019
  • Publication in Spring 2021 (estimated)
  • ISBN 9781617295850
  • 375 pages (estimated)
  • printed in black & white

Super practical and super packed with a great content. The perfect read for API designers and architects.

Luke Kupka
Modern software systems are composed of many servers, services, and other components that communicate through APIs. As a developer, your job is to make sure these APIs are stable, reliable, and easy to use for other developers. API Design Patterns provides you with a unique catalog of design standards and best practices to ensure your APIs are flexible and user-friendly. Fully illustrated with examples and relevant use-cases, this essential guide covers patterns for API fundamentals and real-world system designs, along with quite a few not-so-common scenarios and edge-cases.

About the Technology

API design patterns are a useful set of best practice specifications and common solutions to API design challenges. Using accepted design patterns creates a shared language amongst developers who create and consume APIs, which is especially critical given the explosion of mission-critical public-facing web APIs. API Patterns are still being developed and discovered. This collection, gathered and tested by Google API expert JJ Geewax, is the first of its kind.

About the book

API Design Patterns draws on the collected wisdom of the API community, including the internal developer knowledge base at Google, laying out an innovative set of design patterns for developing both internal and public-facing APIs. In this essential guide, Google Software Engineer JJ Geewax provides a unique and authoritative catalog of patterns that promote flexibility and ease-of-use in your APIs. Each pattern in the catalog is fully illustrated with its own example API, use-cases for solving common API design challenges, and scenarios for tricky edge issues using a pattern’s more subtle features. With the best practices laid out in this book, you can ensure your APIs are adaptive in the face of change and easy for your clients to incorporate into their projects.
Table of Contents detailed table of contents

PART 1 Introduction

1 Introduction to APIs

1.1 What are interfaces?

1.2 What are APIs?

1.3 Why do APIs matter?

1.4 What are resource-oriented APIs?

1.5 What makes an API “good”?

1.5.1 Operational

1.5.2 Expressive

1.5.3 Simple

1.5.4 Predictable

1.6 Summary

2 Introduction to API design patterns

2.1 What are API design patterns?

2.2 Why are API design patterns important?

2.3 Anatomy of an API design pattern

2.3.1 Name and synopsis

2.3.2 Motivation

2.3.3 Overview

2.3.4 Implementation

2.3.5 Trade-offs

2.4 Case study: Twapi a Twitter-like API

2.4.1 Overview

2.4.2 Listing messages

2.4.3 Exporting data

2.5 Summary

PART 2 General design principles

3 Naming

4 Resource scope and hierarchy

5 Data types and defaults

6 Versioning and compatibility

6.1 What is versioning?

6.1.1 Serialization versioning versus service versioning

6.2 What is compatibility?

6.3 Defining backward compatibility

6.3.1 Adding functionality

6.3.2 Fixing bugs

6.3.3 Handling mandatory changes

6.3.4 Under-the-hood changes

6.3.5 Changing semantics

6.4 Versioning strategy trade-offs

6.4.1 Granularity versus simplicity

6.4.2 Stability versus new functionality

6.4.3 Happiness versus ubiquity

6.5 Strategies for web API versioning

6.5.1 Perpetual stability

6.5.2 Agile instability

6.5.3 Semantic versioning

6.6 Exercises

6.7 Summary

7 Resource identification

7.1 What is an "identifier"?

7.2 What makes a good identifier?

7.2.1 Easy to use

7.2.2 Unique

7.2.3 Permanent

7.2.4 Fast and easy to generate

7.2.5 Unpredictable

7.2.6 Readable, copyable, and shareable

7.2.7 Informationally dense

7.3 What does a good identifier look like?

7.3.1 Data type

7.3.2 Character set

7.3.3 Identifier format

7.3.4 Checksums

7.3.5 Resource type

7.3.6 Hierarchy and uniqueness scope

7.4 Implementation

7.4.1 Size

7.4.2 Generation

7.4.3 Tombstoning

7.4.4 Checksum

7.4.5 Database storage

7.5 What about UUIDs?

7.6 Exercises

7.7 Summary

PART 3 Resource layout

8 Singleton subresources

8.1 Motivation

8.2 Overview

8.3 Implementation

8.4 Trade-offs

8.5 Exercises

8.6 Summary

9 Cross-references

9.1 Motivation

9.2 Overview

9.3 Implementation

9.4 Trade-offs

9.5 Summary

10 Association resources

10.1 Motivation

10.2 Overview

10.3 Implementation

10.4 Trade-offs

10.5 Exercises

10.6 Summary

11 Add and Remove methods

11.1 Motivation

11.2 Overview

11.3 Implementation

11.4 Trade-offs

11.5 Exercises

11.6 Summary

PART 4 Basic interactions

12 Standard methods

13 Copy and move

14 Enabling and disabling

15 Partial updates and retrievals

16 Batch operations

17 Long-running operations

18 Rerunnable jobs

PART 5 Special interactions

19 Soft deletion

20 Request deduplication

21 Request validation

22 Shortcut methods

23 Anonymous writes

24 Transactions

25 Operations on non-local resources

26 Polymorphism

PART 6 Data exploration and transformation

27 Pagination

27.1 Motivation

27.2 Overview

27.3 Implementation

27.4 Trade-offs

27.5 Anti-pattern: Offsets and limits

27.6 Summary

28 Filtering, searching, and sorting

29 Importing and exporting

30 Snapshots

What's inside

  • A full case-study of building an API and adding features
  • The guiding principles that underpin most API patterns
  • Fundamental patterns for resource layout and naming
  • Advanced patterns for special interactions and data transformations

About the reader

Aimed at software developers with experience using APIs, who want to start building their own.

About the author

JJ Geewax is a software engineer at Google, focusing on Google Cloud Platform and API design. He is also the author of Google Cloud Platform in Action.

placing your order...

Don't refresh or navigate away from the page.
Manning Early Access Program (MEAP) Read chapters as they are written, get the finished eBook as soon as it’s ready, and receive the pBook long before it's in bookstores.
print book $24.99 $49.99 pBook + eBook + liveBook
Additional shipping charges may apply
API Design Patterns (print book) added to cart
continue shopping
go to cart

eBook $39.99 3 formats + liveBook
API Design Patterns (eBook) added to cart
continue shopping
go to cart

Prices displayed in rupees will be charged in USD when you check out.
customers also reading

This book

FREE domestic shipping on three or more pBooks