Q: You create a DynamoDB table heavily queried by `UserID`. Months later, the business wants to query by `EmailAddress`. You go to add a Local Secondary Index (LSI) but the AWS console firmly prevents you. Why?
Local Secondary Indexes (LSIs) are deeply embedded into the physical partition layout of the original DynamoDB table (forcing the same Partition Key, but allowing a new Sort Key).
Want to master this scenario in a live sandbox? KodeKloud's PostgreSQL Database Administration & High Availability Course covers this exact problem with hands-on terminal drills.
🛠️ Production Runbook & Step-by-Step Resolution
Direct Answer: "AWS reliability requires differentiating between AWS control plane limits and host-level resource exhaustion. The interviewer is testing: Global (GSI) vs Local (LSI) Index immutability constraints.. I structure my answer around systematic triage first, root cause analysis second, and permanent remediation third."
Production Solution & Architecture
Local Secondary Indexes (LSIs) are deeply embedded into the physical partition layout of the original DynamoDB table (forcing the same Partition Key, but allowing a new Sort Key). Because of this physical constraint, LSIs must be created at the exact moment the table is initially created. They are entirely immutable and cannot be added later. *Fix:* You must instead create a Global Secondary Index (GSI). GSIs are essentially asynchronous replica tables maintained by AWS under the hood. They can be dynamically added or securely deleted at any time with zero downtime to the primary table.
- Immediate Triage: Local Secondary Indexes (LSIs) are deeply embedded into the physical partition layout of the or
- Run targeted verification commands before modifying configuration.
- Automate permanent guardrails (CI check, alerts, IaC policy) to prevent recurrence.
Senior hiring managers and bar raisers evaluate how you prioritize during outages. Avoid these common anti-patterns:
- Using a low-cardinality partition key (e.g., status, boolean, date) in high-throughput DynamoDB tables Low-cardinality partition keys route disproportionate request volume to single storage nodes, triggering ProvisionedThroughputExceededException throttling.
- Neglecting GSI write throttling backpressure on primary DynamoDB table write operations If a GSI lacks sufficient WCU capacity, backpressure from the secondary index throttles writes on the primary table regardless of base table provisioning.
- Omitting exponential backoff and jitter algorithms in client SDK retry configurations during DynamoDB throttling Retrying throttled calls in lockstep causes synchronized retry storms that compound partition exhaustion instead of letting the partition drain.
-
Failing to monitor CloudWatch
ThrottledRequestsand Contributor Insights during DynamoDB latency spikes when configuring create DynamoDB table Senior SREs use Contributor Insights to pinpoint the exact partition keys and access patterns causing throttling rather than relying on average latency metrics.