projection-patterns

Transform event streams into queryable read models with Python, SQL, and Elasticsearch templates.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/azap026/smetalabv3 --skill projection-patterns-azap026
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: projection-patterns
Source: https://github.com/azap026/smetalabv3/tree/main/.agent/skills/projection-patterns
Command: npx skills add https://github.com/azap026/smetalabv3 --skill projection-patterns-azap026

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Projections and read models are critical for enabling fast, scalable querying in event-sourced systems. This skill provides a structured approach to transform streams of events into denormalized views that support real-time dashboards and analytics.

Core Features & Use Cases

  • Projection Architecture: Support various projection types (Live, Catchup, Persistent, Inline) to keep read models up to date.
  • Templates & Examples: Includes ready-to-adapt templates for Python, SQL, and Elasticsearch to implement projections across multiple data stores.
  • Use Case: Build a product catalog search projection that updates a Redis cache or PostgreSQL table as new events arrive and are processed.

Quick Start

Set up a basic projection by applying Template 1: Basic Projector to a simple Event stream and verify the read model updates as events are ingested.

Frequently Asked Questions about projection-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I turn event streams into queryable read models for CQRS?

To turn event streams into queryable read models, you apply deterministic projection logic to transform events into denormalized views. This skill provides templates for Python, SQL, and Elasticsearch to build and maintain these read models.

What is the best way to build projections for event-sourced architectures?

Building projections for event-sourced architectures requires applying structured projector templates that support idempotent updates. This approach ensures deterministic projection logic across multiple data stores like SQL and Elasticsearch for real-time dashboards.

Does this approach support different projection types like live and catchup?

Yes, the projection architecture supports various projection types including Live, Catchup, Persistent, and Inline. These types ensure read models stay up to date as new events arrive and are processed within the event-sourced system.

Can I use these projection templates with Elasticsearch and PostgreSQL?

Yes, you can use the included templates with Elasticsearch, PostgreSQL, and Python. They provide ready-to-adapt code to implement projections, such as building a product catalog search projection that updates a cache or table.

How do I ensure idempotent updates when processing event streams?

To ensure idempotent updates when processing event streams, the projection logic enforces deterministic processing rules. This prevents duplicate data entries if the same event is processed multiple times during catchup or recovery.

Why do I need projections for event-sourcing read sides?

You need projections for event-sourcing read sides because event streams are optimized for writes, not queries. Projections transform these streams into denormalized views, enabling fast, scalable querying for analytics and dashboards.