Services and data
Define contracts and handle concurrency, jobs, storage, and access.
Turn requests into inspectable service behavior.
Chapters
API contracts: parameters, identity, access, and errors
Define private-draft editing through JSON validation, trusted identity, object permissions, safe errors, timeout retry, pagination, and concurrent version checks, with an offline ownership model.
Use database constraints to protect business correctness
Verify inventory reservations with uniqueness, conditional decrements, and rollback, while separating index costs, concurrency isolation, and Supabase row-access rules from the offline SQLite test.
Handle load with jobs, caches, and backpressure
Connect bounded job admission, acknowledgements, retries, and deduplication, while distinguishing rate limits, backpressure, concurrency, and cache staleness from durable processing guarantees.
Organize service code by responsibility
Organize a reservation service through HTTP adaptation, use cases, rules, and repositories, then verify transactions, cancellation, and dependency failures separately from framework integration.
Use different storage strategies for files, indexes, and records
Separate learning originals, ownership records, and search indexes, then design upload recovery, scoped signed access, model choices, and deletion across derived copies.