ddd-patterns

Domain-Driven Design (DDD): Advanced Patterns

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "ddd-patterns" with this command: npx skills add kinhluan/skills/kinhluan-skills-ddd-patterns

Domain-Driven Design (DDD): Advanced Patterns

Advanced integration patterns for handling complex distributed system interactions and transactional consistency.

🚀 Advanced Patterns

  • CQRS (Command Query Responsibility Segregation): Separation of write (Command) and read (Query) models to optimize performance and scalability.

  • Event Sourcing: Capturing all changes to the state of an application as a sequence of events (The current state is reconstructed from the log).

  • Outbox Pattern: Ensuring transactional consistency between a database and a message broker. (Save to DB and a 'Message Outbox' in the same transaction).

  • ACL (Anti-Corruption Layer): Translating and isolating external systems' models to maintain the integrity of your core domain model.

⚡ CQRS + Event Sourcing Workflow

  • Command Side: Receives request -> Aggregate Root (AR) validates -> AR emits Event -> Event saved to Event Store.

  • Projection Side: Projector listens to Events -> Updates Read Model (Optimized for queries: e.g., Elasticsearch, Read DB).

  • Query Side: Reads from Read Model only.

🚫 Advanced Anti-Patterns

  • Premature CQRS: Adding CQRS to simple systems. (Increases complexity needlessly).

  • The Giant Event: Capturing too much state in a single event. (Events should be granular business facts).

  • Ignoring Eventual Consistency: Forgetting that Read Models may be out of sync for a short time. Solution: Compensating actions or UI feedback.

🔗 Integration Checklist

  • Is the Outbox pattern used for cross-container communication?

  • Is the ACL properly shielding the Core Domain?

  • Are events immutable and versioned?

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

ddd-tactical

No summary provided by upstream source.

Repository SourceNeeds Review
General

docker-containerization

No summary provided by upstream source.

Repository SourceNeeds Review
General

scheduling-algorithms

No summary provided by upstream source.

Repository SourceNeeds Review
General

kubernetes-orchestration

No summary provided by upstream source.

Repository SourceNeeds Review