AWS · Analytics
Amazon Athena
Serverless, interactive SQL queries directly on data in S3, paying per data scanned, with no clusters to manage.
What it is and what problem it solves
Amazon Athena runs SQL queries on data in S3 without loading it anywhere or running servers. Table definitions live in the AWS Glue Data Catalog; data can be CSV, JSON, Parquet, ORC, Avro or Apache Iceberg tables. Federated queries reach other sources (databases, other clouds) through connectors, and Athena also runs Apache Spark for notebooks.
Cost and speed depend on how much data each query scans, so columnar formats, compression and partitioning make a large difference.
When to use it
- Ad hoc analysis of logs (CloudTrail, VPC Flow Logs, ALB, CloudFront) and data lakes in S3.
- Occasional or unpredictable queries where a always-on warehouse would sit idle.
- Quick exploration before deciding to build a warehouse.
When to avoid it
- High-concurrency, sub-second dashboards on large, constantly queried datasets: a warehouse such as Redshift may be cheaper and faster.
- Transactional workloads: a database.
- Huge unpartitioned CSV scanned repeatedly: convert it first, or costs and times balloon.
Scaling model and bottlenecks
Athena scales automatically, within per-Region limits on concurrent active queries; capacity reservations dedicate processing capacity for predictable concurrency and cost.
Performance, latency and throughput
Partition data by common filters (such as date), use Parquet or ORC with compression, and avoid many tiny files; these reduce the data scanned and speed up queries.
Limits and quotas
| Item | Value | Context | Source |
|---|---|---|---|
| DML query timeout | 30 minutes by default, up to 240 minutes Can be raised with a quota request |
Source checked |
|
| Active DML queries in US East (N. Virginia) | 200 Can be raised with a quota request |
Lower defaults in other Regions. | Source checked |
Quotas and limits change. Check the linked source before designing around a number.
Cost model
What you pay for
Per TB of data scanned by SQL queries (federated queries have a per-query minimum), or per DPU-hour with capacity reservations; Spark per DPU-hour. S3 storage and requests and Glue Data Catalog are billed separately.
Where it is cost-efficient
Partitioned, compressed, columnar data where queries scan a small fraction of the dataset.
Where costs grow
SELECT * on large raw CSV or JSON, unpartitioned data, and many tiny files.
Cost controls and common surprises
Convert to Parquet with Glue, partition by date, use workgroups with per-query data limits, and cache results where possible.
Prices differ by Region and change over time; see the pricing page linked under Sources.
Security
Controls the service provides
IAM and Lake Formation permissions, encryption of query results, workgroups to separate users and set limits.
What you configure
Grant access to tables and buckets by role, encrypt results, and use Lake Formation for column- and row-level control.
Logging and monitoring
CloudTrail, workgroup metrics in CloudWatch.
Related security services
Glue Data Catalog, Lake Formation, KMS, S3.
Shared responsibility
AWS runs the query engine. You control data, permissions and encryption.
Availability, backup and failure behavior
Athena is a regional, serverless service; data durability comes from S3.
Common service combinations
S3 data lake, Glue crawlers and ETL, Lake Formation, Quick Sight dashboards, CloudTrail and VPC Flow Logs analysis.
Business application examples
- A security team queries a year of CloudTrail logs in S3 to investigate an incident.
- Analysts explore clickstream data partitioned by day in Parquet.
Exam cues and common confusions
- Serverless SQL on S3, pay per query: Athena.
- Reduce Athena cost and time: columnar formats (Parquet/ORC), compression, partitioning.
- Fine-grained data lake permissions: Lake Formation.
Related
Courses and lessons
- Data lakes: S3, AWS Glue, Athena and Lake Formation · AWS Solutions Architect – Associate (SAA-C03) · Members
Services, comparisons and patterns
- Amazon S3 · Service
- AWS Glue · Service
- AWS Lake Formation · Service
- Amazon Redshift · Service
- Amazon Quick · Service
- Athena vs Redshift vs EMR · Comparison
Sources
Independent study material, not affiliated with or endorsed by Amazon Web Services. AWS and service names are trademarks of Amazon.com, Inc. or its affiliates.