Skip to content

CASE STUDY · SIBIYON PRODUCT

Malia

A family finance app rewritten only after it had been measured — not because the stack felt heavy, but because the numbers showed where the weight actually sat.

KIND
Sibiyon product
OUR ROLE
Design, build, measure, rewrite
CHANNELS
Web and an Android app
STATUS
In development, running on its own VPS

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.

The Malia home screen: total balance, income and spending, a menu, and recent transactions.
Home: one balance figure, income and spending, then the latest transactions. Every number in this image is example data.

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.

Malia's transaction list, grouped by date with categories and amounts.
The transaction list. Money is never stored as a floating-point number — decimal in the database, whole minor units in the code.
Malia's reports page with per-category summaries and a chart.
Reports. The figures are computed from the transactions rather than stored separately, so no summary can quietly drift from its source.

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

All work

Let's build something worth running

Tell us what you are trying to build or monitor. We will be straightforward about whether we can solve it, and how we would approach it.

Tell us about your project

No commitment. We reply personally within 1–2 business days.

WhatsApp