---
title: "Nosflare Overview - Architecture of a Serverless Nostr Relay"
description: "How Nosflare works: Cloudflare Workers for compute, D1 SQLite with global read replicas for storage, and a 9-region Durable Objects mesh for WebSockets."
canonical: "https://nosflare.com/docs/overview.md"
---

# Nosflare Overview

Nosflare is a serverless [Nostr](https://github.com/nostr-protocol/nips) relay implementation that runs entirely on Cloudflare's edge platform. It is open source under the MIT license at https://github.com/Spl0itable/nosflare.

A live, paid instance runs at `wss://relay.nosflare.com`.

## The problem it solves

A Nostr relay accepts signed events from clients, stores them, and rebroadcasts them to subscribers. Running one traditionally means:

- renting and maintaining a VPS,
- operating a database (usually PostgreSQL or SQLite on a single box),
- keeping a WebSocket process alive under load,
- paying a fixed monthly bill sized for peak traffic, and
- accepting single-region latency for a global audience.

Nosflare removes all five. It is deployed as a Cloudflare Worker, so there is no server, no process supervision, and no fixed monthly capacity charge.

## Architecture

### Compute: Cloudflare Workers

The relay logic runs as a Cloudflare Worker, executed at whichever of Cloudflare's 300+ edge locations is closest to the connecting client. Workers scale to zero when idle and scale out instantly under load, so the relay does not need capacity planning.

### Storage: Cloudflare D1 with global read replicas

Events are stored in [Cloudflare D1](https://developers.cloudflare.com/d1/), which is SQLite at the edge. Nosflare uses D1's [Session API](https://developers.cloudflare.com/d1/worker-api/d1-database/#withsession), which enables Cloudflare's global read replication: read-only copies of the database are placed in regions closer to clients. This lowers read latency and scales read throughput by adding replicas rather than by vertically scaling a single database.

D1 provides up to 10 GB of storage per database. Nosflare includes fallback support for the case where read replication is disabled.

### WebSockets: multi-regional Durable Objects mesh

Long-lived client WebSocket connections are held by [Durable Objects](https://developers.cloudflare.com/durable-objects/). Rather than routing every connection through a single Durable Object instance - which would create one global bottleneck - Nosflare runs a **mesh across 9 locations**. New events are broadcast across the mesh, so every connected client receives real-time updates from a nearby region.

Nosflare also uses the [WebSocket Hibernation API](https://developers.cloudflare.com/durable-objects/best-practices/websockets/#websocket-hibernation-api). Hibernation means billable Duration (GB-s) charges are not incurred during periods of inactivity while clients remain connected, which is the dominant cost of a naive Durable-Objects relay.

### Landing page

When a browser (rather than a Nostr client) requests the relay URL over HTTP, Nosflare serves a static HTML landing page. That page displays relay metadata and, when pay-to-relay is enabled, handles payment for relay access. Operators can customize it with their own branding.

## What Nosflare supports

- **19 NIPs** - see [Supported NIPs](https://nosflare.com/docs/supported-nips.md).
- **Pay-to-relay** - Lightning payments over Nostr zaps; see [Pay-to-relay](https://nosflare.com/docs/pay-to-relay.md).
- **NIP-05 addresses** - serve `username@your-domain.com` verified Nostr addresses from your own relay.
- **Access control** - allowlist or blocklist pubkeys, event kinds, and tags.
- **Rate limiting** - throttle events per pubkey, with kinds excludable from the limit.
- **Content filtering** - block specific words and phrases; see [Anti-spam](https://nosflare.com/docs/anti-spam.md).

## Companion: the "Send It" blaster

The repository also contains `send-it.js`, the code behind `wss://sendit.nosflare.com`, a relay that "blasts" a note to as many online relays as possible using [NIP-66](https://github.com/nostr-protocol/nips/blob/master/66.md) relay discovery.

## Roadmap

The current release focuses on the [basic protocol flow](https://github.com/nostr-protocol/nips/blob/master/01.md) so that events store and retrieve quickly. Planned additions include:

- [NIP-50](https://github.com/nostr-protocol/nips/blob/master/50.md) - full-text search
- [NIP-65](https://github.com/nostr-protocol/nips/blob/master/65.md) - relay list metadata / replaceable events

## Project details

- **License:** MIT
- **Repository:** https://github.com/Spl0itable/nosflare
- **Releases and changelog:** https://github.com/Spl0itable/nosflare/releases
- **Maintainer:** [21 Million LLC](https://nostrservices.com)
- **Contact:** GitHub Discussions, or Nostr `npub16jdfqgazrkapk0yrqm9rdxlnys7ck39c7zmdzxtxqlmmpxg04r0sd733sv`
