Plate III · Filed under
PostgreSQL
PostgreSQL
8 entries
- 001
Transactional outbox pattern: events that never go missing
Write to the database, then publish to Kafka, and one of them will eventually fail. How an outbox table makes the write and the event a single commit.
Distributed SystemsPostgreSQLReliabilityBackend - 002
Postgres as a job queue with SELECT FOR UPDATE SKIP LOCKED
You do not need a second system for background jobs. How SKIP LOCKED turns a table into a queue, and the details that decide whether it holds up.
PostgreSQLDatabasesBackendQueues - 003
PostgreSQL composite indexes: which column goes first
A multicolumn B-tree sorts by its first column, then its second. Why (a, b) and (b, a) are different indexes, and the rule that decides the order.
PostgreSQLDatabasesIndexingPerformance - 004
Database connection pool sizing: a pool is a queue with a depth
Every request waits in line for a connection. Little's law says how long the line is, why a bigger pool makes it slower, and how exhaustion cascades.
PostgreSQLBackendPerformanceReliability - 005
Idempotency keys: how to stop a retry double charging
A timeout never tells you whether the write landed. How an idempotency key settles it, and why the key has to commit in the same transaction as the work.
API DesignIdempotencyReliabilityBackend - 006
UUID primary keys and write amplification in PostgreSQL
A UUIDv4 primary key scatters every insert across the B-tree, turning one logical write into several physical ones. The mechanism, and when it matters.
PostgreSQLDatabasesUUIDPerformance - 007
Keyset pagination vs OFFSET in PostgreSQL
OFFSET reads and discards every row it skips, and silently duplicates records when data shifts. Keyset pagination fixes both, at a price worth knowing.
PostgreSQLDatabasesAPI DesignPagination - 008
Build a REST API in Rust with Axum, SQLx and PostgreSQL
A step-by-step guide to building a type-safe REST API in Rust using Axum for the web layer and SQLx for database access. Covers project setup, connection pooling, and handlers.
RustBackendAPIAxum