nostr-sdk is probably better setup to do that. nostrdb is more for building high-performance apps on top of. I haven't focused too much on dev docs.

Reply to this note

Please Login to reply.

Discussion

Cool -- my goal would eventually be to build "high performance apps" but I need to start somewhere ...

if you want raw performance using nostrdb-rs directly is best, since when nostr-sdk wraps it, it kills the perf as it is no longer zero-copy.

the enostr stuff is old and crufty. i was working on a networking side of nostrdb at one point but it fell by the wayside for the time being

https://github.com/damus-io/nostrdb-rs/pull/32

Very helpful. Thanks for explaining!

the main point of enostr/nostrdb_net is to avoid parsing json twice, enostr basically just barely and badly parses some high level tokens (OK, EOSE, AUTH, etc, subscription ids, etc) without parsing the json. then it passes the websocket &str directly to nostrdb for processing.

Also extremely helpful! Makes a ton of sense.

nostr:nprofile1qqsprwdgjszdhucrfelp3p46nhzvd5mk7gu6zxp8r0fwc4n63zv9pnsppemhxue69uhkummn9ekx7mp0rqtknc, yeah, you can use nostrdb APIs directly for the zero-copy queries and nostr-sdk for the networking stuff.

You can eventually clone the nostrdb instance and pass it to nostr-sdk just to automatically save the events received from the relays into nostrdb.