我使用 Azure cosmos db 设置了一个 Web 应用。我发现我们对每个数据库的容器数量有限制。现在,当我们共享吞吐量时,它是 25 个容器。 这里的最佳实践是什么:
- 为每个应用创建多个数据库,尽管该应用不是微服务。
- 用户无服务器 Cosmos 数据库
- 将吞吐量置于容器级别。
请指教。
最佳答案
I have a container for each entity like Organizations and Users... So the containers number reaches this limit easily.
我认为你需要重新考虑你的设计。来自 the docs :
A container is a schema-agnostic container of items. Items in a container can have arbitrary schemas. For example, an item that represents a person and an item that represents an automobile can be placed in the same container. By default, all items that you add to a container are automatically indexed without requiring explicit index or schema management. You can customize the indexing behavior by configuring the indexing policy on a container.
不要陷入尝试将关系数据库架构映射到 Cosmos DB 资源模型的陷阱。不要将容器视为 table 。您读过modeling guide吗?已经了吗?
关于azure - 我们应该为每个 Web 应用程序创建一个 Azure CosmosDB 还是多个?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72811597/