Skip to content
All articles

Syncing 8 laboratories without touching the legacy software

· · 3 min read

Laboratoires SION runs eight medical laboratories in Yaoundé, Douala and Bafoussam. Each site ran its own copy of a legacy application, with a local SQLite database and no link between sites. Management had no consolidated view of revenue, prescribers or patients: every number was rebuilt by hand.

The hard constraint: the legacy software could not be modified, and some front desks can stay offline for up to 72 hours. Here is how the network got a single view without stopping a single desk.

1. Back up without trusting the network or the machine

Backups were manual, on Windows machines exposed to power cuts. Lightweight agents, compiled to native binaries, now back up each site's database, hash it, upload it over HTTPS and report a heartbeat.

Two details make the difference. The backup uses SQLite's online backup API rather than a raw file copy, which could ship a half-written file during a power cut. And the API derives the site from the agent's token, never from the request: a compromised agent cannot overwrite another site's backup. Anything suspicious is quarantined rather than accepted.

2. Read eight databases without changing the software that writes them

The management tool that leadership opens every day reads the backed-up databases. On the server, files are replaced at every backup: a report running several queries could mix two states of the same database without noticing.

All reads go through a single access point that runs a report's queries on one connection, hence on one state of the file. The rules that define revenue and prescriber attribution are written once and shared by every screen.

3. Remap 72% colliding identifiers

The eight databases had been forked from the same trunk and kept issuing identifiers from the same counter. A September 2026 measurement found 20,060 colliding prescription identifiers (72%), 17,557 patient identifiers (69%) and 2,725 prescriber identifiers (42%). A naive merge was impossible.

The platform issues its own identifiers and keeps, for good, a mapping between each legacy identifier, its site and the new key. Nothing is lost or ambiguous, and staff still see the familiar number at the desk.

4. One authorization model, and revocation in under a minute

Three tools each had their own role list (seven, three and six). A numeric hierarchy let a site manager validate a biologist's work — a medical act that role must never perform. A shared package now defines 13 roles, 68 permissions with no wildcard and 6 scope levels, locked by a test.

Finally, a revoked account must be cut off within 60 seconds, while an offline workstation must keep registering patients. Services receive an internal assertion valid for 60 seconds, checked locally; offline, the workstation falls back to a restricted mode and queues its changes.

A project that touches money, data or several sites?

In 30 minutes I will tell you what is risky, what is simple, and where to start.

Syncing 8 laboratories without touching the legacy software