Re: Waste of storage space?

From: Date: Tue, 28 Oct 2008 22:56:46 +0000
Subject: Re: Waste of storage space?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-282542@lists.php.net to get a copy of this message
1) Store the "delta" (=the actual change) of a text change. This could be done by utilizing the Pear package TextDiff. My idea was to compare the old with the new text with help of the TextDiff class. I would then grab the array containing the changes from TextDiff, serialize it and store this data into the db. The problem is that this is every thing else but efficient when it comes to smaller text (the serialized array holding the changes was actually larger than the two texts combined).
What happens when you want to restore a particular version? You have to go through each edition and apply patches. Could get very messy. I'd say you're on the right track in just storing each version.
2) Do some kind of compression on the text to be stored. However, it seems that the build-in compression functions from PHP5 are more efficient when it comes to large texts.
All compression techniques (in or out of php) will work better on more text. -- Postgresql & php tutorials http://www.designmagick.com/

« previous php.general (#282542) next »