Vitor Pamplona on Nostr: Bloom filters are awesome. A bloom-based Outbox indexer can index 1 million pubkeys ...
Bloom filters are awesome.
A bloom-based Outbox indexer can index 1 million pubkeys with 5 relays each in a second.
Each query to build the inbox/outbox relay list of the user takes just 255 nanoseconds.
All of that in just under 10MB of memory.
As a comparison, just keeping 1M pubkeys in memory takes ~32MB. Keeping 1M relay list events with 5 relays each takes ~650MB of memory.
Published at
2025-02-20 18:01:39Event JSON
{
"id": "64e9de63aefcb5aee9d85f14cc4917365810e38681cc84f94246c50d691174e6",
"pubkey": "460c25e682fda7832b52d1f22d3d22b3176d972f60dcdc3212ed8c92ef85065c",
"created_at": 1740074499,
"kind": 1,
"tags": [
[
"alt",
"A short note: Bloom filters are awesome.\n\nA bloom-based Outbox i..."
]
],
"content": "Bloom filters are awesome.\n\nA bloom-based Outbox indexer can index 1 million pubkeys with 5 relays each in a second. \n\nEach query to build the inbox/outbox relay list of the user takes just 255 nanoseconds. \n\nAll of that in just under 10MB of memory.\n\nAs a comparison, just keeping 1M pubkeys in memory takes ~32MB. Keeping 1M relay list events with 5 relays each takes ~650MB of memory.",
"sig": "dc4f0fb5206d202539ac205458347be7167892333ae47a11809ca397d35eaf28279e0319de42835543c60df3d4b544a032c127e07ea12620a4913fad8bfc6d7f"
}