DP-420: Azure Cosmos DB Developer Specialty: Difference between revisions
From Ilianko
Recreated DP-420 Terminology index page |
|||
| Line 204: | Line 204: | ||
: Declarative, version-controlled provisioning of Cosmos DB resources as code. | : Declarative, version-controlled provisioning of Cosmos DB resources as code. | ||
; [[log-analytics]] | ; [[log-analytics]] | ||
---- | ---- | ||
Latest revision as of 15:12, 26 October 2026
DP-420: Designing and Implementing Cloud-Native Applications Using Microsoft Azure Cosmos DB — Key terminology reference for exam preparation.
Core Concepts
- Azure Cosmos DB
- Microsoft's globally distributed, multi-model NoSQL database service for cloud-native apps.
- Request Unit (RU)
- Normalized currency measuring the cost of database operations, independent of hardware.
- Container
- Fundamental unit of scalability/storage in Cosmos DB for NoSQL, analogous to a table.
- Item (Document)
- Fundamental unit of data, stored as a self-describing JSON document within a container.
- API for NoSQL
- Cosmos DB's native API (formerly SQL API), queried with a SQL-like language; DP-420's focus.
- OLTP
- Online Transactional Processing; small, fast operations — Cosmos DB's core transactional workload type.
- OLAP
- Online Analytical Processing; large aggregations and analytical queries over historical data
Data Modeling & Partitioning
- Partition Key
- Property used to distribute items across physical partitions for scalability.
- Logical Partition
- Group of items sharing the same partition key value; max 20 GB storage.
- Physical Partition
- Underlying infrastructure unit hosting one or more logical partitions.
- Synthetic Partition Key
- Concatenated/computed key combining multiple properties for better distribution.
- Hierarchical Partition Key
- Up to 3 levels of partition keys for granular, multi-tenant partitioning.
- Embedding (Denormalization)
- Nesting related data within a single document for fewer round trips.
- Referencing (Normalization)
- Storing related entities as separate documents linked by an id reference.
- Time to Live (TTL)
- Container/item setting that automatically deletes items after a set time.
- Unique Keys
- Container-level constraint enforcing uniqueness of property paths per logical partition.
Throughput & Scaling
- Provisioned Throughput
- Reserved, guaranteed RU/s billed regardless of consumption; suits steady workloads.
- Serverless
- Consumption-based billing for actual RUs used; suits intermittent/unpredictable traffic.
- Autoscale Throughput
- Automatically scales RU/s between 10%-100% of a configured maximum based on demand.
- Database-Level Throughput
- Provisioned throughput shared across all containers in a database.
- az cosmosdb sql container update
- CLI: updates container config (indexing, TTL, unique keys), not throughput.
- az cosmosdb sql container throughput update
- CLI: changes a container's manual RU/s or autoscale max RU/s.
- az cosmosdb sql container throughput migrate
- CLI: switches a container between manual and autoscale throughput.
- az cosmosdb sql container redistribute-partition-throughput
- CLI: reallocates RU/s unevenly across physical partitions to relieve a hot partition.
Data Distribution & Consistency
- Global Distribution
- Turnkey replication of data across any number of Azure regions, no code changes.
- Consistency Levels
- Five tunable levels (Strong, Bounded Staleness, Session, Consistent Prefix, Eventual).
- Automatic Failover
- Policy that automatically promotes a new write region during a regional outage.
- Multi-Region Writes
- Every region accepts reads and writes simultaneously (multi-master).
- Conflict Resolution Policy
- Defines how concurrent multi-region write conflicts are resolved (e.g., LWW).
- Session Token
- Value guaranteeing a client reads its own writes under session consistency.
Client Connectivity & SDK
- Gateway Mode
- SDK connectivity via a single HTTPS endpoint; more firewall-friendly, higher latency.
- Direct Mode
- SDK connectivity direct to backend replicas over TCP; lower latency, more ports needed.
- Cosmos DB Emulator
- Local, offline tool emulating Cosmos DB for development/testing without Azure cost.
- Point Operation
- Single-item operation using id + partition key, more RU-efficient than a query.
- Patch Operation
- Partial update of specific item properties without replacing the whole document.
- Transactional Batch
- Groups multiple point operations on the same logical partition into one atomic transaction.
- Bulk Support
- SDK feature optimized for loading/updating large volumes of items across many partitions.
- Optimistic Concurrency (ETag)
- Uses the ETag property with if-match preconditions to detect write conflicts.
- Continuation Token
- Opaque value used to resume a paginated query/feed from where the last page left off.
- Cross-Partition Query
- Query spanning multiple physical partitions; tuned via MaxConcurrency and MaxBufferedItemCount.
- 429 Throttling Error
- Error indicating a request was rate-limited due to exceeding provisioned RU/s.
- isTombstone
Server-Side Programming
- x-ms-retry-after-ms
- http header value that represents in milliseconds the minimal waiting time between requests.
- Item response, Feed response
- Contains both returned data plus request charge, session token, and ETag
- Queries
- Queries
- Stored Procedure
- JavaScript logic executed server-side within a single logical partition transaction.
- BulkImportResponse
- Return object of the classic bulkImport stored procedure pattern; reports numDocsImported/continuation.
- Trigger
- Pre- or post-operation JavaScript logic, explicitly invoked by the client per request.
- User-Defined Function (UDF)
- Read-only JavaScript function extending SQL queries with custom computations.
- Aggregate Functions (COUNT, SUM, AVG, MIN, MAX)
- Built-in SQL aggregate operators (COUNT, SUM, AVG, MIN, MAX) used with GROUP BY.
- EXISTS & Array Functions (IS_ARRAY, ARRAY_CONTAINS)
- SQL subquery and array functions (EXISTS, IS_ARRAY, ARRAY_CONTAINS, ARRAY_LENGTH) for nested data.
Integration & Analytics
- Change Feed
- Persistent, ordered log of item inserts/updates, consumable by apps and Azure Functions.
- Full-Text Query
- Native keyword search via FULLTEXTCONTAINS/FULLTEXTSCORE, backed by a full-text index.
- HTAP (Hybrid Transactional and Analytical Processing)
- Architecture running analytics over operational data without impacting transactional OLTP RUs, enabled via Synapse Link/analytical store.
- Azure Synapse Link / Analytical Store
- Near real-time analytics via a separate column-store, no RU impact on transactional data.
- Azure Cosmos DB Mirroring for Fabric
- Near real-time replication of Cosmos DB data into Microsoft Fabric's OneLake.
- OneLake
- Fabric's single, unified, tenant-wide data lake storing all workloads' data in Delta format.
- Delta Format
- Open-source ACID table format (Delta Lake) used for all data stored in OneLake.
- Apache Spark
- Distributed processing engine used in Synapse/Fabric notebooks to analyze Cosmos DB data.
- Serverless SQL Pool
- On-demand T-SQL query service in Azure Synapse to query Cosmos DB analytical store via OPENROWSET.
- Direct Lake
- Power BI mode reading Delta tables directly from OneLake — near-Import speed, always fresh.
- Azure Functions Integration
- Serverless compute triggered by Cosmos DB change feed for event-driven processing, denormalization, and data movement.
- Azure Logic Apps
- Low-code cloud workflow automation service integrating with Cosmos DB via connectors, triggers, and actions.
- Azure AI Search Integration
- Indexer pulls Cosmos DB data (via change feed) to enable full-text/semantic search.
Optimization
- Indexing Policy
- Defines which properties are indexed, trading off query performance vs. write RU cost.
- Range Index
- Default index type for string/numeric properties; supports equality, range, and ORDER BY.
- Spatial Index
- Accelerates geospatial queries (ST_DISTANCE, ST_WITHIN) over GeoJSON properties.
- Composite Index
- Index across multiple properties to support efficient multi-property filter/sort queries.
- Vector Index
- Enables approximate nearest-neighbor similarity search over embeddings for AI/RAG scenarios.
- Wildcard / Included & Excluded Paths
- Path expressions (with optional /* wildcard) controlling exactly which properties are indexed.
- Integrated Cache
- In-memory caching layer (via dedicated gateway) reducing RU cost/latency for repeated reads.
- Change Feed Estimator
- Reports pending change feed lag to help decide when to scale out consumer instances.
Maintenance & Security
- Alerts
- Cosmo DB alerts
- Normalized RU Consumption
- Azure Monitor metric showing % of provisioned throughput used; flags hot partitions.
- PartitionKeyRUConsumption (Diagnostic Log)
- Per-second RU/s consumption per partition key; pinpoints hot partitions.
- PartitionKeyStatistics (Diagnostic Log)
- Estimated storage size (KB) per logical partition key; flags storage skew.
- QueryRuntimeStatistics (Diagnostic Log)
- Logs query operations against the account for query performance analysis.
- ControlPlaneRequests (Diagnostic Log)
- Logs account control-plane operations, e.g. adding/removing replication regions.
- DataPlaneRequests (Diagnostic Log)
- Logs item-level create/read/replace/delete/query operations with RU charge and duration.
- KQL (Kusto Query Language)
- Query language used in Azure Monitor Log Analytics to analyze Cosmos DB diagnostic logs and metrics.
- Periodic Backup
- Original backup mode; scheduled snapshots, typically restored via a support request.
- Continuous Backup & Point-in-Time Restore
- Continuous backups enabling self-service restore to any timestamp in the retention window.
- Customer-Managed Keys
- Encrypt data at rest using a key you control in Azure Key Vault.
- Data Encryption Key (DEK)
- for Always Encrypted in Azure Cosmos DB, you must use the Azure Cosmos DB SDK (C#, Java, or Node.js).
- RBAC for Data Plane
- Fine-grained Microsoft Entra ID permissions for data operations, avoiding shared account keys.
- Cosmos DB Operator
- Provisions accounts, databases, and containers; cannot access data or use Data Explorer.
- Cosmos DB Account Reader Role
- Can read Azure Cosmos DB account data; cannot provision resources or make changes.
- Cosmos Backup Operator
- Submits a restore request for a periodic backup-enabled database or container.
- CosmosRestoreOperator
- Performs the restore action for an account in continuous backup mode.
- Always Encrypted
- Client-side encryption ensuring Cosmos DB never sees plaintext values of protected properties.
- Azure Data Factory (Data Movement)
- Pipeline-based ETL/ELT service for moving data into/out of Cosmos DB.
- ARM Templates (Infrastructure as Code)
- Declarative, version-controlled provisioning of Cosmos DB resources as code.
- log-analytics
DP-420: Designing and Implementing Cloud-Native Applications Using Microsoft Azure Cosmos DB — terminology reference