Egres

Postgres-compatible database in Zig for heavy, multi-tenant workloads

Image 1 of 1: Line chart of reader transactions per second through a 600M-row load, Egres against Postgres 18.6

One binary that speaks the Postgres protocol on a new storage engine, on local disk or S3. Every query is a fiber on its own scheduler, so each tenant is metered and parked at its allowance, and Raft replicas serve read-your-writes.

  • 3.9 msTwo-index p95 (settled)
  • 0.65×Disk against raw data
  • 3,563 tx/sReaders (settled)

Trade-offs

  • A ground-up redesign, not a Postgres rewrite. At 600M rows it uses 46% less disk and writes 23% fewer bytes, but Postgres loads 15% faster.
  • Tuned for tables past memory. A two-index query settles at 3.9 ms p95 against 490 ms, but while the table fits in memory Postgres serves nearly twice the readers.

Q&A4

One node on one machine: 600 million rows, four indexes and a 64 GiB memory cap. Replication, branching, tenancy and distributed compaction are not measured, and latency at a fixed arrival rate was not either.

Reviews

Loading reviews

    More in Distributed systems

    See all 20 →
    • arbiterPostgreSQL job queue for Haskell, with no broker and no leader
    • RRQClosed-loop payment ledger on sharded Postgres with a Kafka outbox
    • RuvioRust key-value server that speaks RESP, with locks and queues as commands
    • clinkC++ stream processing engine that stays correct when processes die
    • pg-statusSidecar that reports PostgreSQL master, replicas and replication lag
    • LassoSelf-hosted Ethereum JSON-RPC proxy that routes each call to the best provider

    More in Postgres

    See all 25 →
    • SupermetryCookie-free web and product analytics on one Go binary and PostgreSQL
    • StreambedPostgres-to-Iceberg CDC engine with a built-in Postgres wire query server
    • MigrationPilotPostgreSQL migration linter that blocks unsafe DDL before merge
    • go-ledgerMulti-tenant double-entry payment ledger API in Go, built in public
    • pistachioDeclarative PostgreSQL schema management with a plan and apply workflow
    • pgledgerDouble-entry ledger implemented entirely in PostgreSQL functions and views

    More in Database internals

    See all 29 →
    • PaganelData migration engine that verifies the destination down to the row
    • FeOxDBEmbedded key-value store in Rust with write-behind durability
    • SNKVEmbedded key-value store built directly on SQLite's B-tree
    • musqlSQLite-compatible SQL engine on columnar storage and a JIT
    • MongrelDBEmbedded Rust database with vector, sparse and text indexes
    • MenteDBRust storage engine built for AI agent memory