Ravi Sir's Cards › AWS
Scan caution on cleanup
What is a VPC: your own private network inside one AWS Region, example ThreeTierVpc 10.0.0.0/16.
Read card text
What this card says
Why do we need it?
Deleting “old” rows often starts with a Scan, which reads the whole table and costs as it grows.
What is it?
Lab Scan with a filter on createdAt is OK for tiny seed data. Production should Query a GSI on expiry or use DynamoDB TTL.
How to do it
Prefer TTL attribute expiresAt for pure expiry. For “archive then delete”, Query a date GSI in pages of 100.
FilterExpression
Example
100-item lab cleanup finishes in one Scan page; a 10 GB table would need a better key design first.