database modeling for google app engine for multiple revison of entity
in my application ( kind of wiki clone ) - an article is frequently changing.
and i need to track all changes that are开发者_如何学Python done on that article. { text only. }
one crude way i have done it, is to add a datetime property and create a new entity everytime something change. which is too much database wasting. { and also un-necessary index waste too. } and also need to re-create parent-child and entity relationships.
i also have log which can show changes -- but i want some thing easier , so that jumping from one version to another version could be easier.
ideas ?
thanks.
You could split the location in your wiki from the content, and link from there to the version of the page. Keep the versions in a linked list, doubly linked if you 2 way navigation, circular, whatever.
The parent child, indexing and so forth deal only with the location and the article linked to that. Reverting to a previous change is only changing the link in the location (and pushing the changes to your indexing machine). Pruning are basic list operations, i.e. pointing the next field to a version further down and deleting the version in between.
精彩评论