Azure Cosmos DB collections are not really collections

If you have been working with MongoDB or RavenDB, you know that a collection is a set of documents of the same type. So given a document of an Order type, you would have a collection named Orders which holds all your Order documents.

Azure Cosmos DB collections are different. I would say they are so different that they really should have different name. Perhaps something like "Container". Anyway, a collection in Cosmos DB is a lot more flexible and not restricted to only holding documents of the same schema, you could (and probably should) be reusing the same collection for multiple document types. You reserve throughput (RU/s) at the level of a collection in CosmosDB, so if you where to make a single collection per document type you would likely be spending more money than necessary.

You should consider creating a new collection when

  • The new documents requires higher or lower demands on throughput, so they could have more or less RU/s
  • The new items would take up so much space that they would require a separate collection (250GB)