On 07/16/2012 04:10 PM, Platonides wrote:
On 17/07/12 00:22, Adam Wight wrote:
Hello comrades, I've run into a challenge too interesting to keep to myself ;) My immediate goal is to prototype an "offline" wikipedia, similar to Kiwix, which allows the end-user to make edits and synchronize them back to a central repository like enwiki.
The catch is, how to insert these changes without edit conflicts? With linear revision numbering, I can't imagine a natural representation of the data, only some kind of ad-hoc sandbox solution.
Extending the article revision numbering to represent a branching history would be the natural way to handle optimistic replication.
Non-linear revisioning might also facilitate simpler models for page protection, and would allow the formation of multiple, independent consensuses.
-Adam Wight
Actually, the revision table allows for non-linear development (it stores from which version you edited the article). You could even make to "win" a version different than the one with the latest timestamp (by changing page_rev) one. You will need to change the way of viewing history, however, and add a system to keep track of "heads" and "merges". There may be some assumtions accross the codebase about the latest revision being the active one, too.
Cool! That's a nice solution because it's transparent to the end-user's system. However, if we use the current schema as you're describing, we would have to reconcile rev_id conflicts during the merge. This seems like a nasty problem if the merge is asynchronous, for example a batched changeset sent in email. -adam