Re: Adding history/versioning to a Nested Set model (is it possible?)

From: Vladimir Odrljin <vldmdeseta_at_gmail.com>
Date: Fri, 30 Oct 2009 01:39:09 -0700 (PDT)
Message-ID: <d38baead-8153-41be-a524-8d146563bb0e_at_s31g2000yqs.googlegroups.com>


On Oct 28, 6:55pm, Ed Lucas <edward.lu..._at_gmail.com> wrote:
> Hi All,
>
> I'm trying to implement a tree structure, hence I'd like the Nested
> Set model, but I need to be able to record the history of the tree
> structure *somehow* so that I can access previous versions.
>
> I've searched up and down online but all I can find are transactions
> +rollbacks.
>
> As far as I can see...
>
> The simplest option would be to add a version number to the model, but
> then every member of the set would have to be updated each time a
> change is made - not feasible because of how fast that would make the
> table would grow, and how slow that would make it to update?
>
> I imagine I could log each action and then replay all the log actions
> in a temporary table when I needed them, but that would get pretty
> slow after a few updates.
>
> The previous Nested Set could be serialised to an blob and stored.
> That's currently looking like the best option, but only by process of
> elimination...
>
> I've probably missed something obvious that's staring me in the face
> here! - any suggestions?
>
> Thanks for taking the time to read this far, best regards,
> Ed

You can find the solution at www.dbdesign11.com see states of relationships.
Vladimir Odrljin Received on Fri Oct 30 2009 - 09:39:09 CET

Original text of this message