返回顶部
d

db-design

Deep database design workflow—entities and relationships, keys and constraints, normalization vs denormalization, indexing strategy, integrity, and operational concerns. Use when designing OLTP schemas or reviewing greenfield data models.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
114
下载量
0
收藏
概述
安装方式
版本历史

db-design

# DB Design Good OLTP design balances integrity, write paths, query patterns, and evolution—not “third normal form everywhere.” ## When to Offer This Workflow **Trigger conditions:** - Greenfield service schema or major new domain - Performance or integrity issues from ad-hoc tables - Multi-tenant isolation questions **Initial offer:** Use **six stages**: (1) domain & access patterns, (2) entities & relationships, (3) keys & constraints, (4) normalization trade-offs, (5) indexing & performance, (6) operations & evolution). Confirm RDBMS and scale expectations. --- ## Stage 1: Domain & Access Patterns **Goal:** List critical queries and writes: QPS, joins, filters, hot rows. **Exit condition:** Top access paths ranked by business importance. --- ## Stage 2: Entities & Relationships **Goal:** ER model; cardinality; optional vs required relationships. ### Practices - Clear table names; avoid opaque “data” blobs unless documented --- ## Stage 3: Keys & Constraints **Goal:** Primary keys (surrogate vs natural); foreign keys with explicit ON DELETE policy; unique constraints for business rules. ### Multi-tenant - `tenant_id` on rows that need isolation; composite keys or indexes as appropriate --- ## Stage 4: Normalization Trade-offs **Goal:** Normalize to reduce update anomalies; denormalize read hotspots with documented trade-offs. --- ## Stage 5: Indexing & Performance **Goal:** Indexes serve real queries; watch write amplification and index bloat. --- ## Stage 6: Operations & Evolution **Goal:** Migration strategy (expand/contract); backup/restore; PII columns flagged. --- ## Final Review Checklist - [ ] Access patterns drive schema - [ ] Keys, FKs, and constraints explicit - [ ] Multi-tenant isolation if applicable - [ ] Normalization decisions justified - [ ] Index plan aligned with queries - [ ] Migration and ops considerations noted ## Tips for Effective Guidance - NULL semantics and defaults matter for bugs and migrations. - Pair with **db-migrate** for online schema changes. ## Handling Deviations - Document stores: embed vs reference with consistency story.

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 db-design-1775984107 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 db-design-1775984107 技能

通过命令行安装

skillhub install db-design-1775984107

下载 Zip 包

⬇ 下载 db-design v1.0.0

文件大小: 1.76 KB | 发布时间: 2026-4-13 09:59

v1.0.0 最新 2026-4-13 09:59
db-design 1.0.0 – Initial release

- Introduces a structured six-stage workflow for relational database (OLTP) schema design and review.
- Covers domain and access patterns, entity & relationship modeling, key & constraint strategies, normalization vs denormalization, indexing, and operational concerns.
- Includes triggers for when to use the workflow, expected exit conditions, and a final review checklist.
- Provides specific multi-tenant considerations and high-level tips for schema evolution.
- Designed for both greenfield projects and performance/integrity reviews.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部