CoursesSystem Design Foundations

APIs and Data

The contract a client can rely on, the identifier that survives growth, the schema and index that make the query cheap, and the key that makes a retry safe.

Lessons
6
Exercises
35
Minutes
37

Start The Contract Before the Code

  1. 1

    The Contract Before the Code

    After this lesson you can write an endpoint as a contract: the resource, the verb, what it returns, how it pages, and what it says when it fails.

    DebugFill blankMultiple choice
    5 exercises
    5 min
  2. 2

    Choosing an ID

    After this lesson you can pick an identifier by the three questions that matter: who generates it, whether it must sort by time, and whether a stranger may guess it, and you can count the keyspace before you pick a length.

    DebugFill blankMultiple choiceShort answer
    5 exercises
    5 min
  3. 3

    The Index That Makes the Query Cheap

    After this lesson you can read a query, say which index it needs, predict what the database does without one, and refuse the index nobody reads.

    DebugMultiple choiceTapTrace
    5 exercises
    6 min
  4. 4

    Doing It Once

    After this lesson you can make a retried write safe with an idempotency key, say where the key lives and for how long, and spot the handler that charges twice.

    DebugFill blankMultiple choiceTrace
    5 exercises
    6 min
  5. 5

    Checkpoint: APIs and DataCheckpoint

    Contracts, ids, indexes and idempotency for a system you have not seen before.

    DebugMultiple choiceShort answer
    7 exercises
    6 min
  6. 6

    Boss: The Registration DeskBoss

    One design carried from the ask to the post-mortem: the question, the estimate, the contract, where the seat count lives, the rush at opening, the duplicates in the log, the revised write path, and the tradeoff you have to defend.

    Code orderMultiple choiceShort answerTrace
    8 exercises
    9 min