jb55 on Nostr: You create subscriptions on nostrdb, but they are just threadsafe queues of pointers ...
You create subscriptions on nostrdb, but they are just threadsafe queues of pointers to binary notes in the db instead of json and websockets and all that.
The idea is that you create remote subscriptions like normal, but the results of those subscriptions are only dumped into nostrdb.
nostrdb has a super efficient de-duping threadpool note processor. Any new incoming note matching a local subscription will be pushed to the subscription queues. They can be then polled or you can register a callback.
You can even do privacy stuff like open a remote global filter, and have local subscriptions that try to match notes without leaking any queries on the relay. This is a bit more bandwidth intensive of course.
The idea is that you create remote subscriptions like normal, but the results of those subscriptions are only dumped into nostrdb.
nostrdb has a super efficient de-duping threadpool note processor. Any new incoming note matching a local subscription will be pushed to the subscription queues. They can be then polled or you can register a callback.
You can even do privacy stuff like open a remote global filter, and have local subscriptions that try to match notes without leaking any queries on the relay. This is a bit more bandwidth intensive of course.