Hacker News new | ask | show | jobs
by kentonv 2095 days ago
> The performance benefits for the cart, social feed, and chat are irrelevant. Nobody cares if it takes 50 ms longer for any of those things.

I think this is missing a few points:

1. Yeah they do. If your shopping cart responds 50ms faster when someone clicks "add to cart", you will see a measurable benefit in revenue.

2. It's actually a lot more than 50ms. A chat app built on a traditional database -- in which a message arriving from one user is stored to the database, and other users have to poll for that message -- will have, at best, seconds of latency, and even that comes at great expense (from polling). The benefit from Durable Objects is not just being at the edge but also being a live coordination point at which messages can be rebroadcast without going through a storage layer.

3. Yes, some databases have built-in pub/sub that avoids this problem and may even be reasonably fast, but using Durable Objects is actually much easier and more flexible than using those databases.

1 comments

(1) If 50 ms is that important then the cart should be stored locally and synced in the background. That's my broader point. Performance sensitive things should use local storage. Things that are not should use the convenience of a central server.

(2) Nobody builds chat apps that way. The apples to apples comparison would be something using websockets and Redis. The only savings I see there are the time saved by the server being physically closer.

> Nobody builds chat apps that way.

Of course they don't.

> The apples to apples comparison would be something using websockets and Redis.

Which would be way more complicated to write, deploy, and maintain, and scale than this little 200-line Durable Objects chat demo...

The real point here isn't performance, it's simplicity. But also not having to trade away performance to get simplicity is nice.

> The only savings I see there are the time saved by the server being physically closer.

Here in Australia, with ping times to US West Coast (where lots of companies host by default) of 170ms this is a real issue.