[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M79SMZWS1ZM2Z28DXCKE8VFT":3,"skill-same:01M79SMZWS1ZM2Z28DXCKE8VFT":64},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":14,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":31,"updatedAt":32,"install":33,"resources":45},"01M79SMZWS1ZM2Z28DXCKE8VFT","dynamodb-modeling",null,"Design a DynamoDB table or review one before it ships: \"what should my partition key be\", \"do I need a GSI here\", \"is this single-table design right\", \"review my access patterns\", or any new table\u002Fentity in a Dynamo-backed service. Access-pattern-first modeling, key strategies, index choice, and the anti-patterns that show up in review.","dannybrown37\u002Fskill-tree","dannybrown37","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F28059438?v=4","01M79SKVHAKWQH9VF0G6KQRZZ2","Danny Brown","01M79SKVJ1X8VHPTK7MKMHBRD2",0,"MIT","https:\u002F\u002Fgithub.com\u002Fdannybrown37\u002Fskill-tree\u002Fblob\u002Fmain\u002Fskills\u002Fdynamodb-modeling\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: dynamodb-modeling\ndescription: \"Design a DynamoDB table or review one before it ships: \\\"what should my partition key be\\\", \\\"do I need a GSI here\\\", \\\"is this single-table design right\\\", \\\"review my access patterns\\\", or any new table\u002Fentity in a Dynamo-backed service. Access-pattern-first modeling, key strategies, index choice, and the anti-patterns that show up in review.\"\nuser-invocable: true\n---\n\n# DynamoDB Modeling\n\nModel before you write application code. Dynamo punishes discovering an access pattern late in\na way a relational database does not: there is no `ADD INDEX` that makes an unplanned query\ncheap, and the key you chose is the one you're stuck with.\n\nThe through-line: you are designing disk operations, not tables -- every read should be one\ncontiguous read from one partition.\n\n## 0. Decide Dynamo is the right call\n\nDynamo earns its constraints with three strengths -- operational, economic, and performance.\nIf the project needs none of them, the constraints are just cost, and the argument is about\nthe datastore rather than the schema. `references\u002Fchoosing-dynamo.md` has that argument in\nfull, including what Dynamo is genuinely bad at.\n\n## 1. Write the access patterns down before the schema\n\nModeling starts with a table of access patterns, not entities. Build this artifact first and\nkeep it in the repo. It is the design document, and it's what a reviewer reads:\n\n| Pattern | Operation | Target | Filters \u002F Projections | Notes |\n| --- | --- | --- | --- | --- |\n| Get user | GetItem | base table | | |\n| Fetch inventory for user | Query | base table | | one item collection |\n| Fetch users by guild | Query | GSI1 | project `name`, `avatar` only | |\n\nBefore filling it in, answer:\n\n- Know your domain: what are the constraints? what's the data distribution? how big are\n  the items?\n- Know your access patterns: every read and every write.\n- Know the API: primary key + operations + secondary indexes. That's the whole toolkit.\n\nThe `Filters \u002F Projections` column is the one people skip. It's there to force the question\n\"does this index actually need every attribute?\" at design time, when it's free to answer.\n\nCheck: if any row's Target is \"Scan,\" it needs a written justification.\n\n## 2. The API is the mental model\n\nPrimary key + operations + secondary indexes is the entire toolkit: single-item actions\n(`PutItem`\u002F`GetItem`\u002F`UpdateItem`\u002F`DeleteItem`, full key required, all writes), Query (many\nitems, one partition, 1MB per request), and Scan. Each physical partition serves 3000 RCUs \u002F\n1000 WCUs; 1 RCU per 4KB read, 1 WCU per 1KB written. `references\u002Fthe-api.md` expands each.\n\n## 3. Two meta-goals, and everything else is downstream\n\n1. **Integrity of what you save**: a valid schema, application constraints (uniqueness,\n   limits), no inconsistency when duplicating data.\n2. **Reach exactly the right items**: writes need a primary key addressing exactly the\n   relevant item(s); reads need primary key + indexes to filter efficiently.\n\n## 4. Partition keys\n\nFacts that constrain the design:\n\n- A PK or SK may be string, number, or binary. Prefer string, it's more future-proof. Number sometimes.\n- You cannot change a key value. Changing one means delete and re-insert.\n- Name key attributes `PK` and `SK` -- generic, future-proof, and short, which matters because\n  attribute names are stored on every item.\n- Decorate the values, not the attribute names: `CUSTID#123` beats a raw `123`.\n- Keys are hashed for even physical distribution. Partitions split as they grow; a single\n  scorching item can be given its own partition. The search term is \"split for heat.\"\n\nPK strategies worth naming in review:\n\n| Strategy | Example | Why |\n| --- | --- | --- |\n| Descriptive | `Zip#89109` | identify the entity type in the key |\n| Multi-value | `89109#Casino` | a natural key that stores related data together |\n| Sharded | `Zip#89109#0` | many items per key value, so spread the heat |\n\n## 5. Sort keys\n\nThe sort key is what makes a Query cheap. Three strategies:\n\n| Strategy | Example | Why |\n| --- | --- | --- |\n| Hierarchical | `USA#NV#LAS` | \"limit to USA, or to NV, or to LAS\" |\n| Sorting | `1729101402` | \"store data sorted by time\" |\n| Typed | `Name#Hunter` | \"get all names, or names with a prefix\" |\n\nThe base table is the white pages: trivial to find by the beginning of a value, hopeless by\nthe middle or end. Design keys so every query is a prefix query.\n\n## 6. Item collections\n\nA collection is every item sharing a partition key.\n\n- Hard limit 10GB per collection (LSIs count toward it).\n- Only co-locate items retrieved together; sharing a partition key with an item you never\n  fetch in the same request buys nothing.\n- Single-table design is a good default, not a mandate. Don't push unrelated entities into one\n  table for the aesthetics of it. The \"kitchen-sink item collection\" is a named anti-pattern,\n  and so is the over-normalized model at the other extreme.\n\n## 7. Secondary indexes\n\nGSIs are the yellow pages: find things by category, as long as you categorized them.\n\n- Prefer GSIs. An LSI is a one-way door -- creatable only with the table, and it binds the\n  collection's 10GB limit -- whose one real advantage is strong consistency.\n- GSIs are eventually consistent only. That's half the read price, and fine for\n  user-driven flows, since nobody clicks fast enough to observe the lag. Machine-driven flows\n  are a different question; check whether a stale read breaks the caller. If it does, either\n  use a second base-table item or accept an LSI's downsides deliberately.\n- Indexes enable additional read-based patterns only.\n- Add indexes one at a time; they can be added to a live table whenever.\n\nCheck, per index: do I need the index? do I need all items in it? do I need the full item in\nit? `references\u002Findex-design.md` answers each at length -- multi-attribute composite keys over\nsynthetic `GSI1PK` strings, selective projection, and when to reuse an index instead.\n\n## 8-10. What the application still has to do\n\nThe table design doesn't cover any of this, and `references\u002Fapplication-rules.md` has it in\nfull:\n\n- **Schema-less is not schema-free.** Validate on the way in *and* out, and hard-error on a\n  failed parse rather than continuing.\n- **Duplicating data** is legitimate; copying a mutable attribute without an answer to \"how\n  do I find every copy when it changes\" is a future inconsistency.\n- **Use the basics.** Single-item actions, Query, secondary indexes -- then transactions,\n  sparingly, for low-volume high-value operations.\n\n## 11. Anti-patterns\n\n1. Kitchen-sink item collection, and its opposite, the over-normalized model.\n2. Hiding the API behind a SQL-flavored abstraction or an ORM. It makes the mental model\n   opaque and produces bad designs; the related failure is never using the full API.\n3. Strongly consistent reads as a default: double the price, rarely the requirement.\n4. Large items: every update pays the full item size.\n5. Overuse of `TransactWriteItems`.\n\n## 12. What Dynamo is genuinely bad at\n\nAggregations, and complex filtering on several optional properties. If a core requirement is\none of those, that's a datastore argument -- see `references\u002Fchoosing-dynamo.md`.\n\n## Related\n\n- `skill-tree:dynamodb-cost-audit`: for an existing table or a bill that hurts.\n- `skill-tree:dynamodb-migrations`: for changing a table that's already live.\n","# DynamoDB Modeling\n\nModel before you write application code. Dynamo punishes discovering an access pattern late in\na way a relational database does not: there is no `ADD INDEX` that makes an unplanned query\ncheap, and the key you chose is the one you're stuck with.\n\nThe through-line: you are designing disk operations, not tables -- every read should be one\ncontiguous read from one partition.\n\n## 0. Decide Dynamo is the right call\n\nDynamo earns its constraints with three strengths -- operational, economic, and performance.\nIf the project needs none of them, the constraints are just cost, and the argument is about\nthe datastore rather than the schema. `references\u002Fchoosing-dynamo.md` has that argument in\nfull, including what Dynamo is genuinely bad at.\n\n## 1. Write the access patterns down before the schema\n\nModeling starts with a table of access patterns, not entities. Build this artifact first and\nkeep it in the repo. It is the design document, and it's what a reviewer reads:\n\n| Pattern | Operation | Target | Filters \u002F Projections | Notes |\n| --- | --- | --- | --- | --- |\n| Get user | GetItem | base table | | |\n| Fetch inventory for user | Query | base table | | one item collection |\n| Fetch users by guild | Query | GSI1 | project `name`, `avatar` only | |\n\nBefore filling it in, answer:\n\n- Know your domain: what are the constraints? what's the data distribution? how big are\n  the items?\n- Know your access patterns: every read and every write.\n- Know the API: primary key + operations + secondary indexes. That's the whole toolkit.\n\nThe `Filters \u002F Projections` column is the one people skip. It's there to force the question\n\"does this index actually need every attribute?\" at design time, when it's free to answer.\n\nCheck: if any row's Target is \"Scan,\" it needs a written justification.\n\n## 2. The API is the mental model\n\nPrimary key + operations + secondary indexes is the entire toolkit: single-item actions\n(`PutItem`\u002F`GetItem`\u002F`UpdateItem`\u002F`DeleteItem`, full key required, all writes), Query (many\nitems, one partition, 1MB per request), and Scan. Each physical partition serves 3000 RCUs \u002F\n1000 WCUs; 1 RCU per 4KB read, 1 WCU per 1KB written. `references\u002Fthe-api.md` expands each.\n\n## 3. Two meta-goals, and everything else is downstream\n\n1. **Integrity of what you save**: a valid schema, application constraints (uniqueness,\n   limits), no inconsistency when duplicating data.\n2. **Reach exactly the right items**: writes need a primary key addressing exactly the\n   relevant item(s); reads need primary key + indexes to filter efficiently.\n\n## 4. Partition keys\n\nFacts that constrain the design:\n\n- A PK or SK may be string, number, or binary. Prefer string, it's more future-proof. Number sometimes.\n- You cannot change a key value. Changing one means delete and re-insert.\n- Name key attributes `PK` and `SK` -- generic, future-proof, and short, which matters because\n  attribute names are stored on every item.\n- Decorate the values, not the attribute names: `CUSTID#123` beats a raw `123`.\n- Keys are hashed for even physical distribution. Partitions split as they grow; a single\n  scorching item can be given its own partition. The search term is \"split for heat.\"\n\nPK strategies worth naming in review:\n\n| Strategy | Example | Why |\n| --- | --- | --- |\n| Descriptive | `Zip#89109` | identify the entity type in the key |\n| Multi-value | `89109#Casino` | a natural key that stores related data together |\n| Sharded | `Zip#89109#0` | many items per key value, so spread the heat |\n\n## 5. Sort keys\n\nThe sort key is what makes a Query cheap. Three strategies:\n\n| Strategy | Example | Why |\n| --- | --- | --- |\n| Hierarchical | `USA#NV#LAS` | \"limit to USA, or to NV, or to LAS\" |\n| Sorting | `1729101402` | \"store data sorted by time\" |\n| Typed | `Name#Hunter` | \"get all names, or names with a prefix\" |\n\nThe base table is the white pages: trivial to find by the beginning of a value, hopeless by\nthe middle or end. Design keys so every query is a prefix query.\n\n## 6. Item collections\n\nA collection is every item sharing a partition key.\n\n- Hard limit 10GB per collection (LSIs count toward it).\n- Only co-locate items retrieved together; sharing a partition key with an item you never\n  fetch in the same request buys nothing.\n- Single-table design is a good default, not a mandate. Don't push unrelated entities into one\n  table for the aesthetics of it. The \"kitchen-sink item collection\" is a named anti-pattern,\n  and so is the over-normalized model at the other extreme.\n\n## 7. Secondary indexes\n\nGSIs are the yellow pages: find things by category, as long as you categorized them.\n\n- Prefer GSIs. An LSI is a one-way door -- creatable only with the table, and it binds the\n  collection's 10GB limit -- whose one real advantage is strong consistency.\n- GSIs are eventually consistent only. That's half the read price, and fine for\n  user-driven flows, since nobody clicks fast enough to observe the lag. Machine-driven flows\n  are a different question; check whether a stale read breaks the caller. If it does, either\n  use a second base-table item or accept an LSI's downsides deliberately.\n- Indexes enable additional read-based patterns only.\n- Add indexes one at a time; they can be added to a live table whenever.\n\nCheck, per index: do I need the index? do I need all items in it? do I need the full item in\nit? `references\u002Findex-design.md` answers each at length -- multi-attribute composite keys over\nsynthetic `GSI1PK` strings, selective projection, and when to reuse an index instead.\n\n## 8-10. What the application still has to do\n\nThe table design doesn't cover any of this, and `references\u002Fapplication-rules.md` has it in\nfull:\n\n- **Schema-less is not schema-free.** Validate on the way in *and* out, and hard-error on a\n  failed parse rather than continuing.\n- **Duplicating data** is legitimate; copying a mutable attribute without an answer to \"how\n  do I find every copy when it changes\" is a future inconsistency.\n- **Use the basics.** Single-item actions, Query, secondary indexes -- then transactions,\n  sparingly, for low-volume high-value operations.\n\n## 11. Anti-patterns\n\n1. Kitchen-sink item collection, and its opposite, the over-normalized model.\n2. Hiding the API behind a SQL-flavored abstraction or an ORM. It makes the mental model\n   opaque and produces bad designs; the related failure is never using the full API.\n3. Strongly consistent reads as a default: double the price, rarely the requirement.\n4. Large items: every update pays the full item size.\n5. Overuse of `TransactWriteItems`.\n\n## 12. What Dynamo is genuinely bad at\n\nAggregations, and complex filtering on several optional properties. If a core requirement is\none of those, that's a datastore argument -- see `references\u002Fchoosing-dynamo.md`.\n\n## Related\n\n- `skill-tree:dynamodb-cost-audit`: for an existing table or a bill that hurts.\n- `skill-tree:dynamodb-migrations`: for changing a table that's already live.\n",{"name":5,"description":7,"user-invocable":24},true,"main","aec70683dacdf9512d27e04a1e04069bbd199b5e","skills\u002Fdynamodb-modeling","https:\u002F\u002Fgithub.com\u002Fdannybrown37\u002Fskill-tree","https:\u002F\u002Fgithub.com\u002Fdannybrown37","dannybrown.dev","Software Engineer","2026-11-12 15:25:14",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":24},[35,38,41],{"tool":36,"command":37},"npx","npx skills add dannybrown37\u002Fskill-tree --skill dynamodb-modeling",{"tool":39,"command":40},"bunx","bunx skills add dannybrown37\u002Fskill-tree --skill dynamodb-modeling",{"tool":42,"command":43},"pnpm","pnpm dlx skills add dannybrown37\u002Fskill-tree --skill dynamodb-modeling","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fdannybrown37\u002Fskill-tree\u002Fblob\u002Fmain\u002Fskills\u002Fdynamodb-modeling\u002FSKILL.md",[46,52,56,60],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"references\u002Fapplication-rules.md","REFERENCE","参考文档",1526,"https:\u002F\u002Fgithub.com\u002Fdannybrown37\u002Fskill-tree\u002Fblob\u002Fmain\u002Fskills\u002Fdynamodb-modeling\u002Freferences\u002Fapplication-rules.md",{"path":53,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":54,"sourceHtmlUrl":55},"references\u002Fchoosing-dynamo.md",1477,"https:\u002F\u002Fgithub.com\u002Fdannybrown37\u002Fskill-tree\u002Fblob\u002Fmain\u002Fskills\u002Fdynamodb-modeling\u002Freferences\u002Fchoosing-dynamo.md",{"path":57,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":58,"sourceHtmlUrl":59},"references\u002Findex-design.md",2666,"https:\u002F\u002Fgithub.com\u002Fdannybrown37\u002Fskill-tree\u002Fblob\u002Fmain\u002Fskills\u002Fdynamodb-modeling\u002Freferences\u002Findex-design.md",{"path":61,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":62,"sourceHtmlUrl":63},"references\u002Fthe-api.md",823,"https:\u002F\u002Fgithub.com\u002Fdannybrown37\u002Fskill-tree\u002Fblob\u002Fmain\u002Fskills\u002Fdynamodb-modeling\u002Freferences\u002Fthe-api.md",[65,72,79,86,93,100],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M79SQ7Z4DXMYJECV1NTEP9WY","wait-what","Stop. Your plan\u002Fidea did not land. Re-pitch it.","https:\u002F\u002Fgithub.com\u002Fdannybrown37\u002Fskill-tree\u002Fblob\u002Fmain\u002Fskills\u002Fwait-what\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M79SQ4WQB5YZ7Q2A87JVR219","verify","Verify before answering whether something works, still passes, is gone, is used, or is correct — and whenever the user says \"can you confirm\", \"are you sure\", \"did that actually work\", or reports something is \"still\" broken. Produces the answer plus the evidence that would have falsified it. A failed GitHub Actions run is skill-tree:debug-ci instead.","https:\u002F\u002Fgithub.com\u002Fdannybrown37\u002Fskill-tree\u002Fblob\u002Fmain\u002Fskills\u002Fverify\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M79SQ0GKSM5891DKPXE8J7TZ","ui-designer","Design or restyle a web UI — landing pages, dashboards, docs sites, app chrome — or when the user asks why a site \"looks generic\", \"looks like a template\", or wants it to feel intentional. A running list of design lessons learned, applied as rules rather than suggestions.","https:\u002F\u002Fgithub.com\u002Fdannybrown37\u002Fskill-tree\u002Fblob\u002Fmain\u002Fskills\u002Fui-designer\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M79SPVN5C0XYAXWBH9HD1YF1","two-axis-review","Two-axis review of changes since a fixed point (commit, tag, HEAD~N, or default HEAD~1): Standards (does the code follow this repo's conventions?) and Spec (does the code do what it should?). Axes run as parallel sub-agents so neither masks the other. Use when the user says \"review against the spec\", \"does this follow our conventions\", \"standards and spec review\", or \"two-axis review\". Not a correctness bug hunt — that's the built-in `\u002Fcode-review`.","https:\u002F\u002Fgithub.com\u002Fdannybrown37\u002Fskill-tree\u002Fblob\u002Fmain\u002Fskills\u002Ftwo-axis-review\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":19},"01M79SPRT8GV1RPQ2VVR9K08BB","tui-screenshots","Use for generating or refreshing TUI screenshots for docs — \"regenerate the screenshots\", \"the README screenshots are stale\". Drives a Textual\u002FTUI app headlessly and exports SVG. Not for reading a user's screenshot — that is `screenshot`.","https:\u002F\u002Fgithub.com\u002Fdannybrown37\u002Fskill-tree\u002Fblob\u002Fmain\u002Fskills\u002Ftui-screenshots\u002FSKILL.md",[],[],{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":19},"01M79SPNVJQ0WNWH7PBEM5Y463","to-tickets","Break a spec, plan, or conversation into tracer-bullet vertical-slice tickets with blocking edges — \"turn this into tickets\", \"break this down\", \"what's the work?\". Pairs with skill-tree:to-spec upstream and skill-tree:handoff downstream.","https:\u002F\u002Fgithub.com\u002Fdannybrown37\u002Fskill-tree\u002Fblob\u002Fmain\u002Fskills\u002Fto-tickets\u002FSKILL.md",[],[]]