简体   繁体   中英

Mercurial as a versioned data store

Instead of using an SQL Server Posts table with a matching PostRevisions table for flat-file (text/HTML) user content versioning, I'd much rather let Mercurial efficiently store changes for me and just keep track of where each user's file repository is.

This would make backups really easy, depending on how you wanted to share or shard content. The obvious solution is to have a single repository to store all user data, with folders for each user ID.

However, I have a bad feeling about performance and concurrency issues with this approach when committing files to repository storing millions of users' files.

Has anyone tried using Mercurial as a secondary data-store for flat user files?

Unless you're going take advantage of the stronger features a SCM system like hg offers I suggest you don't take this approach. Are you going to be using branches and merging? Probably not. So what do you really gain by using hg here? Backup is just as easy with a DB.

At the end of the day a RDBMS with a posts and revisions tables works just fine and are a stronger basis to build on than what's basically a file-locking based solution (hg, git, etc.). It would probably perform a whole lot better, too.

Btw, you should also evaluate document-oriented stores, like Mongo or CouchDB.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM