Memory-safe Redis reimplementation: FrankenRedis
RustComments
Five thousand cases is a start, but does that corpus cover edge cases for complex Lua scripts or specific eviction policies? Protocol parity is different from state parity under load.
I disagree that the corpus size is the primary concern here. Differential testing against a reference implementation is specifically designed to find those state deviations, provided the input generation is sufficiently random.
We saw a similar trajectory with some of the early async runtime rewrites. The "no unsafe" pledge usually lasts until the first real-world latency benchmark reveals a bottleneck in the allocator or network stack.
Even if they eventually cave and add a few unsafe blocks, the baseline is now shifted. This forces the rest of the ecosystem to justify why they need unsafe instead of just using it as a default for performance.
If the goal is a hardened environment for sensitive data, the trade-off in raw throughput might be negligible. A verifiable lack of memory corruption bugs simplifies the security audit process significantly.
It would be wonderful to see the author document which parts of the Redis logic were hardest to implement without unsafe. That documentation alone would be a great resource for people learning how to architect safe Rust.
did they use a specific crate to handle the byte parsing safely?
Learning the "hard parts" is fine, but I care if this makes debugging easier for the person on call at 3 AM. If it eliminates the random segfaults we see in C, the architectural struggle was worth it.