Courseiva
Develop for Azure storagemediumMultiple ChoiceObjective-mapped

Preventing Hot Partitions in Cosmos DB with Proper Partition Key Design

A Cosmos DB container for session records receives hot-partition throttling because the partition key has only five possible values. What should the developer change?

Quick Answer

Cosmos DB spreads a container's storage and throughput across physical partitions based on the partition key's value, so a key with only five distinct values gives the system just five buckets to distribute all the container's data and requests into — no matter how much throughput is provisioned overall, each of those five logical partitions can only draw on a fraction of it, and any partition receiving a disproportionate share of traffic gets throttled once it exceeds its slice, regardless of how much headroom sits unused elsewhere. This is what 'hot partition' means concretely: request volume concentrated on too few partition key values rather than spread across many, since low cardinality caps how finely the workload can be divided. Choosing a key with higher cardinality — many distinct values, ideally with requests distributed roughly evenly across them, such as a user ID or session ID rather than a fixed status code with only a handful of states — lets Cosmos DB spread both storage and request load across far more physical partitions, so no single one absorbs a disproportionate share of traffic. The pattern to recognize in these questions: a low-cardinality key isn't wrong because of storage skew, it's wrong because it artificially limits how much of the provisioned throughput the workload can actually use before hitting a per-partition ceiling.

⚠ Common exam trap

Many exam-takers confuse throttling with performance tuning (TTL) or data storage (analytical store), rather than recognizing that the root cause is an insufficiently granular partition key leading to uneven request distribution.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Choose a partition key with higher cardinality and even request distribution

A partition key with only five values leads to hot partitions, where one or a few partitions handle the majority of requests, causing throttling. By choosing a partition key with higher cardinality (many distinct values) and even request distribution, the load is spread evenly across physical partitions, eliminating hot spots and throttling.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Increase the default TTL

    Why it's wrong here

    TTL controls item expiry, not partition distribution.

  • Enable analytical store only

    Why it's wrong here

    Analytical store supports analytics but does not correct transactional hot partitions.

  • Choose a partition key with higher cardinality and even request distribution

    Why this is correct

    A good partition key spreads storage and throughput across logical partitions.

  • Use a stored procedure for every write

    Why it's wrong here

    Stored procedures do not fix a hot partition key.

About these practice questions

This AZ-204 question is part of Courseiva's 881-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

1 more way this is tested on AZ-204

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. A Cosmos DB container for session records receives hot-partition throttling because the partition key has only five possible values. What should the developer change? The design must avoid adding custom operational scripts.

medium
  • A.Increase the default TTL
  • B.Enable analytical store only
  • C.Choose a partition key with higher cardinality and even request distribution
  • D.Use a stored procedure for every write

Why C: Hot-partition throttling occurs when a partition key has low cardinality (few distinct values), causing uneven request distribution and exceeding the physical partition's throughput limits. Choosing a partition key with higher cardinality and even request distribution spreads operations across more physical partitions, eliminating throttling without custom scripts.

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This AZ-204 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AZ-204 exam.