I read in many posts that Stack Overflow uses some kind of diff algorithm to find diff between text blobs of edits. I wanted to know if Stack Overflow saves all the blobs in the database as-is or if it has some way of saving just the diffs over the original question or answer.
-
3My bet would be they store the full thing. Otherwise, displaying the post history and applying a rollback would have to apply the diff to the current state (uggh) and there would be no sane way to alter the diff format retroactively (arrgh).Pekka– Pekka2014年03月24日 16:07:41 +00:00Commented Mar 24, 2014 at 16:07
-
The schema is available on data.stackexchange.com; posts are stored wholesale in the PostHistory table.Martijn Pieters– Martijn Pieters2014年03月24日 16:07:47 +00:00Commented Mar 24, 2014 at 16:07
1 Answer 1
Each revision is saved in its entirety and the diffs are produced on the fly by comparing the subsequent revisions.
answered Mar 24, 2014 at 16:07