Replying to Avatar phil

I created a quick diagram to illustrate the Primal cache issue in a simplified way that may help some people understand what is going on and help with choices about which client to use. There are many ways to build clients and there are advantages and disadvantages of each.

In Primal’s case, notes are served from Primal’s cache server which gets notes from the relays rather than the client getting them directly from the relays. The advantage to this is that much of the processing can be done on the server side resulting in a very smooth and consistent experience for users.

The down side to this is that it becomes centralised as, without the server infrastructure operated by Primal themselves, the client completely stops working (the cache is open source but I’m not aware of any other instances of the Primal cache being run and most users wouldn’t use a different one anyway). The issues with this centralisation are that it make Primal much more prone to outages and it would be very easy for ISPs to block Primal just by DNS blocking of the Primal cache server or blocking the associated IPs. Primal could also potentially filter or censor the feed from their cache although I’m not aware of whether they actually do this currently.

For me personally, I want a client that talks directly to the relays and does the processing locally but others may be comfortable with the limitations and loss of decentralisation and find that Primal provides a good experience.

One of the best things about Nostr is that you can take your key and move to a different client. It is worthwhile experimenting with different clients to find the experience that best suits you. 💜🫂

Is damus' nostrdb a better alternative to primal caching? Seems so, since, as I understand, it's running on the client, no?

Reply to this note

Please Login to reply.

Discussion

I don’t know if it’s the same but there is something called indexedDB that runs client side / in browser that caches a lot of stuff locally from your own relays.

nostrdb support filter queries, full text search, note stats, multithreaded ingester with efficient note de-dupe by a quick exit json parser, flatbuffer-like binary note format for zero serialization (queries return pointers to virtual memory) . It’s like an embedded strfry. IndexedDB isn’t really comparable.

So yeah its like a caching relay in your phone

Is nostrdb open source? Is there documentation to implement it?

https://github.com/damus-io/nostrdb

https://docs.rs/nostrdb/latest/nostrdb/

docs aren’t the best, still need to improve that

Cool!

notedeck is completely powered by this, which is why its crazy fast. Still in the process of moving Damus iOS to it, but it is in damus iOS in a limited capacity (profile search, tagging, fulltext search, walking threads). Damus iOS just lacks using it for all queries atm.

Another cool thing that notedeck will do is host many different nostr apps at once. Like a nostr OS/browser. This means all your nostr apps can interact with each other while you’re offline.

Interesting