Skip to content

Rollback a Service

This document describes the process for rolling back a backend service to a previous version in case of issues after deployment.

Overview

If a service deployment causes issues in production, you can quickly rollback to a previous stable version using AWS ECS by selecting an earlier task definition.

Rollback Process

1. Access AWS ECS

  1. Log into AWS Console
  2. Navigate to ECS (Elastic Container Service)
  3. Select the appropriate cluster (e.g., production cluster)
  4. Locate and select the service you want to rollback

2. Update Service Configuration

  1. Click Update service (top right corner)
  2. In the Task Definition section, you will see a dropdown
  3. Select the correct Task Definition revision that corresponds to the version you want to rollback to
    • Task definitions are versioned sequentially (e.g., service-name:15, service-name:14, etc.)
    • Each task definition corresponds to a specific release version
  4. Review the configuration
  5. Click Update to apply the changes

3. Monitor Rollback

Critical Compatibility Checks

Important

Before rolling back a service, verify compatibility with other components:

Database Compatibility

Does the database version (migrations) fit with the service version you're rolling back to?

  • If the current database includes migrations that were added after the version you're rolling back to, the rollback may fail or cause data issues
  • Check the migration history for the service

Frontend Compatibility

Does the frontend version fit with the service version you're rolling back to?

  • Check if the frontend depends on API endpoints or DTOs that were:
    • Added in the version you're rolling back from
    • Modified in the version you're rolling back from
  • If there's a mismatch, you may need to rollback the frontend as well (see Rollback the Frontend)

Post-Rollback Verification

After rollback completes:

  • [ ] Verify the service is running the expected version
  • [ ] Check service health and logs
  • [ ] Test critical functionality
  • [ ] Monitor error rates
  • [ ] Confirm the issue is resolved