Skip to content

Comment on Inventory management in MongoDB: A design philosophy I find bafflingparent

Comments

It was a distributed system.

So you can't have exactly once semantics. When you say 'bus' I assume you mean a message broker which at best gives you at least once semantics. What happens when the message is delivered multiple times?

That's just a broker; all message handlers must be idempotent. This sometimes means storing message IDs or creating one-direction state change conduits that fail subsequent duplicate messages.

To answer that question more succinctly, nothing special happens when a message is delivered more than once.

At least, when we didn't screw up :)

Those were fun days.

I would assume you propagate a transaction ID or expected row version (and persist transaction histories and/or version numbers along with the inventory item row after mutation).

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.