This fundamentally changed the way I build full-stack applications - Durable Objects
Вставка
- Опубліковано 6 лют 2025
- Once you understand the basics of Durable Objects, it may change the way you build full-stack services.
Durable Objects Docs: developers.clo...
How Queues use Durable Objects: blog.cloudflar...
How workflows use Durable Objects: blog.cloudflar...
Stay in touch:
/ backpine
x.com/backpine...
great script, very concise and easy to understand with some dev knowledge
great voice, and great subject, this is the type of content we don't see much out there
You are the gem! In 12 minutes you taught me more than +40 minutes tutorials.
I really appreciate your work brother! Keep it up, you are doing great!
I appreciate that!
Thanks for uploading a video on the topic I just said yesterday "I have to look into this, it sounds promising"
Please upload regularly. 😅
I'll try 😅
Content is soo good. I'm hoping he can get some momentum because he clearly has top tier quality content
I appreciate you! I have a huge backlog of videos I want to make. It's just a bit hard to consistently publish these type of videos because they take a while to make.
Most my time is spent building products for clients, so it's hard to find a dedicated 8 hours to for recording and editing. I might play around with the format it bit to reduce the effort needed to make videos
Thank you for this simple explanation! I passed over learning about Durable Objects at first because I didn't immediately see what their purpose was.
You're very welcome!
Interesting. First time I hear about DurableObjects.
I had the exact same thought but instead of before a user is created like in this particular instance my idea was to "Have a specific endpoint for the user to concatenate all the operations from a single place for the user based on his permissions and everything available with the durable object" and persist with DB as needed. So no more client side requests as such just all from backend and very near to user with Durable Objects and workers.
Great job explaining this.
I absolutely loved your video - you're truly a gem! Youve mentioned you're creating a new video. If possible, please consider including a small example of queues.
Also, Thank you for taking the time to create such valuable contents in your busy schedule.❤
Oooooh this was goooood. I never paid attention to these and now ideas are flowing…
bro is not pregnant but still delivered
Really nice thanks for sharing
Excited for more tutorials!
same!
Matt. I encourage you to really reflect on and understand the flaws in your existing mental model, previous implementations and why you feel relieved when you reach for durable objects.
What feels so unsafe about your code that you feel the desire to use durable objects? What is so unsafe about your architecture that you feel the need to tightly couple all aspects of your designs to every type of cloudflare product?
It's clear that you have problems enforcing or trusting consistency boundaries. There are better ways of writing software where these problems don't exist, and it's clear from you examples that you might be unaware of them (it's not your fault).
I would suggest looking into functional programming (in ts) and things like the functional core imperative shell pattern just to understand a glimpse of what's out there.
Take the transcript of your video and my comment, give them to chatgpt and ask it how you can improve. It should be a good starting point to help break you out of vendor prison.
Do you teach?
U should teach
Your logic make sense
I recently started shipping code as personal projects and this man has singlehandedly put me on the cloudflare ecosystem lol
i love how you communicate and deliver idea
High quality content 🎉
Thank you!
Thanks for doing this! Can you share a bit about the pricing? I find it to be super confusing.
Fantastic vid!
God tier !!!!
Pretty cool, but the vendor locking scares me.
Yeah, this is the biggest downside. You have to really commit to the Cloudflare ecosystem.
Durable objects are so cool. I've been using them for small scale room based games that need some shared state.
Awesome! I assume you are using websockets?
@@backpine Yup! Websockets / real-time stuff are fun things I never get to use at my day job. My (shitty) game isn't the most efficient, I use Immer to perform state updates within the durable object as it exposes a patches API that you can just send over the wire then user immer on the frontend to reconcile the patches to synchronise state.
Great one!
Thanks!
Great Video
Thank you!
lovely content!
Thank you!
Awesome video! I created API credits system, based on DO. It’s super fast. However, there are disadvantages. For example there is no UI to check what data is in the DO. You need to write your own backup method.
Cloudflare is really sleep on but their dx is really rough still. I feel like I end up always thinking. “What if I want retry logic? In a DO? Do I use a workflow to create a do or do I call a workflow from a DO? What about queues? Are they needed if you’re using workflows? “
I feel like there’s now a good amount of overlap so it’s tough to grok as a beginner when to use what
And you’re right about their examples are sometimes complicated and niche.
solid stuff!!
Full stack means full stack where you build everything not relying on 10 thousand external services
Okay /10 developer
Isn't this similar to what upstash provides like redis, queue etc
nice video but your voice loudness varies wildly between sceenes. you should probably normalize volume across the video because it may put some people off.
Will work on it!
How are durable objects different from a regular VPS?
those are two different things
cloudflare should sponser him
I think it is somewhat the same thing as temporalio and temporal is open source and most top tech company use it 🤔
Hey, I found out about your channel today. And after all watching your tutorials, i started exploring cloudflare for nextjs deployment. I ran into some issues though... There's a warning because of which the builds are failing. Can you please tell me what I can do to suppress the warning at least? Thanks. Keep up the good content!
opennextjs/opennextjs-cloudflare/issues/321 on github
Email me a link to your repo
Would you ever use durable objects to replace your Postgres completely? Or do you think they lack anything to make them your principal data store?
It would really depend on the application and use case. Most applications have some component that requires data to be aggregated which doesn't fit in the Durable Object pattern as each instance of a Durable Object is isolated.
There are situations where I solely store data in a Durable Object and don't sync it anywhere else. But it is hard to beat relational databases when you need to join data together and view things at an aggregate.
any one code explain the pricing of DO objects . with example . i could not understand
You just upload at the right time!
I'm having this kind of problem for past few weeks, thanks God, what a savior!
Nixe stuff. But do we really need a class? I mean server less, stateless, low latency doesn’t rime with OO 😅
what tool do u use for the diagram & slides?
I use Figma for the diagrams and very basic animations. And DaVinci resolve for editing
Keeping state in a private/transient storage of a durable object, without having easy access to it from anywhere else - does not seem like a good design choice for me.
I think it would be smart/best to save the data async in r2/d1 storage as well to be more accessible.
DO storage is not transient. But I agree, it's not the best solution for every use case.
It works great for the real world use case I talked about in the video though.
How do you handle dependencies that are not able to run on the edge runtime?
I design around this. You can enable the node compatible flag in your wrangler file which will patch some most incompatibility issues.
That said, some node packages relay on OS operations which are not available in the Edge runtime. In these scenarios I will try to find WebAssembly packages the accomplish the same thing.
An example would be SVG to PNG transformations. Most NPM packages that do image transformations don't work on non-Node runtimes. But I managed to find a webassembly module that can convert SVG files to PNGs. This module worked seamlessly on Cloudflares Edge.
@@backpine can you share the link to the module. I might need it soon.
Search "ssssota svg2png-wasm" in Google and it will be the first hit.
I kind of want to make a video about using WASM modules in worker projects, but I am not sure if this topic is too niche.
@@backpinethis would be helpful. I’ve run into it before. Like file compression in r2 iirc a lot of packages use lots of node
@@backpine definately too niche but will be very useful for some
So basically… stateless state. Huh.
been waiting...
OOP but in infra?
Oooooh this was goooood. I never paid attention to these and now ideas are flowing…