system-and-data-design
安装方式
先用 Prompt 核对来源与依赖。也可下载安装包。
用 AI 助手安装
复制提示词,让助手先核对固定版本和依赖。
查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "system-and-data-design":https://skillpi.com/zh/skills/deepskill-330c8f3d98c5d536cb192d590246767ea41c4515cd0da92ad86dbf722406cd25。安装前核对上游来源和版本:https://github.com/AnastasiyaW/codex-claude-code-config。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。
来源与配置
github.com
配置方式待核实
请查看原始来源中的适用工具、依赖和权限要求。
安装实测待补充
判断系统可行性并确定数据存放方案:先分析需求与负载并做粗略容量估算,评估是否需要缓存、队列、负载均衡器或 CDN,深入分析数据层(存储引擎、索引、复制、分区、事务与一致性、批处理与流处理)。适用于评估容量与扩展性、选择数据库/缓存/队列/索引、回答可否支撑与所需机器数、是否需要只读副本或分片、是否采用最终一致性、分析大规模查询变慢原因、或设计数据摄取与处理流水线。不适用于模块边界或依赖方向划分、函数级代码质量评估、对大型代码的重构建议,或针对低流量内部工具的简化部署建议。
介绍来源: third_party · AnastasiyaW · 0.0.1 参考来源
SkillPi 解读
- 能完成的任务
- 翻译待完成,请参阅来源文档。
- 软件、账号及付费要求
- 翻译待完成,请参阅来源文档。
- 实测状态
- 未测试
文件浏览
Frontmatter
name: system-and-data-design
description: >
Decide whether the system will hold, and where the data lives: requirements and load
first, then back-of-the-envelope numbers, building blocks (cache, queue, load
balancer, CDN), and the data layer in depth — storage engines, indexes, replication,
partitioning, transactions and consistency, batch vs stream. Use when sizing or
scaling anything; choosing a database, cache, queue or index; when asked "will this
hold", "how many machines", "which database", "do we need a queue", "read replica",
"sharding", "eventual consistency", "why is this query slow at scale"; when designing
an ingestion or processing pipeline; or when a service is slow under load rather than
wrong. Do NOT use for module layout, dependency direction or domain boundaries (use
architecture-first), for function- and naming-level quality (use code-complexity), for
restructuring code that is already too large (use refactoring-safely), or for a
low-traffic internal tool where the honest answer is one process and one database.System and data design — will it hold, and where does the data live
Two questions that are usually asked together and answered separately, badly. Capacity without storage internals gives a diagram that cannot be built; storage internals without capacity gives a database choice with no reason behind it.
Scope guard — read first
The most common failure here is answering at the wrong scale.
| Situation | Honest answer |
|---|---|
| Internal tool, tens of users | One process, one database, no cache. Stop. |
| Product with real traffic, single region | Estimate first; add a cache and a queue only where the numbers say |
| Multi-region, or data outgrowing one machine | Full pass: estimation → building blocks → replication/partitioning → consistency |
Adding a cache before measuring is the canonical way to convert one problem into two.
Step 1 — requirements before architecture
- Functional: what must it actually do? Write it as verbs, not components.
- Non-functional, with numbers: users, requests/sec at peak, payload size, growth, read:write ratio, acceptable latency, acceptable staleness, retention.
- Constraints: budget, team size, existing stack, compliance, where data may live.
"Acceptable staleness" is the single most useful number and the one nobody asks for. It decides caching, replication and consistency all at once.
Step 2 — back-of-the-envelope, before any diagram
Estimate storage/day, bandwidth at peak, QPS, and working-set size. The point is not precision; it is discovering that the answer is "one machine" or "this cannot work as described" before drawing anything.
Anchors worth remembering: memory reads are ~100ns, SSD ~100µs, a same-region round trip ~0.5ms, cross-continent ~150ms. Anything crossing a network is ~1000× a memory access — which is why one N+1 query pattern outweighs most micro-optimisation.
Step 3 — building blocks, each with a reason
| Block | Add it when | Cost you accept |
|---|---|---|
| Cache | Read-heavy, tolerable staleness, measured hot set | Invalidation becomes your problem |
| Queue | Work can be async; spikes must be absorbed | Ordering, retries, duplicate delivery |
| Read replica | Reads dominate; stale reads acceptable | Replication lag becomes visible to users |
| Partitioning | One machine cannot hold data or throughput | Cross-partition queries and transactions get hard |
| CDN | Static or cacheable content, geographically spread | Purge and versioning discipline |
Each row is a trade, not an upgrade. A block added without its reason written down is a future mystery.
Step 4 — the data layer
- Storage engines: log-structured (LSM) favours writes and compaction; B-tree favours predictable reads and in-place updates. Choose by the workload's read:write shape, not by brand.
- Indexes are a write-cost you pay for a read-benefit. An index nobody's query plan uses is pure cost.
- Replication: single-leader is the default and enough for most systems; multi-leader and leaderless buy availability and pay in conflict resolution you must then design.
- Partitioning: choose the key by access pattern, not by what looks even. Hot keys and unbounded partitions are the two failures; both are visible in a histogram before they are visible in production.
- Transactions: know which isolation level you actually get. Read-committed does not prevent lost updates; "we use transactions" is not a consistency argument.
- Batch vs stream: batch for correctness and reprocessing, stream for freshness. Streams that cannot be replayed lose the ability to fix a bug retroactively.
Review pass
- Is every component justified by a number, or by habit?
- What happens at 10× — which part breaks first, and is that acceptable?
- Where can it lose data, and is that written down?
- What is the failure mode of each dependency: degrade, queue, or fail loudly?
- Does any user-visible read cross a replication lag nobody bounded?
References — load on demand
references/system-design/four-step-process.md,estimation-numbers.md,building-blocks.md,database-scaling.md,common-designs.md,reliability-operations.mdreferences/ddia-systems/storage-engines.md,data-models.md,replication.md,partitioning.md,transactions.md,batch-stream.md,fault-tolerance.md*-original.md— the source skills' own framework prose, kept verbatim
Gotchas
- Designing for a scale you do not have. The cost is paid now, the benefit maybe never. Estimate first; the estimate frequently says "one machine".
- Cache as a fix for a slow query. It hides the query and adds invalidation. Fix the query, then decide about the cache.
- Eventual consistency chosen by accident. A read replica added for speed silently makes some reads stale. Decide which reads may be stale, and say so.
- The queue that became a database. Unbounded retention plus a consumer that never catches up is a data store with none of the guarantees of one.
Troubleshooting
| Symptom | Likely cause | Where to look |
|---|---|---|
| Fine in test, slow in production | Working set exceeds memory; disk seeks per request | Storage engine, index coverage |
| Latency spikes at intervals | Compaction, GC, or a cron competing for IO | Storage engine internals, host metrics |
| One shard hot, others idle | Partition key follows structure, not access | Partitioning |
| Users see their own write disappear | Read served by a lagging replica | Replication, read-your-writes |
| Duplicate side effects | At-least-once delivery without idempotency | Queue semantics |
版本历史
-
v2026.10.24
GitHub ↗
原版更新说明
Three ideas from this month's agent-harness news, adopted as checks rather than prompts. ## New - **Output legibility** — [`docs/output-legibility.md`](https://github.com/AnastasiyaW/codex-claude-code-config/blob/main/docs/output-legibility.md). Karpathy's readability ladder (STE-style text, diagram, HTML, video), plus the two ASD-STE100 rules that need no licensed dictionary: one concept keeps one term, and sentences stay short. - **`scripts/term_drift_check.py`** — checks agent output against a project glossary. It flags synonyms of your terms (`stem*` covers inflection, so it works in Russian too) and overlong sentences, and skips code, URLs and HTML comments. Exit `0` clean, `1` findings, `2` not checked. It ships with a self-test whose must-fail controls catch six deliberate breaks of the logic. - **Bounded harness-improvement pilot** — [`docs/harness-improvement-pilot.md`](https://github.com/AnastasiyaW/codex-claude-code-config/blob/main/docs/harness-improvement-pilot.md). The method behind Google Research's Harness², without the auto-patcher: a frozen suite with a held-out case, one change per candidate, strict improvement and no safety regression. - **Dead-code sweep** — a new reference in the `refactoring-safely` skill, after OpenAI's GPT-6 maintenance guide. It covers a read-only audit with production evidence and one small draft PR per removal, and keeps killswitches and safeguards out of scope. ## Changed - `rules/quality-code.md`: when you change code, update or delete the comment next to it in the same commit. Research suggests a wrong or stale comment misleads a model more than a missing one. - `CLAUDE.md`: new Harness² and Output Legibility sections. Full changelog: [`UPDATES.md`](https://github.com/AnastasiyaW/codex-claude-code-config/blob/main/UPDATES.md) · PRs #18, #19
当前收录版本
0.0.1
质量评测
满分100 · 来自 SkillPi LAB 实验室的评测报告。
亮点
- 提供系统容量估算与数据架构设计的完整方法论
- 明确区分适用与不适用场景,避免误用
- 涵盖从需求收集到故障排查的全生命周期指导
亮点
- 触发词覆盖多种自然语言提问变体
- 边界清晰,与架构优先、代码复杂度等 Skill 无重叠
- description 位置正确且内容完整
亮点
- 四步流程结构清晰,每步有明确目标
- 包含多个实用表格(场景判断、构建块、故障排查)
- frontmatter 完整,文档长度适中
待提升项
-
引用文件缺失 原报告严重程度:重大
SKILL.md 引用了 references/system-design/*.md 和 references/ddia-systems/*.md 等文件,但未传入任何引用文件,影响用户获取完整参考资料。
改进建议:请补充所有被引用的参考文件,或移除引用链接以避免误导用户。
亮点
- 覆盖缓存、队列、复制、分区等核心组件的 trade-off 分析
- 明确提示 eventual consistency、分区热点等常见陷阱
- 提供可操作的故障排查对照表
取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。
正文静态检测
100 / 100 · skillpi-20261123-no-r3-v1
正文未命中当前规则。
分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。
权限与使用前检查
根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。
未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。
安全评级与访问范围
safe · 静态证据核验,不代表运行安全保证。
翻译待完成,请参阅来源文档。
使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。
用户讨论
还没有已核实的点评。