All blog posts
Updates 3 min read

Commonveil's Rust Server Migration Begins With Data Parity

The first Rust backend stage implemented configuration, data storage and site pages with the same interfaces as the existing Node.js server.

By Comutability Published Update from
A Rust development workstation with two equal database stacks representing data parity.

Project update: 15 November 2026. GitHub pull request #8: merged into GitHub source, not necessarily deployed. Commonveil has not been independently security audited.

The first Rust backend stage implemented configuration, data storage and site pages with the same interfaces as the existing Node.js server.

Why this matters

A self-hosted network should remain maintainable without forcing operators to abandon their existing data. This migration is designed around compatibility: the new server reads the same configuration and SQLite layout while the production Docker image continues to use Node.js. Matching behaviour is the gate, not simply getting the Rust code to compile.

Detailed change record

The public engineering notes below describe what was implemented or proposed and the evidence recorded with the change. Historical instructions in the notes describe the pull request at the time it was raised.

The first stage of moving the self-hosted server from Node.js to Rust (rust/commonveil-server), with the same HTTP API and the same data on disk. The Docker image is unchanged: it keeps running the Node.js server until every part has moved and matches. This is not a release.

What's in it

  • Settings: every variable in docs/SELF_HOSTING.md, read the way server/config.mjs reads it.
  • Data store: the same SQLite file and layout as server/store.mjs, with the same query language and row rules. The same random workload (1,000 operations across four seeds) gives identical answers from the Rust and Node stores, on both Node 22 and 26.
  • The site: pages, search tags, sitemap and robots. About 40 requests get the same status, security headers and bytes from both servers. I confirmed the comparison catches a deliberately broken header.
  • /api/health and /api/site. Everything not yet moved answers 501 NOT_YET.

What the comparison found

  • Now matched: a null sort is oldest first in the Node store, while a missing one is newest first.
  • Unspecified in JavaScript: for a field that mixes types, < isn't a consistent ordering, so the sort order is up to the engine. Node 22 and Node 26 give different orders for the same rows, which CI caught. Real fields hold one type each, so the comparison sorts only on such fields; filters still mix types. The Rust store sorts with a TimSort because, unlike the standard library's sort, it never panics on an inconsistent comparison.

CI

A new rust job builds the self-hosted site, then runs the tests, the comparison with the Node server, and clippy.

Next: sign-in and accounts (passkeys, sessions and devices), then the backend functions, group by group.

https://claude.ai/code/session_01E76Taoar7U1rk6dCAJ1SbV

Decisions and principles behind the work

Comutability is building towards privacy, user control and genuinely self-hostable software. That does not mean every proposal is already deployed. The Rust backend is being checked for parity with Node.js before it can replace the existing Docker image.

What comes next

Repeat parity tests, back up existing databases before any future deployment and retain a straightforward rollback path.

Check the sources

Sources and further reading

Explore the evidence and original project records behind this article.