Introduction

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#

TierPlatformsState
1: built, tested, benchmarkedWindows x86_64All tests, lint and benchmarks run here, in the default build and in the portable build.
1: tests runLinux 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 runLinux aarch64, macOS (Intel and Apple Silicon), Windows aarch64The portable code paths are exercised by the portable build on x86_64. Not compiled or run on these systems.
3: best effort32-bit systems (they need 64-bit atomics), big-endian CPUsOn-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#

  1. One portable implementation, written with the standard library and plain arithmetic, defines the behaviour.
  2. 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.
  3. The portable build option switches every fast path off on any machine.
  4. Bytes on disk and on the wire are fixed by format descriptions with explicit little-endian integers; tests assert exact bytes.
  5. Targets without 64-bit atomics fail to compile with a clear message.

Differences between systems#

DifferenceHandling
What fsync guaranteesFile::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 fileA directory sync is still missing on all systems (an open item of the WAL).
File locking between processesNot implemented. Two server processes started on the same data directory would corrupt the logs. Start one.
Service installationLinux: a systemd unit. Windows: a startup task, not a Windows service.
Resource control by cgroupsLinux with cgroups v2 only.
Free disk space check of the watcherdf on Linux and macOS, PowerShell on Windows.
Default data directory/var/lib/raftdb or %ProgramData%\RaftDB if that folder exists, otherwise ./raftdb-data.

See also#