PhilippTheServer

databases

Relational, time-series and the schema decisions that outlive the code.

  1. OpenTaberna: Headless, Open-Source E-Commerce You Self-Host

    OpenTaberna is headless, open-source e-commerce: an Apache-2.0 shop API on FastAPI and PostgreSQL that you self-host with Docker Compose.

  2. The Transactional Outbox: Never Losing a Job You Already Committed

    Transactional outbox in Postgres: commit-then-enqueue loses jobs on a crash. A SKIP LOCKED relay to Redis Streams and an idempotent consumer.

  3. Running Alembic Migrations Once, Before the Workers Fork

    alembic upgrade head in app code runs once per gunicorn worker and races. Running it in the entrypoint under pg_advisory_lock, before exec.

  4. Preventing Overselling with a Database CHECK Constraint

    violates check constraint "stock_not_negative": why check-then-decrement oversells under READ COMMITTED, and a single conditional UPDATE that cannot.

  5. Sizing Redis maxmemory Against a Stream Trim Threshold

    OOM command not allowed when used memory exceeds maxmemory on XADD MAXLEN: why the stream never trims itself, and why a standalone XTRIM still works.

All topics · All writing