用户创建的文本内容的版本控制
问题:我正在开发一个网站,用户可以在其中创建、编辑和销售故事(基本上是文本文件)。我想为他们的文本实现一个用户友好的版本控制(或多或少像谷歌文档)。我不是在寻找 Wiki,而是在寻找一个可以集成到版本控制只是一方面的网站中的 VCS 解决方案(例如,我有自己的编辑器,带有 web、桌面版和 iOS 版)。
设计细节:在我的设计中,我希望能够处理 5 万个用户,每个用户平均有 4 个故事(文本文件),每个故事大小为 100kb。他们的故事至少每 30 分钟左右就会自动提交一次。我担心可能的开销和延迟频繁创建和删除以及提交数千个故事和数百个帐户的更改。我担心的另一个问题是数据容易损坏。最后还有实用性问题。对于后者,了解我主要使用 Django 1.3 在 Python 2.7 中对服务器 Web 界面进行编程可能会有所帮助。考虑到上述内容,我有以下问题:
- 假设我使用 subversion (我很熟悉,但从未如此大规模地使用过)。下面哪个选项更好?
- 为每个用户创建一个单独的项目;
- 为每个用户创建一个单独的文件夹,所有文件夹都在同一个巨大的项目中;
- 为每个用户在同一文件夹和项目中创建单独的文件(以避免处理数千个 .svn 标头)。
- 假设我不使用颠覆。您推荐哪些其他 VCS(Git?Mercurial?...)以及什么样的设置(在上述问题的模型中)?请简单解释一下原因。
Problem: I am developing a website where users will create, edit and sell stories (basically text files). I want to implement a user-friendly version control for their texts (more or less like Google Docs). I am not looking for a Wiki, I am rather looking for a VCS solution that can be integrated in a website where version control is only one aspect (for instance, I have my own editors, with web, Desktop and iOS versions).
Design details: In my design I would like to be able to deal with 50k users, each with an average of 4 stories (text files) with 100kb each. Their stories would be automatically committed at least every 30 minutes or so. I am worried about the possible overhead and delays frequent creation and deletion and commit of changes of thousands of stories and hundred of accounts. Another concern I have is vulnerability of the data to corruption. Finally there is also the problem of practicality. For the later it may help to know I am programming my server web interfaces mainly in Python 2.7 using Django 1.3. With the above in mind I have the following questions:
- Supposing I use subversion (which I am familiar with, but never used in such scale). Which of the options below is better?
- create a separate project for each user;
- create a separate folder for each user, all in a same huge project;
- create separate files for each user all in the same folder and project (to avoiding processing thousands of .svn headers).
- Supposing I do not use subversion. Which other VCS do you recommend (Git? Mercurial? ...) and with what kind of setup (in the molds of question above)? Please, briefly explain why.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为什么不直接使用具有严格安全设置的 wiki,以便每个用户只能看到自己的 wiki 页面呢?一个流行的 wiki 项目是 MediaWiki
Why don't you just use a wiki with strict security settings, so that each user can only see their own wiki pages? A popular wiki project is MediaWiki
如果您必须使用 VCS,我认为使用分布式 VCS(例如 git 或 < a href="http://mercurial.selenic.com/" rel="nofollow">mercurial。这些存储库是轻量级的,您可以轻松地为每个用户创建一个存储库。
If you must go with a VCS, I think you would have much better luck with a distributed VCS like git or mercurial. The repositories are lightweight and you could easily create one per user.