The WebSocket Sower
Realtime WebSocket channels with presence, built on a single Worker + one Durable Object class.
The WebSocket Sower is an open-source Ably/PubNub alternative built on Cloudflare (D1, Durable Objects, WebSockets, Workers). Self-hosted cost: ~$0.04/month, vs ~$499/month for the SaaS it replaces. Source code is open and available on the linked repository.
How it works
The shape of The WebSocket Sower on Cloudflare, and how it stacks up against the rented tools it replaces.
Architecture
Feature comparison
The WebSocket Sower vs Pusher Channels
Same realtime model, a fraction of the cost
Sandbox plan is free (capped at 200 concurrent connections and 200k messages/day). Paid plans start at the Startup tier; larger workloads move to Pro and Premium tiers. Verify current numbers on Pusher's pricing page — limits and dollar amounts shift.
Verify on Pusher Channels's pricing page ↗Workers Paid base ($5/mo) plus per-million-request Durable Object usage and D1 reads/writes for the audit log. Small-to-mid workloads sit in the low single digits per month; pricing stays linear with usage.
| Feature | | The WebSocket Sower |
|---|---|---|
| WebSocket pub/sub channels Same publish/subscribe semantics; clients connect to a named channel. | ✓ supported | ✓ parity |
| Presence (who is in a channel) Per-channel presence inside the Durable Object. No global presence index. | ✓ supported | ~ partial |
| Channel auth tokens HMAC-signed token endpoint, same shape as Pusher's auth endpoint. | ✓ supported | ✓ parity |
| Encrypted channels Bring your own end-to-end encryption — not provided out of the box. | ✓ supported | ✗ missing |
| Push notifications Use a dedicated push service (APNS/FCM); not part of the build. | ✓ supported | ✗ missing |
| Replays / message history D1 stores recent messages; no infinite-scroll history out of the box. | ✓ supported | ~ partial |
| Webhooks for backend events Easy to bolt on with a Worker route — not bundled. | ✓ supported | ~ partial |
| Hosted dashboard / debug console Cloudflare logs + a small admin route; no polished console. | ✓ supported | ✗ missing |
| SDK ecosystem Use any WS client. No drop-in Pusher SDK shim yet. | ✓ supported | ~ partial |
| Vendor lock-in Source is yours. Move off Cloudflare with a port to any WS-capable runtime. | ✓ supported | ↑ better |
The WebSocket Sower vs Ably
80% of Ably for ops you actually own
Free tier with a fixed monthly message and channel allowance, then a usage-priced "pay-as-you-go" plan, with Pro and Enterprise tiers above. Numbers depend on message volume, peak connections, and add-ons — check the live pricing page.
Verify on Ably's pricing page ↗Workers Paid + Durable Objects usage. No per-message platform fee, just the underlying request and storage costs.
| Feature | | The WebSocket Sower |
|---|---|---|
| WebSocket pub/sub channels | ✓ supported | ✓ parity |
| Presence Per-room presence; no cross-region presence aggregation. | ✓ supported | ~ partial |
| Message persistence D1-backed audit log with TTL. Ably's persistence tier is richer. | ✓ supported | ~ partial |
| Push notifications | ✓ supported | ✗ missing |
| Global edge delivery Cloudflare edge + Durable Object affinity gives sub-50ms fan-out in most regions. | ✓ supported | ✓ parity |
| Token auth & capabilities Channel-level auth via Workers; no fine-grained capability tokens like Ably's. | ✓ supported | ~ partial |
| SLA + uptime guarantees Cloudflare SLAs cover the platform; you own the application SLA. | ✓ supported | ↓ worse |
| Vendor lock-in | ✓ supported | ↑ better |
The WebSocket Sower vs PubNub
The pub/sub primitive without the platform tax
Free tier capped on monthly active users, then usage-priced plans up to enterprise. Pricing scales with MAUs, transactions, and storage retention — verify on PubNub's pricing page.
Verify on PubNub's pricing page ↗Workers Paid + Durable Object usage. No MAU multiplier, no per-message platform fee.
| Feature | | The WebSocket Sower |
|---|---|---|
| Pub/sub channels | ✓ supported | ✓ parity |
| Presence | ✓ supported | ~ partial |
| Functions / serverless on messages Workers IS the function runtime; bind it to the message path you care about. | ✓ supported | ✓ parity |
| Storage & history | ✓ supported | ~ partial |
| Mobile push | ✓ supported | ✗ missing |
| Access manager / ACLs Roll your own with the auth Worker; PubNub's manager is more polished. | ✓ supported | ~ partial |
| Vendor lock-in | ✓ supported | ↑ better |
The WebSocket Sower vs Liveblocks
Realtime channels without the per-MAU pricing trap
Free tier with a monthly active-user cap, then a usage-priced Pro plan that scales with MAUs and connection minutes, plus an Enterprise tier with custom limits.
Verify on Liveblocks's pricing page ↗Workers Paid + Durable Object usage. No MAU pricing — costs scale with raw requests and DO seconds, not user counts.
| Feature | | The WebSocket Sower |
|---|---|---|
| Realtime rooms / channels Durable Object per room maps cleanly to Liveblocks' room model. | ✓ supported | ✓ parity |
| Presence Basic presence; doesn't ship Liveblocks' rich presence helpers. | ✓ supported | ~ partial |
| Live cursors / collaborative pointers Easy to layer on top — not provided. | ✓ supported | ✗ missing |
| Yjs / CRDT support Liveblocks Storage is its own thing. Pair Sower with a Yjs provider if you need CRDT. | ✓ supported | ✗ missing |
| Comments & threads | ✓ supported | ✗ missing |
| Permissions / room ACLs Channel-level auth in Workers; no per-user permission tokens. | ✓ supported | ~ partial |
| Hosted dashboard | ✓ supported | ✗ missing |
| Vendor lock-in | ✓ supported | ↑ better |
The WebSocket Sower vs Supabase Realtime
Realtime channels without dragging Postgres along
Realtime is bundled with the Supabase platform plans. Free tier ships with a daily message and concurrent-connection allowance; the paid Pro plan adds higher limits and usage-based overage. Realtime alone isn't sold separately.
Verify on Supabase Realtime's pricing page ↗Workers Paid + Durable Object usage. No bundled platform fee — pick D1 or Hyperdrive only if your build actually needs Postgres.
| Feature | | The WebSocket Sower |
|---|---|---|
| Pub/sub channels (broadcast) | ✓ supported | ✓ parity |
| Presence | ✓ supported | ~ partial |
| Postgres change feeds (postgres_changes) Sower is channel-only — no DB CDC. Pair with Hyperdrive + a webhook if needed. | ✓ supported | ✗ missing |
| Row-level-security driven authorization Auth lives in Workers, not in Postgres RLS. | ✓ supported | ✗ missing |
| Built-in auth integration Use any auth provider (or your own) and sign channel tokens in a Worker. | ✓ supported | ✗ missing |
| Vendor lock-in Supabase Realtime ties you to their Phoenix-based broker. Sower is Workers + DOs you can read. | ✓ supported | ↑ better |
The WebSocket Sower
We were paying hundreds a month for Pusher to fan out WebSocket messages to browsers. We replaced it in an afternoon with a Worker that accepts WS upgrades and a single Durable Object class that owns each channel.
Architecture
- Worker — terminates the WS upgrade, authenticates the client, routes to the channel DO.
- Durable Object (
ChannelDO) — one instance per channel slug; holds the connection set and fans out. - Presence — the DO keeps a
Map<userId, meta>; broadcasts join/leave on state change. - Hibernation API — WS sessions hibernate when idle, so memory cost is zero between messages.
What it gives you
Channels, presence, private channels (HMAC-signed), client events, message history via D1.
What it does not give you
A hosted dashboard. You read logs via wrangler tail. That is the trade.
Frequently asked about The WebSocket Sower
What is The WebSocket Sower? +
The WebSocket Sower is an open-source Ably/PubNub alternative built on the Cloudflare developer platform. Realtime WebSocket channels with presence, built on a single Worker + one Durable Object class.
What does The WebSocket Sower replace? +
The WebSocket Sower replaces Ably, PubNub, Pusher Channels. Replacing the SaaS saves approximately $499/month at the listed self-host cost.
What Cloudflare primitives does The WebSocket Sower use? +
The WebSocket Sower is built on D1, Durable Objects, WebSockets, Workers.
How much does The WebSocket Sower cost to run? +
The WebSocket Sower runs at approximately $0.04/month self-hosted on Cloudflare. Equivalent SaaS pricing is around $499/month.
Is The WebSocket Sower open source? +
Yes. The WebSocket Sower is open source under the MIT license. Source code is at https://github.com/cloudsteading/websocket-sower.
Discussion · 0
sign in to comment →