1

This is language agnostic (but I am using PHP and MySQL if it helps). How can I save MASSIVE amounts of text data efficiently? Google Docs, for example, autosaves a document and saves every version of that document. I imagine they don't store EACH version as that would be super huge. They probably just store a series of DIFFS.

Any ideas?

Shamoon
  • 33,919
  • 63
  • 225
  • 452

2 Answers2

3

RCS? http://www.gnu.org/software/rcs/

Ritch Melton
  • 11,107
  • 4
  • 38
  • 53
1

I think you've got it. Storing the current version of a file and diffs for revisions is a good way to go. You always have the current version handy, and you only need to apply the diffs when you display or revert to an old version. There's the command line diff and patch, and there's a variety of "difflib" libraries to choose from if you want to avoid the filesystem altogether.

ccoakley
  • 3,125
  • 12
  • 11
  • I do want to avoid the filesystem altogether. Do you know any libraries in PHP? – Shamoon May 18 '11 at 20:23
  • Sorry, I have Java, Lisp, and Python, but no PHP. I found this SO question that might be of help: http://stackoverflow.com/questions/112523/calculate-text-diffs-in-php – ccoakley May 18 '11 at 20:29