Durable Objects - Everything Everywhere All At Once For Not Very Much Money

Rate this content
Bookmark

Cloudflare's Durable Objects are a new JavaScript runtime that makes building stateful, on-demand backend servers on the edge as easy and cheap as serverless functions. 

By colocating compute and state, Durable Objects melt complexity at scale, and allow you to focus on building your product.

In this fast-paced talk we'll live code a real-time backend from scratch, show how Durable Objects work, and explore how you can apply this versatile tool to a wide range of everyday engineering problems.

Jani Eväkallio
Jani Eväkallio
31 min
08 Dec, 2023

Comments

Sign in or register to post your comment.

Video Summary and Transcription

Durable Objects is a versatile programming paradigm by Cloudflare that allows for stateful and uniquely addressable server environments. It simplifies feature development, enables real-time updates through WebSocket connections, and provides a built-in key-value store for long-term storage. It can be used to create collaborative applications, manage data storage efficiently, and explore co-located compute and data at the edge. Other companies like Azure also offer similar technologies. Deno's KV and fly.io's Flame are innovative products that eliminate the need for provisioning databases and Kubernetes clusters.

1. Introduction to Durable Objects

Short description:

Let's get going. Thank you, Kevin, for this wonderful introduction. Today we're not going to do slides. We're going to do live coding. So today I want to talk to you about something called Durable Objects, which is a bad name for a really cool thing. Can I have a show of hands? Who here before coming to this talk has even heard of what Durable Objects are? We have about 10 hands. And I'll keep the hand up if you've actually run Durable Objects in production.

Let's get going. Thank you, Kevin, for this wonderful introduction. It's a thankless job to be an MC. Can we have a round of applause for Kevin and the MCs as well?

Yes. I do love being a part of these conferences. I've been part of almost every React Debrieve in the past. And it's my first time speaking. And I don't speak very often because I hate making slides. So today we're not going to do slides. We're going to do live coding. But because I did make the mistake of naming this talk everything, everywhere, all at once. I thought there might be some movie buffs in there. So I did put in one slide just in the beginning just so people don't get angry about me not, you know, putting in the slides. So this is the slide. It's a keynote animation. Look at it. It's beautiful. There. Wow. Look at that. Wow. Okay. Nice.

So today I want to talk to you about something called Durable Objects, which is a bad name for a really cool thing. So this year, like every year at the end of the year, I reflect what is it that I've been working on differently this year. What are some of the sort of new tools and new practices that have sort of, you know, improved my ability to do my job as an engineer. And Durable Objects is one of those discovered from this year I really want to share with you. Can I have a show of hands? Who here before coming to this talk has even heard of what Durable Objects are? Okay. We have about 10 hands. And I'll keep the hand up if you've actually run Durable Objects in production.

2. Introduction to Cloudflare's Durable Objects

Short description:

Okay. So like two or three people. Great. This is exactly what I was hoping for. Durable Objects is a technology by a company called Cloudflare. It's a really cool technology company, but they're not really good at telling people how to use it or selling it or anything like that. So I thought instead of trying to explain it to you, I'm just going to show you how this works. Cloudflare is one of the biggest internet infrastructure companies, known for its CDN, cache, proxy, and bot defense services. They have a developer platform called Workers, where you can run serverless code. Cloudflare's workers run in every one of their 300 server locations, making services extremely fast. Durable Objects is a versatile programming paradigm, which I will soon demonstrate to you.

Okay. So like two or three people. Great. This is exactly what I was hoping for. And don't worry, this is not your fault. This is Cloudflare's fault.

So first, a little preamble. Durable Objects is a technology by a company called Cloudflare. I do not work for Cloudflare. I'm just an enthusiastic fan. I am not paid by them. They didn't even review my slides, so everything could be incorrect. But then on the other hand, I get to say anything I want about Cloudflare. And the thing about Cloudflare is that it's a really cool technology company, that there's really cool technology, and they're not really good at telling people how to use it or selling it or anything like that. So I thought instead of trying to explain it to you, I'm just going to show you how this works.

Okay, so this is Cloudflare. If you haven't heard of this company, it's one of the biggest sort of internet infrastructure companies. You might know them as a CDN provider, as a cache provider, proxy provider, bot defense, stuff like that. But more than that, they have a perfectly wonderful developer platform called Workers, where you can run serverless code, just like Lambda. But instead of like Lambda that usually runs in only one location or one availability zone, depending on how you configure it, Cloudflare's workers run in every one of their 300 server locations that they have around the globe. And they automatically in their network, basically just route your request to the closest one. So this means that thanks to these things being close, usually these services are extremely fast.

But so if we go to this developer platform website, behind here, below this Workers, there's this kind of well buried section called durable objects. And under here, if we go, we get to find out what durable objects are and what they do. And remember, I don't work for Cloudflare. And they tell us that we can build collaborative applications, like chat rooms, games, whiteboards. This is really cool. I love playing games, like building games and chat rooms and whiteboards. But in reality, most of us don't really get to build this type of software in day to day thing. And this is, I think, the biggest underselling of what durable objects are, is that they are really versatile programming paradigm, which I will soon demonstrate to you.

QnA

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Modern Web Debugging
JSNation 2023JSNation 2023
29 min
Modern Web Debugging
Top Content
Few developers enjoy debugging, and debugging can be complex for modern web apps because of the multiple frameworks, languages, and libraries used. But, developer tools have come a long way in making the process easier. In this talk, Jecelyn will dig into the modern state of debugging, improvements in DevTools, and how you can use them to reliably debug your apps.
The Future of Performance Tooling
JSNation 2022JSNation 2022
21 min
The Future of Performance Tooling
Top Content
Our understanding of performance & user-experience has heavily evolved over the years. Web Developer Tooling needs to similarly evolve to make sure it is user-centric, actionable and contextual where modern experiences are concerned. In this talk, Addy will walk you through Chrome and others have been thinking about this problem and what updates they've been making to performance tools to lower the friction for building great experiences on the web.
pnpm – a Fast, Disk Space Efficient Package Manager for JavaScript
DevOps.js Conf 2022DevOps.js Conf 2022
31 min
pnpm – a Fast, Disk Space Efficient Package Manager for JavaScript
You will learn about one of the most popular package managers for JavaScript and its advantages over npm and Yarn.A brief history of JavaScript package managersThe isolated node_modules structure created pnpmWhat makes pnpm so fastWhat makes pnpm disk space efficientMonorepo supportManaging Node.js versions with pnpm
Beyond Virtual Lists: How to Render 100K Items with 100s of Updates/sec in React
React Advanced Conference 2021React Advanced Conference 2021
27 min
Beyond Virtual Lists: How to Render 100K Items with 100s of Updates/sec in React
Top Content
There is generally a good understanding on how to render large (say, 100K items) datasets using virtual lists, …if they remain largely static. But what if new entries are being added or updated at a rate of hundreds per second? And what if the user should be able to filter and sort them freely? How can we stay responsive in such scenarios? In this talk we discuss how Flipper introduced map-reduce inspired FSRW transformations to handle such scenarios gracefully. By applying the techniques introduced in this talk Flipper frame rates increased at least 10-fold and we hope to open-source this approach soon.
High-Speed Web Applications: Beyond the Basics
JSNation 2022JSNation 2022
30 min
High-Speed Web Applications: Beyond the Basics
Knowing how to run performance tests on your web application properly is one thing, and putting those metrics to good use is another. And both these aspects are crucial to the overall success of your performance optimization efforts. However, it can be quite an endeavor at times for it means you need to have a precise understanding of all the ins and outs of both performance data and performance tooling. This talk will shed light on how to overcome this challenge and walk you through the pitfalls and tricks of the trade of Chrome DevTools, providing you with a complete roadmap for performance analysis and optimization.
Debugging with Chrome DevTools
JSNation Live 2021JSNation Live 2021
11 min
Debugging with Chrome DevTools
Jecelyn will share some tips and tricks to help you debug your web app effectively with Chrome DevTools.

Workshops on related topic

React, TypeScript, and TDD
React Advanced Conference 2021React Advanced Conference 2021
174 min
React, TypeScript, and TDD
Top Content
Featured WorkshopFree
Paul Everitt
Paul Everitt
ReactJS is wildly popular and thus wildly supported. TypeScript is increasingly popular, and thus increasingly supported.

The two together? Not as much. Given that they both change quickly, it's hard to find accurate learning materials.

React+TypeScript, with JetBrains IDEs? That three-part combination is the topic of this series. We'll show a little about a lot. Meaning, the key steps to getting productive, in the IDE, for React projects using TypeScript. Along the way we'll show test-driven development and emphasize tips-and-tricks in the IDE.