2

If we have the following:

  • 1 Azure Cosmos DB account
  • 4 databases
  • Each database contains 1 collection

Would we be able to add 1 new database containing 1 new collection and use that collection as the lease collection for monitoring changes to the other 4 collections? Or does each lease collection need to be associated with 1 and only 1 monitored collection?

Tom Robinson
  • 8,348
  • 9
  • 58
  • 102

2 Answers2

2

Response from the Cosmos DB team (askcosmosdb@microsoft.com):

You can share the Lease collection without issues. Depending on the activity on those 4 collections you might need to adjust the RUs on it though.

Tom Robinson
  • 8,348
  • 9
  • 58
  • 102
1

Yes, the Changefeedprocessor library stores the leases for each partition key range with the following identifier:

"id": "accountHostUrl_DatabaseResourceId_CollectionResourceId..PartitionNumber"

this makes it unique enough to use the same collection for storing leases for many collections across different databases, accounts.

KranthiKiran
  • 145
  • 6