Deployment
This document provides comprehensive guidance on deploying the MSR (Multi-Session Replay) module backend infrastructure in production environments. A successful deployment consists of the MSR backend server and supporting infrastructure for change data capture. The frontend interface is provided through the MSR modlet installed in web-base projects.
Prerequisites
Before deploying MSR, ensure you have:
- Container Runtime: Docker or Podman with compose support
- Module Dependencies: Deployed instance of
iams
module for authentication - Network Access: Connectivity between MSR components and dependency services
- Storage: Adequate disk space for TimescaleDB and Redpanda data retention
- Environment File: Properly configured
.env
file with required variables
Container Images
The MSR backend deployment uses the following container images:
Component | Image | Purpose |
---|---|---|
MSR App | ghcr.io/mssfoobar/msr/msr-app:latest | Main backend server |
MSR Database | ghcr.io/mssfoobar/msr/timescaledb:2.21.1-pg17-aoh | TimescaleDB for session data |
Redpanda | docker.redpanda.com/redpandadata/redpanda:latest | Kafka-compatible streaming platform |
Redpanda Console | docker.redpanda.com/redpandadata/console:latest | Redpanda management interface |
Kafka Connect | ghcr.io/mssfoobar/debezium-connect:latest | CDC connectors with Debezium |
The MSR frontend interface is provided through the MSR modlet, which is installed into web-base projects using npx cli install msr
. No separate frontend container deployment is required.
Use specific version tags instead of latest
for production deployments to ensure consistency and easier rollbacks.
Deployment Steps
1. Deploy Infrastructure
Deploy the infrastructure components using the dev-containers setup:
# From dev-containers directory
docker compose --env-file .env -f msr/compose.yml -f compose.override.yml up -d
This deploys:
- Database: TimescaleDB instance for time-series data storage
- Redpanda: Kafka-compatible streaming platform
- Kafka Connect: CDC pipeline with Debezium connectors
See the Kafka Connect configuration guide for detailed connector setup.
2. Deploy Application
Deploy the MSR backend application:
Artifact: ghcr.io/mssfoobar/msr/msr-app:latest
Ensure the application is configured with proper environment variables. See the configuration section for required variables.
3. Frontend Integration
The MSR frontend is provided through a modlet that developers install into their web-base projects:
# Install MSR modlet into web-base project
npx cli install msr
Developers can then build custom replay interfaces using the provided components. See the quickstart guide for implementation details.
Architecture Overview
The MSR deployment follows a CDC (Change Data Capture) architecture:
- MSR Backend: Handles session recording, storage, and replay API
- MSR Database: TimescaleDB instance optimized for time-series data
- CDC Pipeline: Debezium + Kafka Connect + Redpanda for real-time data capture
- Frontend: Provided via modlet components in web-base projects
- Dependencies: IAMs for authentication, source databases with CDC-enabled tables
For detailed architectural concepts, see the MSR overview.
Network and Security Considerations
Port Requirements
Service | Port | Purpose | Access |
---|---|---|---|
MSR Backend | 8080 | API and web server | Internal |
MSR Database | 5432 | PostgreSQL connection | Internal |
Kafka Connect | 8083 | REST API | Internal |
Redpanda | 9092 | Kafka protocol | Internal |
Redpanda Console | 8080 | Management UI | Internal |
Security Best Practices
- Database Credentials: Use strong passwords and rotate regularly
- Network Isolation: Deploy in private networks with controlled access
- TLS/SSL: Enable encryption for inter-service communication
- IAMs Integration: Leverage centralized authentication for access control
- Resource Limits: Configure container resource constraints
Monitoring and Maintenance
Scaling Considerations
- Database Performance: Monitor TimescaleDB performance and consider read replicas
- Kafka Connect: Scale connector tasks based on CDC volume
- Redpanda: Adjust partition count and replication factor for throughput
Development and Testing
MSR Web Container (Internal Use Only)
The MSR module includes a containerized web interface (ghcr.io/mssfoobar/msr/msr-web:latest
) that is used exclusively for internal testing and modlet development purposes. This container:
- Is NOT deployed in production environments
- Is NOT used by project developers
- Serves only as a testing artifact for modlet development
- Provides a standalone interface for validating backend functionality
Project developers should use the MSR modlet installed via npx cli install msr
instead of this container.
Troubleshooting
For common deployment issues, see the FAQ section which covers:
- CDC pipeline problems
- Connector configuration issues
- Database connection problems
- Performance optimization