api-design
5 posts — newest first.
-
gRPC vs REST: Smaller Bytes Are the Least Interesting Difference
Protobuf is smaller than JSON until you gzip it. The real gRPC trade-offs are contracts, deadlines, status codes in trailers, and load balancing on Kubernetes.
-
Offset Pagination Works Until Someone Writes to the Table
?page=37 has two bugs: it duplicates and skips rows under concurrent writes, and it gets slower with depth. Keyset cursors fix both. Runnable demo inside.
-
Webhooks: Verify, Store, Say 200, Then Think
A webhook is a message queue whose producer belongs to someone else. The receiver pattern that survives retries, duplicates, replays and out-of-order events.
-
Idempotency Keys: The Thing That Makes a Retry Safe
A timeout never tells you whether the work happened. Idempotency keys resolve that — if you get the concurrency and scope right.
-
Rate Limiting Algorithms: Token Bucket, Leaky Bucket, and Sliding Window, Compared
Five algorithms, one trade-off: burst tolerance vs memory vs precision. Plus why LLM APIs limit tokens instead of requests.