4

I'm curious to know how does Stack Overflow store the revisions/versions of each post edition in the database?

Does it represent each edition version in the database, following the Temporal Pattern? Meaning each time an edition is submitted, a new insertion is made incrementing the edition version?

Or does it implement Event Sourcing? Storing only events and replaying them to build the history.

2
  • 2
    The Data Explorer maybe a good place to see a high level view of the database schema.
    – Steven V
    Commented Mar 10, 2014 at 14:19
  • @StevenV Great! Thanks a lot :)
    – Mik378
    Commented Mar 10, 2014 at 14:27

1 Answer 1

7

No, no Event Sourcing here.

We have a PostHistory table with timestamps - not exactly a temporal pattern either (no version/edition field). This table records any changed post.

The Posts table holds the current version of a post.

5
  • Interesting:) I wondered why since I want to implement something similar for my website. And there was this possibility of event sourcing. But IMO, the main benefit of event sourcing is to understand "Why this object ends up to this state" whereas a classical table with timestamp (as you provide so) is focused only on the "What is the state?" no matter what was the possible user actions. (indeed, there's only one possible to edit a post: a click on the "edit" button).
    – Mik378
    Commented Mar 10, 2014 at 14:23
  • @Mik378 sounds like you're over-complicating things. One table where each record is one revision should be just enough, you can add more fields if you want extra details. Commented Mar 10, 2014 at 14:28
  • @ShadowWizard Yes, what I wanted to mean is that Event Sourcing would break KISS in this case. Right now, I'm focusing on this idea: patrick.wagstrom.net/weblog/2011/09/22/… It sounds pretty similar to the way StackOverflow does but focused on a graph database, that I use.
    – Mik378
    Commented Mar 10, 2014 at 14:32
  • You guys have any plans on cleaning up the timeline view? Always found that really hard to understand/parse.
    – user1228
    Commented Mar 10, 2014 at 14:54
  • 1
    @Won't - I don't believe that will be cleaned up - it is mostly viewed as "legacy". We do have a newer, mod-only timeline that may end up in some shape or form as a new timeline for other users as well.
    – Oded StaffMod
    Commented Mar 10, 2014 at 14:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .