When an internal tool starts as a single-user application on SQLite, almost every query carries an unspoken assumption: whoever is running the app owns all the data. A request for record 42 just fetches row 42.

Moving that tool to a shared service breaks that assumption immediately. Once two people share the same database, a bare lookup by numeric ID becomes a data-leak bug. Adding login authentication at the front end is not enough, because the back end still has to know who owns each row and enforce that boundary on every read, write, and background job.

For example, say Alice and Bob both use a shared application, and Bob requests record 42 in a URL. If the query only checks WHERE id = 42, Bob can read or overwrite Alice’s record. With explicit ownership, the query checks both the record ID and the authenticated owner context, so Bob’s request returns “not found” or “unauthorized” instead of Alice’s data.

LayerSingle-user assumptionShared-service requirement
Request handlingUser is implied by the local sessionAuthenticated owner identity is attached to every request
Database queriesLookup by primary key (id = 42)Lookup scoped by owner (id = 42 AND owner_id = ...)
Database policiesApplication code is the only gateRow-level security or equivalent enforces isolation
File storageShared local directory by filenameOwner-scoped paths or object keys
Background workRuns with full local accessCarries explicit owner context, with external calls outside DB transactions

Enforcing ownership in only one layer is rarely enough. Application code can miss a filter on a new endpoint, and a shared file directory can expose another user’s attachment when filenames collide. Pairing owner-scoped queries in the application with row-level policies in the database gives you a second line of defense, and passing the owner context explicitly to background jobs keeps external calls from assuming a global session.

Simple diagram comparing a single-user lookup for record 42 with a shared-service ownership check where Alice's request succeeds and Bob's request for the same ID is blocked.

Before you open a single-user tool to a second person, trace every query, file path, and background task and ask the same question: who owns this row?

—jhunterj

Join the conversation

Your email address will not be published. Required fields are marked *