Logo Distributed Systems Patterns

Distributed Systems Patterns

Cộng đồng
peterbamuhigire
distributed-systems-patterns

Use when designing or reviewing multi-service, message-driven, or eventually consistent systems. Covers service boundaries, consistency tradeoffs, event workflows, outbox and inbox patterns, sagas, ordering, and idempotency.

Add to TypingMind

Tổng quan

Nhà phát hànhpeterbamuhigire
Kho mãchwezi-dev-engine
Tên kỹ năngdistributed-systems-patterns
Sao
29
Bản fork
6
Tệp đi kèm
4
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 4 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được peterbamuhigire công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Distributed Systems Patterns trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/peterbamuhigire/chwezi-dev-engine/tree/main/skills/architecture/distributed-systems-patterns
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/peterbamuhigire/chwezi-dev-engine.git /tmp/chwezi-dev-engine
mkdir -p .claude/skills
cp -r /tmp/chwezi-dev-engine/skills/architecture/distributed-systems-patterns .claude/skills/distributed-systems-patterns
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Distributed Systems Patterns trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Distributed Systems Patterns ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Distributed Systems Patterns với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Distributed Systems Patterns

Acknowledgement: Shared by Peter Bamuhigire, techguypeter.com, +256 784 464178.

Use When

  • Use when designing or reviewing multi-service, message-driven, or eventually consistent systems. Covers service boundaries, consistency tradeoffs, event workflows, outbox and inbox patterns, sagas, ordering, and idempotency.

Do Not Use When

  • The change is a single-process transaction with no remote dependency, asynchronous delivery, or independently failing component.
  • The task is mainly service decomposition or API shape; use system-architecture-design or api-design-first and return here for cross-boundary failure semantics.

Required Inputs

InputRequiredWhy it matters
Workflow steps and system boundariesyesIdentifies where atomicity ends and partial failure begins
Delivery, ordering, and consistency requirementsyesDetermines idempotency, sequencing, and reconciliation choices
Failure and recovery expectationsyesSets timeout, retry, compensation, and operator intervention rules
Throughput and latency constraintsconditionalTests whether the coordination pattern is viable

Workflow

Draw state transitions and ownership boundaries, enumerate failure windows, choose consistency and coordination patterns, define idempotency and recovery, then verify duplicate, reordered, delayed, and partially applied events.

Quality Standards

Every remote interaction has a timeout and failure policy. Every retried side effect has an idempotency rule. Consistency claims state their scope, and recovery does not assume exactly-once delivery.

Outputs

OutputConsumerAcceptance condition
Distributed workflow modelArchitecture and implementation teamsShows state ownership, message boundaries, consistency guarantees, and failure windows
Failure-handling contractService ownersDefines timeout, retry, deduplication, compensation, replay, and reconciliation behavior
Verification scenariosTest and operations teamsCover duplicates, reordering, concurrency, dependency outage, and partial completion

Evidence Produced

CategoryArtifactFormatExample
OperabilityService consistency and idempotency noteMarkdown doc covering chosen consistency model, idempotency keys, and saga sequencesdocs/dist/consistency-note-checkout.md
OperabilityFailure-mode catalogueMarkdown doc listing partition, retry, and replay failure modes with mitigationsdocs/dist/failure-modes-checkout.md

References

  • Use the references/ directory for deep detail after reading the core workflow below.
  • Load references/event-driven-architecture.md for event choreography, event contracts, brokers, and asynchronous workflow design.
  • Load references/realtime-systems.md for WebSocket, SSE, pub/sub, and realtime delivery concerns.

Use this skill when a design crosses process, service, queue, or region boundaries. The goal is to keep distributed complexity deliberate and bounded rather than accidental.

Load Order

  1. Load world-class-engineering.
  2. Load system-architecture-design first for the overall shape.
  3. Load this skill only when the system genuinely needs multiple services, asynchronous workflows, or weakly consistent boundaries.

Decision Workflow

1. Justify Distribution

State why distribution is necessary:

  • team ownership and release independence
  • scaling asymmetry
  • fault isolation
  • compliance or tenancy isolation
  • long-running or bursty workflows

If none of these are strong, prefer a modular monolith.

2. Define Boundaries and Contracts

For each service or asynchronous component, define:

  • owned data
  • API or event contracts
  • consistency expectation
  • failure effect on upstream and downstream flows
  • observability and ownership requirements

3. Choose Interaction Patterns

Use:

  • synchronous calls when the caller needs immediate confirmation
  • messaging when work is slow, bursty, or naturally eventual
  • outbox and inbox patterns when reliability across boundaries matters
  • sagas or compensations when one business workflow spans multiple durable states

4. Design Consistency and Recovery

Make explicit:

  • source of truth
  • ordering requirements
  • deduplication strategy
  • reconciliation path
  • timeout and retry policy
  • compensation or manual repair path

5. Prove the Design

Before calling it production-ready, provide:

  • consistency model
  • failure-mode examples
  • idempotency and replay notes
  • contract evolution rules
  • operational signals for stuck or divergent workflows

Non-Negotiable Standards

Service Boundaries

  • Each service owns its data and rules.
  • Do not share databases across services as a convenience.
  • Keep contracts narrow and versionable.
  • Avoid chatty request chains on critical paths.

Messaging

  • Assume at-least-once delivery unless proven otherwise.
  • Design consumers to be idempotent and replay-safe.
  • Define ordering needs explicitly; unordered by default is safer to assume.
  • Include correlation IDs and causation metadata.

Consistency

  • Strong consistency has operational cost; use it where business correctness needs it.
  • Eventual consistency requires visible user and operator handling.
  • If divergence is possible, define reconciliation before shipping.

Sagas and Compensation

  • Use compensation when the workflow spans multiple irreversible boundaries.
  • Compensation must be explicit, auditable, and tested.
  • Never describe a workflow as atomic if it crosses systems that cannot commit atomically.

Deliverables

For distributed-system work, produce:

  • service and ownership map
  • contract list
  • consistency decision table
  • event and retry flow notes
  • reconciliation or compensation plan
  • stuck-workflow and replay detection signals

Review Checklist

  • Distribution is justified by real constraints.
  • Data ownership is explicit and not undermined by shared persistence shortcuts.
  • Idempotency and replay behavior are defined.
  • Ordering assumptions are explicit.
  • Consistency and compensation strategy match business risk.
  • Operational detection exists for stuck, duplicated, or divergent workflows.

References

Capability contract

Model boundaries, messages, and failure semantics by default. Do not provision brokers, replay events, or mutate production state unless explicitly authorised.

Degraded mode

If topology or failure evidence is unavailable, return a read-only pattern comparison and assumptions register; withhold recommendations dependent on unknown delivery guarantees.

Domain Anti-Patterns

  • Assuming exactly-once delivery. Fix: define idempotency and deduplication.
  • Sharing one database across autonomous services. Fix: assign data ownership.
  • Publishing before the state change commits. Fix: use a transactional outbox.
  • Retrying non-idempotent commands blindly. Fix: add keys and retry limits.
  • Omitting poison-message handling. Fix: define dead-letter and replay controls.

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Distributed Systems Patterns làm được gì?

Use when designing or reviewing multi-service, message-driven, or eventually consistent systems. Covers service boundaries, consistency tradeoffs, event workflows, outbox and inbox patterns, sagas, ordering, and idempotency.

Vì sao nên dùng Distributed Systems Patterns trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Distributed Systems Patterns là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Distributed Systems Patterns trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/peterbamuhigire/chwezi-dev-engine/tree/main/skills/architecture/distributed-systems-patterns. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Distributed Systems Patterns?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Distributed Systems Patterns với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Distributed Systems Patterns với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Distributed Systems Patterns có miễn phí không?

Có. Kỹ năng này được peterbamuhigire phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇