Video wird geladen...

Video konnte nicht geladen werden

Zur Startseite

im building the best next.js stack to ever exist i just found out cloudflare workers natively support long-running websocket connections - extremely cheap - reliable af & fully serverless - zero infra to manage you can setup real-time next.js in literally seconds

52,539 Aufrufe • vor 1 Jahr •via X (Twitter)

10 Kommentare

Profilbild von Josh tried coding
Josh tried codingvor 1 Jahr

this is the API i'm thinking of for jstack (the next.js/typescript stack im building), probably doesnt get simpler than this if i now find a way to make the messages type-safe its over

Profilbild von Irteza Bangash
Irteza Bangashvor 1 Jahr

Yp I've been playing with cf workers and its crazy good. Looking forward to trying the jstack

Profilbild von chronark — oss/acc
chronark — oss/accvor 1 Jahr

Is this integrated into @upstash with a db, vector and workflows?

Profilbild von Josh tried coding
Josh tried codingvor 1 Jahr

@upstash vector and workflows no, a redis db yes because that powers the bidirectional comms. you could also use cloudflare durable objects, but i prefer upstash

Profilbild von Alchemist
Alchemistvor 1 Jahr

You can use durable object for this

Profilbild von Carlos Ziegler
Carlos Zieglervor 1 Jahr

How about self hosted ?

Profilbild von Josh tried coding
Josh tried codingvor 1 Jahr

should be possible by just switching out the url to your own ws server, but not nearly as convenient

Profilbild von Umair
Umairvor 1 Jahr

Pr?

Profilbild von Firat Özcan
Firat Özcanvor 1 Jahr

If you go the path of using durable objects for your rooms (which you should), you do need to solve the issue of those objects being fixed to the location of the first request. May not be what you want, some solution for migrating it closer to the user may need to be built by you

Profilbild von Josh tried coding
Josh tried codingvor 1 Jahr

not a problem when using upstash redis realtime subscriptions as we do in the demo, i find durable objects to be pretty unintuitive

Ähnliche Videos

I built a self-hosted Sentry clone that runs entirely on Cloudflare Workers, and I think it showcases one of the most underrated features in the Cloudflare ecosystem: Service Bindings. Let me explain why this matters. When you have multiple Cloudflare Workers (an API, a webhook handler, a cron job), they all need common things: error tracking, authentication, rate limiting, metrics. The typical solution? External HTTP calls to third-party services. That means: - 50-200ms latency per call - Egress fees - Your data leaving your infrastructure - Another vendor to manage Service bindings let Workers call each other directly inside Cloudflare's network. No HTTP. No internet. Just internal RPC with <5ms latency. With Workers Sentinel, any Worker in my account can just point Sentry-SDK into the Service binding, and have all errors flow into one centralized dashboard, stored in Durable Objects with SQLite. No external calls. No added latency. Service bindings aren't just for error tracking. You can centralize: 🔐 Authentication — One Worker that validates tokens for all your services 📊 Metrics — Centralized collection without external observability costs 🚦 Rate Limiting — Shared counters that actually work across Workers 🚩 Feature Flags — Instant propagation, no deployment needed Think of it as building your own internal microservices mesh, but at the edge, with zero network overhead. Workers Sentinel uses two Durable Objects: - AuthState (singleton) — users, sessions, projects - ProjectState (per-project) — issues, events, stats Events are fingerprinted and grouped intelligently. The dashboard is a Vue.js app served from the same Worker. I could say i built this to learn Durable Objects or that I needed error tracking for side projects, but honestly I just need a way to show my wife why I'm sending $200/month to some guy named Claudio who apparently helps me write code. The whole thing is open source. Deploy it to your Cloudflare account, point your Sentry SDKs at it, and you're done. But more importantly: take a closer look at service bindings. They're the glue that turns a collection of Workers into an actual platform. Most Cloudflare customers I talk to aren't using them, and they're missing out. To the Sentry team: I love your work. Genuinely. Sentry is battle-tested, has incredible features, and is what you should use for anything that matters. This project is a toy. A learning exercise. A weekend hack that got slightly out of hand. Please do not trust your production errors to this dummy clone. If your startup goes down at 3 AM because Workers Sentinel missed an edge case, that's on you. I warned you. Use the real thing. But if you want to learn about Durable Objects, service bindings, and how error tracking works under the hood? Clone away. Your Workers shouldn't be islands. Connect them.

Gabriel Massadas

28,656 Aufrufe • vor 6 Monaten