mealstrom icon indicating copy to clipboard operation
mealstrom copied to clipboard

Add another Store that keeps the log as individual rows

Open linearray opened this issue 9 years ago • 1 comments

One advantage of using the current JSON store is that you can lock a row, append the new transition and write everything back again. Another advantage is that you can extend the data model quite easily, you just need to edit the data types and the ToJSON/FromJSON instances and the next time an instance is read it will be upgraded in memory and the next time it is written it will be upgraded in the database.

The downside is that the entire history of an instance is stored in one field. If the history is very long, this could be a problem. Right now to read the current state you need to read the entire history (although this could be fixed with PG's JSON operators). Some people might also just feel more comfortable with a more traditional relational store, perhaps because some tools work better with it.

Disregarding data model upgrades for the moment, it should be possible to store instances in a relational store. Data types need ToField/ToRow instances instead of ToJSON, locking needs to be done appropriately and updates need to be globally ordered (perhaps it is best to let PG do that). It might even be possible to allow Step1 updates, while Step2 updates are still running, something that is disallowed at the moment.

linearray avatar Nov 14 '16 10:11 linearray

Think about how to do "schema" updates.

linearray avatar Dec 11 '16 05:12 linearray