Lesson 1 of 7 Analytics: Data Lakes, Athena, Glue, EMR, Redshift and QuickSight

Designing a Data Lake on Amazon S3

This lesson explains how a data lake stores raw and processed data cheaply in S3, in open formats that many analytics engines can read, with a catalogue and permissions on top.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe how the storage layer is organised into zones.
  • Explain how partitioning makes queries efficient.
  • Choose an ingestion service for each source.

Storage layer

A data lake on AWS stores its data in Amazon S3, organised into zones such as raw, processed and curated, which hold data at different stages of preparation. Lifecycle rules move older data to cheaper storage classes.

Data is stored in open formats, such as Parquet, ORC and Apache Iceberg, so that many engines, including Athena, Redshift Spectrum, EMR and Glue, can read the same data without copies. Amazon S3 Tables provide managed Apache Iceberg tables with automatic maintenance. Columnar formats with compression reduce the data each query reads, and therefore the cost and time of queries.

The following diagram shows the zones and the engines that read them.

A data lake on Amazon S3. Data moves through raw, processed and curated zones, stored in open, columnar formats such as Parquet or Apache Iceberg. Because the formats are open, Athena, Redshift Spectrum, EMR and Glue all read the same data without copies, and lifecycle rules move older data to cheaper storage classes.
The formats and engines are examples. Each zone can have its own lifecycle rules and access controls.
True or false

Storage layer

Exam skills 3.5.1 · 3.5.7

Check how a data lake's storage layer is designed.

Log in to try this activity Interactive activities are free with an account.

Partitioning

Partitioning stores data in folders named after the values of a column, such as s3://lake/sales/year=2026/month=05/. A query that filters on year and month then reads only the matching folders, which reduces the data scanned, and therefore both the cost and the time of queries in services such as Athena that charge by data scanned.

Partitions should follow the columns most often used in filters, usually dates. Too many partitions is also a problem: partitioning by a high-cardinality column, or at too fine a granularity, creates many folders each holding only tiny files, and the overhead of listing and opening them outweighs the benefit.

The following diagram shows a query reading only the matching partition.

Partition pruning. Sales data is stored in folders named after year and month. A query filtering on year 2026 and month 05 reads only that folder, so far less data is scanned, which lowers the cost and time of queries in Athena, which charges by data scanned.
The bucket and values are illustrative.

Ingesting data

A data lake on S3 receives data from many kinds of source, and each has a suitable ingestion service. Streams of events, such as clickstreams or logs, are delivered to S3 by Amazon Data Firehose. Databases are copied by AWS DMS, which can keep replicating changes, or by zero-ETL integrations that replicate continuously without pipelines. Files on premises are moved by DataSync, which transfers large file sets efficiently, or by Transfer Family for partners who send files over SFTP. SaaS applications, such as Salesforce, are connected by Amazon AppFlow. The following table summarises the services.

SourceService
StreamsData Firehose
DatabasesDMS, or zero-ETL integrations
Files on premisesDataSync or Transfer Family
SaaS applicationsAmazon AppFlow
Match the pairs

Ingesting into a data lake

Exam skills 3.5.1 · 3.5.6

Match each source with the service that ingests it into an S3 data lake.

Log in to try this activity Interactive activities are free with an account.
Worked example

Building a data lake

A data lake on AWS is assembled from several layers. The following table identifies the service used at each layer and its role.

LayerServiceRole
StorageAmazon S3 (raw, cleaned and curated zones)Cheap, durable storage for any data
CatalogueAWS Glue crawlers and Data CatalogDiscover schemas and register tables
TransformationAWS Glue ETL jobsClean data and convert it to Parquet
Access controlAWS Lake FormationColumn- and row-level permissions for each team
QueryAmazon AthenaServerless SQL on the data

Lake Formation lets the finance team see revenue columns while the marketing team sees only aggregated customer data, from the same tables, without copying data or writing separate bucket policies.

Check yourself

Why partition data lake files by date?

Show answer

Queries that filter on the date read only the matching partitions, which reduces the data scanned, the cost and the query time.

Exam Tips

Remember for the exam

  • To reduce the data scanned by queries, partition data by the columns most often filtered on.
  • Store data lake data in columnar formats such as Parquet with compression.
  • For managed Apache Iceberg tables in S3, use S3 Tables.
  • To ingest data from SaaS applications into S3, use Amazon AppFlow.