Martti Malmi on Nostr: Daily dev thoughts: Nostr notification server should probably connect to relays and ...
Daily dev thoughts: Nostr notification server should probably connect to relays and let them do what they do best: filter -> subscription matching. On the notification server you'd just match the subscription ID to notification endpoints. Resubscribe everything if the relay websocket reconnects.
If you're self-hosting and only have a small number of notification subscriptions (less than 20 or so), you can connect to public relays. If you're running a notification server for 1M users, you'll need your own private relay that has no subscription limit.
I'm thinking of pubkey -> [notification subscription JSON] database. Pubkey is client & session specific, not linked to a Nostr public identity.
What DB to use? I want it to be easy to self-host (docker at minimum) but also scaleable, so it can be the default notification server of a client. Efficient persistence is an obvious requirement. LMDB seems like a good option, but on the other hand MongoDB has lots of existing tools for administration, monitoring, indexing, JSON handling etc.
jb55 (npub1xts…kk5s)Published at
2024-10-23 10:32:07Event JSON
{
"id": "b98fb3a6a0adfb4eed0342739d137f0ffbd63cafb7faf9a23b63ba9bc23a74b0",
"pubkey": "4523be58d395b1b196a9b8c82b038b6895cb02b683d0c253a955068dba1facd0",
"created_at": 1729679527,
"kind": 1,
"tags": [
[
"p",
"32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245"
]
],
"content": "Daily dev thoughts: Nostr notification server should probably connect to relays and let them do what they do best: filter -\u003e subscription matching. On the notification server you'd just match the subscription ID to notification endpoints. Resubscribe everything if the relay websocket reconnects.\n\nIf you're self-hosting and only have a small number of notification subscriptions (less than 20 or so), you can connect to public relays. If you're running a notification server for 1M users, you'll need your own private relay that has no subscription limit.\n\nI'm thinking of pubkey -\u003e [notification subscription JSON] database. Pubkey is client \u0026 session specific, not linked to a Nostr public identity.\n\nWhat DB to use? I want it to be easy to self-host (docker at minimum) but also scaleable, so it can be the default notification server of a client. Efficient persistence is an obvious requirement. LMDB seems like a good option, but on the other hand MongoDB has lots of existing tools for administration, monitoring, indexing, JSON handling etc.\n\nnostr:npub1xtscya34g58tk0z605fvr788k263gsu6cy9x0mhnm87echrgufzsevkk5s",
"sig": "147619e2abc788d917e4bd7948a439e0c24422a635a52d7068ded66668fb73d3048638deea7f3877644846849853be968df863ad4dcc865415a608bcec289602"
}