Amazon S3 Data Lake: Architecture, Setup, and Best Practices
18 min read

If you ask a room of data engineers where their company stores its analytical data, most of them will say "S3, mostly" in some variation. Amazon S3 was not designed as an analytics system, but it has become the default place to land data on AWS because it is cheap, durable and can hold almost anything without capacity planning. The catch is that a bucket full of files doesn't answer questions all by itself, and turning one into a working data lake takes a few more pieces.
This guide covers those pieces, from the architecture and core AWS services to ingestion, processing, querying, and the problems teams tend to hit once the lake grows. To make it concrete, it walks through one example: an online retailer moving its PostgreSQL orders data and website clickstream to S3 so analysts can query them in one place.
What Is an Amazon S3 Data Lake?
An Amazon S3 data lake is a centralized repository that uses S3 buckets to store structured, semi-structured, and unstructured data at any scale. On top of this, AWS and third-party services are layered to catalog, secure, process, and query the data. Database tables, JSON events, CSV exports, logs, images and Parquet files can all live in the same lake and none of them need a predefined schema before they land.
That last point is the difference between a data lake and a traditional data warehouse. A warehouse expects data to be modeled and loaded into its own storage before anyone can query it. A data lake stores data first and applies structure when it is read or when a pipeline promotes it to a cleaner zone. S3 fits this model nicely as storage and compute are completely separate so the same files can be read by Amazon Athena in the morning, an Apache Spark job on Amazon EMR in the afternoon and a machine learning pipeline overnight.
S3 also has a few properties that are more important for analytics than they seem at first. Objects are designed to achieve 11 nines durability, every read after a successful write returns the latest data with strong read-after-write consistency, and a single bucket can store an effectively unlimited number of objects. That's why most lakehouse tools on AWS, including Apache Iceberg tables, consider S3 as their foundation for storage.
How Does an Amazon S3 Data Lake Work?
An S3 data lake works by breaking out four jobs that a database typically does in one place: storing the data, describing the data, controlling access to the data, and running queries against the data. S3 stores, a catalog like AWS Glue Data Catalog keeps track of tables and schemas, AWS Lake Formation and IAM decide who can read what, and engines like Athena, Amazon Redshift, EMR or Trino do the computation.
So in the retailer example the flow looks something like this. Change data capture streams each insert and update from the PostgreSQL orders table into a raw area of the lake. The clickstream events arrive through a streaming service and land as files every few minutes. Processing jobs clean both datasets, convert them to Parquet and write them as tables to a curated area. Each table is cataloged in Glue Data Catalog, so when an analyst queries SELECT * FROM curated.orders in Athena, the engine asks the catalog where that table lives, reads only the files it needs from S3, and returns the result.
And because compute isn't bound to storage, each workload can choose the engine that's best for them, and only pay for that engine when it's on. It's the data itself that is in one place, in open formats, that keeps an S3 data lake from turning into a bunch of copies across different systems.
Amazon S3 Data Lake Architecture
A typical Amazon S3 data lake architecture has five layers from left to right where security and governance is applied to all layers from where data is produced to where it gets used.

The source layer includes operational databases (PostgreSQL, MySQL, MongoDB), SaaS applications, event streams, and file drops from partners. The ingestion layer transports that data to S3 using tools like AWS Database Migration Service (DMS), Amazon Data Firehose, AWS Glue jobs, or open-source CDC tools. The storage layer is S3 itself, typically segmented into raw, cleansed and curated zones, and increasingly organized as Apache Iceberg tables. The processing layer cleans and reshapes data between zones using AWS Glue, Amazon EMR, or AWS Lambda. Finally, the consumption layer is where the curated tables are consumed by Athena, Redshift, Amazon QuickSight, and Amazon SageMaker.
Underneath all five is the governance layer. The Glue Data Catalog stores metadata for each table, Lake Formation manages fine-grained permissions down to the column and row, AWS KMS manages encryption keys, and AWS CloudTrail logs who accessed what. Teams that skip this layer early on often end up retro-fitting it later, which is a lot more painful when hundreds of tables and users already depend on the lake.
Key Components of an Amazon S3 Data Lake
Most S3 data lakes are constructed from the same handful of AWS services plus whatever open source tools the team likes. Those that appear most frequently and what each is responsible for are listed in the table below.
| Component | What it does in the lake |
|---|---|
| Amazon S3 | Stores every file and table, across raw, cleansed, and curated zones |
| Amazon S3 Tables | Table buckets built for Apache Iceberg, with automatic compaction, snapshot management, and unreferenced file removal |
| AWS Glue Data Catalog | Central metadata store for databases, tables, schemas, and partitions |
| AWS Glue crawlers and ETL | Discover schemas in S3 and run serverless Spark or Python jobs |
| AWS Lake Formation | Fine-grained access control at the database, table, column, and row level |
| Amazon Athena | Serverless SQL queries directly on S3, billed per data scanned |
| Amazon EMR | Managed Spark, Trino, Flink, and Hive clusters for heavy processing |
| Amazon Redshift | Data warehouse that can also query lake tables in place |
| AWS KMS and IAM | Encryption keys, identities, and bucket-level access policies |
The common denominator here is the Glue Data Catalog. All engines that have access to it see the table once you register it. Athena, Redshift, EMR and Lake Formation all read table definitions from it. It can also act as an Apache Iceberg REST catalog, so engines outside of AWS such as Snowflake, DuckDB, or a self-managed Trino cluster can work with the same tables.
How to Build a Data Lake on Amazon S3
The exact steps will vary by data and team, but most S3 data lakes coalesce in roughly this order. In the case of the retailer example, a first version could be up and running in a few days, with the rest refined as more sources and users come on board.
- Decide the layout of buckets and zones. You can create separate buckets or top-level prefixes for raw, cleansed, and curated data. For example,
s3://retail-lake-raw/ands3://retail-lake-curated/. Using separate buckets allows you to apply different access policies and lifecycle rules to each zone. - Lock the buckets down before any data lands. Enable S3 Block Public Access, default encryption with SSE-S3 or SSE-KMS, versioning on your raw data, and CloudTrail data events so that access is auditable from day 1.
- Select a table format. When the curated data is stored as Apache Iceberg tables in either general purpose buckets or in S3 Tables, the lake gets ACID transactions, schema evolution and time travel, instead of a loose collection of Parquet files.
- Install the catalog and permissions. You create Glue Data Catalog databases per zone and register the S3 locations with Lake Formation so that you can manage table and column permissions in one place rather than managing dozens of bucket policies.
- Set the first sources. You'd start with a high value source like the orders database and set up CDC into the raw zone. If you use OLake Go for this, choose append mode so the raw zone keeps every change, because its default upsert mode keeps only the latest state of each row. Once the first pipeline is stable, add the clickstream feed.
- Construct the processing tasks. Write Glue or EMR jobs to clean raw data, dedup and write Iceberg tables to the cleansed and curated zones and schedule them using AWS Step Functions, Amazon MWAA or the orchestrator the team already uses.
- Open it for queries. Point Athena to the curated tables and establish workgroups with query limits, and attach a BI tool, like QuickSight, so analysts can hit the ground running with the data.
- Add surveillance and maintenance.
- Schedule compaction and cleanup of snapshots for Iceberg tables
- Set S3 lifecycle rules for old raw data
- Track costs with Amazon S3 Storage Lens and AWS Cost Explorer
It is tempting to connect every source on day one, but lakes built that way tend to have dozens of half-maintained pipelines and no clear owner for any of them. One reliable pipeline that people actually use is a better starting point than ten that nobody trusts.
Amazon S3 Data Lake Storage Layers
S3 generally stores data in zones, according to how far it has been processed. The names are different, some teams call them bronze, silver and gold, but the idea is the same. For a deeper look at each zone, see Data Lake Layers: Architecture, Types, and Best Practices.

The raw zone stores data as it flows in, whether CDC events from PostgreSQL or JSON clickstream payloads, and nothing is altered in it. After type fixes, deduplication and validation, the cleansed zone holds the same data, typically as Iceberg tables in Parquet. The curated zone is where you keep business-ready tables such as daily_revenue or sessions_by_channel that are meant for dashboards and models. Some teams also have a sandbox zone, where analysts can play around without affecting shared tables.
Zones are only half of the storage story, S3 storage classes determine the cost per zone. Constantly read data should be in S3 Standard and older raw data that is rarely touched can be moved to S3 Standard-IA, S3 Glacier Instant Retrieval or S3 Glacier Deep Archive via lifecycle rules. S3 Intelligent-Tiering is useful when access patterns are difficult to predict. It automatically moves objects between access tiers based on how often they are read. S3 Express One Zone is a separate directory bucket type that provides single-digit millisecond access in a single Availability Zone for workloads that require very low latency. S3 Express One Zone does not support lifecycle transitions.
Be careful when working with cold storage classes: Iceberg tables assume they can read their files at any time. It is better to archive old raw files or tables that have been fully retired, rather than moving data files to S3 Glacier Flexible Retrieval or Deep Archive under an active table, which can break queries.
Data Ingestion into Amazon S3 Data Lakes
Usually most of the engineering time is spent on ingestion, since each source behaves differently. Databases change all the time and need their updates and deletes captured, event streams never end, and SaaS tools have their own APIs and rate limits.
Change data capture is the norm for operational databases. Instead of exporting full tables every night, CDC reads the database's transaction log (PostgreSQL write-ahead log or MySQL binlog, for example) and ships each change as it happens. AWS DMS can do this and write CSV or Parquet files into S3, but you still need a separate merge step to turn those files into tables that reflect the current state of each row. Open-source tools such as OLake Go take a more direct approach, replicating PostgreSQL, MySQL, MongoDB, Oracle and other sources directly into Apache Iceberg tables on S3, with a full initial load followed by CDC. This way, the orders table in the lake stays close to the source without a hand-written merge job.
For streaming data like clickstream events, Amazon Kinesis Data Streams or Amazon MSK gather the events and Amazon Data Firehose can buffer them and deliver to S3, including directly into Iceberg tables. For SaaS applications, Amazon AppFlow pulls data from tools like Salesforce to S3 on a schedule. For batch exports, partners can drop files into an S3 bucket through AWS Transfer Family, where a Glue job or Lambda function picks them up.
Whatever the tool, two decisions pay dividends early: The first is to write in a columnar format, preferably Parquet within an Iceberg table, as opposed to raw CSV or JSON. Secondly, keep files reasonably large, as thousands of tiny files from a streaming pipeline will slow down every query that touches them.
Data Processing and Transformation in Amazon S3
Once the data lands in the raw zone, processing jobs transform it into something people can reliably query. In the case of the retailer example, this involves applying the latest change to each order, converting timestamps to UTC, deduplicating clickstream events, and joining orders to sessions to build a revenue_by_channel table.
There are a few ways to get this work done on AWS, and the right choice depends mostly on volume and how much infrastructure the team wants to manage:
- AWS Glue ETL runs serverless Spark or Python jobs, which is great for teams that want to avoid managing clusters and have moderate, predictable workloads.
- Amazon EMR runs Spark, Trino, Flink and Hive on managed clusters or in serverless mode, and tends to be cheaper at high and steady volumes.
- Use AWS Lambda for small, event-driven tasks, e.g., validating a file the moment it lands in a bucket.
- For simple transformations, Athena SQL can often get the job done with
CREATE TABLE AS SELECT,INSERT INTOandMERGEstatements on Iceberg tables. - dbt builds on top of Athena, Spark, or Redshift and version-controls your SQL models, tests and dependencies.
Orchestration wires together the jobs. AWS Step Functions and Amazon Managed Workflows for Apache Airflow (MWAA) are the typical AWS-native options that ensure the cleansed orders table is ready before the job that builds revenue_by_channel starts. Write your jobs to be idempotent, no matter what tool you use to run them. If a job fails halfway through and has to be re-run, it will produce the same result.
Querying Data in an Amazon S3 Data Lake
Usually, teams adopt Amazon Athena for their S3 data lake as a first step, since it is serverless, and you pay per amount of data that each query reads. An analyst at the retailer can open the Athena console and run something like this against the curated Iceberg table:
SELECT order_date,
channel,
SUM(order_total) AS revenue
FROM curated.revenue_by_channel
WHERE order_date >= DATE '2026-11-01'
GROUP BY order_date, channel
ORDER BY order_date;
Since the table is partitioned by date, and stored in Parquet format, Athena only reads the November partitions, and only the three columns that the query is using. This keeps the run time, and the bill, low. The same query on unpartitioned CSV data files would scan the entire dataset each time.
You're not limited to Athena. If a team wants to join lake data with warehouse tables, Amazon Redshift can query lake tables using Redshift Spectrum or native Iceberg support. Heavier workloads run on Spark SQL or Trino in EMR and Amazon SageMaker reads lake tables for model training. Outside of AWS, engines such as Snowflake, DuckDB, Databricks, and self-managed Trino can access the same Iceberg tables through the Glue Data Catalog Iceberg REST endpoint.
A few habits will make your queries on S3 perform well: keep your data in Parquet, partition on the columns that most of your queries filter on, keep your files roughly 128 MB to 512 MB in size, and compact small files regularly. Usually the more important thing is getting those right, than which engine runs the query.
Amazon S3 Data Lake Best Practices
Much of the advice on S3 data lakes seems obvious until a team is six months in and paying the price for not doing it. These are the things that matter most in the long term.
- If you have anything other than raw files, use an open table format like Apache Iceberg. It turns folders of Parquet into real tables with schema evolution, time travel and transactions and keeps the data readable by any engine that supports the format.
- Partition by the columns people actually filter on, which is typically a date. Don't partition on high cardinality columns like
customer_id. This will create millions of tiny partitions and slow down queries. - Split heavy traffic across prefixes. S3 supports at least 3,500 writes and 5,500 reads per second for each partitioned prefix, so very busy tables benefit from spreading data across multiple prefixes.
- Block public access at the account level and encrypt everything. SSE-KMS with customer managed keys has an audit trail of who decrypted what, which compliance teams will ask sooner or later.
- Instead of a mess of bucket policies, use Lake Formation for permission management. Column and row filters can be used to provide a single orders table to finance and a support team that shouldn't be able to see payment details.
- Apply lifecycle rules on raw zone. Old raw files can be moved to cheaper storage classes or expire entirely once the cleansed tables built from them are stable.
- Schedule table maintenance. Iceberg tables need to be compacted regularly, snapshot expiration and unreferenced files cleanup, either through S3 Tables, Glue's table optimizers or a dedicated tool such as OLake Fusion, which takes care of compaction, delete-file cleanup and metadata trimming.
- Tag buckets and tables with an owner and cost center. Tags are what tell you which team/pipeline caused the S3 bill to jump.
Common Amazon S3 Data Lake Challenges
Even the best-laid S3 data lakes have a familiar set of problems, and most of them creep up slow enough that nobody notices until queries get slow or the bill gets big.
- Little files. Streaming and CDC pipelines write frequently, resulting in thousands of small objects. Each query has to open each of them. S3 request costs add up as well. The fix is regular compaction to larger files. This needs to be run on a schedule, not when someone remembers.
- Data swamps. A lake filling with tables no one can explain. No catalog, no ownership, no naming conventions. Analysts lose faith in the data and revert to asking engineers for one-off exports, which defeats the whole purpose of having a lake.
- Managing updates and deletions. Plain Parquet files are immutable. Applying CDC changes or a GDPR deletion request meant rewriting entire partitions. Table formats like Iceberg solve this with row-level deletes. Those deletes add additional delete files that need to be cleaned up over time as well.
- Schema drift. On Friday a developer adds a column to the orders table and by Monday the ingestion pipeline has either failed or silently dropped the new field. Schema evolution tables and pipelines that capture schema changes mean this is not a recurring incident.
- Unforeseen expenses. Storage is cheap, but request charges, data scanned by Athena, cross-region transfer and forgotten snapshots are not always obvious. Athena workgroup limits, lifecycle rules and S3 Storage Lens dashboards can help catch these before the monthly bill does.
- Access sprawl. Permissions usually start with a few IAM policies and become a mess no one can audit. It's much easier to get table and column access into Lake Formation up front than to untangle it after a security review.
Conclusion
A good place to start is with Amazon S3 as it decouples storage from compute, scales without any planning, and is compatible with almost all the analytics engines available today. But that's the easy part, the storage. The value of an S3 data lake is in all of the things around it: well-defined zone layout, shared catalog, centralized permission management, open table formats such as Apache Iceberg, and ongoing maintenance to keep tables performant as they scale.
For the retailer in this guide, the orders data and clickstream events land in one place, queryable from Athena, Redshift, or Spark, without separate copies for each team. It's the same pattern on a much larger scale, provided you consider ingestion and table maintenance as ongoing work, not a one-time setup.
If you are building on Apache Iceberg, OLake does both of those jobs. OLake Go CDC replicates databases such as PostgreSQL, MySQL, and MongoDB to Iceberg tables on S3. OLake Fusion keeps those tables healthy with compaction, delete-file cleanup, and metadata trimming.


