Amazon Athena Fundamentals
What you'll learn: How Amazon Athena enables serverless SQL queries directly on S3 data without managing infrastructure.
What is Amazon Athena?
Amazon Athena is AWS's serverless query engine that lets you analyze data stored in S3 using standard SQL. Think of it like having a SQL database that magically reads files in your data lake—no servers to provision, no databases to maintain. You simply point Athena at your S3 buckets, define a schema, and start querying.
Core Architecture
Athena sits between you and your S3 data. When you run a query, Athena:
- Reads schema definitions from the AWS Glue Data Catalog (or its internal catalog)
- Scans the relevant S3 objects in parallel
- Processes the data using distributed query execution
- Returns results directly or saves them to S3
It's built on Presto, an open-source distributed SQL engine, which means it can handle large-scale analytics without you managing any compute clusters.
Pricing Model
Athena charges per query based on data scanned—currently around $5 per terabyte scanned. This means:
- Scanning 1 GB costs roughly $0.005
- Efficient file formats (Parquet, ORC) drastically reduce costs
- Partitioning your data can cut scanned data by 90% or more
- Failed queries still incur charges for data scanned before failure
No charges for storing results (those go to S3), no idle infrastructure costs, and no minimum fees.
When to Use Athena
Perfect for ad-hoc analytics, log analysis, and exploring data lakes where you already have structured or semi-structured data in S3. Since you learned about data lake architectures and file formats earlier, Athena is the natural query layer on top of that foundation.
Key Takeaway: Amazon Athena provides serverless SQL querying on S3 data with pay-per-scan pricing, eliminating infrastructure management while leveraging your existing data lake storage.