Re:Skip the API, Ship Your Database
by Ambolia on Thursday September 14, 2023 @04:59AM
(#37506540)
It could be done with "select for update" and etags+triggers checking the etag received + triggers generating a new etag on every create/update.
[ Parent
| on HN ]
If everyone's working on their own local copy of the database then the select for update isn't going to do anything. The issue is later syncing and detecting conflicts. It's actually easier to do this with a centralized DB, hence why everything works this way. If an app is mostly offline then, yeah, ship it with a SQLite DB and life will be good, but for something like a hotel booking app that doesn't actually solve many problems and makes existing ones harder.