nosql-expert
Skill này làm gì
Agent này giúp thiết kế cơ sở dữ liệu NoSQL phân tán như Cassandra và DynamoDB. Nó tập trung vào việc tổ chức dữ liệu dựa trên các câu hỏi bạn sẽ đặt ra, thay vì cách làm trong cơ sở dữ liệu truyền thống.
Khi nào nên dùng
- ✓Khi lên kế hoạch cho một hệ thống cần xử lý nhiều dữ liệu và người dùng.
- ✓Khi chọn giữa các loại cơ sở dữ liệu NoSQL khác nhau.
- ✓Khi cần khắc phục tình trạng chậm trong cơ sở dữ liệu NoSQL hiện có.
Liên kết skill
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/nosql-expert/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Tôi cần giúp thiết kế một bảng DynamoDB để lưu thông tin người dùng và đơn hàng của họ, tập trung vào việc tra cứu nhanh theo ID người dùng.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent dạy bạn nghĩ về các truy vấn sẽ thực hiện trước. Sau đó, nó tổ chức dữ liệu sao cho các truy vấn đó nhanh nhất có thể, ngay cả khi điều đó nghĩa là phải lặp lại một số thông tin.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
NoSQL Expert Patterns (Cassandra & DynamoDB)
Overview
This skill provides professional mental models and design patterns for distributed wide-column and key-value stores (specifically Apache Cassandra and Amazon DynamoDB).
Unlike SQL (where you model data entities), or document stores (like MongoDB), these distributed systems require you to model your queries first.
When to Use
- Designing for Scale: Moving beyond simple single-node databases to distributed clusters.
- Technology Selection: Evaluating or using Cassandra, ScyllaDB, or DynamoDB.
- Performance Tuning: Troubleshooting "hot partitions" or high latency in existing NoSQL systems.
- Microservices: Implementing "database-per-service" patterns where highly optimized reads are required.
The Mental Shift: SQL vs. Distributed NoSQL
| Feature | SQL (Relational) | Distributed NoSQL (Cassandra/DynamoDB) |
|---|---|---|
| Data modeling | Model Entities + Relationships | Model Queries (Access Patterns) |
| Joins | CPU-intensive, at read time | Pre-computed (Denormalized) at write time |
| Storage cost | Expensive (minimize duplication) | Cheap (duplicate data for read speed) |
| Consistency | ACID (Strong) | BASE (Eventual) / Tunable |
| Scalability | Vertical (Bigger machine) | Horizontal (More nodes/shards) |
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.
Core Design Patterns
1. Query-First Modeling (Access Patterns)
You typically cannot "add a query later" without migration or creating a new table/index.
Process:
- List all Entities (User, Order, Product).
- List all Access Patterns ("Get User by Email", "Get Orders by User sorted by Date").
- Design Table(s) specifically to serve those patterns with a single lookup.
2. The Partition Key is King
Data is distributed across physical nodes based on the Partition Key (PK).
- Goal: Even distribution of data and traffic.
- Anti-Pattern: Using a low-cardinality PK (e.g.,
status="active"orgender="m") creates Hot Partitions, limiting throughput to a single node's capacity. - Best Practice: Use high-cardinality keys (User IDs, Device IDs, Composite Keys).
3. Clustering / Sort Keys
Within a partition, data is sorted on disk by the Clustering Key (Cassandra) or Sort Key (DynamoDB).
- This allows for efficient Range Queries (e.g.,
WHERE user_id=X AND date > Y). - It effectively pre-sorts your data for specific retrieval requirements.
4. Single-Table Design (Adjacency Lists)
Primary use: DynamoDB (but concepts apply elsewhere)
Storing multiple entity types in one table to enable pre-joined reads.
| PK (Partition) | SK (Sort) | Data Fields... |
|---|---|---|
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" - Result: Fetches User Profile AND all Orders in one network request.
5. Denormalization & Duplication
Don't be afraid to store the same data in multiple tables to serve different query patterns.
- Table A:
users_by_id(PK: uuid) - Table B:
users_by_email(PK: email)
Trade-off: You must manage data consistency across tables (often using eventual consistency or batch writes).
Specific Guidance
Apache Cassandra / ScyllaDB
- Primary Key Structure:
((Partition Key), Clustering Columns) - No Joins, No Aggregates: Do not try to
JOINorGROUP BY. Pre-calculate aggregates in a separate counter table. - Avoid
ALLOW FILTERING: If you see this in production, your data model is wrong. It implies a full cluster scan. - Writes are Cheap: Inserts and Updates are just appends to the LSM tree. Don't worry about write volume as much as read efficiency.
- Tombstones: Deletes are expensive markers. Avoid high-velocity delete patterns (like queues) in standard tables.
AWS DynamoDB
- GSI (Global Secondary Index): Use GSIs to create alternative views of your data (e.g., "Search Orders by Date" instead of by User).
- Note: GSIs are eventually consistent.
…
Câu hỏi thường gặp
Khác biệt chính giữa SQL và NoSQL cho người mới là gì?
Trong SQL, bạn tổ chức dữ liệu thành bảng có quan hệ rồi đặt bất kỳ câu hỏi nào. Trong NoSQL (như Cassandra/DynamoDB), bạn tổ chức dữ liệu theo những câu hỏi cụ thể sẽ đặt ra, nên câu trả lời rất nhanh.
“Hot partition” là gì?
Đó là khi quá nhiều dữ liệu hoặc truy cập tập trung vào một điểm của cơ sở dữ liệu, tạo ra nút thắt cổ chai và làm hệ thống chậm. Mục tiêu là phân bố đều mọi thứ.
Tôi có thể dùng agent này cho MongoDB không?
Agent này tập trung vào cơ sở dữ liệu NoSQL dạng wide-column và key-value như Cassandra và DynamoDB. MongoDB thuộc loại khác (document) và có thể cần cách tiếp cận khác.
Chi tiết
Mô tả gốc của tác giả
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.
Độ phổ biến
- Sao GitHub
- 48k
- Vị trí xếp hạng
- #5310
- Giấy phép
- MIT
- Cập nhật
- 15/10/2026
Bình luận
- …
Thêm skill từ kho mã này
00-andruia-consultant
48kGiúp agent của bạn bắt đầu hoặc cải thiện các dự án AI. Phân tích mã, gợi ý công cụ và lập kế hoạch hành động bằng tiếng Tây Ban Nha.
007
48kCho phép agent của bạn thực hiện kiểm toán bảo mật và mô hình hóa mối đe dọa. Hữu ích để bảo vệ dự án khỏi các cuộc tấn công và lỗ hổng.
10-andruia-skill-smith
48kGiúp agent của bạn tạo hoặc cải thiện các công cụ AI. Xác định cách công cụ hoạt động, viết tài liệu và kiểm tra cấu trúc.
20-andruia-niche-intelligence
48kGiúp agent của bạn tạo bản tóm tắt về một ngành cụ thể. Hữu ích để hiểu bối cảnh, quy tắc, cách người dùng tương tác và rủi ro của dự án.
Skill tương tự
discrawl
394kCho phép agent của bạn tìm kiếm và tóm tắt kho lưu trữ tin nhắn Discord trên máy, kiểm tra độ mới của dữ liệu và đọc tin nhắn trực tiếp.
clickhouse-io
280kGiúp agent của bạn tối ưu truy vấn và schema trong ClickHouse theo thực hành tốt nhất cho phân tích dữ liệu hiệu năng cao khi truy vấn chậm.
scientific-db-pubmed-database
280kGiúp agent của bạn tìm bài báo khoa học trong lĩnh vực y sinh. Hữu ích cho nghiên cứu cần thông tin y khoa cụ thể.