Spot missing fields and type drift in your DynamoDB tables
Sample any table, see which fields actually appear and how often, declare the ones that are required per record type, and get a list of records that break your rules.
Build me a data quality explorer for our Amazon DynamoDB tables. I open it whenever we ship a schema change or onboard someone new to the data model. DynamoDB lets every item carry different attributes, and only key attributes can be formally declared, so non key attributes are completely unpoliced and nobody can tell me what is actually in a table. The app should show me what is really there, let me declare what ought to be there, and list the items that disagree.
Start on a table picker. Use List Tables to show every table in the connected region and let me choose one. Once I pick a table, call Describe Table and show its structure: the partition key and sort key, and every global and local secondary index with the attributes each one is keyed on. Present this as the declared schema and make clear it is the only part of the model DynamoDB actually enforces.
Then sample the table with Scan. Sampling must be capped and paginated. Use a modest page size and follow LastEvaluatedKey into ExclusiveStartKey on each subsequent request, stopping the moment the sampled item count reaches a cap I control. Default the cap to about 1000 items and expose it as an input on the view. Always tell me how many items were sampled and whether the cap was hit before the table ran out. Never run an unbounded full table scan, and never scan automatically on page load without me asking for a refresh.
From the sample build an attribute profile. For every attribute name seen anywhere in the sample, show the number of sampled items carrying it, the percentage of sampled items carrying it, and the DynamoDB types observed for it with a count per type. When one attribute shows more than one type across the sample, for example sometimes a string and sometimes a number, flag it as a type conflict and make it visually prominent, because those are the bugs worth chasing. Sort free form attributes by coverage descending.
Split the profile into two clearly separated groups. One group is key attributes, meaning anything named in the table key schema or in any index key schema from Describe Table. The other group is free form attributes, meaning everything else. This separation is the point of the app, so do not blend the two into one flat list.
Handle single table design properly. Derive an entity type for each sampled item by reading the prefix of its partition key value up to a delimiter, defaulting to a hash character and letting me change the delimiter. Group the attribute profile by entity type as well as showing the table wide view, since a customer item and an order item in the same table have nothing to do with each other. Items whose partition key has no delimiter fall into an untyped group.
Give me a rules panel where I declare, per entity type, which attributes are required. Rules are always per entity type and never global. Bake in that a missing secondary index key attribute is not automatically a violation: sparse indexes are intentional in DynamoDB and teams leave index keys off items deliberately to keep those indexes small, so an attribute is only ever reported as missing when I have declared it required for that entity type.
Persist the rules with Put Item into a small config table whose name I supply, writing one config item per profiled table so the rules load back with Get Item the next time I open the app. Alongside the rules, store a snapshot of the current profile, meaning the coverage percentage per attribute plus the sample size and a timestamp, so the app can compare against it on my next visit.
Add a violations view that evaluates the sampled items against my saved rules and lists every failing item. Each row shows the item key, its entity type, and a specific human readable reason such as missing required attribute email, or attribute status expected string but found number. One reason per row, written so a new teammate understands it without reading the rules panel first.
Clicking a violation row opens the full item, fetched fresh with Get Item so I am never editing a stale copy from the sample. Give me two modes. Read only, for when I just want to inspect the item. And edit, where I can correct an existing attribute or add a missing one inline, one attribute at a time, committed with Update Item behind an explicit confirm step that shows the before and after value. The app must never bulk edit items automatically: no fix all button, no background repair, no cascading writes. Every write is one item, one attribute, one confirmation.
Finally add a share button that composes a short drift summary and posts it to our engineering channel using the Slack Bot Send a Message operation, with the channel configurable. The summary covers attribute coverage changes against the last stored snapshot, meaning attributes that newly appeared, attributes that disappeared, and attributes whose coverage moved by more than a threshold such as five percentage points, plus the current violation count and the sample size the numbers came from. Keep it to a handful of lines that read well in Slack rather than a full dump of the profile.
Throughout, label coverage numbers as sample based rather than exact table statistics, so nobody mistakes an 80 percent reading for a guarantee about the whole table.
What does this prompt do?
- Pick a table and see its structure at a glance, with the fields that make up its keys and indexes kept clearly separate from the free form fields that nobody formally declared
- Samples a capped number of records and builds a profile of every field found, showing the percentage of sampled records that carry it and flagging any field that is sometimes text and sometimes a number
- Lets you declare which fields are required for each record type, grouped by the ID prefix that marks the type, so tables holding several kinds of record are handled properly
- Saves those rules back into a small settings table so the checks stick between visits, and lists the records that fail them with a plain reason on every row
- Opens any failing record so you can inspect it read only, or correct one field at a time behind a confirm step
- Shares a short drift summary, meaning what changed in field coverage plus the current number of failing records, straight to your engineering channel in Slack
What do I need to use this?
- An AWS login with access to the DynamoDB tables you want to explore, plus the region they live in
- Permission to read those tables and to write to the records you choose to correct
- A small settings table in the same region where the app can store your rules, or the ability to create one
- A Slack workspace and the channel where your team wants drift summaries posted
How can I customize it?
- Raise or lower the sampling cap depending on how big your tables are and how precise you want the coverage percentages to be
- Change the separator used to read the record type out of the ID, if your naming convention uses something other than a hash
- Set which Slack channel receives the drift summary, and how big a coverage swing has to be before it shows up there
- Adjust the required fields per record type as your data model evolves
FAQs
Will this scan my whole table and run up a big bill?
Can it change my data by accident?
My table holds several different kinds of record. Does that break it?
Are the percentages exact?
Why is a missing index field not always reported as a problem?
Do my rules survive if I close the app?
Related templates
See how your brand's news coverage and sentiment stack up against four competitors, then let an assistant write the weekly report for you.
One screen showing every social post waiting on approval, sorted by deadline, so reviewers can approve or reject without leaving the page.
Every Monday, find the past champions and closed-won contacts who changed jobs, update Attio, and get the moves worth chasing in Slack.
Staff submit what happened, your social manager edits the copy, picks the accounts and puts it on the calendar without a single spreadsheet.
Open one board each morning, see which voice calls went badly, replay the exact moment the caller got frustrated, and file the fix.
A personal queue of every overdue Guru card, sorted by how late it is, with one-click verify, reassign, comment, and an agent that drafts the refresh for you.
Stop guessing what is actually in your tables.
Give your team one screen that shows which fields really exist, which records break the rules, and what changed since the last schema change.