Загрузка...

Durable Objects Finally Make Sense

Durable Objects can be tricky to wrap your head around, but they don't have to be. In this video, we finally make Durable Objects click by building a Slack-style real-time chat application from scratch.

Instead of just talking about theory, we dive straight into the code. We cover how Cloudflare's Durable Objects differ from standard serverless workers, how to set up persistent SQLite state, and how to seamlessly add real-time WebSocket broadcasting—all in under 70 lines of code.

Create an account on Cloudflare today for free: https://dash.cloudflare.com/sign-up

Tools mentioned:
https://developers.cloudflare.com
https://developers.cloudflare.com/workers/
https://workers.cloudflare.com/product/durable-objects

Chapters:
00:00 - Introduction to Durable Objects
00:15 - The Chat App Demo
00:51 - Where Does the State Live? (Routing)
01:38 - The Durable Object Paradigm (1 ID = 1 Object)
02:13 - Setup & wrangler.json Migrations
02:38 - Writing the Worker Code
03:06 - Writing the Durable Object Code (SQLite)
04:05 - The Problem: Adding Real-Time Updates
04:51 - Updating the Worker for WebSockets
05:15 - The WebSockets Hibernation API
05:54 - Broadcasting Messages to Clients
06:44 - Real-Time Chat Demo
07:05 - How to Scale Durable Objects
07:53 - Conclusion & When to Use Them

Repository: https://github.com/jillesme/finally-durable-objects-click

#Cloudflare #DurableObjects #Serverless #WebSockets #CloudflareWorkers #WebDevelopment #Backend #RealTime #JavaScript #TypeScript

Видео Durable Objects Finally Make Sense канала Cloudflare Developers
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять