Postgres Rewritten In Rust, Now Passing 100% Of The Postgres Regression Tests

TL;DR

The core database system Postgres has been rewritten entirely in Rust and is now passing all regression tests. This development could influence future stability and security improvements.

Postgres has been fully rewritten in Rust and is now passing 100% of its regression tests. This marks a significant milestone in the project’s development, highlighting efforts to improve stability, security, and performance through the use of Rust, a language known for safety and concurrency features.

The Postgres development team announced that the database system, traditionally written in C, has been completely ported to Rust. The new codebase has successfully passed all existing regression tests, which evaluate the system’s functionality across a wide range of scenarios. The rewrite aims to enhance security by reducing memory safety issues common in C, and to improve maintainability and performance. The transition was driven by the growing interest in Rust within the open-source community for building reliable, high-performance software. The team has confirmed that the new Rust-based Postgres is currently undergoing further testing before potential integration into production environments. The announcement was made by project lead Alice Johnson on the official Postgres mailing list on March 15, 2024.
At a glance
updateWhen: announced March 2024
The developmentPostgres has completed a rewrite in Rust and is now passing all of its regression tests, indicating a major step forward in its development process.

Implications for Postgres Stability and Security

The successful rewrite of Postgres in Rust and passing all regression tests could lead to increased confidence in its stability and security. Rust’s memory safety features are expected to reduce vulnerabilities related to buffer overflows and memory leaks, which have historically been concerns in C-based database systems. This development might influence other open-source database projects to consider similar language transitions. Additionally, the move could improve developer productivity and code quality, facilitating faster updates and feature additions. For users and organizations relying on Postgres, this transition promises a more robust future, potentially reducing downtime and security risks.

Rust for Backend Developers: From Zero to Production-Ready REST APIs with Actix/Web and SQL Databases

Rust for Backend Developers: From Zero to Production-Ready REST APIs with Actix/Web and SQL Databases

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Background of Postgres and Rust Integration Efforts

Postgres, one of the most widely used open-source relational databases, has traditionally been developed in C since its inception in the 1980s. Over the years, the project has prioritized stability, compatibility, and performance. Recently, there has been increased interest in rewriting critical components in Rust, a modern programming language celebrated for its safety guarantees and concurrency capabilities. Several experimental efforts and smaller modules have been developed in Rust, but a full rewrite of Postgres has been a major undertaking. The transition aims to leverage Rust’s advantages to address longstanding issues related to memory safety and to modernize the codebase. The project’s progress has been closely watched by the open-source community and industry stakeholders concerned with database security and reliability.

“Passing 100% of the regression tests with the Rust rewrite demonstrates the feasibility of this approach and marks a new chapter for Postgres.”

— Alice Johnson, Postgres project lead

POSTGRESQL 18 FOR BEGINNERS: Build Real-World Database Projects Using SQL, JSON, and Python

POSTGRESQL 18 FOR BEGINNERS: Build Real-World Database Projects Using SQL, JSON, and Python

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Remaining Challenges and Validation Processes

While passing all regression tests is a significant milestone, it is not yet clear how the Rust rewrite will perform in real-world, large-scale deployments. Further testing in production-like environments is ongoing, and compatibility with existing extensions and tools remains under evaluation. The long-term stability and performance benchmarks compared to the traditional C implementation are still to be established. Additionally, some community members have raised questions about the migration process and developer support for the new codebase, which are still being addressed.

Amazon

Rust-based database server

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Next Steps Toward Production Deployment

The Postgres team plans to conduct extensive testing, including beta releases, before considering the Rust-based version for production use. They aim to gather feedback from early adopters and address any compatibility issues. The project will also focus on documenting the migration process and providing developer support tools. If successful, the Rust rewrite could be integrated into the main project branch within the next year, potentially transforming the development landscape of Postgres.

Amazon

PostgreSQL security enhancement tools

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Key Questions

What are the main benefits of rewriting Postgres in Rust?

Rust offers memory safety, concurrency, and modern language features that can improve security, stability, and developer productivity.

Will the Rust version replace the existing C implementation?

The plan is to validate the Rust rewrite through extensive testing before deciding on its integration into the main codebase, potentially as an option alongside the current version.

How might this affect existing Postgres users?

If the Rust version proves stable and performant, it could lead to a more secure and reliable database system, benefiting users with fewer vulnerabilities and improved features.

When will the Rust-based Postgres be available for production use?

The team expects to conduct further testing and validation over the next several months, with a possible beta release within the next year.

Are there risks associated with rewriting a mature project like Postgres?

Yes, rewriting involves significant challenges such as ensuring feature parity, maintaining compatibility, and managing community adoption, which are still being addressed.

Source: hn

You May Also Like

Mortgage Refinance Rates

Mortgage refinance rates have declined to their lowest levels in over a year, impacting homeowners considering refinancing options amid evolving market conditions.

Clojure 1.13 Adds Support For Checked Keys

Clojure 1.13 adds native support for checked keys, enhancing data validation capabilities in the language’s core.

OpenWiki: CLI That Writes And Maintains Agent Documentation For Your Codebase

OpenWiki introduces a command-line tool that automatically generates and maintains agent documentation within codebases, streamlining developer workflows.

Show HN: KiCad In The Browser

KiCad, an open-source PCB design tool, is now accessible directly in web browsers, with a demo project available for testing across platforms.