An Overview of pgrust: A Postgres Rewrite in Rust
Better Stackgo watch the original →
the gist
pgrust is an experimental Postgres-compatible database engine written in Rust that passes the official PostgreSQL regression test suite, though it remains in early development and is not yet production-ready.
The Core Architecture
pgrust is a complete rewrite of the PostgreSQL engine in Rust rather than an extension or a wrapper. It maintains wire-protocol compatibility with standard psql clients and can mount existing PostgreSQL 18.3 data directories. The project utilizes a process-per-connection model in its current release to mirror standard PostgreSQL behavior, but developers are actively experimenting with a thread-per-connection architecture in an unreleased branch to reduce memory overhead and improve concurrency.
Development and Performance Claims
The project relies heavily on AI-assisted coding to manage the scale of the rewrite, which the authors argue significantly lowers the cost of large-scale infrastructure experimentation. While the current public version focuses on functional parity, the developers claim that the internal thread-per-connection prototype achieves 50% higher performance on transactional workloads and up to 300x faster performance on analytical queries. These performance figures are currently unverified as the specific code paths enabling these gains have not been released for public benchmarking.
Production Readiness and Risks
Despite passing all 46,066 official PostgreSQL regression queries, pgrust is not a drop-in replacement for production environments. It lacks the extensive battle-testing required for crash recovery, replication, and long-term stability that the original PostgreSQL codebase has accumulated over decades. Furthermore, the project does not yet support the vast ecosystem of PostgreSQL extensions, which remains a significant barrier to real-world adoption.