Question

Difficulty: MediumHigh-Performing Data Ingestion and Transformation Solutions

A smart utility company is designing a real-time data ingestion pipeline to monitor 500,000500,000 smart electricity meters. The meters transmit power consumption metrics every 1515 seconds, resulting in a total write throughput of 5 MB/s5 \text{ MB/s} and approximately 33,00033,000 records per second. The company has two requirements:

1. An anomaly detection application must process the incoming metrics and identify power spikes. To prevent false positives, the application must process the metrics from each individual meter in the exact order they were generated.
2. The raw data must be converted to Apache Parquet format and archived in Amazon S3 within 55 minutes of generation for historical analysis.

Which architecture should a solutions architect recommend to meet these requirements with the highest performance and the lowest operational overhead?

  1. A
    Ingest the data into an Amazon SQS standard queue. Configure the anomaly detection application to process messages from the queue. Create an Amazon Data Firehose delivery stream to poll the SQS queue, convert the messages to Parquet, and write them to Amazon S3.
  2. B
    Ingest the data into Amazon Kinesis Data Streams, using a single static partition key for all smart meter payloads. Configure the anomaly detection application to consume from the stream. Configure an Amazon Data Firehose delivery stream to read from the Kinesis Data Stream, convert the data, and deliver it to Amazon S3.
  3. Ingest the data into Amazon Kinesis Data Streams, using the smart meter ID as the partition key. Build the anomaly detection application to consume from the stream. Configure an Amazon Data Firehose delivery stream to read from the Kinesis Data Stream, use AWS Glue to convert the data format, and deliver the files to Amazon S3.Answer
  4. D
    Ingest the data into Amazon Kinesis Data Streams. Configure a continuously running AWS Lambda function that polls the stream, performs anomaly detection, and immediately writes each record individually to Amazon S3 after converting it to Parquet.

Answer

Ingest the data into Amazon Kinesis Data Streams using the smart meter ID as the partition key, run the anomaly detection application as a consumer, and use Amazon Data Firehose with AWS Glue integration to deliver the data in Parquet format to Amazon S3.
Ingesting data into Amazon Kinesis Data Streams with the smart meter ID as the partition key ensures that all records for a specific meter are routed to the same shard, preserving the order of generation. The anomaly detection application can consume the ordered stream directly. Amazon Data Firehose can subscribe to the Kinesis Data Stream as a source, integrate with AWS Glue to convert JSON records to Parquet format, and batch-deliver them to Amazon S3 within the 5-minute requirement with minimal operational overhead.

Step-by-Step Solution

1
Ensure ordered processing of events for each smart meter.
Using the smart meter ID as the partition key in Amazon Kinesis Data Streams ensures that all events for a specific meter are routed to the same shard, maintaining chronological order for that meter.
Kinesis Data Streams preserves ordering within a shard based on the partition key.
2
Select a high-throughput, near-real-time archiving mechanism to Amazon S3.
Configure Amazon Data Firehose to read from the Kinesis Data Stream and buffer data for delivery.
Firehose natively integrates with Kinesis Data Streams to batch and load data into S3 with minimal operational overhead.
3
Perform format conversion from JSON to Parquet during ingestion.
Integrate Amazon Data Firehose with the AWS Glue Data Catalog schema to automatically convert JSON records to Parquet before writing to S3.
This setup achieves the transformation requirement serverlessly, avoiding custom Lambda transformation overhead.

Key Concept

Partition keys in Amazon Kinesis Data Streams ensure message ordering per key while scaling throughput. Amazon Data Firehose can serverlessly transform stream data to Parquet using AWS Glue.
Estimated Time:2m 0s
Rate this question