Evento Framework
  • Introduction
  • Architecture Overview
    • Distributed Systems & Microservices
    • Recative Manifesto & Reactive Principles
    • State-of-the-art Patterns
      • DDD (Domain Driven Design)
      • CQRS (Command Query Responsability Separation)
      • Event Sourcing
      • Messaging
      • Saga
  • GETTING STARTED
    • Quick Start
    • TodoList - RECQ Tutorial
      • Problem Description and Requirement Gathering
      • RECQ Payload Design
      • RECQ Components Design
      • Set up your Development Environment
      • RECQ Payload Evento Implementation
        • Domain Commands
        • Domain Events
        • Views
        • Queries
      • RECQ Components Evento Implementation with Spring Data
        • TodoListAggregate
        • TodoList Model with Spring Data
        • TodoListProjector
        • TodoListProjection
        • TodoList Invoker
      • Expose the RECQ architecture with Spring Web
      • Test Your App
    • Extend TodoList - Handle Complexity Tutorial
      • Unique identifier generation
      • Extends behaviors with Observer and Services
      • Cross Domain Consistency with Sagas
      • Handle Real time data updates with MQTT and Save-Notify Pattern
  • RECQ Patterns
    • RECQ Patterns
    • RECQ System Pattern
      • Component
      • Message Gateway
      • System State Store
    • RECQ Communication Pattern
      • Component to Component
      • Component to System State Store
      • System State Store to Component
    • RECQ Component Pattern
      • Aggregate
      • Projector
      • Projection
      • Service
      • Invoker
      • Saga
      • Observer
  • Evento Framework
    • Evento Framework Introcution
    • Payload and Messages
      • Command
        • Domain Command
        • Service Command
      • Event
        • Domain and Service Event
      • Query and View
    • @Component
      • @Aggregate
        • Aggregate State
        • @AggregateCommandHandler
        • @EventSourcingHandler
      • @Projector
        • Projector @EventHandler
      • @Projection
        • @QueryHandler
      • @Service
        • @CommandHandler
      • @Invoker
      • @Saga
        • SagaState
        • @SagaEventHandler
      • @Observer
    • Dead Event Queues
    • EventoBundle
      • EventoServerMessageBusConfiguration
      • ConsumerStateStore
        • InMemoryConsumerStateStore
        • PostgresConsumerStateStore
        • MysqlConsumerStateStore
      • Context
      • TracingAgend and @Track
        • SentryTracingAgent
      • Autoscaling Protocol
        • ThreadCountAutoscalingProtocol
      • Injector and @Component
  • Evento Server
    • Evento Server Introduction
    • SetUp Evento Server
      • Advanced Options
      • Evento Event Store Modes: APES and CPES
    • Evento Server Cluster
    • Bundle Deploy Script
  • EVENTO GUI
    • Explore RECQ Systems Visually
    • GUI Auth
    • Payload Catalog
    • Component Catalog
    • Bundle Catalog
    • Cluster Status (Experimental)
    • Flows
      • Performance Evaluation
    • Application Graph
    • System State Store
  • Evento CLI
    • Evento CLI Introduction
    • Update Version
    • Publish
Powered by GitBook
On this page
  1. RECQ Patterns
  2. RECQ System Pattern

System State Store

The Heart of Event-Driven State Management

PreviousMessage GatewayNextRECQ Communication Pattern

Last updated 1 year ago

The System State Store (SSS) is a crucial component in a RECQ architecture. It serves as the central repository for all events that occur within the system, acting as the Single Source of Truth (SSOT) for the system state. Unlike traditional data stores that hold the current state directly, the SSS maintains an ordered sequence of change-of-state events, providing a complete audit trail of the system's history.

Key Responsibilities of the SSS:

  • Publishing Domain Events:

    • The SSS is responsible for persisting domain events published by components within the system. These events represent atomic changes in the system's state.

    • When a component performs an action that modifies the system state, it publishes an event to the SSS.

    • The event can be associated with an aggregate, which is a group of related domain objects treated as a single unit.

  • Event Stream Retrieval:

    • Components can retrieve event streams from the SSS.

    • An event stream is an ordered sequence of events starting from a specific point in time.

    • The retrieval can be filtered by:

      • Starting point: Specify the point in time or event sequence number from which to start retrieving events.

      • Aggregate: Retrieve events associated with a specific aggregate or group of related domain objects.

      • Event Type: Filter events based on their specific type (e.g., UserCreatedEvent, OrderPlacedEvent).

Benefits of the SSS:

  • Single Source of Truth: The SSS ensures data consistency by maintaining a single definitive source for all events that have occurred within the system.

  • Audit Trail: The complete sequence of events provides a comprehensive history of the system's state changes, allowing for easier debugging, tracing, and compliance purposes.

  • Replayability: The system state can be reconstructed at any point in time by replaying the sequence of events stored in the SSS. This enables functionalities like disaster recovery or rolling back to a previous state.

Additional Considerations:

  • Event Schema: The SSS needs a well-defined schema for storing and retrieving events. This schema should capture relevant information about the event, such as timestamp, type, associated aggregate, and event payload.

  • Event Persistence: The choice of a persistence mechanism for the SSS is crucial. Common options include databases (relational or NoSQL) or dedicated event streaming platforms. The chosen technology should offer scalability, durability, and efficient retrieval capabilities.

  • Event Sourcing vs. Snapshotting:

    • While the core concept is event storage, some systems utilize snapshots in conjunction with event streams. Snapshots are periodic summaries of the system state at specific points in time. This can improve performance for retrieving the current state compared to replaying the entire event stream.

Conclusion:

The SSS plays a vital role in RECQ systems by providing a reliable and consistent mechanism for managing the system state. By understanding its functionalities and considerations, developers can design robust event-driven applications that leverage a complete history of state changes for various purposes.

System State Store Structure