Skip to content

Comment on Turning the database inside-out (2015)parent

Comments

You write the 'add item' event regardless, and when building the 'cart' view you handle the limit.

add_item is not an event, rather a command/ request that is yet to be validated. item_added is the event = a fact that was 'allowed to happen' by the system.

Keeping commands in a persistent store is a matter of choice but not necessary. I've seen people doing command sourcing and calling it event sourcing.

Alternatively "invalid cart" could itself become an event.

Well, assume the non-overdraftable bank account example instead then, what do you do then?

Sounds like an easy way to run out of storage space

AboutSource Built by g1lg1l

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