Platforms
Which operating systems and CPUs Raft DB has been tested on, the portability rules, and what differs between systems.
Raft DB must run on Windows, Linux, macOS and less common systems and behave the same everywhere: the same input gives the same output and the same bytes on disk. The rules are below.
Support tiers#
| Tier | Platforms | State |
|---|---|---|
| 1: built, tested, benchmarked | Windows x86_64 | All tests, lint and benchmarks run here, in the default build and in the portable build. |
| 1: tests run | Linux x86_64 (Ubuntu 24.04, kernel 6.8, Rust 1.93.0) | Tests passed in the default and portable builds on an earlier build; the SQL front-end and the cluster tests were also run on Linux test hosts. Benchmarks were run on one Linux server (see How it compares). |
| 2: designed for, not yet run | Linux aarch64, macOS (Intel and Apple Silicon), Windows aarch64 | The portable code paths are exercised by the portable build on x86_64. Not compiled or run on these systems. |
| 3: best effort | 32-bit systems (they need 64-bit atomics), big-endian CPUs | On-disk formats are explicit little-endian and covered by byte-exact tests. Not run. |
The Linux test run was done on an earlier build than the current one. Treat Linux as "tested at a point in time" and test your own workload before relying on it.
The rules that keep behaviour the same#
- One portable implementation, written with the standard library and plain arithmetic, defines the behaviour.
- A platform fast path (SSE2, SSE4.2 CRC-32C, prefetch,
ioctlsocket,MSG_PEEK,setsockopt) is allowed only inside the same function, with an equivalence test against the portable version. - The
portablebuild option switches every fast path off on any machine. - Bytes on disk and on the wire are fixed by format descriptions with explicit little-endian integers; tests assert exact bytes.
- Targets without 64-bit atomics fail to compile with a clear message.
Differences between systems#
| Difference | Handling |
|---|---|
What fsync guarantees | File::sync_data is used everywhere. Windows opens the log write-through (D37). The macOS behaviour of sync_data is expected to be a full-drive flush and must be verified on a Mac before release. |
| Directory entries after creating a file | A directory sync is still missing on all systems (an open item of the WAL). |
| File locking between processes | Not implemented. Two server processes started on the same data directory would corrupt the logs. Start one. |
| Service installation | Linux: a systemd unit. Windows: a startup task, not a Windows service. |
| Resource control by cgroups | Linux with cgroups v2 only. |
| Free disk space check of the watcher | df on Linux and macOS, PowerShell on Windows. |
| Default data directory | /var/lib/raftdb or %ProgramData%\RaftDB if that folder exists, otherwise ./raftdb-data. |