jb55's avatar
jb55 _@jb55.com 11 months ago
coolest thing about building on #nostrdb is that it comes with command-line tools and a portable database that is just a single file. you can copy your nostrdb node from damus-ios to notedeck and back and it will just work (todo: actually implement ios export). it has all of your nostr data, contacts, profiles, bookmarks, notes, mutelists, decks, everything! It also includes a fulltext search and relay index. sure you can use relays for this, but its nice to have a local copy you can backup and redistribute later. eventually your nostrdb nodes will just automatically sync so you don't have to do this manually.
jb55's avatar jb55
just an alias for : ndb -d ~/.local/share/notedeck/db "$@" allows me to query notes streaming into my notedeck node/relay
View quoted note →

Replies (7)

Justin Moon's avatar
Justin Moon 11 months ago
Cool -- my goal would eventually be to build "high performance apps" but I need to start somewhere ...
jb55's avatar
jb55 _@jb55.com 11 months ago
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.
jb55's avatar
jb55 _@jb55.com 11 months ago
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.
Justin Moon's avatar
Justin Moon 11 months ago
Also extremely helpful! Makes a ton of sense.
@Justin Moon, 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.