We have a multi-tasking application that uses Azure DocumentDB as our zero-SQL database.
For multithreading, we read this question and this blog post . Since now the number of users does not meet the needs of using different databases and / or documentCollections , and, more importantly, to save money, we implemented multitasking with the Where clause in the TenantId field with one documentCollection .
Similarly, when it comes to storing “documents” or “objects” with completely different natures (for example, Book and Car ), we question the fact of using one documentCollection .
First, it makes more sense to create two different documentCollection for Book and Car . However, creating a documentCollection costs $ 25 a minimum. We don’t want to pay + $ 25 every time we need to add a new function, even if it is designed to store a small amount of data (for example, our application stores a lot of Books , but few Cars ...).
Is it a good design to put a book and a car in the same documentCollection ? And save the link to the document type in the shared element (for example, string Type ="Book" or string Type = "Car" ).
Knowing that we have already implemented Multitenancy with a Where clause to request all the cars in our application for this tenant, our requests will contain Where TenantId ="XXXX" AND Type = "Car" .
I saw that DocumentDB now supports the Partitioned Collection . Could this be a good use of sections or, conversely, should they be supported to achieve better scalability and not adapted to separate different types of documents whose objects may not be similar?
azure azure-cosmosdb
Benoit patra
source share