Guesses are cheap; measurements are not
Malia's first version was built with Next.js and felt heavy on a small VPS. The usual temptation at this point is to rewrite everything at once, then claim a saving nobody ever measured.
We measured first: twelve samples of memory use per container, written down as they came. The result did not match our guess. The second-largest consumer after the app itself was not the database but MinIO — 111.9 MB, roughly 2.7 times the memory of the Postgres instance holding the entire database. All of it to store receipt images of a few dozen kilobytes.
The biggest win came before the rewrite
MinIO was replaced with ordinary file storage. The scheduler worker, still being run in production through a TypeScript interpreter, was replaced with a compiled build. Those two changes alone cut 180.6 MB — and not one line of application logic was touched.
Our own estimate had been 200 MB. The measured figure was 180.6 MB, slightly less than we hoped, and that is what went into the notes. The same notes carry a correction of our own mistake: the first measuring run hit port 3000, which on that machine turned out to belong to a different project.
Only then was it rewritten
The rewrite went to Go — not because Go sounds faster, but because the app is mostly server-rendered pages with a few interactive parts, and that kind of work does not need a large framework in the browser.
The more consequential decision sat elsewhere: the app had to keep working when the signal drops. That forced a written sync contract between the server and the Android app, and that contract is held in place by tests. Seventeen tests in the mobile repository read the Go and SQL source in the server repository directly; if the server changes vocabulary the client no longer understands, those tests go red before anyone can ship.
A wallet is shared, not owned
Malia is used by a whole household, so one wallet can have several members with different roles. That sounds trivial until you notice how easy it is to write a query that filters data by who created it rather than by who is entitled to see it.
So the rule is written down as a house rule: every route that touches wallet data checks membership first, then filters by the wallet. Filtering by user is forbidden — it is the approach that looks right until one family member cannot see another's spending in the wallet they share.
About the results
The 180.6 MB above is a measured saving from two changes made before the rewrite. We have not re-measured the rewrite itself in production the same way, so we have not written a figure for it. Once that measurement exists, that number goes here — not an estimate.
Screenshots come from this project's own visual reference files, whose data is an example household. No real user transactions appear on this page.
RUNS ON
- Go
- PostgreSQL
- Kotlin Multiplatform
- Docker on a VPS


