Back to Devoured - October 29, 2026
DEVOURED
Egres: A Postgres-compatible database for heavy, multi-tenant workloads

Egres: A Postgres-compatible database for heavy, multi-tenant workloads

Data Manishrjain.com
Egres is a Postgres-compatible database written in Zig that handles multi-tenancy in a single process with per-query resource metering.
What: Created by Manish R. Jain, Egres is an open-source database built from scratch that uses a custom storage engine called zdb (an LSM forest). It supports thousands of tenants on one node, per-query CPU/memory/IOPS metering, and zero-copy branching.
Why it matters: It challenges the traditional 'process-per-connection' database architecture, aiming to solve long-standing Postgres issues like write amplification, vacuuming, and unpredictable multi-tenant performance.
Takeaway: Test your current Postgres workload against Egres using the quickstart: curl -fsSL https://egresql.io/install.sh | sh
Deep dive
  • Multi-tenant architecture: Uses a custom coroutine system (zfiber) to handle thousands of tenants in a single process.
  • Resource metering: Tracks CPU ticks and disk IOPS per query to prevent noisy neighbor issues.
  • Storage engine (zdb): An LSM forest (tree of LSM trees) that replaces the heap and vacuuming with versioning and background compaction.
  • Postgres Compatibility: Speaks the Postgres wire protocol, allowing existing drivers and ORMs to connect.
  • Performance: Benchmarks show significant disk usage reduction (46%) and improved p95 latency on multi-index queries compared to Postgres 18.
  • Branching: Supports instant database and table cloning using manifest updates without copying data.
  • Isolation: Uses pessimistic locking with deadlock detection rather than optimistic concurrency.
Decoder
  • LSM Tree (Log-Structured Merge-Tree): A data structure that optimizes write performance by buffering changes in memory and flushing them to disk in sequential batches, avoiding random I/O.
  • Vacuuming: A Postgres maintenance process that reclaims storage occupied by dead tuples (deleted/updated rows), often a source of performance overhead and bloat.
  • WAL (Write Ahead Log): A data file used to ensure durability by recording every change before applying it to the database tables.
Original article

Full article content is not available for inline reading.

Read the original article →

Explore all 58 articles in today's digest

Fresh dev news, AI-digested daily. Never miss a trend at devoured.fyi