RavenDb 和多租户
我已经研究并使用了 RavenDb 一段时间,并开始考虑 MultiTenancy。多租户的 Ayendes 示例如下所示:
using(var store = new DocumentStore
{
Url = "http://localhost:8080"
}.Initialize())
{
store.DatabaseCommands.EnsureDatabaseExists("Brisbane");
store.DatabaseCommands.EnsureDatabaseExists("Melbroune");
store.DatabaseCommands.EnsureDatabaseExists("Sidney");
using (var documentSession = store.OpenSession("Brisbane"))
{
documentSession.Store(new { Name = "Ayende"});
documentSession.SaveChanges();
}
}
我不知道每个数据库是如何存储的,因此问题是:这适用于拥有大量租户的大型应用程序吗?
I have looked and played around with RavenDb for a while and have started to look at MultiTenancy. Ayendes sample for multitenancy looks like this:
using(var store = new DocumentStore
{
Url = "http://localhost:8080"
}.Initialize())
{
store.DatabaseCommands.EnsureDatabaseExists("Brisbane");
store.DatabaseCommands.EnsureDatabaseExists("Melbroune");
store.DatabaseCommands.EnsureDatabaseExists("Sidney");
using (var documentSession = store.OpenSession("Brisbane"))
{
documentSession.Store(new { Name = "Ayende"});
documentSession.SaveChanges();
}
}
I don't know how each database is stored and hence the question: Will that work for large applications with a lot of tenants?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请参阅文档的第一段和最后一段(v2.5 | v3.0)。
所以是的,它将支持它,并且每个数据库将存储在磁盘上的单独文件夹中。
See the first and last paragraphs from the docs (v2.5 | v3.0).
So yes it will support it and each database will be stored in a separate folder on disk.
实施多租户(加上混合组合)有 3 个基本选项:
一切都可以放入 RavenDB(最初的问题是关于选项#2)。当然,完全隔离租户的选项#1 更安全,但从长远来看,其他选项可能会变得更便宜,而选项#3 是这三种选项中最实惠的(从长远来看)。
查看这些资源:
There are 3 basic options of implementing multi-tenancy (plus hybrid combinations):
All are good to go in RavenDB (the original question was about option #2). Of course, option #1 with fully isolated tenants is more secure but others are likely to become cheaper in the long run with option #3 being the most affordable out of the three (in the long run).
Check out these resources: