API Design
Dispatch
Three industry conventions for cursor pagination headers and parameters: starting_after (Stripe), cursor (Linear/GitHub-style), and page_token (Google-style). The differences are conceptual rather than mechanical and they shape what customers can do at the edges.
Postgres
Dispatch
random_page_cost is the single most important storage-cost parameter the planner uses. Its 4.0 default reflects spinning rust. On SSD and NVMe storage, the right value is between 1.0 and 1.5, and changing it shifts plan choices for thousands of queries at once.
Postgres
Dispatch
track_io_timing turns I/O time into a per-query observable. Off by default because of historical clock-read cost. On modern hardware the cost is negligible and the data is essential for distinguishing CPU-bound from disk-bound queries.
API Design
Dispatch
Export endpoints are a contract about what data the customer can take with them. The customer cases that drive the requirement are competitive migration, internal duplication, account closure, and audit. The right shape for each is different.
Postgres
Dispatch
pg_cancel_backend interrupts a query while keeping the connection alive. pg_terminate_backend kills the connection entirely. The distinction matters during incidents and the wrong choice can convert a slow query into a stampede of reconnects.
API Design
Dispatch
A nullable boolean has three states: true, false, and null. APIs that document the field as a boolean and treat null as false at some layers but as unknown at others produce bugs customers hit months after integration.
Postgres
Dispatch
pg_stat_statements_reset() looks like a clean slate function but throwing away cumulative query statistics destroys trend visibility. The right discipline is rare, scoped resets paired with snapshot capture.
API Design
Dispatch
Most list endpoints include a total count by default. The cost of computing that count grows with the result set, the value to customers is usually small, and the visible-correctness expectation that it creates is hard to satisfy. The right default is no count.
Postgres
Dispatch
Changing a column type in Postgres often forces a full table rewrite while holding an ACCESS EXCLUSIVE lock. Some type changes avoid the rewrite entirely, others can be staged across multiple migrations to keep production traffic flowing.
API Design
Dispatch
Webhook subscriptions degrade silently. The customer notices when something breaks in production weeks after the integration started failing. A computed health score on each subscription surfaces degradation early without requiring customer instrumentation.
Postgres
Dispatch
Postgres compresses large column values transparently using a system called TOAST. Since Postgres 14 the default algorithm can be switched per column from the classic PGLZ to LZ4, and the choice changes both compression ratio and CPU cost in ways most teams never tune.
API Design
Dispatch
Webhook subscriptions accumulate over months and years until customers cannot remember what each one does. The fix is metadata fields that are cheap to add and disproportionately load-bearing for self-service: name, description, owner, contact, and a few others worth specifying upfront.