2023-12-22
- I have just done something most people consider inadvisable. I have migrated my database from a managed service provided by a reputable hosting provider (Render, they do great work) onto a VM that I manage myself. Why would I do this? The first reason is that I want to learn about the tradeoffs of this decision (cloud vs manual managing) for myself. I had followed the conventional wisdom when getting started with my most recent web project, and that helped me go from 0 to 1 very quickly. I think that was a good idea at that stage and with my level of expertise. But now, I’m interested in exploring the alternatives. How much effort is it these days to run a server on your own? I’m excited to find out. So far, there seem to be pretty good tools out there when it comes to managing a small number of servers. In particular, I’ve been impressed with Kamal for automating deployments of docker containers to a small number of servers. It seems like a good fit for what I need. The other
thing that seems like a good fit is the price. My current usage on Render comes out to $75/month. That’s around the level at which I get a little uncomfortable with the prospect of long-term financial viability for my side projects. I’m also starting to get close to the storage limit on my current Render DB, and the next tier up is an additional $75/month (would take me into $150/month, for a service that has yet to make any money). Oh Hetzner, I can get (significantly) more compute/storage for about $10/month. And that $10/month includes plenty of room to grow with other side projects and things I might add to existing things. That’s really nice. If I can keep the complexity low in terms of deployment and infra management, I think it’ll make sense to just have this be the default going forward. And if it doesn’t work out, I’ll learn some good lessons about computers. Ok, and now, one more thing. I really liked Render. It’s super convenient and well done. I will very likely go back to
them for future projects, and certainly if I need more advanced features like autoscaling or whatever. But one thing did irk me: database performance. I guess for $20/month, I expected to get a database that would have pretty fast response times/pretty high throughput for my user requests/batch processing jobs. And I didn’t really get that most of the time. I am not really a database perf expert, but I did seem like what I was seeing was abnormally nerfed performance for what I was asking the server to do. We’re talking about querying a table with ~100k rows and doing bulk inserts of ~1000s of records during batch jobs. Not exactly massive scale. Interestingly, my concerns seem to be somewhat validated with my switch to Hetzner. The DB server I now use has fairly similar hardware specs, but manages to achieve noticeably better throughput on my batch processing jobs (jobs that normally took 10mins to complete now regularly complete in 2 while doing similar amounts of work), and tested
about 20% faster for responding to user searches. It’s nice to be able to switch to something that is both cheaper and better than what I was using before. But I wish that my $20/month would have gone farther with Render.
Date
December 22, 2023