Technology

Engineering record

Records and dataIn use

Moving record storage from a JSON file to SQLite

REDDY rewrote its whole JSON file each time it saved one record. A failed save could affect every record, so we are moving to SQLite.

Log one set and we save every past record again. The user changed one thing, but saving doesn't deal with just that one. The more records pile up, the more there is to save, and if the app dies mid-save we can lose not just this set but the whole history. The unit we save and the unit we can lose are both far bigger than what actually changed.

So we're moving to SQLite. But we won't implement SQLite separately for each app. Shared code runs SQLite, and each app decides which tables and SQL to use. We share how it runs, but we don't force every product's data structure into one shape.

We also asked whether the storage needs an async runtime. SQLite is a synchronous library, and the app can decide which thread runs it. The storage has no need to take on a way of executing as well.

What's left when a save stops halfway

What matters isn't when saving goes well but when it stops partway. We use WAL and synchronous=FULL, and we check that WAL is really on. The database structure and the version number change in a single transaction. If the app dies in the middle, it goes back to the previous state and tries again at the next launch. We also deleted a save function that had no work left, because if only its name remained, someone could think it still saved something.

We got rid of rewriting everything on every save. But we haven't compared speed before and after, so we can't yet say how much faster it is.

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