Leonardo Borges Ramos

Develop DriveVersion 1.4.0, in use

The company's files in a Windows folder, connected to the ERP.

Develop Drive keeps the company's files in the cloud and shows them in the browser, in the ERP app and in a regular Windows folder that a tray app keeps in sync both ways. Everything shows up in the folder, but only downloads when someone opens it.

Develop Drive inside the ERP, with test data: company folders, files and the details panel
Problem

The company's files lived on a network server in the office, far from the customer, quote and order that live in the ERP.

What I built

The API, the web screen, the native ERP screens and the tray app, with a sync engine written in Rust.

Result

From version 1.0 to 1.4 in two months; in one migration, 241 GB went up in 22 hours with nobody touching the PC.

152 µsto save the sync state
Source

Before, a single 50.8 MB JSON was rewritten in full: about 290 ms each time. Measured with 223,496 items after the switch to SQLite.

241 GBuploaded in 22 h in one migration
Source

About 11 GB per hour, measured while migrating a customer's network folder, on version 1.4.0.

459engine tests passing on 1.4.0
Role
Product, code and shipping every version
Version
1.4.0, released on 10/21/2026
Stack
Tauri 2 · Rust · SQLite · Node.js · Express · MySQL · Cloudflare R2 · React

How a file leaves the PC and reaches the cloud

  1. The watcher notices the changebut only marks the folder as "dirty"; it decides nothing
  2. Reconciliation compares three snapshotswhat the app knew, what is on disk and what is on the server
  3. The file goes up in partsabove 16 MB, in chunks that resume where they stopped if the network drops
  4. A conveyor of 8 uploadsfolders are created level by level and files go up 8 at a time, with no idle queue
  5. The state is savedonly what changed, in an SQLite database on the PC itself

Three decisions

Decided

1. Reconciliation decides, not the folder watcher

WhyDeciding on the watcher's event creates echo: the app sees its own download and uploads the file back.

CostA rule that must always be remembered: what did not come from the server only becomes a deletion if the listing was complete.

Read more

The watcher (the notify crate) only says something changed. The decision comes from a pure function that compares three snapshots: what the app knew, the disk and the server. Being pure, it is testable without network or disk, and renaming or moving a folder comes for free, with no special code. The golden rule: in a partial server listing, "not returned" does not mean "deleted". Without it, the Drive would empty itself.

Decided

2. State in SQLite, saving only what changed

WhyA single 50.8 MB JSON was rewritten every 2 s, with the engine locked during the write.

CostOne more native database inside the app and a migration of the old file.

Read more

With 223,496 items, saving the state went from about 290 ms to 152 µs, and the item limit per synced folder rose from 200,000 to 1 million. The engine stopped pausing to save.

Decided

3. Always delete with a brake

WhyIn a system that syncs, one bad listing becomes a mass deletion on everyone's PC.

CostOne more question when someone really does want to delete a lot.

Read more

What gets deleted in the Drive goes to the Windows Recycle Bin, never gone for good. Deleting many files on the PC turns into a two-button question, starting at 25 files and with a limit that grows with the square root of the folder's total. And if someone deletes one of the three root folders (Personal, Company, Shared), it comes back, with its content as placeholders that download on open: a folder disappearing never means the files were deleted.

What went wrong: the bulk upload that slowed the whole ERP

  1. Symptomthe whole ERP slow while one company uploaded a big folder from the Drive screen
  2. Measured141 calls in 44 s taking 85% to 91% of the server's time
  3. Causethe screen fired one upload per file, all at once, with no limit
  4. Fixat most 3 simultaneous uploads on screen, batched reloads and a cap of 3 per company on the server; CPU dropped from 64–72% to 51–61%

What stayed: Every upload route has a per-company cap. One busy company does not slow the others down.

Quer conversar sobre este projeto?