Skip to content
BytePatterns

DEA-C01 · Domain 2: Data Store Management · 26% of the exam

Task 2.4: Design data models and schema evolution

Shaping data for its queries: Redshift distribution and sort keys, DynamoDB keys and indexes, partitioning and compression, schemas that change over time, schema conversion with AWS DMS, lineage, and how vectors are made for a knowledge base.

Study it

Sample questions

Try each one before opening the answer. Every option is explained, with the AWS documentation page that proves it.

Question 1 · choose 1

Two large Amazon Redshift tables, orders and order_items, are joined on order_id in most queries. Query plans show that much of the run time is spent redistributing rows between nodes. Which table design reduces this work?

  1. AUse EVEN distribution for both tables
  2. BUse KEY distribution on order_id for both tables
  3. CUse ALL distribution for both tables
  4. DUse KEY distribution on each table's own primary key column
Show the answer and why
  • AUse EVEN distribution for both tables

    Incorrect

    EVEN spreads rows round-robin regardless of values. It suits tables that do not take part in joins.

  • BUse KEY distribution on order_id for both tables

    Correct

    Distributing a pair of tables on their joining column puts matching rows on the same slice, so the join needs no redistribution.

  • CUse ALL distribution for both tables

    Incorrect

    ALL copies the whole table to every node, multiplying storage and load time. It is meant for relatively slow-moving tables, not two large ones.

  • DUse KEY distribution on each table's own primary key column

    Incorrect

    order_items would be distributed on its own key, not order_id, so rows with the same order_id would still sit on different slices.

Collocation is the point of KEY distribution: when both sides of a frequent join are distributed on the join column, each slice can join its own rows.

Question 2 · choose 1

A Redshift table stores 5 years of clickstream events. Nearly every query filters on a range of event_time, usually the last week or month. How should a data engineer define the table to reduce the data each query reads?

  1. AMake event_time the leading column of the sort key
  2. BMake event_time the distribution key of the table
  3. CUse ALL distribution so every node holds the full table
  4. DSet the encoding of the event_time column to RAW
Show the answer and why
  • AMake event_time the leading column of the sort key

    Correct

    Redshift keeps the minimum and maximum value of each 1 MB block. With data sorted by event_time, a range filter skips most blocks; AWS recommends a timestamp as the leading sort key column for this.

  • BMake event_time the distribution key of the table

    Incorrect

    The distribution key decides which slice stores each row. It does not let a range filter skip blocks.

  • CUse ALL distribution so every node holds the full table

    Incorrect

    ALL copies the table to every node. Each node would read even more data for the same filter.

  • DSet the encoding of the event_time column to RAW

    Incorrect

    RAW means the column is stored without compression. An encoding does not order the rows, so a range filter would still read blocks from all 5 years.

Sort keys and zone maps work together: when rows are stored in event_time order, the block metadata tells Redshift which blocks cannot match.

Question 3 · choose 1

A DynamoDB table in production has customer_id as its partition key and order_date as its sort key. A new feature must list all orders for a given warehouse, newest first, with low latency. The table already holds millions of items. What should a data engineer do?

  1. AAdd a global secondary index keyed on warehouse_id and order_date
  2. BAdd a local secondary index that uses warehouse_id as its sort key
  3. CScan the table with a filter expression on the warehouse_id attribute
  4. DRaise the table's read capacity and read it with a parallel scan
Show the answer and why
  • AAdd a global secondary index keyed on warehouse_id and order_date

    Correct

    A global secondary index can have a key schema different from the table's, and it can be queried directly; ScanIndexForward set to false returns the newest items first.

  • BAdd a local secondary index that uses warehouse_id as its sort key

    Incorrect

    A local secondary index keeps the table's partition key, so it only sorts within one customer, and it can only be created with the table.

  • CScan the table with a filter expression on the warehouse_id attribute

    Incorrect

    A Scan reads every item before the filter applies, which gets slower and more expensive as the table grows.

  • DRaise the table's read capacity and read it with a parallel scan

    Incorrect

    A parallel scan still reads the whole table. More capacity makes it faster but not efficient.

A new access pattern on an existing table is what global secondary indexes are for: a different partition key, added without recreating the table.

Question 4 · choose 1

A company is moving an Oracle database to Amazon Aurora PostgreSQL. A data engineer must convert the schemas, views and stored procedures, see an assessment of what cannot be converted automatically, and work from the AWS Management Console without installing desktop software. What should the data engineer use?

  1. ADMS Schema Conversion in an AWS DMS migration project
  2. BAn AWS DMS full-load task with the target table preparation mode set to drop and create
  3. CAn AWS Glue crawler that reads the Oracle schema and creates the tables in Aurora
  4. DAWS DataSync, which copies the Oracle data files to the Aurora cluster
Show the answer and why
  • ADMS Schema Conversion in an AWS DMS migration project

    Correct

    DMS Schema Conversion reads the source metadata, runs an assessment of what converts automatically and what needs manual work, and converts the schema in a migration project.

  • BAn AWS DMS full-load task with the target table preparation mode set to drop and create

    Incorrect

    A migration task moves data. DMS Schema Conversion is the feature that converts schema code such as procedures and views.

  • CAn AWS Glue crawler that reads the Oracle schema and creates the tables in Aurora

    Incorrect

    Crawlers populate the AWS Glue Data Catalog with table definitions. They do not create objects in a target database.

  • DAWS DataSync, which copies the Oracle data files to the Aurora cluster

    Incorrect

    DataSync transfers files and objects between storage systems. It does not convert database schemas.

Heterogeneous migrations have two parts: converting the schema and code, then moving the data. DMS Schema Conversion handles the first part inside AWS DMS.

Question 5 · choose 1

One Amazon Bedrock knowledge base holds documents from HR, legal, and sales. The HR assistant must retrieve only HR documents. A data engineer wants to keep one knowledge base. What should the data engineer do?

  1. ARaise the maximum number of results that each retrieval returns
  2. BSwitch the retrieval search type from semantic search to hybrid search
  3. CAdd a department attribute in metadata files and filter on it
  4. DChange the chunking strategy to hierarchical chunking for all documents
Show the answer and why
  • ARaise the maximum number of results that each retrieval returns

    Incorrect

    numberOfResults sets the maximum number of chunks returned. It does not restrict which documents they come from.

  • BSwitch the retrieval search type from semantic search to hybrid search

    Incorrect

    Hybrid search combines embeddings with a search of the raw text. It does not limit results to one department.

  • CAdd a department attribute in metadata files and filter on it

    Correct

    A fileName.metadata.json file in the S3 data source adds attributes to a document, and queries can filter on those attributes.

  • DChange the chunking strategy to hierarchical chunking for all documents

    Incorrect

    Chunking controls how documents are split before embedding. It does not decide which department's chunks a query sees.

Metadata attributes stored beside the vectors let one index serve many audiences; filters narrow retrieval before the model sees any text.

Question 6 · choose 1

A data engineer creates a new Amazon Redshift table. It starts small but will grow large over the coming months, and its join patterns are not yet known. The engineer wants Redshift to choose the distribution and change it as the table grows. Which distribution style should the engineer use?

  1. AALL
  2. BEVEN
  3. CAUTO
  4. DKEY on a column chosen now
Show the answer and why
  • AALL

    Incorrect

    ALL keeps a copy of the entire table on every node. The style does not change as the table grows large.

  • BEVEN

    Incorrect

    EVEN spreads rows round-robin regardless of values. It is a fixed choice, not one that adapts to the table's size.

  • CAUTO

    Correct

    With AUTO, Redshift assigns a style based on table size, for example ALL while the table is small, and changes it to KEY or EVEN as it grows.

  • DKEY on a column chosen now

    Incorrect

    KEY places matching values together for a chosen column, but the join patterns that would guide that choice are not yet known.

When size and access patterns are uncertain, AUTO lets Redshift move from ALL to KEY or EVEN as data grows; explicit styles fit known workloads.

Question 7 · choose 1

A data engineer creates an Apache Iceberg table in Amazon Athena for click events. Analysts filter on the event_ts timestamp column, and the table must be partitioned by day without a separate date column that analysts would have to remember to filter on. Which PARTITIONED BY clause should the engineer use?

  1. APARTITIONED BY (bucket(16, event_ts))
  2. BPARTITIONED BY (truncate(10, event_ts))
  3. CPARTITIONED BY (hour(event_ts))
  4. DPARTITIONED BY (day(event_ts))
Show the answer and why
  • APARTITIONED BY (bucket(16, event_ts))

    Incorrect

    bucket(N, col) partitions by a hashed value modulo N buckets, which spreads each day across buckets instead of grouping it.

  • BPARTITIONED BY (truncate(10, event_ts))

    Incorrect

    truncate(L, col) works on int, long, decimal, and string columns, not on timestamps.

  • CPARTITIONED BY (hour(event_ts))

    Incorrect

    hour(ts) partitions by hour, which is finer than the daily partitions the table needs.

  • DPARTITIONED BY (day(event_ts))

    Correct

    day(ts) partitions a date or timestamp column by day, and Athena supports Iceberg's hidden partitioning, so analysts keep filtering on event_ts.

Iceberg partition transforms derive partitions from a column, so queries on the source column still prune partitions without an extra date column.

Question 8 · choose 1

An Amazon DynamoDB table stores insurance claims. Each claim must now include a scanned PDF of up to 5 MB, and writes fail with a ValidationException. Which design should a data engineer use?

  1. ACompress each PDF with GZIP and store it in a Binary attribute of the item
  2. BStore each PDF in Amazon S3 and keep its object key in the claim item
  3. CSwitch the table from provisioned to on-demand capacity mode
  4. DWrite the claims with BatchWriteItem instead of PutItem calls
Show the answer and why
  • ACompress each PDF with GZIP and store it in a Binary attribute of the item

    Incorrect

    Compression can help values fit, but a 5 MB file is more than 12 times the 400 KB item limit.

  • BStore each PDF in Amazon S3 and keep its object key in the claim item

    Correct

    DynamoDB items are limited to 400 KB. Storing the large object in S3 and its identifier in the item keeps the claim within that limit.

  • CSwitch the table from provisioned to on-demand capacity mode

    Incorrect

    The capacity mode changes how reads and writes are billed and scaled. The 400 KB item size limit still applies.

  • DWrite the claims with BatchWriteItem instead of PutItem calls

    Incorrect

    BatchWriteItem fails when any item in the batch exceeds 400 KB, so the limit is unchanged.

Large blobs belong in S3 with a pointer in DynamoDB; the table keeps the small, queryable attributes.

Question 9 · choose 1

An Amazon Athena table over Parquet files uses the default column access. The producer renames the column cust_id to customer_id in new files, and the table must show old and new values in one column named customer_id without rewriting old files. Column order is unchanged. What should a data engineer do?

  1. ARename the column in the table and keep the default access by name
  2. BSet parquet.column.index.access to true, then rename the column
  3. CAdd customer_id at the end of the table and keep cust_id as well
  4. DSet parquet.column.index.access to false, then rename the column
Show the answer and why
  • ARename the column in the table and keep the default access by name

    Incorrect

    Renaming columns is listed as safe for Parquet only when it is read by index; by name, old files would not match the new column name.

  • BSet parquet.column.index.access to true, then rename the column

    Correct

    Parquet is read by name by default. Reading by index uses the column's ordinal number, and renaming columns is supported for Parquet read by index.

  • CAdd customer_id at the end of the table and keep cust_id as well

    Incorrect

    Adding a column at the end is safe, but the values would sit in two columns instead of one.

  • DSet parquet.column.index.access to false, then rename the column

    Incorrect

    False sets the access method to column name, which is the default that does not support renaming.

Parquet and ORC differ in default column access, and the access method decides which schema changes are safe: by name for adding and removing, by index for renaming.

Practise domain 2 →Practise all domains →