Technology

Engineering record

Server and accountsIn use

Settling shared data on the server

In October we set out to take product rules out of the server. We are changing direction: data that several people use at once is settled on the server.

In October we tried not to keep product rules separately in the app, the server and the database. So we planned to make the server know no rules and only store records. Even then, we saw exceptions. Some facts, like usage limits and public records, can't be decided by one app's judgment alone. Gym records are tied to too many people for us to leave that question as a mere exception.

Records such as memberships, lessons and inventory have a copy on each device, and the device where the button was pressed decided the result. That may look right when one person uses it, but what happens when two people press at once? Each device made a correct decision with the values it had, but the two decisions may not hold together. Syncing the two copies better later can't turn two decisions already made differently into one.

So for facts that many people use together, we decided the server makes the final decision, in one place. We define types for the server's tables and functions, and the screen that needs the result calls the server directly. A personal workout is different. There's no reason to wait on many people's decisions to save my own record, so it's saved on the phone first, as now. “Does the server know the product?” was less accurate a criterion than “Does this fact need one answer?”

Same direction doesn't mean rebuild everything

We could also rebuild all the code in which Desk (now REDDY Console), used in gyms, reads data from the server. But this code only reads and doesn't decide facts. We don't need to change code that has no problem just because it seems to fit the new principle, so we leave it as is.

This choice has a price. Gym work now requires an internet connection. Right after the app opens, some spots stay empty until the server answers. And we mustn't let devices decide the facts again just to fill those spots quickly.

Written from that day’s point of view, using the documents and change history of the time. Published 2026.12.01.