Skip to content

Create Infrastructure in Digital Ocean #2163

@tomca32

Description

@tomca32

Our current infrastructure is in AWS. This made sense for us before but the price is getting prohibitive. We should migrate all infrastructure to Digital Ocean.

We use pulumi https://www.pulumi.com/ in Typescript for defining our infra. This works well because types are very helpful when defining infrastructure.

Currently our infra consists of Staging and Production environments. Staging is located in us-east-1 while production is in eu-central-1. Both have:

  • Entry through a load balancer
  • Multiple application instances, currently Fargate instances running docker containers
  • RDS Postgres Database
  • Bastion (an EC2 instance that serves as an entry point if we want to shh. Not sure if we need this)

Digital Ocean seems to have parallels for all of these services. We want to setup the production environment in the FRA1 region in Frankfurt. The reason for this is to reduce the ping for a lot of our users in Africa. Staging can be in any zone.

Load Balancer

https://www.digitalocean.com/products/load-balancers
https://docs.digitalocean.com/products/networking/load-balancers/how-to/ssl-termination/

We want the Load Balancer to be an entry point to our cloud. It should have SSL Termination on, meaning that the traffic from the internet to the load balancer is over SSL, but from the load balancer further in we can run without SSL. This frees the application from worrying about SSL.

Application Instances

https://docs.digitalocean.com/products/droplets/
https://docs.digitalocean.com/products/app-platform/

We have two options here: droplets or app platform. Droplets are pretty much the same thing as EC2 Instances. This means we have to manage them ourselves. It would be easier if we can use the app platform and just give it a docker image. We don't want to think about managing the running machines ourselves, although if the difference in cost is big enough we might end up using droplets.

Database

https://docs.digitalocean.com/products/databases/postgresql/

Digital Ocean has a managed Postgres database that is much cheaper than AWS. We want the cheapest general purpose Dedicated CPU for production, while a shared cpu is fine for staging.

We need to investigate what are automated backup options for the database. Ideally we would want daily backups stored on Digital Ocean Spaces, which is DO's version of S3, and a 30 day Point in Time recovery if that's possible.
Bonus recovery option would be storing backup both on DO and AWS to be super safe.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Ready

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions