Guided architecture tour · 6–8 min
Ask questions of files in a bucket — Athena and S3
Use SQL to answer a question about log files stored in S3.
This tour teaches architecture decisions. Its services are not provisioned in the emulator.
Your goal
Use SQL to answer a question about log files stored in S3.
Why this matters
A team wants to count yesterday’s requests without loading all logs onto a laptop. You will describe the files, choose the relevant data, and protect the query results.
Words you will use
SQL is a language for asking questions about tables. Athena can query data in S3. A schema describes the fields. A partition groups data, often by date.
How to proceed
Read each situation and choose an answer. The lesson explains the result. Try again if needed, then continue through all three decisions and finish the tour.
1. Describe the files
Your bucket holds structured request logs. Athena needs to know where the data lives and what its fields mean before SQL can use it. Choose the first setup task.
What should you define?
A table description with the data location, format, and fields.
A table definition describes existing data; it does not magically fix malformed files. Match the definition to the actual format so fields such as time and status can be read correctly.
The logs have a table shape that a query can use.
S3 location + format + schema → queryable table2. Read only the needed data
You need yesterday’s errors, but the bucket contains a year of logs organized by date. Choose a query approach that avoids needless scanning.
What should the query limit?
The relevant date partitions and required columns.
Selecting relevant partitions can reduce the files read. Suitable column-based formats can also reduce work. Check the scanned data and query plan rather than assuming a short answer required little reading.
The query focuses on the data needed for the question.
Selected date + needed fields → smaller query scope3. Protect the results too
The source logs have restricted access. Query output is written to a results location that also needs protection. Choose the next access review.
What else must be secured?
The results location, encryption, and permissions.
A query can create another copy of sensitive data. Review who can read the result files, where they are saved, and how long to retain them. Source protection alone does not cover the output.
The query result has an access and retention plan.
Protected input → authorized query → protected result locationPractice, then check your understanding
In the interactive tour, make each decision before seeing the outcome. Wrong answers receive coaching, and replay gives you a fresh attempt without duplicating earned XP.
Read the official AWS documentation for service behavior and production details.