From magic-powers
Use when designing DynamoDB schemas, choosing partition and sort keys, planning GSI/LSI indexes, selecting capacity modes, or implementing DynamoDB Streams and DAX. Covers AWS DEA-C01 and DVA-C02 NoSQL design domains.
npx claudepluginhub kienbui1995/magic-powers --plugin magic-powersThis skill uses the workspace's default tool permissions.
- Designing a NoSQL schema for a new DynamoDB table
Generates design tokens/docs from CSS/Tailwind/styled-components codebases, audits visual consistency across 10 dimensions, detects AI slop in UI.
Records polished WebM UI demo videos of web apps using Playwright with cursor overlay, natural pacing, and three-phase scripting. Activates for demo, walkthrough, screen recording, or tutorial requests.
Delivers idiomatic Kotlin patterns for null safety, immutability, sealed classes, coroutines, Flows, extensions, DSL builders, and Gradle DSL. Use when writing, reviewing, refactoring, or designing Kotlin code.
Good partition key examples:
user_id (UUID) — high cardinality, random distributionorder_id (UUID) — unique per orderdevice_id — high cardinality for IoTHot partition fixes:
user_id#1, user_id#2 … user_id#N; scatter reads across shards then aggregateuser_id#2024-01)| Feature | Global Secondary Index (GSI) | Local Secondary Index (LSI) |
|---|---|---|
| Partition key | Different from table partition key | SAME as table partition key |
| Sort key | Any attribute (optional) | Different from table sort key |
| Capacity | Separate RCU/WCU from base table | Shares capacity with base table |
| Consistency | Eventually consistent ONLY | Supports strongly consistent reads |
| Size limit | No constraint per partition | 10GB per partition key value |
| Creation time | Anytime (even after table creation) | ONLY at table creation time |
| Max per table | 20 GSIs | 5 LSIs |
| Projection | Can project any attributes | Can project any attributes |
GSI use case: Query orders by customer email (different partition key than order_id):
Table: PK=order_id, SK=timestamp
GSI: PK=customer_email, SK=order_date
LSI use case: Query user's posts sorted by likes (same user_id partition, different sort):
Table: PK=user_id, SK=post_date
LSI: PK=user_id, SK=like_count
| Mode | Pricing | Best For | Scaling |
|---|---|---|---|
| Provisioned | Per RCU/WCU-hour | Predictable, sustained workloads | Manual or Auto Scaling |
| On-Demand | Per request (Read Request Unit / Write Request Unit) | New, unpredictable, spiky workloads | Automatic, instant |
Cost comparison: On-Demand = ~2–2.5x more expensive per RCU/WCU than right-sized Provisioned + Auto Scaling.
Auto Scaling (Provisioned): Set min/max RCU/WCU; DynamoDB adjusts within bounds using CloudWatch alarms. Scale-up is fast; scale-down slower (4 decreases/day limit historically, now managed automatically).
| Type | Freshness | Cost | Use Case |
|---|---|---|---|
| Eventually consistent | May be slightly stale | 0.5 RCU per 4KB | Default; fine for most reads |
| Strongly consistent | Always latest data | 1 RCU per 4KB | Financial balances, inventory counts |
| Transactional | ACID across items | 2 RCU per 4KB | Multi-step operations needing atomicity |
GSI reads are always eventually consistent — never strongly consistent.
KEYS_ONLY — only PK/SK of changed itemNEW_IMAGE — full item after changeOLD_IMAGE — full item before changeNEW_AND_OLD_IMAGES — both before and afterLambda integration:
TransactWriteItems: up to 100 items, across multiple tables, all-or-nothing ACIDTransactGetItems: up to 100 items, atomic consistent readConditionExpression on PutItem/UpdateItem/DeleteItem; optimistic locking pattern#0 to #N)