Since 1999


3 minutes estimated reading time.

Case Study: Migration of Public Service On-Prem to AWS Cloud

Government agency's critical business Rails app seamlessly migrated from on-prem to AWS cloud. Users praised how fast the app became!

Client Background

Client is a State government agency. They operate a variety of custom web applications that are used by staff and elected officials for critical business functions. These applications have been developed over the years by various contractors.

Client’s Tech Stack

Prior to the engagement with Rietta, client already had a full-stack Ruby on Rails web application that was built by a previous contractor. The application was deployed to an on-prem virtualized Linux server using Capistrano over SSH. Server maintenance was conducted by manual Linux server administration practices.

The application was built to run on a single Linux server that was responsible for running the web server, the background worker that performed tasks asynchronously from the web user experience, the PostgreSQL database, and it sent outgoing e-mail through client’s Microsoft Outlook server managed by another group within the government.

Furthermore, the application allowed users to post content and upload file attachments. These files were all stored on the web server. The app could only be scaled for more users by increasing the size of the single server that it ran on.

The client wished to migrate these services to their AWS cloud, but didn’t want to just lift the virtual machine into the AWS cloud without taking advantage of AWS’s enhanced scaling and security capabilities.

The Rietta Solution

After reviewing the requirements for the AWS migration, Rietta proposed a multiple step approach to ready the application for the AWS cloud, thoroughly test it to ensure complete functionality preservation, and then to switch when ready.

  1. Inventory all functionality that made assumptions about its running on as single server and make code changes as necessary to correct
  2. Dockerize the test environment, including using the open source Minio Docker service to mock S3
  3. Write additional automated integration tests to fully drive the application via a web browser ensuring that all user-initiated workflows had tests, including uploading and viewing files
  4. Feature flag use of S3 vs local storage so that deployments to on prem solution could continue as this project progressed
  5. Update application’s use of configuration files to use environment variables in way compatible with the use of the AWS Secrets Manager
  6. Separate the worker service in the local Docker test environment to run in a difference Docker instance from the web server and thoroughly test all functionality
  7. Configure AWS cloud resources, including the AWS Elastic Container Service, AWS RDS PostgreSQL, the AWS Secrets Manager, and AWS Simple E-mail Service
  8. Migrate existing file uploads (many gigabytes worth) using the open source rsync utility to transfer all files to an Linux bastion host and then push to AWS S3 using the AWS CLI.
  9. Deploy staging environment to AWS and thorough test for multiple days along with member’s of the client’s staff
  10. Deploy production environment to AWS and switch over during an evening maintenance window
  11. Stood by for two weeks for rapid response in case users experienced difficulties with the migrated system (there were no significant issues during that time)
  12. After a period of time where the system proved reliable, scripted continuous deployment capability such that approved code changes are automatically deployed to client’s staging environment in AWS. Deployment to production is still a manually initiated process so that updates can happen in scheduled maintenance windows as per policy.


With the Rietta-implemented solution, client completed the migration of this application from their on-prem environment to the AWS cloud. Client’s users experienced no downtime outside of a scheduled maintenance window and the only feedback client received from the users was compliments on how snappy and fast loading the application had become! After a few week waiting period, client completed the decommissioning process by deleting their previous on prem environment.