ETExamTower
Q20Data Operations and SupportMultiple answers

A data engineer must orchestrate a series of Amazon Athena queries that will run every day. Each query can run for more than 15 minutes. Which combination of steps will meet these requirements MOST cost-effectively? (Choose two.)

Select 2 answers.
← → navigate · a answer
Community votes
B
47% (14)
A
33% (10)
E
10% (3)
C
7% (2)
D
3% (1)
Discussion · 24
A, B 11
Selected Answer: AB AWS Lambda can be used effectively to trigger Athena queries. Using the start_query_execution API from the Athena Boto3 client, you can start Athena queries programmatically. Lambda functions are cost-effective because they bill only for the compute time used, and there is no charge when the code is not running. However, Lambda has a maximum execution timeout of 15 minutes, which means it is not suitable for long-running operations, but it can still be used to trigger or start queries. AWS Step Functions can orchestrate multiple AWS services in workflows. With a Wait state, the workflow can periodically check the status of the Athena query and move to the next step once the query is complete. This approach is more scalable and reliable than continuously running a Lambda function, since Step Functions handle long-running processes better and can keep the state of each step in the workflow.
B, E 10
Selected Answer: BE B - because https://docs.aws.amazon.com/step-functions/latest/dg/sample-athena-query.html E - because https://aws.amazon.com/blogs/big-data/orchestrate-amazon-emr-serverless-spark-jobs-with-amazon-mwaa-and-data-validation-using-amazon-athena/
5
Lambda max timeout is 15 minutes, and the query takes more than 15 minutes. So Lambda should finish before the Athena query.
B, C 4
Selected Answer: BC BC for me A - lambda function will stop at 900s, so it will stop before the query ends(more than 15mins) E - Airflow is way more complex and expensive than step function
3
The question is asking about a "combination of steps" - MWAA and Step Functions are separate options, so I would go with AB
A, B 3
Selected Answer: AB Lambda for kick start Athena Step Functions for orchestration
A, B 2
Selected Answer: AB I would go with AB
A, B 2
Selected Answer: AB my opinian
A, B 2
Selected Answer: AB Since the Athena API supports async/await, users can split the steps into trigger queries and get results after 15 minutes.
A, B 2
Selected Answer: AB It should be AB
B, D 2
Selected Answer: BD Lambda maximum timeout is 15 minutes. So the query takes more than Lambda can handle. So you cannot use lambda. Use Step-Function (answer B) or glue python (answer D) Airflow is more expensive than Glue/Step-Functions, so E is discarted also.
2
I discarted E because Airflow is more expensive than Glue/Step-Functions. So B (step-function) and D (glue python shell).
A, B 2
Selected Answer: AB Not E because "You should use Step Functions if you prioritize cost and performance" https://aws.amazon.com/managed-workflows-for-apache-airflow/faqs/ And also the fact that the queries take longer than 15 min can be handled with step functions, therefore AB
A, B 2
Selected Answer: AB Why? B (Step Functions): Step Functions are ideal for orchestrating long-running workflows, including polling the Athena query status and triggering the next query when it is ready. A (Lambda): Lambda is used to programmatically trigger Athena queries within Step Functions, despite its 15-minute limitation, because Step Functions can handle the long runtime by using Wait states. Why Not C, D, or E? C and D involve Glue, which is better suited for ETL jobs than orchestration, so they are less efficient and cost-effective. E (Amazon MWAA) adds unnecessary cost and complexity for a straightforward workflow.
A, B 2
Selected Answer: AB After real-world testing, A is a valid answer. This is because Lambda only sends the API request to Athena, which runs the query. Even if the Lambda times out, the query result is still stored in the designated S3 bucket.
2
Lamda timeout has nothing to do with Athena Query. It just starts the Athena Query, returns the execution_id and exists. Athena runs in the background independently.
1
Option B, using AWS Step Functions, can be a cost-effective solution for orchestrating the execution of Athena queries, but it might not be the most cost-effective choice in this scenario because Step Functions are billed based on state transitions and the duration of state execution. Since each query can run for more than 15 minutes, using Step Functions to wait and periodically check the status of the queries could potentially lead to higher costs, especially if the queries often take a long time to finish.
1
Option C and D involve using an AWS Glue Python shell script to run a sleep timer and periodically check whether the current Athena query has finished running. While this approach may seem cost-effective in terms of using AWS Glue, it's not the most efficient way to handle the execution of Athena queries. AWS Glue is mainly designed for ETL (Extract, Transform, Load) tasks rather than orchestrating long-running query execution. Therefore, while both options B, C and D could technically work, they might not be the most cost-effective or efficient solutions for orchestrating long-running Athena queries. Instead, options A and E would likely be more cost-effective and suitable for this scenario.
B, E 1
Selected Answer: BE tricky, A is valid. Still, cost effective: B no one doubt on it. then why E? MWAA provides a managed Apache Airflow environment for orchestrating complex workflows. It can handle long-running tasks like Athena queries efficiently. Batch Processing: Using AWS Batch inside the Airflow workflow allows for distributed and scalable execution of the Athena queries, which improves overall processing efficiency.
1
BE is right. A is only giving option to envoke the athena query. how about the response. if the execution is beyong 15 mins
1
A could be not valid, as queries take more than 15 minutes, and Lambda maximum timeout is 15 minutes. Lambda would end before the query is finished.
1
A.Why it's correct: AWS Lambda is a cost-effective, serverless option for invoking Athena queries using the Boto3 API. Lambda charges are based on execution time and memory usage, making it an efficient solution for periodic query execution. B. Why it's correct: Step Functions provide a serverless orchestration option with a pay-per-use pricing model. Adding a Wait state prevents excessive API calls and ensures queries are executed in sequence, making it a cost-effective and scalable solution. Why the other options are less optimal: -- E. Use Amazon Managed Workflows for Apache Airflow (MWAA): MWAA is powerful for complex workflows, but its pricing includes environment uptime costs, which can be higher than Lambda and Step Functions for simple tasks like orchestrating Athena queries. By choosing A and B, you balance cost-effectiveness and simplicity for orchestrating daily Athena queries.
1
Lambda is just for triggering the query. Its not waiting for the query to finish. The status of the query will be checked using Step functions.
C, E 1
Selected Answer: CE AB - Because of the Lambda timeout CE—is correct. The query will be run by a glue job, which will be orchestrated by Airflow. The job will be scheduled using AWS Batch.