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
- Real-time state reconstruction for immediate analysis
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
Multi-Session Management
- Support for multiple concurrent replay sessions
- Configurable session limits and resource management
- Automatic cleanup and resource optimization
High-Performance Data Storage
- TimescaleDB hypertables for efficient time-series data storage
- Continuous aggregates for optimized snapshot management
- Automated data retention and compression policies
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
- Debezium CDC Pipeline: Monitors source databases and captures change events
- Kafka Connect: Streams and transforms change events, storing them in our TimescaleDB database
- TimescaleDB Database: Stores time-series event data with automatic partitioning
- MSR Service: Provides APIs for session management and state reconstruction through reeading the TimescaleDB
- Frontend Components: Pre-built drop-in Svelte components for efficient state playback in any page
Data Flow
- Source Monitoring: Debezium monitors the primary database transaction log
- Event Streaming: Changes are streamed through Kafka to the MSR database
- State Storage: Events are stored in TimescaleDB with continuous aggregate snapshots
- Replay Requests: Users request historical state reconstruction through the API
- State Reconstruction: MSR efficiently reconstructs state using snapshots and delta events
- Frontend Playback: Web worker buffers state data for smooth playback
- 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
- Continuous Aggregates: Automatic incremental snapshot updates
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