As users sign up to the trial and give
如果一切顺利,我们会得到越来越多
databases that were at least 2GB in
size, even if the whole of the data
文件没有用,我们发现这个用了一个
大量的磁盘空间
为所有人建立几个数据库
客户的磁盘空间可以
used to maximum efficiency.
Sharding will be on a per collection
基准作为标准,提出了一个
问题是收藏从来没有
达到起始的最小尺寸
sharding, as is the case for quite a
我们的收藏品(例如:
存储用户登录详细信息),
我们已经要求,这也将
be able to be done on a per database
水平,看
Http://jira.mongodb.org/browse/sharding-41
I have the same problem to solve and also considering variants.
As I have years of experience creating SaaS multi-tenant applicatios I also was going to select the second option based on my previous experience with the relational databases.
他们说不惜一切代价避免第二种选择,据我所知,这种选择并不特别适用于蒙哥布。我的印象是,由于数据库设计的特殊性,这适用于我研究的大多数 NoSQL 数据库(CoachDB、 Cassandra、 CouchBase Server 等)。
Collections (or buckets or however they call it in different DBs) are not the same thing as security schemas in RDBMS despite they behave as container for documents they are useless for applying good tenant separation. I couldn't find NoSQL database that can apply security restrictions based on collections.
当然,您可以使用基于 mongodb 角色的安全性来限制对数据库/服务器级别的访问
I would recommend 1st option when:
您有足够的时间和资源来处理
design, implementation and testing of this scenario.
Your application design will allow customers (tenants) to make significant changes in the application runtime (adding modules, customizing the fields etc.).
如果您有足够的资源来快速扩展新的硬件节点。
If you are required to keep versions/backups of data per tenant. Also the restore will be easy.