Skip to main content
Intermediatehow it works Verified ~8 min

How do you design an S3 data lake layout?

Source: Amazon S3 User Guide: best practices design patterns for optimizing S3 performance

Quick answer

Design an S3 data lake with zones: immutable raw, curated Parquet and a publish zone. Use Hive-style partitions such as dt=2026-11-20/ that match common filters, register tables in the Glue Catalog, and add lifecycle, encryption and least-privilege policies. S3 is strongly consistent.

A good S3 data lake layout makes data easy to find, cheap to query and safe to change. Decide zones, partitions, file format and governance.

1. Zones

output.txt
s3://company-datalake-prod/
  raw/                      <- as received, immutable, source format
    orders/source=shop/dt=2026-11-20/part-0001.json.gz
  curated/                  <- cleaned, typed, deduplicated Parquet
    orders/dt=2026-11-20/part-00000.snappy.parquet
  publish/                  <- marts and extracts for consumers
    daily_sales/dt=2026-11-20/part-00000.snappy.parquet
  tmp/                      <- scratch, short lifecycle

Use separate buckets per zone or per environment when you need different encryption keys, permissions, replication or lifecycle rules. Prefixes are enough for small teams.

2. Partitioning

  • Use Hive-style key=value/ folders such as load_date=2026-11-20/ or dt=2026-11-20/, so Athena, Glue and Spark can prune partitions.
  • Partition by the columns that appear in most WHERE filters, usually a date. Avoid high-cardinality partition keys such as user ID: they create millions of tiny folders and files and slow planning.
  • Aim for files of about 128 MB to 1 GB. Many tiny files hurt query speed and request cost; compact them.
  • Register tables in the Glue Data Catalog; use partition projection for date-based tables.

3. File format

Store curated data as Parquet (or ORC, or Iceberg tables for updates and time travel), compressed with Snappy or Zstd. Keep raw data in its original format.

4. Consistency and scale

  • S3 provides strong read-after-write consistency for PUT and DELETE of objects, and strongly consistent LIST. A job that writes a file can read or list it immediately.
  • The documentation states that S3 supports at least 3,500 PUT/COPY/POST/DELETE and 11,000 GET/HEAD requests per second per partitioned prefix, and scales higher with traffic. (Older articles quote 5,500 reads per second; check the current page.) Partitioning by date and source naturally spreads load over many prefixes.

5. Governance and cost

  • Encryption: SSE-S3 or SSE-KMS per zone; Block Public Access on.
  • Least-privilege bucket and IAM policies; Lake Formation for column-level access.
  • Lifecycle: expire tmp/, move old raw data to Glacier classes, expire noncurrent versions and incomplete multipart uploads.
  • Versioning on raw and publish buckets if you need recovery.
  • Tag buckets with owner and data classification.

6. Operating rules

Write new data to new paths (append by partition) instead of overwriting in place; for rewrites use Iceberg or write to a new location and swap the partition in the catalog.

Animated explanation
raw/as received, immutable
Glue or Spark jobclean, type, deduplicate
curated/Parquet, dt=2026-11-20/
publish/marts for consumers
Glue Data Catalogtables and partitions
Athena or Sparkprunes dt= partitions
Data moves from raw to curated Parquet with dt= partitions, registered in the Catalog for queries.

Key points

  • Separate zones (raw, curated, publish) by prefix or bucket; keep raw immutable.
  • Hive-style partitions on common filter columns (usually date); register tables in the Glue Catalog.
  • Use Parquet with files of about 128 MB to 1 GB; avoid tiny files and high-cardinality partitions.
  • S3 is strongly consistent for reads after writes; documented rates are at least 3,500 writes and 11,000 reads per second per partitioned prefix.
  • Add lifecycle rules, encryption and least-privilege policies.

Common mistakes

  • Partitioning by a high-cardinality column such as user ID.
  • Writing millions of tiny files per partition.
  • Mixing raw and curated data in one prefix with the same permissions.
  • Overwriting data in place without versioning or table formats like Iceberg.
  • Quoting old request-rate numbers or eventual consistency for modern S3.

Prerequisites

  • S3 buckets and prefixes
  • Parquet and partitioning

Best practices

  • Compact small files with a scheduled job.
  • Name partitions consistently (dt=YYYY-MM-DD) so every tool can prune them.
  • Apply lifecycle rules per zone.
  • Document the layout and owners in the catalog.

Likely follow-ups

  • How would you decide between partitioning by date or by date plus region?
  • Why do many small files slow down Athena and Spark?
  • How does Apache Iceberg improve on plain Parquet folders in S3?
  • How do you secure raw versus curated zones differently?
  • What does strong consistency mean for S3 and why did it matter for data lakes?

References

Discussion