Bitzu

SAA-C03 ยท High-performing databases and caching

DynamoDB keys, capacity modes, indexes and global tables

Partition and sort keys, on-demand versus provisioned capacity (RCU and WCU), secondary indexes and global tables for multi-Region access.

Key points

  • Primary key: partition (+ sort) key; many distinct, evenly used values.
  • On-demand (PAY_PER_REQUEST): unpredictable traffic; provisioned + auto scaling: steady.
  • 1 RCU: one strongly consistent (or two eventually consistent) read/s up to 4 KB; 1 WCU: one write/s up to 1 KB.
  • GSI: other key, added anytime, eventually consistent; LSI: same partition key, at creation, strong reads.
  • Global tables: every Region's replica reads and writes.

Source: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/provisioned-capacity-mode.html

Practice questions

Single choice

In DynamoDB provisioned mode, one write capacity unit (WCU) covers one write per second of an item up to what size?

  1. 4 KB
  2. 8 KB
  3. 1 KB
  4. 64 KB
Show answer

Answer: C. 1 KB

A WCU covers one write per second for an item up to 1 KB; larger items consume more units. The 4 KB figure belongs to read capacity units, not writes.

Select all that apply

Which statements correctly compare DynamoDB global secondary indexes (GSI) and local secondary indexes (LSI)?

  1. Reads on a GSI consume the base table's read capacity
  2. An LSI must be created at the same time as the table
  3. Queries on a GSI support eventual consistency only
  4. A GSI can use a partition key different from the table's
  5. An LSI can be added to an existing table at any time
Show answer

Answer: B. An LSI must be created at the same time as the table, C. Queries on a GSI support eventual consistency only, D. A GSI can use a partition key different from the table's

An LSI must be defined when the table is created, GSI queries are eventually consistent only, and a GSI can use a partition key different from the table's. An LSI cannot be added to an existing table, and GSI reads draw on the index's own capacity, not the base table's.

True or false

In a DynamoDB global table, only one Region's replica accepts writes; the replicas in the other Regions are read-only.

Show answer

Answer: False

False. Global tables are multi-active: every replica can serve both reads and writes, and changes are replicated between Regions. This is what lets an app write locally in each Region and shift traffic if a Region has problems.

Practice 8 questions on this topic in Bitzu

Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.

Download on the App StoreGet it on Google Play

More SAA-C03 topics in this module