-

@ Luxas
2025-06-04 10:51:35
🔥 IT'S FINALLY HERE #NOSTR 🔥
#Nosflare has now been refactored in v6.0.0 to work with Cloudflare's D1 SQL database with read replication!
First some background on why this is a monumental release. When I first pushed its initial commit on Mar 25, 2024 I built the relay using KV store. This was so that the data would be stored across Cloudflare's vast network and the event data would be quick to retrieve from the nearest server closest to the user, similarly to how the Cloudflare Workers operate. However, this proved to be incredibly expensive.
So, I pivoted and rebuilt it using an R2 bucket, with the intention of having a unique API capable of pulling event data or external use in other applications that wouldn't need to connect via a websocket. This proved to be ok, but not great.
Until now, Cloudflare has launched a beta on their D1 SQL database offering, which allows for read replication. This means the same globally distributed event retrieval I had wanted to do with KV store is now accomplished using standardized SQL queries (like almost all other relay offerings out there), but from a replica of the database that's closest to the user!
This makes the relay lightning fast. The websocket, messages, and data read from the database are now all handled from a Cloudflare server closest to each person connecting to the relay. You can use a live version today by subscribing to wss://relay.nosflare.com Or, deploying your own in less than 10 steps!
Oh, and if you previously deployed a Nosflare-powered relay, there is a migration tool that makes it very easy to transfer your relay's data from the R2 bucket to the D1 database. Check it out:
https://github.com/Spl0itable/nosflare