Skip to main content
Version: 2.2.0

Overview

The MSR (Multi-Session Replay) module provides a comprehensive solution for recording database table states and replaying them at any point in time. Built specifically for command and control systems, MSR enables detailed After Action Reviews (AARs) by allowing users to interactively view and analyze system state at any historical moment.

Key Features

Point-in-Time State Reconstruction

  • Reconstruct the complete state of any recorded table at any historical timestamp
  • Efficient querying using TimescaleDB's time-series optimizations and columnstore compression
  • Real-time state reconstruction for immediate analysis
  • Rotating materialized view snapshots for instant historical state access

Change Data Capture Integration

  • Non-invasive monitoring of database changes through Debezium CDC
  • Automatic capture of all CREATE, UPDATE, and DELETE operations
  • Seamless integration with existing applications without code changes
  • Kafka-based streaming for reliable event delivery

Multi-Session Management

  • Support for multiple concurrent replay sessions with configurable limits
  • Session limit enforcement with user-friendly error messages and correlation IDs
  • Automatic session cleanup and resource optimization
  • Admin interface for monitoring and managing active sessions

High-Performance Data Storage

  • TimescaleDB hypertables with configurable chunk intervals for optimal performance
  • Rotating materialized views for zero-downtime snapshot updates
  • Automated data retention and columnstore compression policies
  • Continuous aggregates for accelerated historical queries
  • Dynamic policy updates based on configuration changes

Advanced Frontend Integration

  • Drop-in Svelte Component: MultiSessionReplay component with complete replay UI
  • Configurable Performance: Fine-tune polling, frame rate, buffering for your use case
  • Safety Buffers: Prevent users from selecting problematic time ranges
  • Custom Error Handling: Override default error behavior with custom handlers
  • Web Worker Processing: Heavy lifting in background thread for smooth UI
  • Reactive State Management: Svelte 5 runes for efficient reactivity

Flexible Configuration

  • Runtime Configuration: Adjust retention, session limits, and performance without restarts
  • Deployment Boundary Support: Set EARLIEST_VALID_TIMESTAMP to prevent empty replays
  • Dynamic Policy Updates: Configuration changes automatically update TimescaleDB policies
  • Performance Tuning: Extensive options for memory, compression, and refresh intervals

Operating Concept

The MSR module operates on a Change Data Capture (CDC) architecture that captures database changes in real-time and stores them in a time-series database for efficient replay capabilities.

Core Components

  1. Debezium CDC Pipeline: Monitors source databases and captures change events
  2. Kafka Connect: Streams and transforms change events, storing them in our TimescaleDB database
  3. TimescaleDB Database: Stores time-series event data with automatic partitioning
  4. MSR Service: Provides APIs for session management and state reconstruction through reading the TimescaleDB
  5. Frontend Components: Pre-built drop-in Svelte components for efficient state playback in any page

Data Flow

  1. Source Monitoring: Debezium monitors the primary database transaction log
  2. Event Streaming: Changes are streamed through Kafka to the MSR database
  3. State Storage: Events are stored in TimescaleDB with rotating materialized view snapshots
  4. Replay Requests: Users request historical state reconstruction through the API
  5. State Reconstruction: MSR efficiently reconstructs state using snapshots and delta events
  6. Frontend Playback: Web worker buffers state data for smooth playback
  7. Frontend Rendering: States are accessible via Svelte Store for easy reactive UI updates

Architectural Advantages

Minimally Invasive Design

  • External Observation: CDC acts as a passive observer of database changes
  • Broad Compatibility: Works with any application using supported databases
  • Easy Integration: The playback Svelte component handles complex frontend state management - just use the provided stores

High Performance

  • Efficient Queries: Optimized SQL queries using TimescaleDB features
  • Chunk-Based Operations: Time-based data partitioning for performance
  • Rotating Materialized Views: Zero-downtime snapshot updates using alternating materialized views

Scalable Session Management

  • Stateless Backend: Avoids the complexity of persisting replay states, services can be also horizontally scaled
  • Frontend State Management: User sessions managed in browser for better UX
  • Resource Optimization: Web Workers for heavy processing tasks