three column dataset - additions and deletions

Tim Harig usernet at ilthio.net
Thu Dec 2 21:19:54 EST 2010


On 2010-12-03, MRAB <python at mrabarnett.plus.com> wrote:
> On 03/12/2010 01:42, Tim Harig wrote:
>> On 2010-12-03, draeath<draeath.spamtrap at gmail.com>  wrote:
>>> On Thu, 02 Dec 2010 22:55:53 +0000, Tim Harig wrote:
>>>
>>> Thanks for taking the time to check in on this, Tim!
>>>
>>>> So, basically, you want to store a local copy of the data and sync it to
>>>> the original.
>>> In a way. I only need to store one copy of the data, and make note of
>>> changes between it and the current data.
>>
>> Perhaps I am missing a sublty that makes those statements different.
>>
> [snip]
> I take the difference to be this:
>
> The first statement says there are 2 copies, the local one and the
> original one, with the local one kept in synch with the original one.
>
> The second statement says there's 1 copy, plus the changes which have
> been made to it.

Okay, so you keep one local copy of the data pristine with what is on the
server, then you want to keep what is effectively a set of local changes
from the what is on the server like a patch so that when you want to access
the data locally, you can generate return a local copy by applying the
patch to the pristine server data.  Then you want to be able to pull down
and incorporate changes from the server, something like what you would do
with "update" on an SCM.  The informated is still changed on a record by
record basis.

Does that sound correct?

In that case, I would use the same basic scheme that I suggested before
but adding a row in the table to track the changes for each field that
might be locally modified.  Null would of course mark fields that have not
changed.  You could store the changes literaly or using some kind of diff
style delta that could be applied against the pristine copy.  Updating from
the server works as before; but, you need to decide what happens if there
is a conflict between what changes on the server and local changes.



More information about the Python-list mailing list