Store events, compute state.

6 thoughts
last posted Feb. 4, 2013, 7:42 p.m.
0
get stream as: markdown or atom
0

In designing the schema for Gittip, I serendipitously chose to make the "tips" table INSERT-only instead of UPDATE. Any time you change a tip you insert the new tip but you still have the old one in there as well. In the application then you generally query for the latest tip, but since all the historic info is there you can do more as well.

0

One of the features this enables is a feature where you can see whom you used to tip but don't anymore. Maybe you want to start tipping them again. This could either be in the accidental case where you want to immediately undo a mis-tip, but also in a longer-term case where you want to revisit past decisions.

0

Anyway, I like that pattern and have been thinking about how best to apply it to other data as well.

0

Bruce Adams is the one who introduced me to the "store events, compute state" pattern.

0

That is, he gave me a concept under which to bring the pattern I was stumbling towards with the tips table.

0

Christian Wyglendowski and I talked about similar things while working together at YouGov. We thought of it primarily in terms of a message bus.