मुख्य सामग्री पर जाएँ
Skillpedia
API और सर्वर (backend)41k · #6637

cqrs-implementation

यह क्या करती है

यह गाइड सिखाता है कि सिस्टम में डेटा लिखने और पढ़ने के काम को कैसे अलग किया जाए। इससे सिस्टम तेज़ और ज़्यादा व्यवस्थित बनता है, खासकर जब बहुत सारी जानकारी पढ़ी या बदली जा रही हो।

कब इस्तेमाल करें

  • ✓जब आपको डेटा लिखने और पढ़ने का काम अलग-अलग तरीके से करवाना हो।
  • ✓लिखने के काम को प्रभावित किए बिना सिस्टम का पढ़ने वाला हिस्सा तेज़ करने के लिए।
  • ✓ऐसे सिस्टम बनाते समय जो हर बदलाव को इवेंट के रूप में रिकॉर्ड करते हैं।

Skill का लिंक

https://github.com/wshobson/agents/blob/main/plugins/backend-development/skills/cqrs-implementation/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/wshobson/agents/blob/main/plugins/backend-development/skills/cqrs-implementation/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“जटिल रिपोर्ट्स की स्पीड बढ़ाने के लिए मैं CQRS कैसे इस्तेमाल करूँ?”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

यह काम को दो हिस्सों में बाँटता है: commands (डेटा बदलने के लिए) और queries (डेटा पढ़ने के लिए)। हर हिस्से को अलग से optimize किया जा सकता है, अलग डेटा मॉडल के साथ और परफ़ॉर्मेंस पर ध्यान देकर।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

CQRS Implementation

Comprehensive guide to implementing CQRS (Command Query Responsibility Segregation) patterns.

When to Use This Skill

  • Separating read and write concerns
  • Scaling reads independently from writes
  • Building event-sourced systems
  • Optimizing complex query scenarios
  • Different read/write data models needed
  • High-performance reporting requirements

Core Concepts

1. CQRS Architecture

                    ┌─────────────┐
                    │   Client    │
                    └──────┬──────┘
                           │
              ┌────────────┴────────────┐
              │                         │
              ▼                         ▼
       ┌─────────────┐          ┌─────────────┐
       │  Commands   │          │   Queries   │
       │    API      │          │    API      │
       └──────┬──────┘          └──────┬──────┘
              │                         │
              ▼                         ▼
       ┌─────────────┐          ┌─────────────┐
       │  Command    │          │   Query     │
       │  Handlers   │          │  Handlers   │
       └──────┬──────┘          └──────┬──────┘
              │                         │
              ▼                         ▼
       ┌─────────────┐          ┌─────────────┐
       │   Write     │─────────►│    Read     │
       │   Model     │  Events  │   Model     │
       └─────────────┘          └─────────────┘

2. Key Components

Component Responsibility
Command Intent to change state
Command Handler Validates and executes commands
Event Record of state change
Query Request for data
Query Handler Retrieves data from read model
Projector Updates read model from events

Templates and detailed worked examples

Full template library and detailed worked examples live in references/details.md. Read that file when you need the concrete templates.

Best Practices

Do's

  • Separate command and query models - Different needs
  • Use eventual consistency - Accept propagation delay
  • Validate in command handlers - Before state change
  • Denormalize read models - Optimize for queries
  • Version your events - For schema evolution

Don'ts

  • Don't query in commands - Use only for writes
  • Don't couple read/write schemas - Independent evolution
  • Don't over-engineer - Start simple
  • Don't ignore consistency SLAs - Define acceptable lag
अक्सर पूछे जाने वाले सवाल

'eventual consistency' क्या है?

इसका मतलब है कि सिस्टम के सभी हिस्सों में डेटा अपडेट होने में थोड़ा समय लग सकता है, लेकिन आखिरकार वह सही हो जाएगा।

पढ़ने और लिखने के मॉडल अलग क्यों रखें?

क्योंकि उनकी ज़रूरतें अलग होती हैं। लिखने वाले मॉडल को डेटा की सटीकता पक्की करनी होती है, जबकि पढ़ने वाले मॉडल को सवालों का जवाब तेज़ी से देना होता है।

क्या मैं सरल तरीके से शुरू कर सकता हूँ?

हाँ, सलाह यही है कि सरल शुरुआत करें और जटिलता तभी जोड़ें जब वास्तव में ज़रूरत हो।

जानकारी

लेखक का मूल विवरण

Implement Command Query Responsibility Segregation for scalable architectures. Use when separating read and write models, optimizing query performance, or building event-sourced systems.

repo: wshobson/agents

लोकप्रियता

GitHub स्टार
41k
रैंकिंग में स्थान
#6637
लाइसेंस
MIT
अपडेट की गई
15/10/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

मिलती-जुलती skills