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. Evento Server
  2. SetUp Evento Server

Evento Event Store Modes: APES and CPES

PreviousAdvanced OptionsNextEvento Server Cluster

Last updated 8 months ago

The Evento Event Store operates in two distinct modes: APES (Available and Partitionable Event Store) and CPES (Consistent and Partitionable Event Store). These modes are fundamentally different in their approach to event sequencing and consistency, each with its own trade-offs.

APES Mode

APES prioritizes availability and partition tolerance. It employs a to generate event sequence numbers. To mitigate potential inconsistencies due to network latency and clock skew, a "fetch delay" mechanism is introduced. This delay ensures that events are not fetched immediately after creation, allowing for sufficient time for synchronization across the cluster.

Key Characteristics:

  • High Availability: APES can tolerate failures and continue to process events.

  • Eventual Consistency: Eventual consistency guarantees that all replicas will eventually converge to the same state, but there might be temporary inconsistencies.

  • Performance: APES generally offers higher performance due to the lack of strict consistency guarantees.

  • Use Cases: Ideal for applications that can tolerate some degree of eventual inconsistency and prioritize high throughput.

CPES Mode

CPES emphasizes strong consistency and partition tolerance. It utilizes an auto-increment sequence shared across all cluster nodes to generate unique event identifiers. This ensures strict ordering of events across the system.

Key Characteristics:

  • Strong Consistency: Events are processed in the exact order they are generated, providing strong consistency guarantees.

  • Limited Availability: In high-load scenarios, CPES might experience reduced availability due to contention for the sequence number.

  • Performance: CPES typically has lower throughput compared to APES due to the overhead of maintaining strong consistency.

  • Use Cases: Suitable for applications that require strict data integrity and are willing to sacrifice some performance for consistency.

CAP Theorem and Trade-offs

The choice between APES and CPES is influenced by the CAP theorem (Consistency, Availability, Partition Tolerance), which states that it's impossible for a distributed system to simultaneously guarantee all three properties.

  • APES: Prioritizes Availability and Partition Tolerance, sacrificing strong Consistency.

  • CPES: Prioritizes Consistency and Partition Tolerance, sacrificing Availability in high-load scenarios.

Choosing the Right Mode

Selecting the appropriate Event Store mode depends on the specific requirements of your application:

  • High throughput and acceptable eventual consistency: APES is the preferred choice.

  • Strict data integrity and consistency: CPES is the recommended option.

It's essential to carefully evaluate the trade-offs between consistency, availability, and performance to make an informed decision. In some cases, it might be possible to combine elements of both modes through hybrid approaches or application-level compensating transactions.

By understanding the fundamental differences between APES and CPES, you can select the optimal Event Store mode for your Evento application.

snowflake algorithm