MedStack to Aptible Migration Guide
Learn how to migrate resources from MedStack to Aptible
Overview
Aptible is a PaaS (Platform as a Service) that provides developers with managed infrastructure and everything that they need to launch and scale apps that are secure, reliable, and compliant — with no need to manage infrastructure.
This guide will cover the differences between MedStack Control and Aptible and suggestions for how to migrate applications and resources.
PaaS concepts
Environment separation
In MedStack, environment separation is done using Clusters. In Aptible, data can be isolated using Stacks and Environments.
Stacks: A Stack in Aptible is most closely equivalent to a Cluster in MedStack. A Stack is an isolated network that contains the infrastructure required to run apps and databases on Aptible. A Shared Stack is a stack suitable for non-production workloads that do not contain PHI.
Environments: An Environment is a logical separation of resources. It can be used to group resources used in different stages of development (e.g., staging vs. prod) or to apply role-based permissions.
Orchestration
In MedStack, orchestration is done via Docker Swarm. Aptible uses a built-in orchestration model that requires less management — you specify the size and number of containers to use for your application, and Aptible manages the allocation to underlying infrastructure nodes automatically. This means that you don’t have direct access to Nodes or resource pinning, but you don’t have to manage your resources in a way that requires access.
Applications
In Aptible, you can set up applications via Git-based deploys where we build your Docker image based on your provided Dockerfile, or based on your pre-built Docker image, and define service name and command in a Procfile as needed. Configurations can be set in the UI or through the CLI.
To deploy the application, you can use aptible deploy
or you can set up CI/CD for automated deployments from a repository.
To scale an application, you can use manual horizontal scaling (number of containers) and vertical scaling (size and profile of container). We also offer vertical and horizontal autoscaling, both available in beta.
Databases and storage
MedStack is built on top of Azure. Aptible is built on top of AWS.
Our managed database offerings include support for PostgreSQL and MySQL, as well as other databases such as Redis, MongoDB, and more. If you currently host any of the latter as database containers, you can host them as managed databases in Aptible.
Aptible doesn’t yet support object storage; for that, we recommend maintaining your storage in Azure and setting up connections from your hosted application in Aptible. For support for persistent volumes, please reach out to us.
Downtime mitigation
Aptible’s release process minimizes downtime while optimizing for container health. The platform runs container health checks during deployment and throughout the lifetime of the container.
Metrics and logs
Aptible provides container metrics and logs as part of the platform. You can view these within the Aptible UI, or you can set up metrics and logs drains to your preferred destination.
Compliance
Compliance frameworks: Aptible’s platform is designed to help businesses meet strict data privacy and security requirements. We offer built-in guardrails and infrastructure security controls that comply with the requirements of compliance frameworks such as HIPAA, HITRUST, PIPEDA, and more. Compliance is built into how Aptible manages infrastructure, so no additional work is required to ensure that your application is compliant.
Audit support: We offer a Security & Compliance dashboard that covers documentation and proof of infrastructure controls in the case of an audit.
Security questionnaires: In general, we don’t fill out security questionnaires on behalf of our customers. The Security & Compliance dashboard can be used as a resource to answer questionnaires. Our support team is available to answer specific one-off questions when needed.
Pricing
MedStack’s pricing is primarily based on a platform fee with added pass-through infrastructure costs. Aptible’s pricing model differs slightly. Plan costs are mainly based on infrastructure usage, with a small platform fee for some plans.
Most companies will want to leverage our Production plan, which starts with a $499/mo base fee and additional unit-based costs for resources.
For more details, see our pricing page.
During the migration period, we will provide an extended free trial to allow you to leverage the necessary capabilities to try out and validate a migration of your services.
Migrating a MedStack service to Aptible
This section walks through how to replicate and test your service on Aptible, prepare your database migration, and plan and execute a production migration plan.
Create an Aptible account
- Create an Aptible account (https://app.aptible.com/signup). Use a company email so that you automatically qualify for a free trial.
- Message Aptible support at support@aptible.com to let us know that you’re a MedStack customer and have created a trial account, and we will remove some customary resource limits from the free trial so that you can make a full deployment, validate for functionality, and estimate your pricing on Aptible.
Replicate a MedStack staging service on Aptible
- Create an Environment in one of the available Stacks in your account
- Create required App(s): an Aptible App may contain one or more services that utilize the same Docker image
- An App with multiple services can be defined using the Procfile standard
- The Procfile file should be placed at
/.aptible/Procfile
in your pre-built Docker image
- The Procfile file should be placed at
- An App with multiple services can be defined using the Procfile standard
- Add any pre or post-release commands to .aptible.yml:
before_release
is a common place to put commands like database migration tasks- .aptible.yml should be placed in
/.aptible/.aptible.yml
in your pre-built Docker image
- Set up config variables
- Aptible makes use of environment variables to configure your apps. These settings can be modified via the Aptible CLI via
aptible config:set
or via the Configuration tab of your App in the web dashboard
- Aptible makes use of environment variables to configure your apps. These settings can be modified via the Aptible CLI via
- Add credentials for your Docker registry source
- Docker credentials can be provided via the command line as arguments with the
aptible deploy
command - They can also be provided as secrets in your CI/CD workflow (Github Actions Example)
- Docker credentials can be provided via the command line as arguments with the
Deploy and validate your staging application
- Deploy your application using:
aptible deploy
for Direct Docker Deployment using the Aptible CLI- Github Actions (example)
- Or, via git push if you are having us build your Docker Image by providing a Dockerfile in your git repo
- Add Endpoint(s)
- An Aptible Endpoint provides load balancer functionality for your App’s services.
- We support a “default domain” endpoint where you can have an on-aptible.com domain used for your test services without configuring a custom domain.
- You can also configure custom domain Endpoints, for which we can automatically provision certificates, or you can bring your own custom SSL certificates.
- Validate your App(s)
Prepare your database migration
- Test the migration of your database to Aptible
- This can be done via dump and restore methods:
- PostgreSQL: using pg_dump
- This can be done via dump and restore methods:
Complete your Aptible setup
- Familiarize yourself with Aptible activity, logs, metrics
- (Optional) Set up log and metric drains
- Invite your team and set up roles
- Contact Aptible Support to validate your production migration plan and set up a Dedicated Stack to host your production resources.
Plan, Test and Execute the Migration
- Plan for the downtime required to migrate the database and perform DNS cutover for services behind load balancers to Aptible Endpoints. The total estimated downtime can be calculated by performing test database migrations and rehearsing manual migration steps.
- Key Points to consider in the Migration plan:
- Be able to put app(s) in maintenance mode: before migrating databases for production systems, have a method available to ensure that no app services are connecting to the database for writes. Barring this, at least be able to scale app services to zero containers to take the app offline.
- Consider modifying the DNS TTL on the records to be modified to value of 5 minutes or less.
- Perform the database migration, and enable the Aptible app, potentially using a secondary Default Domain Endpoint for testing, or using local /etc/hosts to override DNS temporarily.
- Once the validation is complete, make the DNS record change to point your domain records to the new Aptible destination(s).
- Monitor logs to ensure that requests transition fully to the Aptible Endpoint(s) (observe that requests cease at the MedStack Load Balancer, and appear in logs at the Aptible Endpoint).
Was this page helpful?