CertNote/ Commute Study Notes
Roadmap
KOEN
CLF-C02 · FoundationalCloud Practitioner - Foundational
DVA-C02 · AssociateDeveloper - Associate
SAA-C03 · AssociateSolutions Architect - Associate
SOA-C02 · AssociateCloudOps Engineer - Associate
SAP-C02 · ProfessionalSolutions Architect - Professional
DOP-C02 · ProfessionalDevOps Engineer - Professional
Linux Master 2 · 2급KAIT Linux Master - Level 2
SCS-C03 · SpecialtySecurity - Specialty
Linux Master 1 · 1급KAIT Linux Master - Level 1
MLA-C01 · AssociateMachine Learning Engineer - Associate
AIF-C01 · FoundationalAI Practitioner - Foundational
DEA-C01 · AssociateData Engineer - Associate
  • Week 1
    • 1.What Is Data Engineering
    • 2.Batch vs Streaming
    • 3.A Bird's-Eye View of AWS Data Services
    • 4.Data Formats and Modeling
    • 5.Week 1 Comprehensive Review
  • Week 2
  • Week 3
  • Week 4
  • Week 5
  • Week 6
    • 1.S3 Data Lake Layout and Partitioning Strategy
    • 2.Centralized Permission Management with AWS Lake Formation
    • 3.Open Table Formats: Iceberg, Hudi, Delta Lake
    • 4.S3 Storage Management and Cost Optimization
    • 5.Week 6 Review: Data Lakes
  • Week 7
  • Week 8
  • Week 9
  • Week 10
MLS-C01 · SpecialtyMachine Learning - Specialty
SQLD · 개발자SQL Developer (SQLD)

© CertNote · 주간랩스

  • About
  • Changelog
  • Contact
  • Terms
  • Privacy
← DEA-C01/Week 6/Day 5

Based on the DEA-C01 exam guide·Report an error

DEA-C01· AssociateWeek 6 · Day 5~31 min read

Day 5 - Week 6 Review: Data Lakes

📌 Key Takeaways

  • Lake design is a four-layer decision: layout (where and how to place data) → table format (how to change it) → permissions (who can see it) → storage (at what cost to keep it), and the choice in one layer constrains the others.
  • Scan volume problems are solved with partitions and columnar formats, catalog bottlenecks with partition projection and indexes, and file count problems with compaction. Even when symptoms look similar, the prescriptions differ.
  • If you need row-level updates, deletes, and time travel, use an open table format. Iceberg to write with Athena SQL, Hudi if upserts and incremental reads are central, and Delta Lake if you have Spark assets.
  • Column-, row-, and cell-level control and cross-account sharing are Lake Formation. It is actually enforced only when registration, revoking IAMAllowedPrincipals, and removing direct S3 permissions are all in place.
  • Standard if read often, Intelligent-Tiering if the pattern is unknown, lifecycle transitions if it clearly cools off. Do not send data to be read with Athena, or the files of a table format, to archive tiers that require a restore.

The Lake Seen as Four Layers

This week we looked separately at the layout of an S3-based data lake, Lake Formation permissions, open table formats, and storage cost optimization. In real designs, all four apply to a single table at the same time.

┌─ Permissions ───── Lake Formation: registration · LF-Tags · data filters · cross-account sharing
├─ Table format ──── Hive table (path = table)  |  Iceberg · Hudi · Delta (metadata = table)
├─ Layout ────────── zones (raw/clean/curated) · partitions · file size · Parquet/compression
└─ Storage ───────── storage classes · lifecycle · Intelligent-Tiering · versioning
LayerQuestion it asksThis week's toolsIf chosen wrongly
LayoutHow little can a query be made to readZones, partitions, columnar formats, compactionFull scans, small file explosion
Table formatHow to handle consistency and changes during and after writesIceberg, Hudi, Delta LakeHalf-written data exposed, rows cannot be deleted
PermissionsWho sees which columns and rowsLake FormationPII exposure, permission policy explosion
StorageAt what cost to keep the same dataStorage classes, lifecycleRetrieval fee shock, data that silently drops out

Interference Between Layers: Where What You Learned Separately Meets

The content of the four days shows up as problems where the topics collide.

Two topics that meetWhat happensCorrect handling
Partition projection × multiple enginesProjection works only in Athena. Redshift Spectrum and EMR see only the partitions in the catalogFor tables read by multiple engines, also register partitions in the catalog
Partition projection × sparse dataIt lists every empty location the rule computes, which makes it slowIf more than half are empty, use regular partitions
Lifecycle expiration × partition metadataThe S3 objects are gone but empty partitions remain in the catalog, slowing the planning phaseRun ALTER TABLE DROP PARTITION to match the expiration
Lifecycle transition × AthenaObjects in Glacier Flexible Retrieval and Deep Archive are skipped without an errorQueryable data goes down only to Glacier Instant Retrieval
Lifecycle × IcebergIf files the metadata points to are expired or archived, queries failManage file lifetime with snapshot expiration and orphan file removal
Small files × storage classesObjects under 128KB are not transitioned by default, and in IA they are billed as 128KBCompaction first, transition afterwards
Iceberg DELETE × GDPRPrevious snapshots keep holding the files of deleted rowsDELETE → compaction → snapshot expiration (+ noncurrent version cleanup)
Iceberg compaction × storage costRight after compaction, old and new files coexist, so capacity growsAlso perform snapshot expiration after compaction
Versioning × overwriting ETLPrevious output piles up as noncurrent versions every time a job runsNoncurrentVersionExpiration
Lake Formation × direct S3 permissionsA user with S3 permissions bypasses filters and reads the files directlyRemove analysts' direct S3 permissions
Lake Formation × table formatsRead permissions are managed, but VACUUM, MERGE, and OPTIMIZE permissions are notWrites and maintenance go to a dedicated role via IAM
Lake Formation filters × Athena query result reuseTables with row and column permissions are not eligible for query result reuseDo not expect cache savings

The Order for Sorting Out "Queries Are Slow or Expensive"

The same symptom has four prescriptions. First sort out what the bottleneck is.

① Is the amount of data scanned large?
   ├─ It reads dates that are not needed ───────► filter by partition key (partitioning, pruning)
   └─ It reads columns that are not needed ─────► Parquet/ORC + SELECT only the needed columns
 
② Is the scan volume small but the planning phase long?
   ├─ Tens of thousands of partitions ──────────► partition projection / Glue partition index
   └─ Empty or old partitions have piled up ────► clean up partition metadata
 
③ Is the file count high?
   ├─ Small files in a Hive table ──────────────► rewrite and merge, increase writer-side buffer
   └─ Small files and delete files in Iceberg ──► OPTIMIZE / Glue table optimization
 
④ Does S3 return SlowDown?
   └─ Too many files + concurrent queries ──────► merge, spread out queries
  • ① is a matter of data scanned (= Athena cost), and ② and ③ are matters of time. If the question says "reduce cost," it is ①; if "catalog lookups are the bottleneck," it is ②.
  • Splitting partitions more finely solves ① while creating ② and ③. If most queries are by day, do not split down to the hour; sort inside the files by timestamp instead.

Telling Look-Alikes Apart at a Glance

Confusing pairDistinction
Partition pruning vs partition projectionPruning = read only partitions matching the condition (scan volume). Projection = compute the partition list by rule instead of the catalog (metadata lookup)
Partitioning vs bucketingPartitioning = split paths by a key with few distinct values. Bucketing = gather a key with very many values into a fixed number of files by hash
Hive-style partitions vs Iceberg hidden partitioningHive = key=value in the path, queries must know the partition columns. Iceberg = defined by transform functions, filter on the original column
Compaction vs snapshot expirationCompaction = restores read performance. Snapshot expiration = reclaims storage (narrows the time travel range)
Copy-on-Write vs Merge-on-ReadCoW = rewrite at write time, fast reads. MoR = record changes separately, fast writes, merge at read time
Named resources vs LF-TagsNamed = one by one by name. LF-Tags = grouped by tag condition, applied automatically to new resources
Data location permission vs SELECTLocation permission = the right to create tables that point to that path. SELECT = the right to read the data
LF-Tag vs IAM and resource tagsSeparate systems. Not compatible
Standard-IA vs Glacier Instant RetrievalBoth read immediately. IA = about once a month, minimum 30 days; GIR = about once a quarter, minimum 90 days, lower storage price
Glacier Instant vs Flexible RetrievalInstant = immediate GET. Flexible = minutes to hours after a restore request
Intelligent-Tiering vs lifecycleIT = moves by access, no retrieval fee, per-object monitoring fee. Lifecycle = moves by age, transition request cost
Snapshot vs Incremental blueprintSnapshot = full reload, schema may change freely. Incremental = only new rows after the bookmark column

Week 6 Numbers and Defaults on One Page

AreaItemValue
S3Request handling per prefixAt least 3,500 PUT/COPY/POST/DELETE and 5,500 GET/HEAD per second
S3Objects returned by a single listing1,000
LayoutRecommended file size128MB to 1GB
LayoutDefault Parquet row group / ORC stripe size128MB / 64MB
GlueCondition for groupFiles to turn on automaticallyMore than 50,000 input files
AthenaPartitions written at once by CTAS and INSERT INTO100
Athena IcebergDefault snapshot retention432,000 seconds (5 days), minimum 1 kept
Glue ETLNative table format supportGlue 3.0 or later (--datalake-formats)
S3 classesMinimum storage durationIA and One Zone-IA 30 days / Glacier Instant and Flexible 90 days / Deep Archive 180 days
S3 classesMinimum billable sizeIA, One Zone-IA, and Glacier Instant 128KB
S3 classesPer-object overhead for archive objects40KB (32KB at the Glacier rate, 8KB at the Standard rate)
RestoreFlexible RetrievalExpedited 1 to 5 minutes / Standard 3 to 5 hours / Bulk 5 to 12 hours
RestoreDeep ArchiveStandard within 12 hours / Bulk within 48 hours
LifecycleRules per bucket1,000
LifecycleExcluded from transition by defaultObjects under 128KB
Intelligent-TieringAutomatic tier moves30 days without access → Infrequent, 90 days → Archive Instant
Intelligent-TieringOptional archive tiersFrom 90 and 180 days, configurable up to 730 days

Integrated Scenario: An Order Data Lake

Requirements: Load an RDS orders database into a data lake, show analysts only the rows of their own region with PII columns hidden, respond to GDPR deletion requests, and optimize cost.

[RDS] --(Lake Formation Incremental database blueprint)--> s3://lake-raw/orders/dt=.../
   --(Glue ETL: validate, MERGE)--> s3://lake-clean/orders/ (Iceberg table)
   --(Glue: aggregate)--> s3://lake-curated/revenue/ (consumed by Athena/QuickSight)
DecisionChoiceReasonEasy to miss
IngestionIncremental database blueprintAn incremental workflow made of crawlers, jobs, and triggers is generated automaticallyThe bookmark approach sees only new rows. If the source UPDATEs order status, DMS CDC is needed
RawDate partitions, source format as isBaseline for reprocessingKeep it immutable
CleanIceberg tableMERGE INTO upserts, DELETE, time travelAthena DML is Merge-on-Read, so OPTIMIZE is mandatory
GDPRDELETE → OPTIMIZE → VACUUMData is physically erased only after snapshots expireThe same customer's data is also in the originals in the Raw zone
PermissionsLocation registration + data filterColumn exclusion and row filter in one filterRevoke IAMAllowedPrincipals, remove direct S3 permissions
StorageLifecycle transitions for Raw, Standard for Clean and CuratedDifference in access frequencyDo not set transition or expiration rules on the Iceberg prefix
-- Handling a GDPR deletion request (Iceberg on Athena)
DELETE FROM lake_clean.orders WHERE customer_id = 'GDPR-REQ-2026-001';
OPTIMIZE lake_clean.orders REWRITE DATA USING BIN_PACK;
VACUUM lake_clean.orders;
# Cell-level filter for analysts: exclude PII columns + only their own region's rows
aws lakeformation create-data-cells-filter --table-data '{
  "TableCatalogId": "111122223333",
  "DatabaseName": "lake_clean",
  "TableName": "orders",
  "Name": "apne2-no-pii",
  "RowFilter": {"FilterExpression": "region = '\''ap-northeast-2'\''"},
  "ColumnWildcard": {"ExcludedColumnNames": ["customer_name", "phone"]}
}'
 
# Grant SELECT by specifying the filter
aws lakeformation grant-permissions \
  --principal DataLakePrincipalIdentifier=arn:aws:iam::111122223333:role/RegionAnalyst \
  --permissions "SELECT" \
  --resource '{"DataCellsFilter": {"TableCatalogId": "111122223333",
               "DatabaseName": "lake_clean", "TableName": "orders", "Name": "apne2-no-pii"}}'

💡 Related Theory: The easy-to-miss spot in this scenario is the Raw zone. Even if you delete a customer's rows from the Iceberg table in Clean, that customer remains in the original files in Raw. Immutability is the principle for Raw, but deletion requests alone need an exception procedure. So designs such as tokenizing PII as it enters Raw, or setting a short retention period for Raw, are considered together.

Collection of Anti-Patterns

  • Over-partitioning by hour or user: A file of a few KB is created per partition. Scan volume dropped, but the query is slower.
  • Running MSCK REPAIR TABLE every day to add partitions: It rescans all paths. Use ALTER TABLE ADD PARTITION for only the added partitions, or use projection.
  • Granting Lake Formation permissions but leaving the S3 bucket policy as is: Control remains in two places and leaks through the broader one.
  • Making a copy of the table to hide columns: Each copy brings ETL, storage cost, and synchronization problems. A data filter does this instead.
  • Creating an Iceberg table and not setting up maintenance: Delete files and snapshots pile up, making it slower and more expensive.
  • A blanket "IA after 30 days" for every bucket: Cost actually rises for frequently read Curated data and for prefixes with many small files.
  • Turning on versioning only, with no noncurrent version rule: Invisible capacity piles up without limit.
  • Transitioning queryable data to Deep Archive: It drops out of results without an error.

Scenario → Answer Lookup

ScenarioAnswer
Filtering by date but Athena scans the entire tableDate partitioning + a condition on the partition key
Tens of thousands of partitions, GetPartitions is the bottleneck, only Athena is usedPartition projection
Tens of thousands of partitions, Athena and Redshift Spectrum are used togetherKeep catalog partitions + Glue partition index
Streaming ingestion creates hundreds of thousands of files of a few KBIncrease writer-side buffer + compaction
Modify specific rows of a Parquet table in S3 with SQLIceberg table + UPDATE/MERGE INTO
Yesterday's batch was loaded wrongly. Query the state before itIceberg time travel
Deleted data must actually disappear from S3Compaction + snapshot expiration
Make department-specific permissions scalable across thousands of tablesLF-Tags
Make the same table show only different rows per regionData filter (row filter)
Existing Glue jobs stay on IAM, only new analysts get fine-grained permissionsHybrid access mode
Another account queries a table without copyingLake Formation cross-account sharing + resource link
A Clean zone with an unknown access patternIntelligent-Tiering
Raw older than 90 days should be cheap but readable immediately during reprocessingGlacier Instant Retrieval
Audit logs with a 7-year retention obligationLifecycle transition to Deep Archive + expiration
The bucket charge is far larger than the sum of the object listIncomplete multipart and noncurrent version cleanup rules, Storage Lens

Next week we cover the analytics stores that sit next to the lake, Redshift, Athena, DynamoDB, and RDS/Aurora, along with choosing a store per workload.

📖 Glossary

  • Medallion architecture: A lake composition method that divides data into bronze (raw), silver (refined), and gold (aggregated) stages. The same concept as the raw, clean, and curated zones.
  • Pruning and projection: Reading only the partitions that match the condition, and computing the partition list by rule. The names look alike, but they solve different problems.
  • Snapshot isolation: A consistency method in which readers see only the snapshot as of their start, so reads and writes do not block each other.
  • Cell-level security: Applying a column restriction and a row filter together, so that even the visible columns are controlled per row.
  • Data mesh: A distributed structure in which per-domain accounts own the data and the catalog and permissions are managed centrally.
  • Waterfall model: The rule that lifecycle transitions flow only from upper classes to lower classes.
  • Early deletion fee: A charge for the remaining period when you delete or transition before meeting the minimum storage duration.
  • Tokenization: A technique that replaces a sensitive value with a meaningless substitute value when storing it. The mapping back to the original is kept in a separate store.

📝 Practice Questions

Click a choice to reveal the answer and explanation.

Question 1

You want to incrementally load RDS order data into the data lake and configure the clean zone so that row-level deletion (GDPR) and MERGE upserts are possible afterward. Which combination is the most suitable?

Question 2

You want to hide PII columns from an analyst and expose only the rows for their own region. Which combination of Lake Formation features is correct?

Question 3

What is the most appropriate storage strategy for the frequently read curated zone and the rarely read raw zone of a data lake?

Question 4

Which of the following most accurately describes the "schema-on-read" characteristic of a data lake?

Question 5

The partitions of a data lake table have grown to tens of thousands, and Glue Data Catalog lookups have become a bottleneck for Athena queries. How can you solve this without registering each partition in the catalog?

PreviousS3 Storage Management and Cost OptimizationWeek 6 · Day 4Next Amazon Redshift: Distribution and Sort Keys and Workload OptimizationWeek 7 · Day 1

Official references

  • DEA-C01 official exam page(opens in a new tab)
  • Amazon S3 documentation(opens in a new tab)
  • Amazon Athena documentation(opens in a new tab)
  • AWS Lake Formation documentation(opens in a new tab)
  • AWS Glue documentation(opens in a new tab)
  • Amazon RDS · Aurora documentation(opens in a new tab)

On this page

  • Key Takeaways
  • The Lake Seen as Four Layers
  • Interference Between Layers: Where What You Learned Separately Meets
  • The Order for Sorting Out "Queries Are Slow or Expensive"
  • Telling Look-Alikes Apart at a Glance
  • Week 6 Numbers and Defaults on One Page
  • Integrated Scenario: An Order Data Lake
  • Collection of Anti-Patterns
  • Scenario → Answer Lookup
  • Glossary
  • Practice Questions