Synthetic Partition Key

From Ilianko
Revision as of 15:07, 26 October 2026 by Anko (talk | contribs) (Recreated DP-420 term page: Synthetic Partition Key (Data Modeling & Partitioning))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

← Back to DP-420 Terminology Reference

Category: Data Modeling & Partitioning

Summary: Concatenated/computed key combining multiple properties for better distribution.

Overview

A synthetic partition key is a concatenated or computed partition key value, created by combining multiple properties (e.g., 'deviceId-date') when no single existing property provides sufficient cardinality or distribution on its own. Synthetic keys help avoid hot partitions in workloads where the natural candidate key values are too few or unevenly accessed.

More Info & Links

DP-420 Style Practice Questions

Q1. When would you typically construct a synthetic partition key?

  • A. When no single property provides sufficient cardinality or even distribution on its own
  • B. When the container needs to disable indexing
  • C. When you want to reduce the number of containers
  • D. When multi-region writes are disabled

Q2. Which of these is an example of a synthetic partition key?

  • A. A concatenation of deviceId and date, such as 'device123-2026-01-01'
  • B. A GUID generated for the item id
  • C. A property that never changes across all items
  • D. The container's name

Answer Key

Answers are listed at the very end so you can attempt the questions first.

  • Q1 (Synthetic Partition Key): A. When no single property provides sufficient cardinality or even distribution on its own — Synthetic partition keys combine multiple properties to achieve better cardinality/distribution when a single natural key is insufficient.
  • Q2 (Synthetic Partition Key): A. A concatenation of deviceId and date, such as 'device123-2026-01-01' — Synthetic partition keys are often built by concatenating two or more properties to improve distribution.

DP-420: Designing and Implementing Cloud-Native Applications Using Microsoft Azure Cosmos DB — term detail page