You’re building a new Ruby app and are looking for options to deploy it. Or maybe you’re building your portfolio to showcase your projects. If you’re confused or frustrated because you’re not well versed in “Devops stuff” and don’t want to spend a lot of time figuring out how to set things by yourself, then you should consider using a PaaS provider.
There’s been some significant improvements that make self-hosting more approachable, but with a hosting platform you get the following features out of the box:
- Quick setup of your application and an interface to manage them.
- Built in metrics dashboards, logging basics, and standard machine health checks.
- CLI to manage and configure your applications from the terminal.
- SSL certificates and domain configuration out of the box.
- Manual and automatic rollbacks and backups.
- Security and updates of your servers and applications.
The not-so-hidden costs
Generally, if you can make operation problems someone else’s problem, it’s more favourable from a business’s point of view, that’s why I don’t recommend self-hosting on a VPS unless you have previous experience or the scale of your application makes it worth the investment.
Most of the vendors offer a free trial and cheap options to get started, so if you’re deploying small apps, the cost will be very similar to self-hosting, specially when you add the time spent in the extra configuration.
For example, just an hour of your billable time will pay for the cost of hosting your app for at least 1 month. If you’re building an app, then you could use that time to build your product.
The self-hosting tradeoffs
Self hosting can be a great option if the scale of your application translates into a significant cost saving or if you’re operations team or time spent will remain the same. Judoscale has a nice PaaS pricing calculator you can use as reference.
Another great use case for self-hosting is the learning experience, maybe you want to learn more about how things work under the hood or if you’re looking to get some “hands on” experience.
Although tools like Kamal or Dokku can give you a great deployment experience, the infrastructure around will still be your responsibility. These are some of the activities you’ll need to consider just to keep the light on:
- Set up your own load balancers, SSL and domain configuration.
- Upgrade of system dependencies of your app server, database, etc.
- Ensure backups are configured and working.
- Collect logs and monitor your servers.
- Auto-scaling or automatic failover needs to be handled manually.
- If you’re running critical workflows on production, you need to be on-call 24/7.
Next steps
If you haven’t already a look at the Hosting options to deploy a Ruby app or Guide to deploy a Rails app (in less than 10 minutes) for a step-by-step process. Others have written about these tradeoffs, make sure you check them out too:
Feel free to share your experiences with hosting and deployment of your applications.
