Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The calculated price _is_ that version number, but smarter because it requires fewer checks and additional data. You don't really care if the catalog changed version, you care if the specific item in the catalog, for a given quantity of it, changed prices. You do lose the ability to look up the old price and apply that, but that is very rarely desirable anyways. Far easier and straightforward to just reject the transaction and have the user try again.


> You do lose the ability to look up the old price and apply that

For certain e-commerce sites that would be a big loss. This is largely a solved distributed systems problem and I don’t see how passing the cursor back to the server is any more complex than calculating prices.


It's quite common in games for the store catalogue to be produced by pricing tools and handled as a static file by the server. It's then simpler overall for the client to volunteer a maximum price and the server either charges the current price in the file or refuses.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: