Soru

Zorluk: OrtaAzure Cosmos DB and NoSQL Solutions

An online education provider is designing a telemetry storage solution using Azure Cosmos DB for NoSQL to record real-time progress events from students globally. The solution must handle a write-heavy workload (90%90\% writes, 10%10\% reads) with an ingestion rate of thousands of events per second. The database must be replicated across three Azure regions to guarantee a 99.999%99.999\% read and write availability SLA. The primary query pattern retrieves all activity logs for a specific course to generate completion reports. You need to design a storage and security configuration that prevents hot partitions, ensures write scalability, and complies with security best practices. Which configuration should you recommend?

  1. A
    Select courseId as the partition key, and configure the Cosmos DB account with multi-region writes enabled across all three regions.
  2. B
    Select studentId as the partition key, and host the database in a single region using Locally Redundant Storage (LRS) to minimize replication costs.
  3. Select studentId as the partition key, and configure the Cosmos DB account with multi-region writes enabled across all three regions.Cevap
  4. D
    Select studentId as the partition key, enable multi-region writes, and authorize client writes using a Shared Access Signature (SAS) token configured with a three-year lifetime and no stored access policy.

Cevap

Select studentId as the partition key, and configure the Cosmos DB account with multi-region writes enabled across all three regions.
Selecting the student ID as the partition key provides high cardinality, distributing the write workload evenly across physical partitions. This avoids hot partitions. Enabling multi-region writes satisfies the 99.999% write availability SLA by allowing local writes in all three regions.

Adım Adım Çözüm

1
Analyze availability and regional replication requirements.
A 99.999% availability SLA for both reads and writes requires Azure Cosmos DB to be configured with multi-region writes across the target regions.
Single-region or single-write-region configurations cannot guarantee 99.999% write availability during a regional outage.
2
Evaluate the partition key to ensure scale and avoid hot partitions.
Select studentId instead of courseId.
Since the workload is write-heavy and studentId has much higher cardinality than courseId, it distributes writes more evenly. CourseId would create hot partitions for popular courses.
3
Determine the correct authentication mechanism.
Avoid using Shared Access Signatures (SAS) which are not supported by Cosmos DB and present key rotation risks when configured with long lifetimes without a stored access policy.
Cosmos DB client writes should be authorized via Microsoft Entra ID or resource tokens, not long-lived SAS tokens.

Anahtar Kavram

Azure Cosmos DB partitioning strategies, multi-region write availability, and security access controls.
Tahmini Süre:1m 30s
Bu soruyu puanla