Unsafe Policy

AionDB currently prefers safe Rust by default, even in parts of the engine where a more aggressive database implementation might choose low-level unsafe techniques.

This is an intentional product decision, not an accident.

Current policy

The workspace denies unsafe by default. Small exceptions exist only where the gain is obvious and the blast radius is narrow, such as selected SIMD kernels, prefetch hints, or tightly scoped platform interop.

For v0.1, the default position is:

This makes the codebase easier to review, test, and evolve while SQL, graph, vector, storage, and recovery behavior are still moving.

What this choice costs

Avoiding broad unsafe use is not free. In some hot paths, AionDB may pay in:

For the current stage of the project, that trade is acceptable. The project is still optimizing for correctness, inspectability, and architectural stability first.

Future direction

A future performance-oriented variant may intentionally introduce roughly 30 additional unsafe blocks in carefully chosen areas of the engine.

That does not mean "unsafe everywhere". It means targeted use in places where the performance upside is real and the invariants can be documented and tested.

The most likely candidates are:

If that happens, the rules should remain strict:

Why not do it now

Right now AionDB is still an alpha database, not a fully stabilized storage engine chasing every last percentage point.

At this stage, broadening unsafe too early would make it easier to hide correctness bugs in precisely the subsystems that are still being validated:

The current position is straightforward: