A smart grid utility company collects hourly electricity consumption metrics from million smart meters. Each meter sends a 1 KB write payload once per hour, distributed evenly throughout the day, establishing a highly predictable baseline rate. However, during grid maintenance or unexpected outages, up to million smart meters simultaneously send status updates, causing sudden, unpredictable ingestion spikes of up to writes/second that last for less than 5 minutes. The company wants to minimize overall database and ingestion costs while ensuring no data is throttled or lost.
Which architecture meets these requirements most cost-effectively?
- Configure the Amazon DynamoDB table in provisioned capacity mode with Auto Scaling to handle the steady baseline. Buffer the incoming meter payloads using an Amazon SQS queue, and consume messages using AWS Lambda to write to the table at a controlled rate.Cevap
- BConfigure the Amazon DynamoDB table in provisioned capacity mode with Auto Scaling enabled, setting the maximum write capacity to WCUs to dynamically handle anomaly events.
- CConfigure the Amazon DynamoDB table in provisioned capacity mode with Auto Scaling, and use a partition key composed of the current timestamp to ensure sequential order when writing anomalies directly to the table.
- DDeploy an Amazon RDS for PostgreSQL Multi-AZ DB instance to store the data, and configure the smart meters to route write spikes to read replicas during grid anomaly events to prevent overloading the primary DB instance.
Cevap
Configure the Amazon DynamoDB table in provisioned capacity mode with Auto Scaling to handle the steady baseline. Buffer the incoming meter payloads using an Amazon SQS queue, and consume messages using AWS Lambda to write to the table at a controlled rate.
The correct architecture uses an Amazon SQS queue to buffer the high-volume ingestion spikes, decoupling the ingestion layer from the database layer. This allows the DynamoDB table to be provisioned for the steady baseline rate ( WCUs), saving significant costs compared to DynamoDB On-Demand capacity mode or provisioning for the peak capacity of WCUs. AWS Lambda consumes from the queue and writes to DynamoDB at a controlled rate, ensuring no writes are lost or throttled.
Adım Adım Çözüm
Anahtar Kavram
Decoupling architectures to flatten ingestion spikes and optimize database provisioned capacity costs.