Token导航 LogoToken导航

Agent Skill · 研究检索

designing-distributed-systems(设计分布式系统)

designing-distributed-systems 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

designing-distributed-systems 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 41,613。

总安装 1,152周安装 49GitHub Stars 350下载 404核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:designing-distributed-systems(设计分布式系统)
来源仓库:https://github.com/ancoleman/ai-design-components
仓库路径:skills/designing-distributed-systems
安装命令:
npx skills add https://github.com/ancoleman/ai-design-components --skill designing-distributed-systems
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/ancoleman/ai-design-components --skill designing-distributed-systems

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

该技能指导分布式系统设计,涵盖 CAP 定理、一致性模型与容错策略。适用于微服务架构、跨地域部署与高可用系统开发,提供模式选型参考。结合复制、分区与负载均衡机制,帮助构建可扩展且可靠的云原生应用。安装前需确认宿主环境支持,注意可能调用外部工具或生成配置文档,建议核对原始 README。

designing-distributed-systems 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/designing-distributed-systems

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/ancoleman/ai-design-components --skill designi…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

designing-distributed-systems 怎么安装?

在终端执行 npx skills add https://github.com/ancoleman/ai-design-components --skill designing-distrib…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

designing-distributed-systems 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

designing-distributed-systems 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

designing-distributed-systems 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

designing-distributed-systems 用的人多吗?

公开数据是累计安装 1,152 次,近一周安装 49 次,下载 404 次,GitHub 350 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

designing-distributed-systems 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
designing-distributed-systems

设计分布式系统 · 本页

1,152350需要联网未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Designing Distributed Systems

Design scalable, reliable, and fault-tolerant distributed systems using proven patterns and consistency models.

Purpose

Distributed systems are the foundation of modern cloud-native applications. Understanding fundamental trade-offs (CAP theorem, PACELC), consistency models, replication patterns, and resilience strategies is essential for building systems that scale globally while maintaining correctness and availability.

When to Use This Skill

Apply when:

  • Designing microservices architectures with multiple services
  • Building systems that must scale across multiple datacenters or regions
  • Choosing between consistency vs availability during network partitions
  • Selecting replication strategies (single-leader, multi-leader, leaderless)
  • Implementing distributed transactions (saga pattern, event sourcing, CQRS)
  • Designing partition-tolerant systems with proper consistency guarantees
  • Building resilient services with circuit breakers, bulkheads, retries
  • Implementing service discovery and inter-service communication

Core Concepts

CAP Theorem Fundamentals

CAP Theorem: In a distributed system experiencing a network partition, choose between Consistency (C) or Availability (A). Partition tolerance (P) is mandatory.

Network partitions WILL occur → Always design for P

During partition:
├─ CP (Consistency + Partition Tolerance)
│  Use when: Financial transactions, inventory, seat booking
│  Trade-off: System unavailable during partition
│  Examples: HBase, MongoDB (default), etcd
│
└─ AP (Availability + Partition Tolerance)
   Use when: Social media, caching, analytics, shopping carts
   Trade-off: Stale reads possible, conflicts need resolution
   Examples: Cassandra, DynamoDB, Riak

PACELC: Extends CAP to consider normal operations (no partition).

  • If Partition: Choose Availability (A) or Consistency (C)
  • Else (normal): Choose Latency (L) or Consistency (C)

Consistency Models Spectrum

Strong Consistency ◄─────────────────────► Eventual Consistency
      │                    │                      │
  Linearizable      Causal Consistency     Convergent
  (Slowest,         (Middle Ground,        (Fastest,
   Most Consistent)  Causally Ordered)     Eventually Consistent)

Strong Consistency (Linearizability):

  • All operations appear atomically in sequential order
  • Reads always return most recent write
  • Use for: Bank balances, inventory stock, seat booking
  • Trade-off: Higher latency, reduced availability

Eventual Consistency:

  • If no new updates, all replicas eventually converge
  • Use for: Social feeds, product catalogs, user profiles, DNS
  • Trade-off: Stale reads possible, conflict resolution needed

Causal Consistency:

  • Causally related operations seen in same order by all nodes
  • Use for: Chat apps, collaborative editing, comment threads
  • Trade-off: More complex than eventual, requires causality tracking

Bounded Staleness:

  • Staleness bounded by time or version count
  • Use for: Real-time dashboards, leaderboards, monitoring
  • Trade-off: Must monitor lag, more complex than eventual

Replication Patterns

1. Leader-Follower (Single-Leader):

  • All writes to leader, replicated to followers
  • Followers handle reads (load distribution)
  • Synchronous: Wait for follower ACK (strong consistency, higher latency)
  • Asynchronous: Don't wait (eventual consistency, possible data loss)
  • Use for: Most common pattern, strong consistency with sync replication

2. Multi-Leader:

  • Multiple leaders accept writes in different datacenters
  • Leaders replicate to each other
  • Conflict resolution required: Last-Write-Wins, application merge, vector clocks
  • Use for: Multi-datacenter, low write latency, geo-distributed users
  • Trade-off: Conflict resolution complexity

3. Leaderless (Dynamo-style):

  • No single leader, quorum-based reads/writes
  • Quorum rule: W + R > N (W=write quorum, R=read quorum, N=replicas)
  • Example: N=5, W=3, R=2 → Strong consistency (overlap guaranteed)
  • Use for: Maximum availability, partition tolerance
  • Trade-off: Complexity, read repair needed

Partitioning Strategies

Hash Partitioning (Consistent Hashing):

  • Key → Hash(Key) → Partition assignment
  • Even distribution, minimal rebalancing when nodes added/removed
  • Use for: Point queries by ID, even distribution critical
  • Examples: Cassandra, DynamoDB, Redis Cluster

Range Partitioning:

  • Key ranges assigned to partitions (A-F, G-M, N-S, T-Z)
  • Enables range queries, ordered data
  • Risk: Hot spots if data skewed
  • Use for: Time-series data, leaderboards, range scans
  • Examples: HBase, Bigtable

Geographic Partitioning:

  • Partition by location (US-East, EU-West, APAC)
  • Use for: Data locality, GDPR compliance, low latency
  • Examples: Spanner, Cosmos DB

Resilience Patterns

Circuit Breaker:

[Closed] → Normal operation
   │ (failures exceed threshold)
   ▼
[Open] → Fail fast (don't call failing service)
   │ (timeout expires)
   ▼
[Half-Open] → Try single request
   │ success → [Closed]
   │ failure → [Open]
  • Prevents cascading failures
  • Fast-fail instead of waiting for timeout
  • See references/resilience-patterns.md

Bulkhead Isolation:

  • Isolate resources (thread pools, connection pools)
  • Failure in one partition doesn't affect others
  • Like ship compartments preventing total flooding

Timeout and Retry:

  • Timeout: Set deadlines, fail fast if exceeded
  • Retry: Exponential backoff with jitter
  • Idempotency: Ensure safe retry (critical)

Rate Limiting and Backpressure:

  • Protect services from overload
  • Token bucket, leaky bucket algorithms
  • Backpressure: Signal upstream to slow down

Transaction Patterns

Saga Pattern:

  • Coordinate distributed transactions across services
  • No distributed 2PC (two-phase commit)

Choreography: Services react to events

Order Service → OrderCreated event
Payment Service → listens → PaymentProcessed event
Inventory Service → listens → InventoryReserved event
(Compensating: if payment fails → InventoryReleased event)

Orchestration: Central coordinator

Saga Orchestrator:
1. Call Order Service
2. Call Payment Service
3. Call Inventory Service
(If step fails → call compensating transactions in reverse)

Event Sourcing:

  • Store state changes as immutable events
  • Rebuild state by replaying events
  • Audit trail, time travel, debugging
  • Trade-off: Query complexity, snapshot optimization

CQRS (Command Query Responsibility Segregation):

  • Separate read and write models
  • Write model: Normalized, transactional
  • Read model: Denormalized, cached, optimized
  • Use for: Different read/write patterns, high read:write ratio (10:1+)
  • Often paired with Event Sourcing

Service Discovery

Client-Side Discovery:

  • Client queries service registry (Consul, etcd, Eureka)
  • Client load balances and calls service directly
  • Pro: No proxy overhead
  • Con: Client complexity

Server-Side Discovery:

  • Client calls load balancer
  • Load balancer queries registry and routes
  • Pro: Simple clients
  • Con: Load balancer single point of failure

Service Mesh:

  • Sidecar proxies handle discovery, routing, retry, circuit breaking
  • Examples: Istio, Linkerd
  • Pro: Decouples communication logic from services
  • Con: Operational complexity

Caching Strategies

Cache-Aside (Lazy Loading):

Read:
1. Check cache → hit? return
2. Miss? Query database
3. Store in cache, return

Write-Through:

Write:
1. Write to cache
2. Cache writes to database synchronously
3. Return success

Write-Behind (Write-Back):

Write:
1. Write to cache
2. Return success
3. Cache writes to database asynchronously (batched)

Cache Invalidation:

  • TTL (Time-To-Live): Expire after duration
  • Event-based: Invalidate on data change
  • Manual: Explicit invalidation on update

Decision Frameworks

Choosing Consistency Model

Decision Tree:
├─ Money involved? → Strong Consistency
├─ Double-booking unacceptable? → Strong Consistency
├─ Causality important (chat, edits)? → Causal Consistency
├─ Read-heavy, stale tolerable? → Eventual Consistency
└─ Default? → Eventual (then strengthen if needed)

Choosing Replication Pattern

├─ Single region writes? → Leader-Follower
├─ Multi-region writes + conflicts OK? → Multi-Leader
├─ Multi-region writes + no conflicts? → Leader-Follower with failover
└─ Maximum availability? → Leaderless (quorum)

Choosing Partitioning Strategy

├─ Need range scans? → Range Partitioning (risk: hot spots)
├─ Data residency requirements? → Geographic Partitioning
└─ Default? → Hash Partitioning (consistent hashing)

Quick Reference Tables

CAP/PACELC System Comparison

SystemIf PartitionElse (Normal)Use Case
SpannerPCEC (strong)Global SQL
DynamoDBPAEL (eventual)High availability
CassandraPAEL (tunable)Wide-column store
MongoDBPCEC (default)Document store
Cosmos DBPA/PCEL/EC (5 levels)Multi-model

Consistency Model Use Cases

Use CaseConsistency Model
Bank account balanceStrong (Linearizable)
Seat booking (airline)Strong (Linearizable)
Inventory stock countStrong or Bounded
Shopping cartEventual
Product catalogEventual
Collaborative editingCausal
Chat messagesCausal
Social media likesEventual
DNS recordsEventual

Quorum Configurations

ConfigurationWRNConsistencyUse Case
Strong335StrongBanking
Balanced325StrongDefault
Write-heavy235StrongLogs
Read-heavy315EventualCache
Max Avail115EventualAnalytics

Progressive Disclosure

Detailed References

For comprehensive coverage of specific topics, see:

  • references/cap-pacelc-theorem.md - CAP and PACELC deep-dive with PACELC matrix
  • references/consistency-models.md - Strong, eventual, causal, bounded staleness patterns
  • references/replication-patterns.md - Leader-follower, multi-leader, leaderless replication
  • references/partitioning-strategies.md - Hash, range, geographic partitioning with examples
  • references/consensus-algorithms.md - Raft and Paxos overview (when consensus needed)
  • references/resilience-patterns.md - Circuit breaker, bulkhead, timeout, retry, rate limiting
  • references/saga-pattern.md - Choreography vs orchestration with working examples
  • references/event-sourcing-cqrs.md - Event sourcing and CQRS implementation patterns
  • references/service-discovery.md - Client-side, server-side, service mesh patterns
  • references/caching-strategies.md - Cache-aside, write-through, write-behind, invalidation

Working Examples

Complete, runnable examples demonstrating patterns:

  • examples/consistent-hashing/ - Consistent hashing implementation with virtual nodes
  • examples/circuit-breaker/ - Circuit breaker pattern with state transitions
  • examples/saga-orchestration/ - Saga orchestrator with compensating transactions
  • examples/event-sourcing/ - Event store with replay and snapshots
  • examples/cqrs/ - CQRS with separate read/write models
  • examples/service-discovery/ - Consul-based service discovery and registration

ASCII Diagrams

Visual representations for complex concepts:

  • diagrams/cap-theorem.txt - CAP theorem decision tree
  • diagrams/replication-topologies.txt - Leader-follower, multi-leader, leaderless
  • diagrams/saga-flow.txt - Saga choreography and orchestration flows
  • diagrams/caching-patterns.txt - Cache-aside, write-through, write-behind

Integration with Other Skills

Related Skills:

For Kubernetes deployment: See kubernetes-operations skill for pod anti-affinity, service mesh For infrastructure: See infrastructure-as-code skill for deploying distributed systems For databases: See databases-sql and databases-nosql for replication configuration For messaging: See message-queues skill for event-driven architectures, saga orchestration For monitoring: See observability skill for distributed tracing, monitoring patterns For testing: See performance-engineering skill for load testing distributed systems For security: See security-hardening skill for mTLS, service authentication

Common Patterns

Multi-Datacenter Pattern

1. Choose replication: Multi-leader or Leaderless
2. Partition data geographically
3. Implement conflict resolution (LWW, vector clocks, app-specific)
4. Monitor replication lag
5. Add circuit breakers between datacenters

Event-Driven Saga Pattern

1. Define saga steps and compensating actions
2. Choose choreography (events) or orchestration (coordinator)
3. Implement idempotent handlers (retries safe)
4. Publish events with outbox pattern (transactional)
5. Monitor saga progress and timeouts

High-Availability Pattern

1. Use leaderless replication (N=5, W=3, R=2)
2. Partition with consistent hashing
3. Add circuit breakers for failing nodes
4. Implement read repair and anti-entropy
5. Monitor quorum health

Best Practices

Design for Failure:

  • Network partitions will occur - always design for partition tolerance
  • Use timeouts, retries with exponential backoff
  • Implement circuit breakers to prevent cascading failures
  • Test chaos engineering scenarios (partition nodes, inject latency)

Choose Consistency Carefully:

  • Default to eventual consistency, strengthen only where needed
  • Strong consistency has real costs (latency, availability)
  • Use bounded staleness for middle ground

Idempotency is Critical:

  • Design operations to be safely retryable
  • Use unique request IDs for deduplication
  • Essential for saga compensating transactions

Monitor and Observe:

  • Distributed tracing with correlation IDs
  • Monitor replication lag, quorum health
  • Alert on circuit breaker state changes
  • Track saga progress and failures

Partition Strategically:

  • Hash partitioning for even distribution
  • Range partitioning for range queries (monitor hot spots)
  • Geographic partitioning for compliance, latency

Version Everything:

  • Event schemas evolve - use versioning
  • API versioning for service compatibility
  • Database schema migrations in distributed systems

Anti-Patterns to Avoid

Distributed Monolith:

  • Microservices with tight coupling
  • Shared database across services
  • Fix: Database per service, async communication

Two-Phase Commit (2PC) Overuse:

  • Slow, blocking, reduces availability
  • Fix: Use saga pattern for distributed transactions

Ignoring Network Failures:

  • Assuming network is reliable
  • Fix: Always add timeouts, retries, circuit breakers

Strong Consistency Everywhere:

  • Unnecessary latency and complexity
  • Fix: Use eventual consistency by default, strengthen where needed

No Conflict Resolution Strategy:

  • Multi-leader without handling conflicts
  • Fix: Choose LWW, vector clocks, or app-specific merge

Cache Stampede:

  • TTL expires, all clients query database
  • Fix: Probabilistic early expiration, request coalescing

Troubleshooting

Replication Lag Too High:

  • Check network bandwidth between datacenters
  • Monitor write throughput on leader
  • Consider async replication or multi-leader

Split-Brain Scenario:

  • Multiple leaders elected during partition
  • Fix: Use consensus (Raft, Paxos) for leader election
  • Implement fencing tokens to prevent dual writes

Hot Partitions:

  • Range partitioning with skewed data
  • Fix: Add hash component, manually redistribute, use composite keys

Saga Timeout/Stalled:

  • Service unavailable, saga can't complete
  • Fix: Implement saga timeout with automated rollback
  • Dead letter queue for manual intervention

Conflict Resolution Failures:

  • Multi-leader conflicts unhandled
  • Fix: Implement clear resolution strategy (LWW, merge, manual)
  • Monitor conflict rate, alert on spikes

平台分布

Codex

37.17%
按下载量换算150

Claude

30.36%
按下载量换算123

Cursor

16.74%
按下载量换算68

Gemini CLI

8.95%
按下载量换算36

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills