3 ms·
OK, you've compressed all your problems down into one problem - unfortunately that problem is bigger and more complex. How do you safely merge divergent changes
by lmm 5y ago
OK, you've compressed all your problems down into one problem - unfortunately that problem is bigger and more complex. How do you safely merge divergent changes to this shared uber-datastore? By breaking down all the operations my system supports into a set of simple REST endpoints, I (hopefully) simplify the space of things that could happen and get a good sense of which combination of requests I might have to support. If the space of user operations is instead "any database query", that sounds simpler but it's actually much harder to deal with.
- d3nj4l 5y agoYeah, and how would you perform validations that shouldn't be client side?
- chii 5y agoYou perform those in bulk, as a batch job when the client side pushes the state up when back online. After all, if a client is offline, nothing they do can affect anyone else until they go back online.
- cies 5y agoAnd now one needs UI to show that all the forms one thought were saved are merely sent, and come back a "tasks" that still need user attention. What was simple form validation is in "offline first" something akin to a mandatory content moderation step.
- cies 5y agoExactly. State management is the hard part. There are huge merits to having it all in one central data storage layer, where some smart backend code can choose the storage method best fit for the type of data (SQL/ACID, or KV-store, or ...). Having a datastore in every device, that now need to sync is giving me headaches already. Syncing is potentially very hard.