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
  • Week 7
    • 1.Amazon Redshift: Distribution and Sort Keys and Workload Optimization
    • 2.Amazon Athena: Serverless Queries and Cost Optimization
    • 3.DynamoDB (Analytics Perspective): Key Design and Stream-Based Pipelines
    • 4.RDS/Aurora and Store Selection: OLTP, Zero-ETL, Workload-to-Store Decision
    • 5.Week 7 Comprehensive Review: Analytics Stores Recap
  • Week 8
  • Week 9
  • Week 10
MLS-C01 · SpecialtyMachine Learning - Specialty
SQLD · 개발자SQL Developer (SQLD)

© CertNote · 주간랩스

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

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

DEA-C01· AssociateWeek 7 · Day 5~39 min read

Day 5 - Week 7 Comprehensive Review: Analytics Stores Recap

📌 Key Takeaways

  • The first question in choosing a store is the read pattern. If you read and write single records, it is RDS/Aurora or DynamoDB; if you aggregate a few columns across many rows, it is Redshift or Athena.
  • The billing unit sets the direction of optimization. Athena and Spectrum bill by scan volume, so reading less is what counts; Redshift bills by compute time, so key design and concurrency management matter; DynamoDB bills by request units, so eliminating Scans is the cost saving.
  • "Piling up on one side" has a different name in each service: distribution key skew in Redshift, hot partitions in DynamoDB, and the hot shard in Kinesis that we saw in Week 2. The prescription is always an evenly distributed key.
  • Choose the path from operations to analytics by freshness and operational burden: Read Replica (immediate, same engine), zero-ETL (near real time, managed), DMS (wide combinations, CDC), streams (per event), export (snapshot), federation (no data movement).
  • The tuning knobs are distribution and sort keys plus WLM for Redshift, partitions, formats, and workgroups for Athena, keys and indexes for DynamoDB, and readers and zero-ETL for Aurora.

Analytics Stores on One Table

This week we covered the analytics data stores (Redshift, Athena, DynamoDB, RDS/Aurora) and the choice of store by workload. Putting the four days of content on the same axes makes the differences clear at a glance.

AspectRedshiftRedshift SpectrumAthenaDynamoDBRDS / Aurora
EssenceColumnar MPP warehouseQuery S3 external tables from the warehouseServerless S3 queriesKey-value NoSQLRow-based relational OLTP
Data locationCluster (managed storage)S3S3Table partitionsInstance volume / cluster volume
Does wellRepeated bulk aggregation, complex joinsJoining the warehouse with S3 historyIntermittent ad hoc SQLMillisecond lookups by key, large-scale concurrencyTransactions, joins, constraints
Does poorlyPer-record transactionsWrites (read-only)Millisecond responses, row-level updates (except Iceberg)Arbitrary column aggregation, joinsColumn aggregation over hundreds of millions of rows
Billing unitNode hours or RPU-hours + storageScan volumeScan volume (10 MB minimum per query)Request units or provisioned capacityInstance hours + storage
Tuning knobsDistribution key, sort key, WLMPartitions, file formatPartitions, file format, workgroupPartition key, GSI, capacity modeIndexes, Read Replica
ConsistencyTransactionalFile point-in-timeFile point-in-timeEventual (default), strongly consistent read optionalTransactional (ACID)
Serverless optionRedshift Serverless-Serverless by defaultOn-demand modeAurora Serverless

💡 Related Theory: Columnar storage (Redshift, Parquet) is strong at "aggregating a few columns across many rows," and row-based storage (RDS, Aurora) is strong at "reading and updating all the columns of one row." DynamoDB is neither; it is strong at "straight to the answer if you know the key." Look at the verb in the question. Summing, trends, and reports point to columnar; orders, payments, and updates point to row-based; lookups, sessions, and state point to key-value.

The Same Problem Under Different Names: Skew

Distributed systems split data up and work on it in parallel. When the criterion for splitting is lopsided, parallelism breaks down. The skews we saw this week and in earlier weeks all have the same structure.

ServiceSplitting criterionWhen lopsidedSymptomPrescription
RedshiftValue of the DISTKEY → sliceSkewOnly one node is busy and the whole query waits for that sliceAn evenly distributed DISTKEY, or EVEN
DynamoDBHash of the partition key → partitionHot partitionTable capacity is left over but only certain keys are throttledEven key, write sharding
Kinesis Data StreamsHash of the partition key → shardHot shardOnly certain shards are throttledEven key (adding shards does not fix it)
S3 + AthenaPartition key → prefixUneven partition sizes, small filesOnly some partitions are slow, file count explodesRedesign the partition key, compaction
  • Common principle: choose a key with many distinct values whose traffic and row counts spread evenly. A key with few values or one dominant value, such as status, country, or date, is bad everywhere.
  • Difference: Redshift must use the same key as its join partner to eliminate redistribution, so it compromises between "even distribution" and "matching join keys." DynamoDB has no joins, so you only need to look at the access patterns.

The Same Problem Under Different Tools: Skipping

The way to make an analytics query fast and cheap is, in the end, not to read.

LevelRedshiftAthena / Spectrum (S3)DynamoDB
Skip large chunksSort key + zone map (min and max of 1 MB blocks)Partition pruning (prefix)Only one partition through the partition key
Skip within a chunkBlock-level skippingPer-range statistics in Parquet/ORCOnly the range through the sort key condition
Skip columnsColumnar storageColumnar format + SELECT only the needed columnsIndex projection (copy only the needed attributes)
When it is defeatedA function applied to the sort key, unsorted regionNo partition key condition, CSV or JSONScan + FilterExpression
  • All three stores have the trap of "reading everything even though you added a condition." In Redshift it is a filter on a column that is not the sort key, in Athena a filter on a column that is not the partition key, and in DynamoDB a filter on an attribute that is not a key (Scan).

The Billing Unit Sets the Direction of Optimization

StoreWhere the money goesHow to reduce itWasted effort
AthenaBytes scannedPartitions, Parquet, compression, only the needed columns, result reuseAiming only to shorten query execution time
Redshift SpectrumBytes scannedSame as AthenaAdding cluster capacity
Redshift provisionedHours the nodes are onRight size, pause, concurrency scaling for peaksReducing the scan volume of individual queries (the charge stays the same, only performance improves)
Redshift ServerlessRPU-hours used by queriesAdjust base capacity, maximum RPU-hours limit-
DynamoDB on-demandRead and write request unitsEliminate Scans, small items, remove unneeded GSIsReducing capacity in advance (the concept does not exist)
DynamoDB provisionedThe capacity you setAuto Scaling, use for steady workloadsLeaving it as it is during idle hours
RDS / AuroraInstance hours, storage, (I/O for Aurora Standard)Right-size instances, move analytics load to another storeAdding replicas without limit
  • If the question says "minimize cost," first look at how often it is used. If occasionally, scan or request billing (Athena, on-demand, Serverless) is cheaper; if constantly, capacity billing (provisioned Redshift, DynamoDB) is cheaper.

From Operations to Analytics: Choosing the Path

For the requirement "I want to analyze OLTP data," there are several paths. Choose by freshness and operational burden.

PathFreshnessOperational burdenTransformationWhen it fits
Read Replica / Aurora readerAs much as the replication lagVery lowNoneTaking light reports off the writer
Federated query (Athena, Redshift)Real time (direct query)LowIn the queryOccasional joins, volumes not worth moving
Zero-ETL → RedshiftNear real time for Aurora and RDS, minimum 15 minutes for DynamoDBVery lowNone (process inside Redshift)Continuously analyzing the operational DB in the warehouse
DMS (full load + CDC)Near real timeMedium (replication instance and tasks)Mapping, simple rulesHeterogeneous engines, on-premises, diverse targets such as S3 and Kinesis
DynamoDB Streams → LambdaSecondsMedium (function code)In codeReacting to change events, small-scale replication
Kinesis Data Streams → Firehose → S3As much as the bufferLowFirehose transformationContinuously loading DynamoDB changes into the lake
S3 export (DynamoDB), snapshot export (RDS)The time of exportLowAfterward with Glue or AthenaRegular snapshot analysis with no operational load
Glue ETL (JDBC, bookmarks)Batch intervalMedium (job management)Arbitrary codeLoads that need complex cleansing and joins
"Must not put load on the operational DB"     → export, zero-ETL, read replica (direct Scan or federation causes load)
"Do not want to manage a pipeline"            → zero-ETL
"The engine is different / it is on-premises" → DMS (+ schema conversion)
"Complex transformation needed during replication" → Glue ETL
"Must react the moment a change occurs"       → stream + Lambda
"Look occasionally without moving the data"   → federated query

💡 Related Theory: "Keep operations (OLTP) and analytics (OLAP) on different engines" is the cardinal principle of data engineering. Only the means of connecting the two has changed. Going from hand-built ETL to DMS's CDC and then to managed zero-ETL reduced the operational burden. Even so, at the moment a transformation is needed, you still need Glue or SQL inside the warehouse. What zero-ETL removed is the management of E and L, not the need for T.

Telling Look-Alikes Apart at Once

Confusing pairHow to distinguish
Athena vs Redshift SpectrumBoth read S3 with scan-volume billing. Athena is standalone serverless; Spectrum requires Redshift and is meant for joining with internal tables
Loading into Redshift vs SpectrumIf read often and fast, load; if it is large history read occasionally, keep it on S3 and use Spectrum
DISTKEY vs SORTKEYDISTKEY = which slice to place it on (joins, parallelism). SORTKEY = in what order to place it within a slice (block skipping)
DISTSTYLE ALL vs KEYALL = replicate a small, rarely changing dimension to all nodes. KEY = gather large tables by the join key
COMPOUND vs INTERLEAVEDCOMPOUND = mainly filters on leading columns. INTERLEAVED = filters on combinations of several columns, expensive to maintain
Concurrency scaling vs resizeScaling = temporary clusters for short bursts. Resize = grow the cluster itself for a constant capacity shortage
WLM vs workgroupWLM = Redshift's queues, memory, and priority. Workgroup = Athena's result location, scan limits, and isolation
Redshift QMR vs Athena per-query limitBoth guard against runaway queries. QMR is based on metrics such as time and row counts; Athena is based on bytes scanned
GSI vs LSIGSI = a different partition key, can be added anytime, eventually consistent. LSI = the same partition key, only at creation, strong consistency possible
DynamoDB Streams vs Kinesis Data StreamsStreams = 24 hours, no duplicates, Lambda-centered. KDS = up to 1 year, more consumers, connects to Firehose and Flink
Read Replica vs Multi-AZReplica = spreading reads (asynchronous). Multi-AZ = availability (the standby instance cannot serve reads)
Zero-ETL vs DMSZero-ETL = managed replication for fixed combinations, no transformation. DMS = wide combinations, heterogeneous migration, you operate it yourself
CTAS vs view vs materialized viewCTAS (Athena) = writes the result to S3 as a new table. View = stores only the query. Materialized view (Redshift) = stores the result and refreshes it
Athena partition projection vs Redshift sort keyProjection = eliminates partition metadata lookups. Sort key = reduces data block reads

Week 7 Numbers and Defaults on One Page

ServiceItemValue
RedshiftBlock size1 MB (min and max recorded per block)
RedshiftINTERLEAVED sort key columnsUp to 8
RedshiftManual WLMUp to 8 user queues, at most 50 slots in total, default queue concurrency of 5
RedshiftConcurrency scaling free creditAccrues 1 hour per day, up to 30 hours accumulated
RedshiftDefault number of concurrency scaling clusters1
RedshiftCOPY automatic splittingSplittable files of 128 MB or larger
RedshiftRecommended size for unsplittable files1 MB to 1 GB after compression, file count a multiple of the slice count
Redshift ServerlessBase capacityDefault 128 RPUs, minimum 4 RPUs. Billed per second, 60-second minimum
Spectrum, AthenaMinimum charge per query10 MB
AthenaCTAS and INSERT INTO partitions100 at once
AthenaCTAS default Parquet compressionGZIP
AthenaQuery result reuse60 minutes by default, up to 7 days
AthenaPartitions read in a single scanUp to 1 million
DynamoDBMaximum item size400 KB
DynamoDBRead and write unitsRead 4 KB (1 strongly consistent = 2 eventually consistent), write 1 KB
DynamoDBThroughput per partition3,000 read units and 1,000 write units per second
DynamoDBNumber of indexes20 GSIs by default, 5 LSIs
DynamoDBQuery and Scan responseUp to 1 MB per call
DynamoDBStreams retention / concurrent readers per shard24 hours / 2
DynamoDBIncremental export windowMinimum 15 minutes, maximum 24 hours
DynamoDBNew on-demand tableUp to 4,000 writes and 12,000 reads per second
AuroraStorage replication3 AZs, 6 storage nodes
AuroraNumber of readersUp to 15
AuroraCluster volume limit128 TiB (256 TiB for the latest engine versions)
Zero-ETLMinimum latency for DynamoDB → Redshift15 minutes

Integrated Scenario: Data Flow of a Commerce Service

Let us follow one company's store layout and attach the reason for each choice.

[Mobile app]
   ├─ Cart · sessions ───► DynamoDB (on-demand) ──Kinesis Data Streams──► Firehose ──► S3 (behavior log lake)
   └─ Orders · payments ─► Aurora (writer + reader)
                              ├─ reader ────────► customer service lookup screen
                              └─ zero-ETL ──────► Redshift ──► executive dashboard
                                                    ▲
S3 lake (3 years of logs, Parquet · date partitions) ──Spectrum──┘        Athena ──► data scientists' ad hoc analysis
PointChoiceReasonCommon wrong answer
CartDynamoDB on-demandMillisecond lookups by user ID, traffic spikes during eventsAurora (hard to handle spikes)
Orders and paymentsAuroraTransactions spanning several tables, consistencyDynamoDB (unsuitable for joins and complex transactions)
Customer service lookupAurora readerThe same schema as is, protects the writerRedshift (excessive for per-record lookups)
Executive dashboardZero-ETL → RedshiftAggregation over hundreds of millions of rows, no pipeline to manageAggregating directly on the reader (slow because it is row-based)
3 years of logsS3 + SpectrumLarge volumes queried occasionally are not loadedLoading everything into Redshift (storage and load cost)
Ad hoc analysisAthenaIntermittent, no cluster neededA dedicated Redshift cluster
Loading DynamoDB changesKinesis Data Streams → FirehoseContinuous load into S3 with no code, long retentionPeriodic Scan (consumes production capacity)
  • If the dashboard is hit at 9 AM, turn on concurrency scaling in Redshift. A short once-a-day peak often ends within the free credit.
  • The order fact table in Redshift is frequently joined with the customer dimension, so customer_id is the DISTKEY, and because date range queries are common, the order date is the first sort key column. The small region dimension is ALL.
  • On the data scientists' Athena workgroup, set a per-query scan limit to block a query that accidentally reads all 3 years.

Collection of Anti-Patterns

  • Using DynamoDB as a reporting DB: Aggregating with Scan and filters burns read capacity. Export it with an export or a stream.
  • Adding a GSI for every aggregation axis: Only the write cost goes up, and you still cannot aggregate.
  • Running month-end settlement queries on the Aurora writer: Transactions slow down. Move them to a reader or Redshift.
  • DISTSTYLE ALL on every table: Storage and load time are multiplied by the node count.
  • A DISTKEY unrelated to the join key, or a skewed column: Redistribution or skew.
  • Repeating single-row INSERTs into Redshift: Batch them and load with COPY.
  • SELECT * on raw CSV in Athena: The most expensive combination.
  • Keeping a provisioned cluster running constantly for occasional analytics: Athena or Redshift Serverless is the right fit.
  • Hitting the operational DB with large hourly federated queries: Operational load accumulates. Switch to replication.

Scenario → Answer Lookup Table

ScenarioAnswer
Occasional SQL analysis of S3 data with no infrastructureAthena
Two large tables frequently joined on the same key, eliminate redistributionMake that column the DISTKEY on both sides
Optimizing the join of a small dimension tableDISTSTYLE ALL
Date range queries are slow (Redshift)Date as the sort key
Redshift queries wait in the queue every morningConcurrency scaling
Query warehouse data together with old history on S3Redshift Spectrum
Athena cost is highPartitions + Parquet + compression + only the needed columns
Tens of thousands of Athena partitions, metadata lookup bottleneckPartition projection
Controlling Athena cost per teamWorkgroup + per-query scan limit
Join S3 and RDS without moving dataAthena federated query
Large-scale aggregation of DynamoDB operational dataMove it to S3/Redshift with an export or stream and analyze there
Analyze a whole DynamoDB table with no load on the tableS3 export (PITR)
Reacting to DynamoDB changes in real timeStreams + Lambda
Aurora in Redshift in near real time, with no pipelineZero-ETL
Oracle → Aurora migration + continuous replicationDMS
First way to reduce reporting load on the operational DBRead Replica
Intermittent warehouse workload, minimal operationsRedshift Serverless

Next week we move to the side that watches over pipelines: monitoring with CloudWatch metrics, logs, and alarms.

📖 Glossary

  • Read pattern: The way a workload reads data. Whether it is per-record lookup, range aggregation, or search divides the stores.
  • Billing unit: The basis on which a service sets its charges. Examples are scan volume, compute time, and request units.
  • Skew (skew, hot partition): A phenomenon in which the values of the key used for distribution are lopsided, so load piles onto only some nodes or partitions.
  • Data skipping: An optimization that uses statistics or path structure to avoid reading data that does not match the condition at all.
  • Lakehouse: A configuration that queries warehouse tables and S3 lake data together.
  • CQRS: A separation pattern that hands writes and per-record lookups, and analytics and aggregation, to different stores.
  • Freshness: The time it takes for a value changed at the source to become visible on the analytics side.
  • Fact table / dimension table: A large table where measurements accumulate, and the small reference tables that describe them.

📝 Practice Questions

Click a choice to reveal the answer and explanation.

Question 1

Which service is the most suitable for the requirement to "analyze data accumulated in S3 intermittently with standard SQL without provisioning infrastructure"?

Question 2

What is the optimal setting in Redshift to avoid redistribution when two large fact/dimension tables are frequently joined on the same key?

Question 3

You need to aggregate and report on operational data stored in DynamoDB at large scale. What is the recommended approach?

Question 4

How can you analyze Aurora operational data in Redshift in near real time without the burden of operating an ETL pipeline?

Question 5

What is the most appropriate solution when partitions in Athena have grown to tens of thousands and catalog lookups and MSCK REPAIR have become a bottleneck?

PreviousRDS/Aurora and Store Selection: OLTP, Zero-ETL, Workload-to-Store DecisionWeek 7 · Day 4Next Pipeline Monitoring: CloudWatch Metrics, Logs, and AlarmsWeek 8 · Day 1

Official references

  • DEA-C01 official exam page(opens in a new tab)
  • Amazon Redshift documentation(opens in a new tab)
  • Amazon DynamoDB documentation(opens in a new tab)
  • Amazon Athena documentation(opens in a new tab)
  • Amazon RDS · Aurora documentation(opens in a new tab)
  • Amazon S3 documentation(opens in a new tab)

On this page

  • Key Takeaways
  • Analytics Stores on One Table
  • The Same Problem Under Different Names: Skew
  • The Same Problem Under Different Tools: Skipping
  • The Billing Unit Sets the Direction of Optimization
  • From Operations to Analytics: Choosing the Path
  • Telling Look-Alikes Apart at Once
  • Week 7 Numbers and Defaults on One Page
  • Integrated Scenario: Data Flow of a Commerce Service
  • Collection of Anti-Patterns
  • Scenario → Answer Lookup Table
  • Glossary
  • Practice Questions