Course menuMLA-C02

Exams / MLA-C02 / Streaming data for ML / Question 1

MLA-C02 practice question: Streaming data for ML (1 of 2)

Data Preparation for ML and AI A free question from our original MLA-C02 practice exam. Try it, then open the answer to see why each option is right or wrong.

Last verified against current AWS documentation ·How we write our questions

An esports league streams match telemetry from its game servers at roughly 30,000 events per second. A data engineering team wants the raw events in Amazon S3 as Parquet files, partitioned by league and by game ID, so that the ML team can query them with Amazon Athena.

Files should appear within a few minutes of each event. The team does not want to run or patch a Spark cluster, and the data must keep its schema when it is converted.

Which solution meets these requirements?

Choose one answer.

  1. A. Invoke an AWS Lambda function for every event that writes the event as its own small JSON object to Amazon S3 for Athena to query.
  2. B. Run an Amazon EMR cluster with a Spark Structured Streaming job that reads the events and writes partitioned Parquet files to Amazon S3.
  3. C. Send the events to Amazon Data Firehose with Parquet conversion from a Glue table schema, and dynamically partition on the league and game IDs.
  4. D. Send the events to Amazon Data Firehose with Parquet conversion from a Glue table schema, and deliver all records under the default time-based S3 prefixes.
Show the answer and explanation

Answer: C

  • A. Wrong: Writing one object per event creates an enormous number of small files, which slows Athena and drives up request costs. The function would also need its own logic to group events into Parquet.
  • B. Wrong: Spark produces the right output, but the team would size, patch and scale a cluster, which the requirement rules out. Operating the cluster adds effort the team does not want to take on.
  • C. Right: Correct. Firehose converts records to Parquet using a schema in the AWS Glue Data Catalog and delivers them to S3 prefixes built from the partition keys. It is fully managed and delivers within minutes at this volume. Learn more: Partition streaming data in Amazon Data Firehose (opens in a new tab)
  • D. Wrong: Without dynamic partitioning, Firehose writes records under time-based prefixes only, so Athena cannot prune by league or game ID and scans far more data per query. The stem requires partitioning by those keys. Learn more: Partition streaming data in Amazon Data Firehose (opens in a new tab)

Explanation

Amazon Data Firehose is managed, delivers to Amazon S3 within minutes, and can convert records to Parquet using a Glue table schema. Dynamic partitioning writes each record under a prefix built from its league and game keys, so Athena can prune partitions. Per-event Lambda writes create too many objects, and a Spark cluster adds the operations the team wants to avoid.

Study

Keep practicing

Answer questions with a score at the end, or practice just this topic with the explanation after each one. No sign-up needed.

Want more on Streaming data for ML? The 5 full-length practice sets have 10 more Streaming data for ML questions, 325 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets