Skillpedia
واجهات API والخوادم (backend)41k · #6638

event-store-design

ما الذي تفعله

تساعد هذه المهارة على تخطيط وإنشاء «مخزن أحداث» للأنظمة التي تسجّل كل ما يحدث. وهي مفيدة لتخزين المعلومات بأمان وتنظيم.

متى تستخدمها

  • ✓عندما تبني الأساس لنظام يسجّل الأحداث.
  • ✓عندما تختار التقنية المناسبة لتخزين هذه الأحداث.
  • ✓عندما تنظم طريقة تخزين الأحداث واسترجاعها.

رابط المهارة

https://github.com/wshobson/agents/blob/main/plugins/backend-development/skills/event-store-design/SKILL.md

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/wshobson/agents/blob/main/plugins/backend-development/skills/event-store-design/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“كيف أصمم مخزن أحداث لتسجيل إجراءات المستخدمين في التطبيق؟”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

ترشدك هذه المهارة إلى إنشاء بنية مخزن الأحداث، وتحدد كيفية إضافة الأحداث (دائمًا في النهاية)، وتنظيمها في تسلسلات، وكيفية ضمان عدم وجود تكرار أو فقدان.

المحتوى التقني (ملف SKILL.md الأصلي)

النص الأصلي من المؤلف، مباشرة من GitHub.

Event Store Design

Comprehensive guide to designing event stores for event-sourced applications.

When to Use This Skill

  • Designing event sourcing infrastructure
  • Choosing between event store technologies
  • Implementing custom event stores
  • Optimizing event storage and retrieval
  • Setting up event store schemas
  • Planning for event store scaling

Core Concepts

1. Event Store Architecture

┌─────────────────────────────────────────────────────┐
│                    Event Store                       │
├─────────────────────────────────────────────────────┤
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐ │
│  │   Stream 1   │  │   Stream 2   │  │   Stream 3   │ │
│  │ (Aggregate)  │  │ (Aggregate)  │  │ (Aggregate)  │ │
│  ├─────────────┤  ├─────────────┤  ├─────────────┤ │
│  │ Event 1     │  │ Event 1     │  │ Event 1     │ │
│  │ Event 2     │  │ Event 2     │  │ Event 2     │ │
│  │ Event 3     │  │ ...         │  │ Event 3     │ │
│  │ ...         │  │             │  │ Event 4     │ │
│  └─────────────┘  └─────────────┘  └─────────────┘ │
├─────────────────────────────────────────────────────┤
│  Global Position: 1 → 2 → 3 → 4 → 5 → 6 → ...     │
└─────────────────────────────────────────────────────┘

2. Event Store Requirements

Requirement Description
Append-only Events are immutable, only appends
Ordered Per-stream and global ordering
Versioned Optimistic concurrency control
Subscriptions Real-time event notifications
Idempotent Handle duplicate writes safely

Technology Comparison

Technology Best For Limitations
EventStoreDB Pure event sourcing Single-purpose
PostgreSQL Existing Postgres stack Manual implementation
Kafka High-throughput streaming Not ideal for per-stream queries
DynamoDB Serverless, AWS-native Query limitations
Marten .NET ecosystems .NET specific

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

  • Use stream IDs that include aggregate type - Order-{uuid}
  • Include correlation/causation IDs - For tracing
  • Version events from day one - Plan for schema evolution
  • Implement idempotency - Use event IDs for deduplication
  • Index appropriately - For your query patterns

Don'ts

  • Don't update or delete events - They're immutable facts
  • Don't store large payloads - Keep events small
  • Don't skip optimistic concurrency - Prevents data corruption
  • Don't ignore backpressure - Handle slow consumers
الأسئلة الشائعة

ما هو «event sourcing»؟

هو أسلوب لبناء الأنظمة تُحفظ فيه كل التغييرات كتسلسل من الأحداث. فبدلًا من حفظ الحالة الحالية فقط، تحفظ تاريخ الوصول إليها.

لماذا لا يجب تعديل الأحداث أو حذفها؟

الأحداث وقائع حدثت في الماضي. وتغييرها يشبه إعادة كتابة التاريخ، وقد يسبب تناقضات. ولذلك يُفضل إضافة أحداث جديدة لتصحيح الإجراءات السابقة أو إلغائها.

ما هي «correlation IDs» و«causation IDs»؟

هي معرّفات تساعد على تتبع أصل الحدث ومساره عبر أجزاء النظام المختلفة، مما يسهّل تصحيح الأخطاء وفهم ما حدث.

التفاصيل

الوصف الأصلي من المؤلف

Design and implement event stores for event-sourced systems. Use when building event sourcing infrastructure, choosing event store technologies, or implementing event persistence patterns.

repo: wshobson/agents

الشعبية

نجوم GitHub
41k
الترتيب
#6638
الترخيص
MIT
آخر تحديث
15‏/10‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة