I’m almost done with the new relay for nostrcheck-server, currently experimenting with search extensions.
So far, it’s stable and fast with 3,000,000 events loaded into memory. I had to fine-tune every operation to avoid bottlenecks across the system.
Querying such a large dataset is inherently slow, but on top of that, the relay has to handle hundreds of simultaneous requests over open WebSockets.
To tackle this, the relay currently runs with a pool of n workers and a processing queue for heavy tasks.
It’s fully compatible with all relevant NIPs. Not designed for 100 million events yet, but more than capable of efficiently handling community-scale needs.
I’m sure I’m running into the same problems others have already solved, but I’m doing it anyway—because this is Nostr. We have to keep 500 incomplete and incompatible clients connecting to 500 incomplete and incompatible relays, otherwise, what are we even doing here? 🤣🤓
Good morning #nerdstr 🥳🥳
Login to reply
Replies (10)
i have a question for you—it might also relate to what you’re doing now.
i want to set up a fast, lightweight relay dedicated to events like a paywall podcast event, but it has to be light & fast. i need to use it on my client to fetch those events & also be able to make requests from my server function to get & process relay data.
i’m not expecting an exact answer, just your thoughts & experience while building this stuff—you might be able to point me to something.
You are incredible Quentin!
Iefan, long time no talk 💜
A fast and lightweight relay, in my opinion, fundamentally depends on the number of events it stores. Any relay is fast with 10,000 events.
So, I’d say any relay would work, especially if you’re filtering by just a few specific kinds.
If you’d like, we can share opinions and code via DM or Telegram.
💜💜💜
🐶⚡️🙏❤️
thanks for the response. i just want to deploy my relay using the best possible approach, completely forget about it & focus on other stuff, so i want to get it right from the start.
any thoughts on strfry relay? that’s what i’m currently using. or is there any relay implementation more targeted towards apps? for example, if an app wants to use a relay as the majority of its backend, is there anything built for that, or do people just use strfry most of the time?
Sure, you can use strfry by limiting it to the kinds you need, and that's it. It's a very fast and lightweight relay (it does consume memory, but I don't think your case will scale to millions of events).
NFDB is designed to scale to 100+ million events :) that is what the Noswhere search backend is moving to
Are you talking about LMDB?
No.
My own relay DB.