Hacker News new | ask | show | jobs
by Sai_ 807 days ago
Your clients control the number of messages they exchange with each other via the DO.

You still have to protect the DO through some sort of auth and/or rate limits.

Don’t see how any of these issues are unique to DOs.

2 comments

My issue was that a single message, be it 4 bytes, was essentially billed the same as a 20Mb request. Didn't make too much sense to me.

If I have to think about batching messages to decrease costs even tho my overall transport and execution would be the same, I feel like that's an issue on the platform somehow.

When I took a look at using DO last time I decided against using them because you had to pay for the duration your clients are connected to them when using WebSockets. As far as I understood it’s not execution duration but flat out how long your clients are connected. You’ll burn through seconds quickly that way. I decided to go with a polling mechanism instead.
They have hibernating durable objects now that don’t charge unless there is a request through them: https://developers.cloudflare.com/durable-objects/api/websoc...
Oh that’s neat! I’m not sure if it didn’t exist or if I didn’t find this last time. Looks like this would address the problem.