You are designing a multi-tenant SaaS application using Azure Cosmos DB for NoSQL. Each tenant's data must be logically isolated and queries should never cross tenant boundaries. Query performance must be predictable. How should you partition the container?

Direct Answer (Verified)Reviewed by Sunny (Senior Cloud Engineer)

Correct Answer: Use 'tenantId' as the partition key so all tenant data is in the same logical partition

Using tenantId as the partition key ensures all data for a tenant is in the same logical partition, enabling efficient, cross-item queries within a tenant without cross-partition f...

๐Ÿ“‹Part of Microsoft Certified: Azure Developer Associate (AZ-204) ยท Azure Certification Practice
Real Exam ScenarioAzure Cosmos DB

You are designing a multi-tenant SaaS application using Azure Cosmos DB for NoSQL. Each tenant's data must be logically isolated and queries should never cross tenant boundaries. Query performance must be predictable. How should you partition the container?

โœ“ Correct Answer & ExplanationAzure Cosmos DB

Correct Answer

Use 'tenantId' as the partition key so all tenant data is in the same logical partition

Why This Answer Is Correct

Using tenantId as the partition key ensures all data for a tenant is in the same logical partition, enabling efficient, cross-item queries within a tenant without cross-partition fan-out. This provides tenant isolation and predictable query performance, ideal for multi-tenant patterns.

๐Ÿ“š What This Question Tests

This question evaluates your knowledge of Azure Cosmos DB โ€” a core concept tested in Microsoft Certified: Azure Developer Associate (AZ-204). Understanding Azure Cosmos DB is essential for designing scalable, secure, and cost-effective cloud architectures. Mastery of this topic will help you answer scenario-based questions confidently on exam day.