-
Notifications
You must be signed in to change notification settings - Fork 12
Change the storage system to maintain metrics between sessions #26
Comments
I've thought a bit about this and since we don't need any complex querying mechanism (we mostly need to append events when logging stuff and retrieve all the events once a day when sending them to the backend) maybe we can use a different approach for storing the metric events: the raw filesystem. Basically, we would have different separate files:
With this solution, this would be the work that the different
Additionally, since we would access the filesystem asynchronously, we would need some kind of Benefits of this approach:
Disadvantages of this approach:
Thoughts? @jasonrudolph , @nathansobo |
@rafeca: Thanks for outlining this potential solution. My gut reaction is that this is yet more code for us to maintain, and I'm eager to avoid further growth in the surface area we're maintaining. Do you have a feel for how much code would be involved in this file-based approach compared to a solution that uses dexie? |
I also worry about the complexity of interacting directly with the file system. If IndexedDB offers transactions that work across windows, that seems like a more promising path to me. |
Thanks for the feedback! It's fun that both your feedback was posted before my suggestion #TimeZonesAreHard 🤣
I assume that in terms of amount of code it will be quite similar, only slightly less conventional (and probably a bit more convoluted) than just using a DB... I'll then explore using the IndexedDB APIs directly... if they turn out to be so horrible to use as I remember they were ~7y ago, then I'll explore using |
From #25, we need to move away from
lokijs
and change the storage for events not yet sent on thetelemetry
package:The are two potential solutions:
dexie
as an IndexedDB adapter to store the events between sessions.IndexedDB
APIs directly (this would be more performant but slightly harder to implement).The text was updated successfully, but these errors were encountered: