Thread

🛡️
🥳 Yo #Nostrich plebs! Don't know how to code or operate a server but still want to run your own #Nostr relay? I gotchu fam! 🤯 Introducing #Nosflare Deploy, the easiest, no-code, one-click deployment of your very own relay using your own Cloudflare account for a one-time setup fee of 21,420 sats! 😎 You can even make as many updates to your relay as you like after it has been deployed at no extra cost. This is truly democratizing relay ownership!

Replies (14)

🛡️
Curious to see what those calculations look like. Did you use each pricing calculator for the services on Cloudflare? It’s only relative to the traffic and in many cases may only cost the Workers paid monthly fee of $5, depending upon said traffic. So, I’m curious what figures you’ve used to benchmark it as 2x
🛡️
Used the provided pricing, yes. I assumed that Nosflare uses the same set of indexes (NFDB supports composite indexes, I do not think Nosflare does) and based it off of Nostr.land’s read amounts. The CPU time was not too relevant, with a huge chunk of it being D1 read costs. I won’t get into the fact that D1 is probably one of the buggiest products to come out of CF
🛡️
The code looks pretty decent. CF Workers and D1 are still not optimal for hosting relays, in my opinion. SQLite in general performs poorly compared to local KV-store based solutions, and D1 has its own issues. And JS is kind of a terrible runtime for an application like a relay, which does a lot of memory allocations. Also, isn’t the single DO a bottleneck?
🛡️
Yes, you are correct that the current implementation of a single DO can present itself as a bottleneck since it’s single-threaded and caps at 1000 messages per second, but with queuing. However, I am currently working towards a multi-regional and/or a Pub/Sub coordinated integration that should help mitigate that. We’ll see how we go. The alternative would be to strip out the DO like before and not have stateful websocket. It’s been a fun project getting to trial various different methods and edge cloud tech.
🛡️
Cloudflare serverless infrastructure is a usage based model. It’s technically completely free to use, but the free plan is somewhat limited, which is why I recommend the Workers paid plan of $5/month. This gives you a decent included usage amount, but then they will bill for overages, which is reasonably cheap compared to legacy hosting. It all depends on how much traffic the relay receives. If it’s a personal relay for yourself, family, or a few friends, you might be able to just keep it free or at the $5/month mark. If you’re wanting to scale the relay to have lots of users, then you might pay a few dollars more. I recommend looking up the pricing calculators for Workers, Durable Objects, and D1 database.