Analytics
Amazon Athena
Serverless interactive query service that uses standard SQL to analyze data stored directly in Amazon S3. It supports ad hoc queries without setting up or managing infrastructure, and you pay for the queries you run.
Exam phrases that point here
«query data stored in Amazon S3 using standard SQL without loading it into a database»
Athena reads the files directly where they sit in S3: you only define the table (the schema and the location) and you can query it, with no servers and no load process.
When not: If the scenario is a data warehouse with complex, repeated BI queries and many concurrent users, Amazon Redshift is a better fit. If you need your own code or frameworks like Spark with control over the cluster, think of Amazon EMR.
«occasional ad hoc analysis with no infrastructure to manage»
Athena is serverless: there is no cluster to start or shut down, and with the per-query model you pay only when a query runs.
When not: If queries are constant and heavy all day long, a data warehouse such as Amazon Redshift (or provisioned capacity in Athena) can be more predictable. The word 'serverless' alone is not enough: AWS Glue and Amazon EMR Serverless are serverless too, but they are for processing data, not for interactive SQL queries.
«analyze the logs that are already stored in an S3 bucket»
Logs such as AWS CloudTrail, load balancer, or VPC Flow Logs usually end up in S3; with Athena you define a schema over them and query them in place, without moving them.
When not: If the logs are in Amazon CloudWatch Logs, the natural way to query them is CloudWatch Logs Insights. If you need text search and near real-time dashboards over the logs, think of Amazon OpenSearch Service.
«reduce the amount of data each query scans»
With the per-query model, Athena charges for the data scanned. Partitioning the data and storing it compressed in a columnar format (Parquet or ORC) makes each query read less, so it costs less and runs faster.
When not: If the scenario already uses Redshift, the optimization goes another way (distribution keys and sort keys). And if the problem is storage cost rather than query cost, the answer usually lies in S3 storage classes or lifecycle rules.
«query several data sources with SQL without moving them into a single place»
Athena federated queries use data source connectors to read relational and non-relational databases, on premises or in other clouds, and join them with the data in S3. Many connectors run on AWS Lambda.
When not: If the requirement is to continuously replicate Aurora transactional data into a warehouse to analyze it in near real time, the Aurora zero-ETL integration with Amazon Redshift is a better fit.
Often paired with
- Amazon S3
- AWS Glue
- AWS Quick