views:

48

answers:

1

I recently got database for my website and was suprised to see how expensive it was for the amount of space they gave me (only 500 mb for sql2005). The database is used to store data such as posts or articles submitted by members.

the problem: I would like to be able to save not only the final version of a user post, but also all possible modification that occurred since he posted it. How can I save these modifications in the database without having to store the whole post several time with different version numbers? my concern is that the size of the database might grow too fast and reach the 500mb limit. Any ideas?

+2  A: 

How often do you need to retrieve the previous posts? How large are they?

You can compress the data before inserting into the database but this will increase retrieval time.

You could store the diff of the posts but this requires iterating through each post and applying the diff to recreate the history.

You should determine the number of articles/edits that you expect so that you can determine how many you can store within your limit.

If articles are large and previous versions not commonly accessed then just store the articles as files and store the header information in the database.

Steven