I'm managing a web application with a setup that includes a Cloudfront/S3 frontend, a Node.js API backend running on EC2, and an Aurora MySQL RDS cluster with a single database. Recently, we decided to remove over 50% of the application's functionalities, which means we can simplify our database schema. We're considering two options for deploying a new database: either adding the new database to the existing RDS cluster and running both side by side until we fully transition to the new one, or spinning up a new cluster entirely and then deleting the old one once the data is migrated. I'm looking for insights on the advantages and disadvantages of each option from an infrastructure standpoint. I know there's an extra cost involved in running two clusters, but I want to know what's considered best practice and if there are any potential downsides or considerations we should be aware of.
4 Answers
If performance and cluster-level parameters aren't major concerns, it can be more economical to just add a new database to your existing cluster instead of spinning up a new one. Just something to consider to keep costs in check!
I generally prefer to have one cluster per account where each is a different stage in development. Multiple databases can coexist in one RDS cluster without complications, and it's usually cheaper than spinning up separate clusters for every deployment. The overhead for managing separate clusters can add up quickly!
I've gone with the first option before, and it can work well. If you're using PostgreSQL, another approach is creating a second schema within the same database. This way, you can move tables around easily without needing to set up a whole new cluster. It's usually more efficient for cross-database queries too!
Just be aware that running multiple databases in a single cluster can lead to resource contention. If one database hogs the resources, it impacts the rest. Make sure you have a solid ops team and monitoring system in place to handle this effectively!
Totally agree! It keeps things cleaner and you avoid the overhead of using foreign data wrappers, which can slow things down. I’ve only dealt with vanilla Postgres, but if Aurora has features for cross-database queries, that could help too. Keeping things simple by using one cluster is definitely a good way to go.