I've been doing some tests and it looks like I can store about 100k events in an IndexedDB while keeping the query times below .5s

That plus a shared web worker would make a pretty cool caching layer...so I guess ill try adding a caching layer to noStrudel. maybe it will make the app faster?

Reply to this note

Please Login to reply.

Discussion

What kind of architecture are you thinking? I tried this several times and failed before coming up with a very stupid but working implementation. Beware the serialization cost of passing things between the web worker and the main thread.

I didn't think about the serialization. I'll have to check that. The only test I did where around storing and querying events efficiently

Where did you run into this serialization cost? Was it with the JSON.stringify or with passing the data back to the tab

I was doing all my IndexedDB access in the worker, which meant I had to send requests and event results across the boundary using postMessage, which does a deep copy of everything. Turns out there's enough stuff coming back and forth that that becomes a problem.

https://developer.mozilla.org/en-US/docs/Web/API/Worker/postMessage