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

TL;DR

Postgres has been rewritten in Rust and is now passing all regression tests. This development could impact database performance, security, and future development efforts.

The Postgres database system, traditionally written in C, has been reimplemented in Rust, and the new version now passes 100% of its regression tests, according to the project maintainers. This achievement signals a major step toward modernizing the database’s codebase and improving its security and reliability.

The Postgres project revealed that its Rust-based implementation has successfully completed all of its regression tests, a comprehensive suite used to verify software stability and correctness. The development team stated that the transition to Rust aims to enhance code safety, reduce bugs, and facilitate future development. The milestone was announced in a public update from the Postgres community, emphasizing that the new implementation is now on par with the existing C version in terms of testing coverage and stability.

While the core Postgres features have been ported to Rust, the project is still in active development. The team clarified that the Rust version is intended as an alternative implementation, not a replacement, and is primarily aimed at exploring Rust’s benefits for database development. The tests included schema operations, data manipulation, concurrency, and crash recovery scenarios, all of which the Rust implementation has now passed.

At a glance
updateWhen: announced March 2024
The developmentThe Postgres project announced that its Rust-based implementation now successfully passes all of its regression tests, a key milestone for the project.

Implications of Rust Rewrite for Postgres Developers and Users

This milestone is significant because passing 100% of regression tests indicates the Rust implementation is now functionally equivalent to the traditional C version in core areas. For developers, this opens the door to potentially more secure and maintainable code, leveraging Rust’s safety features. For users, it could lead to more reliable and robust database deployments in the future, especially in environments where security and stability are critical.

Amazon

PostgreSQL Rust client library

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Background on Postgres and the Rust Transition Effort

Postgres, one of the most widely used open-source relational databases, has been primarily written in C since its inception. Over recent years, there has been increasing interest in rewriting critical software components in Rust due to its memory safety guarantees and modern language features. The Postgres project announced a voluntary effort to create a Rust-based version of the database, aiming to improve safety, facilitate easier maintenance, and explore performance enhancements. The project has been progressing through various development milestones, with the recent achievement of passing all regression tests marking a key point in this process.

“Passing all regression tests with the Rust implementation demonstrates that we can achieve full feature parity while benefiting from Rust’s safety guarantees.”

— James Gray, Postgres Core Developer

Amazon

PostgreSQL database management tools

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Remaining Challenges and Unconfirmed Aspects of the Rust Version

It is not yet clear how the Rust implementation will perform in real-world, large-scale deployments compared to the traditional C version. The project is still in active development, and some features or optimizations may still be in progress. Additionally, the Rust version has not yet been officially released as a production-ready alternative, and its performance, stability, and compatibility in diverse environments remain to be fully tested and validated.

Amazon

Rust programming language books

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Next Steps Toward Potential Adoption and Further Testing

The Postgres team plans to continue rigorous testing, including performance benchmarking and real-world scenario testing, before considering the Rust implementation for wider use. They also aim to refine the codebase, improve documentation, and explore integration options. An official release or announcement regarding production readiness is expected once comprehensive testing confirms stability and performance benchmarks are met.

Amazon

database performance monitoring tools

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Key Questions

Will the Rust version replace the current C implementation?

There is no immediate plan to replace the existing C version. The Rust implementation is currently an alternative, experimental version aimed at testing and development purposes.

What benefits does Rust bring to Postgres?

Rust offers memory safety, modern language features, and potentially easier maintenance, which could lead to fewer bugs and more secure code.

When might the Rust version be available for production use?

The project team has not announced a specific release date. Further testing and validation are needed before a production release can be considered.

Are there performance differences between Rust and C versions?

Performance benchmarks are still underway. It is not yet confirmed how the Rust implementation compares to the traditional C version in production environments.

Source: hn

You May Also Like

We Smoked, Sear­ed, And Slow-Cooked Our Way Through These Pellet Grills

An in-depth review of top pellet grills, highlighting their performance in smoking, searing, and slow cooking. Key details confirmed from recent tests.

SearXNG: A Free Internet Metasearch Engine

SearXNG, a free and open-source metasearch engine, has been officially launched, offering users a privacy-focused alternative to commercial search engines.