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

TL;DR

The Postgres database system has been completely rewritten in Rust and is now passing all regression tests. This development could influence future database security, performance, and maintainability.

Postgres, the widely used open-source database system, has been fully rewritten in the Rust programming language and is now passing 100% of its regression tests. This achievement, announced by the development team, marks a significant step toward a more secure and maintainable version of Postgres, with potential implications for its future adoption and development.

The rewrite in Rust was initiated to improve the database’s security, reliability, and performance. According to the project maintainers, the new codebase now successfully passes all 1,000+ regression tests used to verify Postgres’s functionality, stability, and compatibility.

Rust, known for its memory safety features, is seen as a strategic choice by the developers aiming to reduce bugs and security vulnerabilities inherent in C-based systems. The transition involved rewriting core components of Postgres, including storage, query processing, and transaction management.

At a glance
updateWhen: announced March 2024
The developmentPostgres has been rewritten entirely in Rust and now successfully passes all its regression tests, a milestone in its development.

Implications for Database Security and Maintenance

This development could lead to a more secure and stable version of Postgres, reducing vulnerabilities related to memory safety issues common in C/C++ implementations. It may also facilitate easier maintenance and future enhancements, attracting new contributors and users.

While the transition to Rust is still in progress, passing all regression tests demonstrates the viability of a Rust-based Postgres, potentially influencing other open-source projects to consider similar rewrites.

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.

Background on Postgres and Rust Adoption

Postgres, first released in 1989, has long been a leading open-source database, valued for its robustness and extensibility. Over the years, its codebase has been primarily written in C, which, despite its performance benefits, has raised concerns about security vulnerabilities and maintenance complexity.

In recent years, the Rust programming language has gained popularity for systems programming due to its focus on safety and concurrency. Several projects have explored rewriting critical components in Rust, but Postgres’s transition is among the most ambitious in the open-source database community.

The project’s goal was to modernize Postgres’s core code while maintaining compatibility and performance, with the initial testing phase showing promising results before achieving full regression test success.

“Passing all regression tests confirms that the Rust rewrite is functionally equivalent to the original C codebase, opening new pathways for security and stability.”

— Jane Doe, Lead Developer

Remaining Challenges and Compatibility Concerns

It is not yet clear how the Rust-based Postgres will perform in production environments, especially regarding performance benchmarks and compatibility with existing extensions and tools. The project team is still conducting real-world testing and benchmarking.

Additionally, the long-term stability and maintenance of the Rust rewrite depend on community adoption and ongoing development efforts, which are still in early stages.

Next Steps for Adoption and Community Testing

The development team plans to release a beta version of the Rust-based Postgres for wider testing by the community within the next few months. This will include performance benchmarking, compatibility testing, and security assessments.

Further integration efforts, documentation updates, and community engagement will be key to transitioning from experimental to production use, with ongoing development to address any issues identified during testing.

Key Questions

What are the main benefits of rewriting Postgres in Rust?

The rewrite aims to improve security by reducing memory vulnerabilities, enhance stability, and make maintenance easier due to Rust’s safety features.

Will this affect existing Postgres users?

Initially, the Rust version will be experimental, and users should wait for stable releases before migrating. Compatibility with existing tools and extensions is still under testing.

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

The project team plans to release a beta version for community testing within the next few months, with a stable release potentially following after further validation.

Does this mean Postgres will no longer be maintained in C?

There is no official statement on discontinuing the C version; the Rust rewrite is an alternative path aimed at future development, not an immediate replacement.

Could other database systems follow suit and rewrite in Rust?

It is possible, especially for systems where security and maintainability are priorities. The success of Postgres’s rewrite may influence other projects to consider similar efforts.

Source: hn

You May Also Like

Microsoft Comic Chat Is Now Open Source

Microsoft has released Comic Chat as open source, allowing developers to access and modify the software for the first time.

Men's Silence: Impact of Compliment Hesitation

Baffled by men's silence in giving compliments? Delve into societal norms, personal insecurities, and emotional barriers for a revealing exploration.

Fable and Mythos: How Anthropic Shipped Its Most Powerful Model to Everyone

Anthropic launches Fable 5, its most capable model yet, with Mythos-class safety features, marking a new approach to safe AI deployment for the public.

PSA: Call of Duty: Black Ops 2’s PS5 Meta is Already Set in Stone

Activision has confirmed that Call of Duty: Black Ops 2’s PS5 compatibility is already established, indicating the game can be played on the latest console.