S3 Data Partitioning and Compression
Data Engineering Amazon S3, Apache Parquet
Delivery Constraint & Opportunity Analysis · Updated 1 month, 3 weeks ago
Content
Skill: S3 Data Partitioning and Compression
Capability Domain: Data Engineering
Technology Stack: Amazon S3, Apache Parquet
Linked Activities: Store Compressed and Partitioned in S3
Canonical layout
- Raw:
s3://{raw}/{source}/{yyyy}/{mm}/{dd}/{event-id}.json - Curated:
s3://{curated}/{table}/source={source}/dt={yyyy-mm-dd}/part-{uuid}.parquet {table}∈ Scope Contractviews. Two buckets. Never a singles3://ops-lake/source=gitlab/dt=layout.
Recipe
ParquetTransformFnon ObjectCreated under raw prefix. Write Parquet with pyarrow bundled in the Lambda asset — not awswrangler (layer size / synth Docker). Unit synth uses CDK contextskip_bundling.- Map GitHub event types onto contract tables (
push→github_commits,pull_request→github_pull_requests,issues→github_issues,workflow_run→github_workflow_runs; backfillkindcommits/pulls/issues/workflow_runs). Projects v2 via GraphQL poller →github_project_itemswhen that poller is real. - Omit partition keys from the Parquet body.
sourceanddtlive only in the S3 path. Duplicatingsourcein the file makes Glue report duplicate columns. - SQS buffer for webhooks. After backfill, do not wait on SQS —
scripts/sync_raw_to_curated.pybatch-invokesParquetTransformFn. - If compression <5x vs JSON, stop and fix schema.
- Lake buckets are SSE-KMS with S3 Bucket Keys (
bucket_key_enabled=Truein IngestionStack). Glue crawlers and Athena GetObject every Parquet part; without Bucket Keys those reads are KMSDecryptper file.
Pitfalls
- One Parquet file per webhook event (webhook path).
- SSE-KMS without S3 Bucket Keys — one-file-per-event plus crawler/Athena reads burns the 20k KMS Free Tier in hours.
sourceboth as Hive partition and Parquet column.- Partitioning finer than
dtwithout a query need.
Details
- Capability Domain:
- Data Engineering
- Technology Stack:
- Amazon S3, Apache Parquet
- Created:
- 2 months ago
- Updated:
- 1 month, 3 weeks ago
Playbook
Activities Using This Skill 1
- Store Compressed and Partitioned in S3 Build the Operational Data Lake Pipeline