gpt4 book ai didi

RavenDb和MultiTenancy

转载 作者:行者123 更新时间:2023-12-04 03:54:12 25 4
gpt4 key购买 nike

我看过RavenDb并玩了一段时间,并开始看过MultiTenancy。用于 Multi-Tenancy 的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();
}
}

我不知道每个数据库的存储方式,因此不知道这样一个问题:它将适用于拥有大量租户的大型应用程序吗?

最佳答案

请参阅文档的第一段和最后一段(v2.5 | v3.0)。

RavenDB's databases were designed with multi tenancy in mind, and aremeant to support large number of databases on a single server. Inorder to do that, RavenDB will only keep the active databases open. Ifyou access a database for the first time, that database will be openedand started, so the next request to that database wouldn't have to paythe cost of opening the database. But if a database hasn't beenaccessed for a while, RavenDB will cleanup all resources associatedwith the database and close it.

That allows RavenDB to manage large numbers of databases, because atany given time, only the active databases are actually takingresources.


因此,是的,它将支持它,并且每个数据库都将存储在磁盘上的单独文件夹中。

关于RavenDb和MultiTenancy,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7364698/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com