Long-Term Considerations Regarding Toml File Storage #97
Labels
A-architecture
Area: Related to our architecture
A-storage
Area: Related to our storage system
C-question
Category: Further information is requested
Current situation
I initially implemented the storage model for the activity log based on the Toml file format.
When we begin a new activity, we parse the log with all entries, and then we append it in memory to the vector and write the whole activity log back into the file.
When we end or update an activity, we do the same thing.
I think that has several disadvantages, e.g. when there is an error during writing back the file, it could be damaged and the activity log destroyed. Also, it will take longer and longer to parse it, with activities becoming more and more. I need to benchmark that, it could be negligible with a few thousand activities, which is unlikely to happen, as users might archive their activity log monthly when the archival feature is implemented.
I could refactor the entire model to an event based one, so the log file is really append-only and only writes to the end of the file. But I'm actually not sure if this makes sense at this point, because I want to implement the storage in a SQLite database soonish, which would make this obsolete. Because I don't think we want to do it event based in the database, as it's much easier to query for a record and update it or even batch update records.
The reason I initially used Toml was so users can edit it within their favourite text editor, and I found that kind of useful as I used that a lot to edit activities in
bartib
. I think this would become less useful, when I reimplement it in a way, that only events are stored. Because then it's not as easy to determine any more, what the actual status, duration etc. of an activity really is. To determine that, we would need to parse all activities in a certain time frame and then merge the events. Which will be much more complicated.Pros And Cons
Current TOML-Based Storage Model:
Pros:
Cons:
Event-Based Append-Only Model:
Pros:
Cons:
Direct Transition to SQLite:
Pros:
Cons:
The text was updated successfully, but these errors were encountered: