Habilidades nosql-expert
📦

nosql-expert

Seguro

Design Scalable NoSQL Databases

This skill provides expert guidance for designing distributed NoSQL databases (Cassandra, DynamoDB). It helps developers understand query-first modeling, single-table design, and avoid common pitfalls like hot partitions.

Suporta: Claude Codex Code(CC)
🥉 75 Bronze
1

Baixar o ZIP da skill

2

Upload no Claude

Vá em Configurações → Capacidades → Skills → Upload skill

3

Ative e comece a usar

Testar

A utilizar "nosql-expert". Help me design a Cassandra primary key for storing user orders where I need to query by user_id and sort by order_date descending.

Resultado esperado:

For this access pattern, use a composite primary key:

**Partition Key:** user_id (high cardinality - each user is a partition)
**Clustering Column:** order_date DESC (sorts orders by date within each partition)

```sql
CREATE TABLE orders_by_user (
user_id uuid,
order_id uuid,
order_date timestamp,
total decimal,
status text,
PRIMARY KEY (user_id, order_date)
) WITH CLUSTERING ORDER BY (order_date DESC);
```

This design ensures all orders for a user live in one partition (efficient), and they're automatically sorted by date.

A utilizar "nosql-expert". What are the key differences between SQL and NoSQL data modeling?

Resultado esperado:

**SQL vs Distributed NoSQL Mental Model:**

| Aspect | SQL (Relational) | NoSQL (Cassandra/DynamoDB) |
|-------|------------------|---------------------------|
| Modeling | Model entities + relationships | Model **queries first** |
| Joins | At read time (expensive) | Pre-computed at write time |
| Storage | Minimize duplication | Duplicate for read speed |
| Consistency | ACID (strong) | BASE (eventual) |
| Scaling | Vertical | Horizontal |

**Golden Rule:** In SQL, design data for *any* query. In NoSQL, design data for *specific* queries efficiently.

A utilizar "nosql-expert". Explain single-table design in DynamoDB

Resultado esperado:

**DynamoDB Single-Table Design:**

Store multiple entity types in one table using composite keys:

| PK | SK | Data |
|----|-----|------|
| USER#123 | PROFILE | {name: 'Ian', email: '...'} |
| USER#123 | ORDER#998 | {total: 50.00, status: 'shipped'} |
| USER#123 | ORDER#999 | {total: 12.00, status: 'pending'} |

**Query:** PK='USER#123' retrieves user + all orders in ONE request.

**Benefits:**
- Reduced application complexity
- Optimized capacity unit usage
- Single network round-trip for related data

Auditoria de Segurança

Seguro
v1 • 2/24/2026

This skill is purely educational documentation about NoSQL database design patterns. The static analyzer detected patterns (external_commands, weak_crypto, system_reconnaissance) that are FALSE POSITIVES - they are documentation examples of database table names, query syntax, and design concepts. No actual code execution, network calls, or file operations exist.

1
Arquivos analisados
114
Linhas analisadas
3
achados
1
Total de auditorias
Problemas de Baixo Risco (3)
False Positive: External Commands Detection
Static analyzer detected 'external_commands' pattern (Ruby/shell backtick execution) at multiple lines. These are FALSE POSITIVES - documentation examples showing database partition keys (e.g., USER#123), query syntax (e.g., PK='USER#123'), and Cassandra keywords (e.g., ALLOW FILTERING). This is a documentation skill containing only markdown text explaining NoSQL concepts.
False Positive: Weak Cryptographic Algorithm Detection
Static analyzer detected 'weak_crypto' patterns (17 occurrences). These are FALSE POSITIVES triggered by words like 'BASE' (BASE consistency model), 'horizontal' (scaling), 'partition', and 'key' in the database design context.
False Positive: System Reconnaissance Detection
Static analyzer detected 'system_reconnaissance' at lines discussing 'Tombstones' (Cassandra deletion markers) and 'ALLOW FILTERING' (performance anti-pattern). These are database design concepts, not system reconnaissance.
Auditado por: claude

Pontuação de qualidade

38
Arquitetura
100
Manutenibilidade
87
Conteúdo
50
Comunidade
99
Segurança
100
Conformidade com especificações

O Que Você Pode Construir

Design a new Cassandra schema

Architect a Cassandra primary key structure for an application that needs to query by user ID and date range efficiently.

Optimize DynamoDB single-table design

Refactor a DynamoDB table to store multiple entity types (users, orders, products) in one table using composite keys.

Fix hot partition issues

Identify and resolve hot partition problems in a high-traffic DynamoDB table by improving partition key cardinality.

Tente Estes Prompts

Basic Cassandra Key Design
Help me design a Cassandra primary key for a table that stores user events. I need to query by user_id and filter by event_type within a date range. What should my partition key and clustering columns be?
DynamoDB Single-Table Design
I have three entity types: Users, Orders, and Products. Design a single DynamoDB table using composite keys where I can fetch a user's profile and all their orders in one request.
Hot Partition Diagnosis
My DynamoDB table is experiencing throttling on one partition. The partition key is 'status' (values: 'active', 'pending', 'completed'). What's wrong and how do I fix it?
Migration from SQL to NoSQL
I have a relational schema with Author and Book tables joined by author_id. How should I model this in Cassandra or DynamoDB without joins?

Melhores Práticas

  • Always design partition keys with high cardinality to avoid hot partitions
  • Pre-compute joins at write time using denormalization instead of querying multiple tables
  • Use composite partition keys (e.g., USER#123#2024-01) to prevent partitions from exceeding 10GB

Evitar

  • Using low-cardinality partition keys like status='active' or gender='m' (creates hot partitions)
  • Using 'scatter-gather' queries that scan all partitions instead of targeting specific keys
  • Applying SQL modeling patterns (separate tables with foreign keys) to NoSQL databases

Perguntas Frequentes

What is query-first modeling?
Query-first modeling means designing your database schema around the specific queries your application needs, rather than trying to fit queries into an entity-based structure. List all access patterns first, then design tables to serve each pattern efficiently.
How do I choose a partition key?
Choose a partition key with high cardinality (many unique values) to distribute traffic evenly across nodes. Avoid low-cardinality keys like status or gender that would create hot partitions.
What is single-table design?
Single-table design stores multiple entity types in one DynamoDB table using composite partition/sort keys. This enables fetching related data (user + orders) in a single request.
What causes hot partitions?
Hot partitions occur when too much traffic hits a single partition key value. This limits throughput to one node's capacity. Fix by using composite keys or sharding (e.g., USER#123#2024-01).
Can I use joins in Cassandra or DynamoDB?
No. Neither Cassandra nor DynamoDB support joins. Instead, denormalize your data and store related data together, or use multiple separate tables optimized for each query pattern.
What is the difference between GSI and LSI in DynamoDB?
GSI (Global Secondary Index) spans the entire table across partitions and can be created anytime. LSI (Local Secondary Index) is scoped to a single partition and must be created at table creation time.

Detalhes do Desenvolvedor

Estrutura de arquivos

📄 SKILL.md