Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Topics Data & databases

PostgreSQL

November 2026

ClickHouse

Fencing a Postgres primary that might still be alive

Case study 10 min +100 XP

Before promoting a standby, a managed Postgres control plane must fence the old primary, because promotion and DNS changes alone don't stop writes: async standbys, per-session synchronous_commit overrides, quorum commit with a remaining standby, and canceled commits already in WAL can all let a still-alive primary accept writes.

October 2026

September 2026

ClickHouse

Memory safety for Postgres extensions in C/C++

Case study 4 min +40 XP

Postgres's palloc/MemoryContext allocation and setjmp/longjmp-based error handling clash with C++ new/delete, destructors and exceptions: longjmp skips destructors (undefined behavior), exceptions bypass PG_CATCH, and an uncaught exception aborts the process and forces cluster-wide crash recovery.

August 2026

Neon

WAL + S3: Lakebase storage for the era of agents

Deep dive 15 min +150 XP

Lakebase Postgres (Neon's architecture) treats the Postgres write-ahead log as the source of truth and data pages as a derived cache, splitting the system into stateless compute running unmodified Postgres and a storage layer of Paxos-replicated safekeepers, pageservers, and S3.

May 2026

February 2026

ClickHouse

pg_stat_ch: a PostgreSQL extension that exports every metric to ClickHouse

Deep dive 16 min +160 XP

pg_stat_ch is an open-source (Apache 2.0) PostgreSQL 16–18 extension that captures every statement execution, including failed queries and DDL, as a fixed-size ~4.6KB event with 45 fields and streams it to ClickHouse for APM-style analysis.

December 2025

July 2025

May 2025

January 2025

April 2024

The quest for software engineering knowledge.

Look:
Layout: