Replying to Avatar hzrd149

nostr:npub1jlrs53pkdfjnts29kveljul2sm0actt6n8dxrrzqcersttvcuv3qdjynqn nostr:npub1l2vyh47mk2p0qlsku7hg0vn29faehy9hy34ygaclpn66ukqp3afqutajft and any other client devs

Id like to get your thoughts on this (very MVP) library I'm building for #noStrudel https://github.com/hzrd149/applesauce/tree/master/packages/core

The idea is to run an in-memory database and have the UI ( react, svelte, etc... ) talk to it with "queries"

Then the data loading layer of the app (outbox model, dumb relay list, etc...) would feed events into this database as needed and the UI would update

This would effectively separate the UI layer from the more complicated relay fetching logic.

My motivation for building this is my data loaders in noStrudel commonly get stuck (as most complex logic does) and because they don'tt talk to each other a user might see an event in the notifications but then the thread loader couldn't find it

I'm aware it may have some performance impacts vs rendering the events straight to the DOM. But the fact that you could have all the events needed for the UI in a single place seems like it would be worth it

My main pain is event lifecycle management. In summary, the database gets too big too fast and start getting slow. So, the app must rotate event database, even in disk, very quickly.

We need to find an abstraction where the UI tells the core when it's ok to delete stuff.

For instance, let's say the user has a Global feed for about 30 minutes and then leaves back to the regular follows feed. Most of the Global feed notes should be deleted.

Save when the person visits a profile. The app loads a bunch of stuff into the database, but those events are irrelevant later and should be deleted.

If you are doing a client that shows the latest note for each custom feed you have, like the list of people and latest messages of a chat client, you are loading and deleting stuff all the time.

Reply to this note

Please Login to reply.

Discussion

No replies yet.