Skip to content
PHP2Shell: The PHP Bug
Akshay Thakare

Designing an S3 Data Lake Layout

Raw, curated and published zones, partition keys, file sizes and naming conventions that keep a data lake fast, cheap and replayable.

AWSBeginner2 min readUpdated 11 Oct 2026

Zones

Plain text.txt
s3://company-lake/
  raw/         source data as received (JSONL / Parquet), immutable
  curated/     cleaned, typed, deduplicated Parquet
  published/   aggregates ready for the warehouse or BI
ZoneWho writesRule
rawIngestion jobsNever overwrite; one prefix per batch or run
curatedTransform jobsRewritten per partition; schema enforced
publishedAggregation jobsShaped for consumers

Partition keys

Plain text.txt
curated/sales/business_date=2026-01-05/part-0000.parquet
  • Partition by what queries filter on, usually a date.
  • Avoid high-cardinality keys such as customer_id, which create millions of tiny folders.
  • Use key=value folder names so Glue, Athena and Spark discover partitions automatically.

File sizes

Aim for roughly 128 MB–1 GB per file. Thousands of small files make every query slow, because opening a file costs more than reading it.

Make raw replayable

Plain text.txt
raw/orders/run_id=7c1e…/part-0000.jsonl
raw/orders/run_id=7c1e…/manifest.json     # files, row counts, checksums

A manifest lists exactly which files belong to a run, so a replay never picks up partial or stray files.

Finished this note?

Share