PostgreSQL & Redis
The database is where most performance and correctness problems end up. These guides cover PostgreSQL features that solve real problems once you understand their limits, such as declarative partitioning, row-level security for multi-tenant apps, and a job queue built on SKIP LOCKED and LISTEN/NOTIFY. Alongside them are worked walkthroughs of EXPLAIN ANALYZE and the two Redis caching patterns teams reach for most, including what happens when Redis goes away.
6 guides
Guides
Cache-Aside in Laravel with Redis: Invalidation, Stampedes and Redis Outages
For API endpoints that return the same data to many requests, such as product listings, category trees or public profiles, running the same database query on every request is wasted work. Cache-aside...
PostgreSQL Declarative Partitioning for Time-Series Tables
Append-heavy tables such as audit_logs, events or sensor_readings tend to grow without limit. Past a certain size, routine work gets painful: autovacuum takes hours, deleting old rows generates huge a...
Write-Through Caching with Redis and FastAPI
With plain cache-aside caching, an update to the database leaves the cached copy stale until it expires or is deleted. Write-through caching updates the cache as part of every write, so reads after an...
A PostgreSQL Job Queue with SKIP LOCKED and LISTEN/NOTIFY
If PostgreSQL is already your main database, it can also run a background job queue for moderate workloads: sending emails, generating exports, calling webhooks. You avoid running a separate broker, a...
Reading PostgreSQL EXPLAIN ANALYZE: A Worked Example
When a query is slow, EXPLAIN ANALYZE shows what PostgreSQL actually did to run it: which tables it scanned, how it joined them, how many rows each step produced, and where the time went. Reading that...
PostgreSQL Row-Level Security for Multi-Tenant Apps: Pitfalls That Break Isolation
In a shared-schema multi-tenant application, every query must include WHERE tenant_id = ?. Miss it once, in a new report, an admin export or a hastily written background job, and one customer sees ano...
