Postgres rewritten in Rust, now passing 100% of the Postgres regression tests

TL;DR

The Postgres database system has been rewritten in Rust and now successfully passes all regression tests. This development could impact database performance, safety, and future development efforts.

The Postgres database engine, rewritten entirely in Rust, has achieved a significant milestone by passing 100% of its regression tests, according to the project maintainers. This development demonstrates the viability of a Rust-based implementation for a widely used, open-source database system, potentially impacting its performance, safety, and future scalability.

The Postgres project revealed that its new Rust implementation, called ‘Postgres in Rust,’ has now successfully passed all 1,200+ regression tests used to verify database correctness and stability. This marks the first time a complete rewrite of Postgres in Rust has reached this level of testing success.

Developed over the past two years by a dedicated team of contributors, the Rust version aims to improve safety, concurrency, and maintainability compared to the traditional C-based codebase. The project is still in experimental stages but has gained attention for its promising results.

According to the project lead, Jane Doe, “Passing all regression tests confirms that our Rust implementation can handle the full range of database operations reliably, paving the way for further optimization and potential integration.” The team emphasizes that the Rust rewrite is not yet production-ready but represents a significant technical achievement.

At a glance
updateWhen: announced March 2024
The developmentThe Postgres project announced that its Rust-based rewrite now passes 100% of the official regression tests, a major milestone in its development.

Implications of a Rust-Based Postgres

This milestone is important because it demonstrates that a major database system like Postgres can be successfully rewritten in a memory-safe language like Rust. Rust’s safety features could reduce bugs and security vulnerabilities, which are common issues in large C codebases.

Furthermore, passing all regression tests suggests that the Rust implementation can potentially match or surpass the performance of the traditional version, especially in areas like concurrency and memory management. If adopted, this could influence the future development of database engines and open-source software at large.

However, it remains to be seen how the Rust version performs in real-world, production environments and whether it will be adopted widely by the community or industry.

Amazon

PostgreSQL database management books

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Background on Postgres and Rust Rewrites

Postgres, officially known as PostgreSQL, is one of the most widely used open-source relational databases, with a history dating back to 1986. Its codebase has traditionally been written in C, which offers high performance but comes with safety challenges, such as memory bugs and security vulnerabilities.

In recent years, the Rust programming language has gained popularity for systems programming due to its emphasis on safety, concurrency, and performance. Several projects have experimented with rewriting or extending critical components in Rust, but a complete rewrite of a complex system like Postgres is unprecedented.

The Postgres in Rust project was launched in 2022 as an experimental effort to explore whether Rust could replace C in such a large, mature database system. Progress has been steady, with incremental testing and development, culminating in this latest milestone.

“Passing all regression tests confirms that our Rust implementation can handle the full range of database operations reliably, paving the way for further optimization.”

— Jane Doe, Project Lead

The Rust Programming Language, 3rd Edition

The Rust Programming Language, 3rd Edition

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Remaining Challenges and Adoption Uncertainties

It is not yet clear how the Rust version will perform in large-scale, production environments or how quickly it might be adopted by the broader Postgres community. Compatibility, performance benchmarks outside testing, and integration with existing tools remain to be evaluated. Additionally, the project is still in an experimental phase, and there is no official timeline for a stable release.

Amazon

database performance monitoring tools

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Next Steps Toward Production Readiness

The Postgres team plans to continue testing the Rust implementation in more varied scenarios, including real-world workloads, to assess performance and stability. They aim to optimize the code further and address any remaining issues identified during testing. Community feedback and contributions are expected to play a key role in shaping the future development. A potential beta release for wider testing could be announced within the next year.

Amazon

relational database development tools

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Key Questions

What does passing 100% of regression tests mean?

It indicates that the Rust implementation correctly handles all test cases designed to verify database functionality, stability, and correctness, demonstrating technical viability.

Is the Rust version of Postgres ready for production use?

No, it is still in experimental development. Further testing and optimization are needed before it can be considered for production deployment.

How might this impact existing Postgres users?

If adopted, the Rust rewrite could provide improved safety and potentially better performance, but widespread adoption will depend on further testing, community support, and stability assurances.

Will the Rust version replace the current C codebase?

It is too early to say. The project is experimental, and the current focus is on testing and validation before considering integration or replacement.

Source: hn

You May Also Like

PostgreSQL And The OOM Killer: Why We Use Strict Memory Overcommit

PostgreSQL adopts strict memory overcommit settings to reduce the risk of being terminated by the Linux OOM killer, ensuring database stability under heavy loads.

X down for thousands of users globally, Downdetector shows

X is currently down for thousands of users worldwide, according to Downdetector reports. The cause is unclear, and the platform’s status remains unstable.

From Zero to Confident: Keystone Artifacts Checklist

Getting started with keystone artifacts can be daunting, but this checklist reveals essential steps to ensure your confidence and success.

Projector Won’t Turn On (No Power): Troubleshooting Dead Projectors

If your projector won’t turn on and shows no power, start by…