Start here: a reference architecture for a SaaS company leaving Postgres and its AI stage, both published in full; four delivered projects; and the production platform work. Open source and measured labs follow in each group.
Data platforms
8 cases · Ingestion, processing and serving at terabyte scale
A six-year platform story: faster processing, lower cost, safer change, and recovery designed before the incident.
50%faster core processingrole-level before/after wall-clock on the rebuilt Spark/Airflow path — not a lab sample · Data Engineer role, 2020–2024
40%lower infrastructure costrole-level before/after infrastructure run-rate on the Kubernetes migration — not a lab sample · Data Engineer role, 2020–2024
A client wanted a working analytics platform, not a design: storage, query engine, orchestration, catalog and API, configured and handed over with security, access control, HA and DR.
A common industry scenario, measured: a B2B SaaS company whose reporting has outgrown its product's Postgres, and a staged architecture with every decision tied to evidence
40 → 525 msthe product's p95 request latency, without and with the BI tool's reports running on the primarya lab copy of the company's database (Postgres 17, 2 vCPU and 4 GB, 31.5 million events); the product's request at 12 a second from pgbench, its weekday peak (each request records one event; 350,000 a day average 4 a second); two analysts running four BI queries in turn; five-minute scenarios after a checkpoint · measured Oct 2026
3 of 35runs of the long BI reports that finished on a Postgres read replica in five minutes; 32 were cancelled by recovery conflictsthe same lab at the product's peak rate; reports on a streaming replica with the default max_standby_streaming_delay (30 s) and hot_standby_feedback off; analysts retried at once · measured Oct 2026
Architecture decision records · Open Data Contract Standard · C4 model · Mermaid · PostgreSQL 17 · pgbench
Spark 4 dropped the AWS SDK the streaming connector depended on, and the maintained alternative paid seconds on every idle shard
≥ 6 sper idle shard, every batch, on the alternative connectorconnector source plus staging Spark UI stage timings; floor = empty-poll count × poll timeout, and the connector requires that product to exceed 5 s, so 6 s is the lowest it accepts · Aug 2026, staging
Exactly-once is a claim about counts, so every layer was counted against a ledger, through broker kills, TaskManager kills and stalls
9 of 9failure runs with every event layer exactthree controller-broker kills, three TaskManager kills and three 150 s stalls under load; Kafka, ClickHouse, Iceberg and the dead-letter topic reconciled against the generator's ledger by sequence number · Oct 2026
59.8%of on-time events left in the window counts after one broker kill118,229 of 197,749 on-time events counted in their 10 s windows in the worst of three broker-kill runs; the rest went to the late side output because catch-up reordered partitions past the 5 s watermark bound · Oct 2026
A breaking schema change should be a question to the teams it breaks, asked by a registry that knows who they are
0breaking schema changes passed as safe, in any mode51 hand-labelled JSON Schema changes, each scored under BACKWARD, FORWARD and FULL; every label cross-checked by an oracle that ran 8,092 generated probe documents through a real JSON Schema validator · measured Oct 2026
2 of 51changes flagged as breaking that are safe, per directionthe same 51 cases; a widened and a narrowed regular expression, an added anyOf branch and an added multipleOf are flagged in both directions by design, and each truly breaks only one · measured Oct 2026
The two halves of the thesis as one system: Trino and Iceberg underneath, retrieval and answers on top, both measured
88 msone-month predicate over 1.5M Iceberg rowsmedian of 7 server-side runs from system.runtime.queries, after 2 warm-ups, on a month-partitioned Iceberg table · measured 2026 · 2024 stack rebuilt
909,968rows recovered by snapshot rollbackan over-broad DELETE (a WHERE reaching years further back than intended), then ALTER TABLE EXECUTE rollback_to_snapshot, counted against the pre-incident total · measured 2026 · 2024 stack rebuilt
One project per tool on one generated SaaS dataset, each with a result the data can prove
15.1%of a year's revenue on the wrong plan with a Type 1 account dimension5,048 generated invoices (seed 7, Oct 2025 – Sep 2026) attributed by each account's current plan and compared with the plan the generator billed; $152,227 of $1,010,202 · measured Oct 2026
96.56%of a month's events lost by high-water-mark loads backfilled newest day first, every run greenSeptember 2026 backfilled through an Airflow 3.3 DAG, one run a day from the 30th back to the 1st; event-time and arrival-time watermark models scored against the 89,508 events that arrived · measured Oct 2026
A governed analytics workflow with typed state, provenance, evaluation, review, and an honest fallback path.
60%faster analytics deliveryrole-level before/after delivery time for recurring analytics requests — not a lab sample · Senior Data Engineer role, 2024–present
75%less analyst manual effortrole-level before/after manual effort per recurring analyst request — not a lab sample · Senior Data Engineer role, 2024–present
Stage 3 of the same company: an assistant that answers customers from governed data, with accuracy, isolation and cost measured on three models and Genie
23 of 120requests for another account's data that leaked when isolation was left to the prompt; none of the 28 queries that reached the database leaked as the customer's own role20 prompts that only another account's data, or every account's, can answer, each from two customers, to Qwen3 8B, Llama 3.3 70B and gpt-oss-120b told to answer only about the customer's account; each generated query run with access to every account and as the customer's role (Postgres row-level security), a leak being any difference · measured Oct 2026
55 → 70 of 70customers' usage questions Llama 3.3 70B answered correctly, from the table definitions alone and with a semantic layer of the business's definitions70 answerable questions with reference answers computed by SQL on a reproducible generated usage mart; one generated query per question, run as the customer's role; the reference value must be in the first row · measured Oct 2026
An LLM judge's pass rate is a biased estimate, and a few-point drop on a small suite is mostly noise
p = 0.39for a 4.8-point judge drop the gate declined to failexact McNemar on 83 paired cases — 8 worse, 4 better, 71 unchanged — qwen3:1.7b judged by qwen3:8b on Ollama, temperature 0 · measured Oct 2026
1,469 → 4,422 msp95 latency, the regression that was realsystem latency over the same 83 cases, sequential, one Apple M5; mean answer length went from 19 to 77 tokens · measured Oct 2026
An agent that writes SQL and proposes refunds will sometimes be confidently wrong, and a system prompt is not a control
48/54answers matched an answer key computed by SQLone live run of a 54-question golden set against qwen3:8b under Ollama, temperature 0, thinking off, over a reproducible generated warehouse; 95% CI 78–95% · Oct 2026, one recorded run
3 of 37answers published without review were wrongsame run; a finding is published only after its schema, policy and grounding checks pass with no proposal attached; 95% Wilson interval on 3/37 is 3–21% · Oct 2026, one recorded run
Most real-time models fail before they are served: in a join that reads the future, a backfill that disagrees with the stream, labels that arrive weeks late
0.363 vs 0.941future AUC-PR, naive join against point-in-time joinsame rows, labels, model and hyperparameters; only the training join differs. Scored on the two weeks after training with point-in-time features and true labels, on reproducible generated payments (874,446 transactions, 0.80% fraud) · measured 2026-10 · reproducible generated data
82.5%of fraud cost saved on two unseen weeksa $5 review per flag plus the amount of every missed fraud, against approving everything; threshold chosen on the validation window, true labels. A hand-written rule saved 20.7% · measured 2026-10 · reproducible generated data
Is Postgres enough, and is hybrid search worth it? One embedding pass, three engines under the same limits, and numbers that flatter none of them
3.9 of 10rows returned by post-filtered HNSW at 10% selectivitypgvector 0.8.7 HNSW at ef_search 40 with iterative scan off, 1,000 queries over 381,559 vectors, a filter keeping 10% of rows; recall@10 0.391 against exact kNN over the rows that pass · measured 2026
0.745recall@10 of OpenSearch's efficient filter at 10% selectivityfilter inside the knn clause, Faiss HNSW at ef_search 40, 1,000 queries over 381,559 vectors, against exact kNN over the rows that pass · measured 2026
Founder and sole engineer — built outside my day job
Clinicians photograph paper records; the system drafts structured fields for review and refuses what it cannot read.
95.8%of matched lab-result values read correctlyfield-level scorer on 97 labelled pages of real clinic captures; development set, not clinical validation · Aug–Sep 2026
8OCR engines scored through one fixed scorersame extraction pipeline and field-level scorer; 11 + 26 labelled pages for classic engines, one 17-page packet for vision-language models · Aug 2026
One database outgrew its server's disk, memory and CPU; another could no longer insert, read or index its vector embeddings. Both moved to Citus, with the data model doing most of the work.
PostgreSQL capacity, operations and platform choice
A capacity plan that had to choose between a managed service and running PostgreSQL yourself, and a fleet of RDS and Aurora databases tuned and failover-tested: the same rule decided both.
A schema that refused to distribute six ways, a tenant whose shard was 7.4× the median, and a rebalance under live writes
0 errorswhile a worker joined and 7 shard groups moved under load8 client threads for 600 s, 80% one-tenant reads and 20% single-row inserts against the Citus coordinator; every acknowledged write counted back afterwards · measured Oct 2026
4.2×faster join co-located than repartitionedthe same join over tenants 1–400, both returning 617,895 rows; p50 of 7 runs, 1,251.7 ms co-located on (tenant_id, user_id) vs 5,206.0 ms against a copy distributed by user_id · measured Oct 2026
Six database engines, eight failover scenarios on real multi-node clusters — with the numbers
8 of 8failover scenarios passedmy own test plan, executed on Docker with 8 CPU / 12.5 GB · 2026
383 µsreplay lag measured on one hosta single pg_stat_replication reading with primary and hot standby on the same machine — loopback, no network, so it is a floor for the configuration rather than a latency anyone should expect across hosts
A production-shaped Postgres cluster on amd64 VMs: killed the primary, rebuilt the replica, recovered a dropped table
10–20 sobserved promotion window after SIGKILLSIGKILL of the Patroni leader, then patronictl polled every 10 s until the survivor showed as Leader — so 10 s is the measurement resolution, not the precision of the result · 2026
~5 sreplica rebuilt from backuppatronictl reinit; the pgBackRest restore itself logged 5,020 ms, then Patroni reported the replica created · 2026
Readiness probes cannot see a release that starts cleanly and then fails real requests; only the traffic can
6 of 6bad releases aborted by canary analysisa release whose Envoy sidecar returns 500 on 30% of requests, under 20 req/s from k6; three runs with keep-alive clients, three with a new connection per request; Prometheus analysis every 15 s after a 30 s initial delay · measured Oct 2026 · kind, three nodes
0 of 18,003requests failed across three good canary releasesk6 at 20 req/s for five minutes per run, GET /healthz and GET /review-queue with a 10 s timeout; canary 20% → 50% with 60 s pauses, background analysis and an evidence step before 100% · measured Oct 2026 · kind, three nodes