Skip to main content
The AWS ECS commands in this document are legacy examples and are not the current Learnille production procedure. The backend is deployed through Dokploy; use the production deployment guide for current release and rollback operations.

Overview

This document contains operational runbooks and playbooks for common scenarios in the Learnille platform. Runbooks provide step-by-step procedures for routine operations, while playbooks offer guidance for incident response and complex situations.

Incident Response Playbook

1. Service Outage Response

Detection Phase

When: Monitoring alerts indicate service degradation or outage Immediate Actions:
  1. Acknowledge Alert
  2. Assess Impact
    • Check affected services and user impact
    • Review error rates and latency metrics
    • Identify affected user segments
  3. Notify Stakeholders

Investigation Phase

  1. Check Application Logs
  2. Database Health Check
  3. Infrastructure Status

Resolution Phase

  1. Common Quick Fixes
  2. Database Issues
  3. Rollback if Necessary

Recovery Phase

  1. Verify Service Recovery
  2. Update Status
  3. Post-Mortem
    • Document root cause
    • Identify improvement actions
    • Update runbooks if needed

2. Database Performance Issues

Symptoms

  • Slow query response times
  • High CPU utilization on database
  • Connection pool exhaustion
  • Increased error rates

Investigation Steps

  1. Check Database Metrics
  2. Identify Slow Queries
  3. Check Index Usage

Resolution Steps

  1. Optimize Queries
    • Add missing indexes
    • Rewrite inefficient queries
    • Implement query result caching
  2. Scale Database
  3. Connection Pool Optimization

3. Security Incident Response

Detection

  • Unusual login patterns
  • Unexpected data access
  • Security monitoring alerts
  • User reports of suspicious activity

Containment

  1. Isolate Affected Systems
  2. Preserve Evidence

Investigation

  1. Log Analysis
  2. Access Review

Recovery

  1. Password Reset
  2. Security Updates

Operational Runbooks

1. Deployment Runbook

Pre-Deployment Checklist

  • Code review completed
  • Tests passing
  • Security scan clean
  • Documentation updated
  • Rollback plan documented
  • Communication plan ready

Deployment Steps

  1. Prepare Release
  2. Build Artifacts
  3. Deploy to Staging
  4. Validation
  5. Production Deployment

Post-Deployment

  1. Monitor Performance
  2. Verify Functionality
    • User login and registration
    • Course creation and enrollment
    • Payment processing
    • Email notifications
  3. Update Documentation
    • Release notes published
    • API documentation updated
    • User guides updated

2. Backup and Recovery Runbook

Daily Backup Procedure

Database Recovery

  1. Assess Damage
  2. Restore Database
  3. Data Validation

File Recovery

3. Monitoring Setup Runbook

Application Monitoring

  1. Install Monitoring Agent
  2. Configure Metrics
  3. Set Up Alarms

New Relic Alert Conditions Setup

  1. Configure High Memory Alarm in New Relic
    • Condition Type: NRQL Alert Condition
    • NRQL Query: SELECT average(memoryUsedBytes / memoryTotalBytes * 100) FROM SystemSample
    • Threshold: > 85% for 5 minutes
  2. Configure Database Connection & Response Time Alarm
    • Condition Type: NRQL Alert Condition
    • NRQL Query: SELECT average(databaseDuration) FROM Transaction WHERE appName = 'Learnille API (Self-Hosted)'
    • Threshold: > 0.1 seconds for 5 minutes

Database Monitoring

  1. Enable Enhanced Monitoring
  2. Configure Database Metrics

4. Capacity Planning Runbook

Resource Usage Analysis

  1. Current Usage Assessment
  2. Growth Projections
    • Analyze user growth trends
    • Project resource requirements
    • Identify scaling thresholds
    • Plan capacity upgrades

Scaling Procedures

  1. Horizontal Scaling
  2. Vertical Scaling

Maintenance Runbooks

1. Security Patching

2. Log Rotation

3. Certificate Renewal

Communication Templates

Incident Notification

Maintenance Notification

Status Update

Escalation Procedures

Level 1 Support

  • Monitor alerts and basic troubleshooting
  • Follow runbooks for common issues
  • Escalate to Level 2 if unresolved within 15 minutes

Level 2 Support

  • Advanced troubleshooting and diagnostics
  • Coordinate with development team
  • Implement fixes and workarounds
  • Escalate to Level 3 for critical issues

Level 3 Support

  • Executive decision making
  • External vendor coordination
  • Crisis management
  • Customer communication

Review and Updates

Monthly Review

  • Review incident response effectiveness
  • Update runbooks based on lessons learned
  • Validate monitoring and alerting
  • Test backup and recovery procedures
  • Update contact information

Continuous Improvement

  • Automate manual procedures where possible
  • Implement preventive measures
  • Enhance monitoring coverage
  • Improve communication processes
  • Update training materials

Contact Information

Emergency Contacts

Communication Channels