Migrating a MySQL Server. Goodbye, Cloud.
Recently, Planetscale announced that they were closing their free tier, and in my case, it was time to migrate to another provider. In this post, I share my experience and the process of migrating to a VPS.
In recent posts, I've mentioned that with any technology you can do almost anything (as with everything, there are exceptions). In my case, I choose those with which I feel most comfortable, seeking a balance between speed and performance.
Choosing a Database for a Project
I have experience with both PostgreSQL and MySQL, and due to recent migrations, I've delved deeper into how MySQL works, which has led me to use MySQL for my personal projects.
In the past, I've created products that do not use databases, that utilize excel or json (I'll tell you about it in other posts), I've used NoSQL databases like MongoDB... but in the end, simplicity is the most comfortable and fastest.
That's why I decided to use Planetscale, a provider for scalable MySQL databases based on Vitess, an open-source tool from Google (specifically YouTube) to scale their databases.
Moreover, they had a very broad free tier and the pro plan was only $30, so if my projects scaled, my intention was to pay for their service since it is a very well-made and carefully crafted product for developers.
Looking for Alternatives for a MySQL Database
There are providers like DigitalOcean, Linode, etc., that offer managed databases at a good price, and this can be an option if you don't want to complicate things. Then there are other options like AWS RDS/Aurora that I love, but the price skyrockets, so, ruled out.
Let's remember that I work alone on these side-projects and my goal is to monetize them, so a while ago I decided to start simply and therefore, reducing cost.
Other options could be using SQLite, which although I love, I don't feel entirely comfortable with. The only provider that has caught my attention and that I really want to try in the future is TursoDB, which is based on SQLite.
In the end, as I have experience with MySQL and managing servers, the simplest thing for me has been to hire a VPS and set up my own MySQL, acting as a db-admin myself.
The upside is that you learn a lot by configuring it, understanding how it really works... and being so stable and scalable, it's very unlikely that it will cause me problems. In fact, I encourage you to subscribe because I will probably delve deeper into the topic.
The only thing I'm missing is the monitoring layer. I'm so used to having observability of everything that when I don't have it, it causes me uncertainty, but I've learned to live with it in the short term. I have data recovery mechanisms, I can quickly create a server, and I have health checks.
When one works alone and manages different projects, you have to learn to live with this "chaos." In contrast, when you work in a company with a team, you can afford certain "luxuries" that one alone cannot, and which really, are not always necessary.
Did you find this article useful? Subscribe to my newsletter and take the first step to launch IT products faster. You will receive exclusive tips that will bring you closer to your goals.