Dynobase (@dynobase) header
Dynobase (@dynobase) profile picture

Professional GUI Client for DynamoDB https://nitter.cf/t.co/nqS5b8GVKr

Joined January 2020
What actually happens when you call GetItem in DynamoDB? It's the simplest read there is, and it still has a few rules that catch people. 🧵
1
1
21
4/ ProjectionExpression trims what comes back, not what you pay. You're billed on the full item size. Reading a few attributes of a big item often? Keep those attributes in their own smaller item.
1
3
5/ Need many items by key? BatchGetItem takes up to 100 keys and 16 MB per call. Retry whatever comes back in UnprocessedKeys. Dynobase's Operation Builder shows the generated code for an operation before you run it.
2
DynamoDB GSI vs LSI: GSI - any partition + sort key - add or drop anytime - eventually consistent reads only LSI - same partition key, new sort key - only at table creation - strongly consistent reads too - 10 GB cap per partition key Default to GSI. LSI only for strong reads.
88
Unpopular opinion: don't add DynamoDB GSIs on day one "just in case". Every GSI copies your writes and bills them again. You can add one to a live table any time; it backfills from the base table. Ship with the access patterns you have. Add the index when a real query needs it.
1
145
DynamoDB TTL vs DeleteItem: TTL - free, no write capacity - usually gone within a few days of expiry - expired items still appear in reads DeleteItem - costs write capacity - immediate - supports a condition expression Using TTL? Filter out expired items until it catches up.
1
85
Before you Scan a whole production DynamoDB table: 1. Check size (Scan reads every item) 2. Split it with Segment/TotalSegments 3. Use eventually consistent reads (half the RCU) 4. Pace it so live traffic isn't throttled 5. Save LastEvaluatedKey to resume Huge? Export to S3.
89
Unpopular opinion: dev, staging and prod DynamoDB tables shouldn't share an AWS account. Prefixes like dev-orders are one typo away from a prod write. Separate accounts give each environment its own IAM boundary, quotas and bill. Prefixes are naming. Accounts are isolation.
2
161
What actually happens when you call PutItem in DynamoDB? It reads like "insert a row". It behaves like "replace whatever is at this key". 🧵
1
93
4/ A GSI gets the item only if it has that index's key attributes. If a replace changes an index key, the index does a delete plus a put, and both cost write capacity. With Streams on, you get an INSERT or a MODIFY record.
1
19
5/ ReturnValues on PutItem accepts only NONE or ALL_OLD. ALL_OLD hands back the item you just overwrote. Dynobase's Operation Builder shows the generated code and conditions for a write before you run it.
19
Which DynamoDB limit surprised you first in production? • 400 KB max item size • 1 MB max per Query or Scan page • 25 items per BatchWriteItem call • 10 GB per partition key once a table has an LSI Or one that isn't on this list?
93
What actually happens when you call DeleteItem in DynamoDB? It looks like the simplest write. It still costs capacity, touches your indexes and can leave a trail. 🧵
2
1
2
166
4/ Need to know what you deleted? ReturnValues=ALL_OLD returns the item as it was. With Streams on, the delete also emits a REMOVE record, with the old image if your stream view type includes it.
1
31
5/ Dynobase's Operation Builder builds delete operations for the selected table and shows the generated code and conditions before you run the write.
28