API Design · Senior · Question 9 of 75
An API writes to a primary database and serves reads from replicas. A client creates an item and immediately lists items without seeing it. How should the API design handle this?
- ✓Correct answer: Return the created resource in the create response, and offer read-your-writes (route the client's next reads to the primary or wait for replication) where needed
- 2Tell clients to wait 10 seconds
- 3Disable replicas
Explanation
Document consistency guarantees per endpoint. Clients can use the create response instead of re-reading immediately.