{"id":"1204a419-00b4-4f0c-b070-5106b12cd883","shortId":"AZnCkD","kind":"skill","title":"nosql-expert","tagline":"Expert guidance for distributed NoSQL databases (Cassandra, DynamoDB). Focuses on mental models, query-first modeling, single-table design, and avoiding hot partitions in high-scale systems.","description":"# NoSQL Expert Patterns (Cassandra & DynamoDB)\n\n## Overview\n\nThis skill provides professional mental models and design patterns for **distributed wide-column and key-value stores** (specifically Apache Cassandra and Amazon DynamoDB).\n\nUnlike SQL (where you model data entities), or document stores (like MongoDB), these distributed systems require you to **model your queries first**.\n\n## When to Use\n- **Designing for Scale**: Moving beyond simple single-node databases to distributed clusters.\n- **Technology Selection**: Evaluating or using **Cassandra**, **ScyllaDB**, or **DynamoDB**.\n- **Performance Tuning**: Troubleshooting \"hot partitions\" or high latency in existing NoSQL systems.\n- **Microservices**: Implementing \"database-per-service\" patterns where highly optimized reads are required.\n\n## The Mental Shift: SQL vs. Distributed NoSQL\n\n| Feature | SQL (Relational) | Distributed NoSQL (Cassandra/DynamoDB) |\n| :--- | :--- | :--- |\n| **Data modeling** | Model Entities + Relationships | Model **Queries** (Access Patterns) |\n| **Joins** | CPU-intensive, at read time | **Pre-computed** (Denormalized) at write time |\n| **Storage cost** | Expensive (minimize duplication) | Cheap (duplicate data for read speed) |\n| **Consistency** | ACID (Strong) | **BASE (Eventual)** / Tunable |\n| **Scalability** | Vertical (Bigger machine) | **Horizontal** (More nodes/shards) |\n\n> **The Golden Rule:** In SQL, you design the data model to answer *any* query. In NoSQL, you design the data model to answer *specific* queries efficiently.\n\n## Core Design Patterns\n\n### 1. Query-First Modeling (Access Patterns)\n\nYou typically cannot \"add a query later\" without migration or creating a new table/index.\n\n**Process:**\n1.  **List all Entities** (User, Order, Product).\n2.  **List all Access Patterns** (\"Get User by Email\", \"Get Orders by User sorted by Date\").\n3.  **Design Table(s)** specifically to serve those patterns with a single lookup.\n\n### 2. The Partition Key is King\n\nData is distributed across physical nodes based on the **Partition Key (PK)**.\n-   **Goal:** Even distribution of data and traffic.\n-   **Anti-Pattern:** Using a low-cardinality PK (e.g., `status=\"active\"` or `gender=\"m\"`) creates **Hot Partitions**, limiting throughput to a single node's capacity.\n-   **Best Practice:** Use high-cardinality keys (User IDs, Device IDs, Composite Keys).\n\n### 3. Clustering / Sort Keys\n\nWithin a partition, data is sorted on disk by the **Clustering Key (Cassandra)** or **Sort Key (DynamoDB)**.\n-   This allows for efficient **Range Queries** (e.g., `WHERE user_id=X AND date > Y`).\n-   It effectively pre-sorts your data for specific retrieval requirements.\n\n### 4. Single-Table Design (Adjacency Lists)\n\n*Primary use: DynamoDB (but concepts apply elsewhere)*\n\nStoring multiple entity types in one table to enable pre-joined reads.\n\n| PK (Partition) | SK (Sort) | Data Fields... |\n| :--- | :--- | :--- |\n| `USER#123` | `PROFILE` | `{ name: \"Ian\", email: \"...\" }` |\n| `USER#123` | `ORDER#998` | `{ total: 50.00, status: \"shipped\" }` |\n| `USER#123` | `ORDER#999` | `{ total: 12.00, status: \"pending\" }` |\n\n-   **Query:** `PK=\"USER#123\"`\n-   **Result:** Fetches User Profile AND all Orders in **one network request**.\n\n### 5. Denormalization & Duplication\n\nDon't be afraid to store the same data in multiple tables to serve different query patterns.\n-   **Table A:** `users_by_id` (PK: uuid)\n-   **Table B:** `users_by_email` (PK: email)\n\n*Trade-off: You must manage data consistency across tables (often using eventual consistency or batch writes).*\n\n## Specific Guidance\n\n### Apache Cassandra / ScyllaDB\n\n-   **Primary Key Structure:** `((Partition Key), Clustering Columns)`\n-   **No Joins, No Aggregates:** Do not try to `JOIN` or `GROUP BY`. Pre-calculate aggregates in a separate counter table.\n-   **Avoid `ALLOW FILTERING`:** If you see this in production, your data model is wrong. It implies a full cluster scan.\n-   **Writes are Cheap:** Inserts and Updates are just appends to the LSM tree. Don't worry about write volume as much as read efficiency.\n-   **Tombstones:** Deletes are expensive markers. Avoid high-velocity delete patterns (like queues) in standard tables.\n\n### AWS DynamoDB\n\n-   **GSI (Global Secondary Index):** Use GSIs to create alternative views of your data (e.g., \"Search Orders by Date\" instead of by User).\n    -   *Note:* GSIs are eventually consistent.\n-   **LSI (Local Secondary Index):** Sorts data differently *within* the same partition. Must be created at table creation time.\n-   **WCU / RCU:** Understand capacity modes. Single-table design helps optimize consumed capacity units.\n-   **TTL:** Use Time-To-Live attributes to automatically expire old data (free delete) without creating tombstones.\n\n## Expert Checklist\n\nBefore finalizing your NoSQL schema:\n\n-   [ ] **Access Pattern Coverage:** Does every query pattern map to a specific table or index?\n-   [ ] **Cardinality Check:** Does the Partition Key have enough unique values to spread traffic evenly?\n-   [ ] **Split Partition Risk:** For any single partition (e.g., a single user's orders), will it grow indefinitely? (If > 10GB, you need to \"shard\" the partition, e.g., `USER#123#2024-01`).\n-   [ ] **Consistency Requirement:** Can the application tolerate eventual consistency for this read pattern?\n\n## Common Anti-Patterns\n\n❌ **Scatter-Gather:** Querying *all* partitions to find one item (Scan).\n❌ **Hot Keys:** Putting all \"Monday\" data into one partition.\n❌ **Relational Modeling:** Creating `Author` and `Book` tables and trying to join them in code. (Instead, embed Book summaries in Author, or duplicate Author info in Books).\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.","tags":["nosql","expert","antigravity","awesome","skills","sickn33","agent-skills","agentic-skills","ai-agent-skills","ai-agents","ai-coding","ai-workflows"],"capabilities":["skill","source-sickn33","skill-nosql-expert","topic-agent-skills","topic-agentic-skills","topic-ai-agent-skills","topic-ai-agents","topic-ai-coding","topic-ai-workflows","topic-antigravity","topic-antigravity-skills","topic-claude-code","topic-claude-code-skills","topic-codex-cli","topic-codex-skills"],"categories":["antigravity-awesome-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/sickn33/antigravity-awesome-skills/nosql-expert","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add sickn33/antigravity-awesome-skills","source_repo":"https://github.com/sickn33/antigravity-awesome-skills","install_from":"skills.sh"}},"qualityScore":"0.700","qualityRationale":"deterministic score 0.70 from registry signals: · indexed on github topic:agent-skills · 34666 github stars · SKILL.md body (5,968 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-04-23T06:51:38.607Z","embedding":null,"createdAt":"2026-04-18T21:41:27.779Z","updatedAt":"2026-04-23T06:51:38.607Z","lastSeenAt":"2026-04-23T06:51:38.607Z","tsv":"'-01':749 '1':225,247 '10gb':738 '12.00':445 '123':427,433,441,451,747 '2':254,283 '2024':748 '3':270,347 '4':393 '5':463 '50.00':437 '998':435 '999':443 'access':156,230,257,692 'acid':184 'across':292,505 'activ':319 'add':235 'adjac':398 'afraid':469 'aggreg':529,541 'allow':369,548 'altern':617 'amazon':62 'answer':207,218 'anti':309,764 'anti-pattern':308,763 'apach':59,516 'append':575 'appli':405 'applic':754 'ask':845 'attribut':674 'author':789,805,808 'automat':676 'avoid':25,547,596 'aw':607 'b':491 'base':186,295 'batch':512 'best':334 'beyond':93 'bigger':191 'book':791,802,811 'boundari':853 'calcul':540 'cannot':234 'capac':333,657,666 'cardin':315,339,706 'cassandra':10,36,60,107,363,517 'cassandra/dynamodb':148 'cheap':177,569 'check':707 'checklist':686 'clarif':847 'clear':820 'cluster':101,348,361,524,565 'code':799 'column':52,525 'common':762 'composit':345 'comput':167 'concept':404 'consist':183,504,510,635,750,757 'consum':665 'core':222 'cost':173 'counter':545 'coverag':694 'cpu':160 'cpu-intens':159 'creat':242,323,616,649,683,788 'creation':652 'criteria':856 'data':69,149,179,204,215,289,305,354,388,424,474,503,557,621,641,679,782 'databas':9,98,126 'database-per-servic':125 'date':269,380,626 'delet':592,600,681 'denorm':168,464 'describ':824 'design':23,46,89,202,213,223,271,397,662 'devic':343 'differ':480,642 'disk':358 'distribut':7,49,77,100,141,146,291,303 'document':72 'duplic':176,178,465,807 'dynamodb':11,37,63,110,367,402,608 'e.g':317,374,622,727,745 'effect':383 'effici':221,371,590 'elsewher':406 'email':262,431,494,496 'emb':801 'enabl':415 'enough':713 'entiti':70,152,250,409 'environ':836 'environment-specif':835 'evalu':104 'even':302,719 'eventu':187,509,634,756 'everi':696 'exist':120 'expens':174,594 'expert':3,4,34,685,841 'expir':677 'featur':143 'fetch':453 'field':425 'filter':549 'final':688 'find':773 'first':18,85,228 'focus':12 'free':680 'full':564 'gather':768 'gender':321 'get':259,263 'global':610 'goal':301 'golden':197 'group':536 'grow':735 'gsi':609 'gsis':614,632 'guidanc':5,515 'help':663 'high':30,117,131,338,598 'high-cardin':337 'high-scal':29 'high-veloc':597 'horizont':193 'hot':26,114,324,777 'ian':430 'id':342,344,377,487 'implement':124 'impli':562 'indefinit':736 'index':612,639,705 'info':809 'input':850 'insert':570 'instead':627,800 'intens':161 'item':775 'join':158,418,527,534,796 'key':55,286,299,340,346,350,362,366,520,523,711,778 'key-valu':54 'king':288 'latenc':118 'later':238 'like':74,602 'limit':326,812 'list':248,255,399 'live':673 'local':637 'lookup':282 'low':314 'low-cardin':313 'lsi':636 'lsm':578 'm':322 'machin':192 'manag':502 'map':699 'marker':595 'match':821 'mental':14,43,137 'microservic':123 'migrat':240 'minim':175 'miss':858 'mode':658 'model':15,19,44,68,82,150,151,154,205,216,229,558,787 'monday':781 'mongodb':75 'move':92 'much':587 'multipl':408,476 'must':501,647 'name':429 'need':740 'network':461 'new':244 'node':97,294,331 'nodes/shards':195 'nosql':2,8,33,121,142,147,211,690 'nosql-expert':1 'note':631 'often':507 'old':678 'one':412,460,774,784 'optim':132,664 'order':252,264,434,442,458,624,732 'output':830 'overview':38 'partit':27,115,285,298,325,353,421,522,646,710,721,726,744,771,785 'pattern':35,47,129,157,224,231,258,278,310,482,601,693,698,761,765 'pend':447 'per':127 'perform':111 'permiss':851 'physic':293 'pk':300,316,420,449,488,495 'practic':335 'pre':166,385,417,539 'pre-calcul':538 'pre-comput':165 'pre-join':416 'pre-sort':384 'primari':400,519 'process':246 'product':253,555 'profession':42 'profil':428,455 'provid':41 'put':779 'queri':17,84,155,209,220,227,237,373,448,481,697,769 'query-first':16,226 'queue':603 'rang':372 'rcu':655 'read':133,163,181,419,589,760 'relat':145,786 'relationship':153 'request':462 'requir':79,135,392,751,849 'result':452 'retriev':391 'review':842 'risk':722 'rule':198 'safeti':852 'scalabl':189 'scale':31,91 'scan':566,776 'scatter':767 'scatter-gath':766 'schema':691 'scope':823 'scylladb':108,518 'search':623 'secondari':611,638 'see':552 'select':103 'separ':544 'serv':276,479 'servic':128 'shard':742 'shift':138 'ship':439 'simpl':94 'singl':21,96,281,330,395,660,725,729 'single-nod':95 'single-t':20,394,659 'sk':422 'skill':40,815 'skill-nosql-expert' 'sort':267,349,356,365,386,423,640 'source-sickn33' 'specif':58,219,274,390,514,702,837 'speed':182 'split':720 'spread':717 'sql':65,139,144,200 'standard':605 'status':318,438,446 'stop':843 'storag':172 'store':57,73,407,471 'strong':185 'structur':521 'substitut':833 'success':855 'summari':803 'system':32,78,122 'tabl':22,272,396,413,477,483,490,506,546,606,651,661,703,792 'table/index':245 'task':819 'technolog':102 'test':839 'throughput':327 'time':164,171,653,671 'time-to-l':670 'toler':755 'tombston':591,684 'topic-agent-skills' 'topic-agentic-skills' 'topic-ai-agent-skills' 'topic-ai-agents' 'topic-ai-coding' 'topic-ai-workflows' 'topic-antigravity' 'topic-antigravity-skills' 'topic-claude-code' 'topic-claude-code-skills' 'topic-codex-cli' 'topic-codex-skills' 'total':436,444 'trade':498 'trade-off':497 'traffic':307,718 'treat':828 'tree':579 'tri':532,794 'troubleshoot':113 'ttl':668 'tunabl':188 'tune':112 'type':410 'typic':233 'understand':656 'uniqu':714 'unit':667 'unlik':64 'updat':572 'use':88,106,311,336,401,508,613,669,813 'user':251,260,266,341,376,426,432,440,450,454,485,492,630,730,746 'uuid':489 'valid':838 'valu':56,715 'veloc':599 'vertic':190 'view':618 'volum':585 'vs':140 'wcu':654 'wide':51 'wide-column':50 'within':351,643 'without':239,682 'worri':582 'write':170,513,567,584 'wrong':560 'x':378 'y':381","prices":[{"id":"39a9b46c-9bb7-4430-8b25-fb28d461152e","listingId":"1204a419-00b4-4f0c-b070-5106b12cd883","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"sickn33","category":"antigravity-awesome-skills","install_from":"skills.sh"},"createdAt":"2026-04-18T21:41:27.779Z"}],"sources":[{"listingId":"1204a419-00b4-4f0c-b070-5106b12cd883","source":"github","sourceId":"sickn33/antigravity-awesome-skills/nosql-expert","sourceUrl":"https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/nosql-expert","isPrimary":false,"firstSeenAt":"2026-04-18T21:41:27.779Z","lastSeenAt":"2026-04-23T06:51:38.607Z"}],"details":{"listingId":"1204a419-00b4-4f0c-b070-5106b12cd883","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"sickn33","slug":"nosql-expert","github":{"repo":"sickn33/antigravity-awesome-skills","stars":34666,"topics":["agent-skills","agentic-skills","ai-agent-skills","ai-agents","ai-coding","ai-workflows","antigravity","antigravity-skills","claude-code","claude-code-skills","codex-cli","codex-skills","cursor","cursor-skills","developer-tools","gemini-cli","gemini-skills","kiro","mcp","skill-library"],"license":"mit","html_url":"https://github.com/sickn33/antigravity-awesome-skills","pushed_at":"2026-04-23T06:41:03Z","description":"Installable GitHub library of 1,400+ agentic skills for Claude Code, Cursor, Codex CLI, Gemini CLI, Antigravity, and more. Includes installer CLI, bundles, workflows, and official/community skill collections.","skill_md_sha":"fdb3f4b7bad4833ea5e67adfbe5c907691ed2f6a","skill_md_path":"skills/nosql-expert/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/nosql-expert"},"layout":"multi","source":"github","category":"antigravity-awesome-skills","frontmatter":{"name":"nosql-expert","description":"Expert guidance for distributed NoSQL databases (Cassandra, DynamoDB). Focuses on mental models, query-first modeling, single-table design, and avoiding hot partitions in high-scale systems."},"skills_sh_url":"https://skills.sh/sickn33/antigravity-awesome-skills/nosql-expert"},"updatedAt":"2026-04-23T06:51:38.607Z"}}