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.
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.
AA. 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.
BB. Run an Amazon EMR cluster with a Spark Structured Streaming job that reads the events and writes partitioned Parquet files to Amazon S3.
CC. Send the events to Amazon Data Firehose with Parquet conversion from a Glue table schema, and dynamically partition on the league and game IDs.
DD. 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.
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.
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 →