Hosting - PAAS vs DigitalOcean/AWS/etc

Expanding on a Twitter thread, I’m really interested in the communities opinion and experience using PAAS (Heroku, etc) vs Digital Ocean or AWS/Azure/Google.

My two cents is that for small projects/teams, using a PAAS makes a lot of sense. With proper caching/CDN, it takes a very large site before diving into devops makes sense. That said, if you are a large site and have a good dev ops team, use them! But in my experience, dev ops knowledge isn’t easy or cheap to come by.

2 Likes

I’ll add that @carltongibson and I have a podcast episode on this topic.

I’d love to hear what the debate is like at large/growing companies: when to jump from PAAS to IAAS, what’s the consideration of tradeoffs? I know @Jeff, for example, uses Digital Ocean for many small/medium projects happily. So I imagine/expect him to weigh in here :slight_smile:

Despite “doing the devops” for many years, I push most people to use a PaaS. For most teams it’s not worth the investment to learn how to set up a server, build reliable database backups, etc. - “undifferentiated heavy lifting.” That said, if you have that knowldege, great, use it and save a bit on your systems.

I’d only move from PaaS to self-managed infrastructure when there’s a requirement to use something more advanced, for example advanced networking configuration to interface with a partner. For “IaaS” tooling at that point I like Ansible, and AWS’ CloudFormation. I’d use Terraform if not on AWS, although it has weird syntax and execution control.

1 Like

Ok, quick thoughts here.

It depends. There is no right or wrong way to go here, but it depends on your experience level and how much you want to fiddle with your infrastructure or not at all.

In general, I would like to see more people use a CDN like Cloudflare and scale back their infrastructure more. I have helped several clients downscale from >200 servers to a single-digit number of servers a few times now by using a CDN. That can save them a million dollars or more a year. Their free plan will make any website more performant and save you money on infrastructure.

If you are new to deployment or don’t want to fiddle with infrastructure, then use Heroku. They are probably the easiest way to get your project deployed with the least grief and the least concerns about resources. Their costs tend to jump from free to more than the average service because they do more for you.

If you want to manage your server or run services that the mainstream servers may not support natively, then DigitalOcean is an excellent way to go. Disclaimer: This is what I use for side projects because my idea of not having to manage servers is very different than the average persons. DO gives you a Linux box to handle, or they can run your Docker images and have reasonably priced database servers that they manage for you. They are one of the cheaper options, IMO.

If you know what you are doing or want infrastructure that’s easier to hand off to others, AWS/Azure/Google is great, but you have to invest time in learning how they work, and they are not easy to learn. If you are new, you are going to spin your wheels and get frustrated with them. Even if you are a seasoned dev, all three have head-scratching moments, but they are incredibly powerful services.

I would avoid Kubernetes (k8s) unless you are very large, have a bunch of bare-metal servers, or you want to fiddle with the technology. It’s excellent for what it does, but I see a lot of people using it as a hammer to solve problems that don’t get any benefit from using it.

3 Likes

I think PaaS is the way to go at least for small teams.

For example, we’re currently using AWS Elastic Beanstalk + RDS. There’s a pretty steep learning curve, but there’s no need for everyone in a team to go down the whole rabbit hole.

We used to have a basic EC2 instance where we ran our app, then one day came where we had to update Ubuntu to get some package updates, update postgres to get some new db features, and the whole thing started crumbling (server maintenance probably not the first thing on your to-do list for small teams, easy for tech debt to accumulate). You also have to use something like fabric / ansible to automate deployments, etc… It turned into a lot of work.

Now we run Docker inside Elastic Beanstalk and our day to day has become much simpler (after quite a lot of learning/setup, but definitely worth it).

I agree with a lot of the sentiments here, namely that is depends, and that Heroku is great for the those who don’t have sysadmin tattooed on their back. Of course this is dependant on whether a team can afford to use Heroku or are looking to save costs.

If you’re feeling a little bit brave, I can recommend Dokku. I should put in a disclaimer that I’ve been playing on Linux for as long as I can remember and setting up Postgres isn’t much of a bother for me, but I totally understand it not being terribly easy, and somewhat daunting for the newcomer.

In my case at the moment, I’m working on a project with one other dev and a subject matter expert. I’m running Django and Postgres on two servers and using Dokku on Linode. This alternative is saving us many tens of dollars a month (this project is done in our spare time and hasn’t got an income yet).

Dokku even has a plugin for Postgres, which should (I’m doing Postgres the old school way) give you Heroku like features for both Django and Postgres. Mind you, I would think you would need two repos, one for Django and one for your Postgres Docker file, as a Dokku repo can only support one dockerfile if I’m not mistaken and it doesn’t support docker-compose files.

Using Dokku means that with a little bit of sysadmining at the start of the project, one can have PaaS like features on any cloud provider they wish.

And whilst I’m on the subject, I think Dokku would be a great fit for your latest book, @wsvincent, Django For Professionals, but appreciate that setting up Dokku is not really in scope for your book. Might work very well as a blog post if I don’t beat you to it! (very unlikely and my mum isn’t likely to have a need for Dokku anytime soon).

I should of course finish up by acknowledging that this isn’t something for everyone, but it might just be an easy enough entry into basic sysadmin linux stuff with a juicy reward, that it might just tempt a few to give it a go.

And at @jeff, I never knew that cloudflare had a free plan. That might in fact help me out very much, as my project is working with a uni in Norway and one in Australia. The project is hosted in Stockholm and very zippy up here in the North, but not so fantastic in Australia on, what is the world’s largest LAN party. Thanks for the tip, I’m off to check it out!

2 Likes

I’ll put another vote in for the pro-PaaS camp, especially for new projects where you’re proving out an idea.

I’ve done deployments with AWS, GCP, Digital Ocean, Rackspace, PythonAnywhere, and Heroku. IMO, Heroku was the easiest choice to hit the ground running.

If folks are interested, I did a stream that covers going from zero to deployed Heroku app that is up on YouTube. I included all the steps in the episode’s show notes. https://www.mattlayman.com/building-saas/new-project-who-dis/

I work with a lot of beginners, and I steer everyone towards Heroku unless they have specific background working with servers. If I were focused on building out my own single project, I’d use Heroku in a heartbeat as well.

But I end up working on a number of small projects where it’s really helpful to have a single general server environment, rather than having to pick and choose services from a PasS provider. For example I work with a couple science-focused teams, and it’s really helpful to have the database on the same server as the django server, and be able to set up cron jobs etc right on that one server. None of these projects are likely to grow, and the data is important but not high-volume, so a single server solution is really nice.

I look forward to working on a bigger project and needing to use all that Heroku offers. And I completely agree with what others are saying around staying away from projects like Kubernetes until you can prove that you need them, or you just want to explore the technology. I am continually amazed at how far you can push Django on a small set of resources, if you pay attention to best practices.

1 Like

Even for small projects, I often use DigitalOcean VPS and deploy with docker. Having a well configured docker services can go a long way on a $5 entry level droplet. I am running several services in this configuration for some time now and it fits my performance criteria so far.

Having said that, having a managed environment (database, redis etc.) has its advantages and impact on the cost in the long run (effort + peace of mind) but for me a PaaS feels too constraining some times (limit of db rows, integration with other services etc.). Therefore in “low-risk” projects i.e. data is pretty much static and can be restored any time through simple means (importing a fixture, data migration etc.) I go with DigitalOcean and docker every time.

1 Like

Great discussion! I am a big fan of managed services and believe businesses should take advantage of Heroku, AWS RDS, etc until it makes sense to hire someone specifically to handle infrastructure.

You need to manage a lot of resources before the savings of moving to raw servers makes sense. Even then, as others have pointed out, I wonder if the company has optimized everything with caching. Cloudflare can reduce a lot of the traffic on a site.

The main reason I like using managed services is because the provider is usually REALLY good at specific functions that are critical to keeping an app running well. For example:

  • Heroku’s deployment and rollback process is solid; I can push an update any time of day and be confident that if something breaks, it’s probably because I caused it within the codebase
  • AWS RDS uptime and backups system is excellent

In my opinion you are taking advantage of a bigger company’s engineers and lessons learned for a small cost, so it absolutely makes sense to go PAAS until you are really big.

From a business case perspective it makes a lot of sense to go with PAAS. I have used Pythonanywhere a few times in the past and have no complaints. However now I use DigitalOcean deploying with ansible and it has taken a lot longer than I thought for me to get comfortable with this approach(still learning :crazy_face:). I am pleased I took the time and persevered…

For a developer I do think it is worth the effort to learn these Devops skills. The best developers I have worked with are the ones that have a full appreciation of the stack all the way to production.

As Carlton said on the podcast our careers are a marathon not a sprint so there is time.

1 Like

I am using DigitalOcean because it costs me lower than AWS but the performance is awesome, You can check this guide to get it fixed on DigitalOcean server: https://www.cloudways.com/blog/host-wordpress-on-digitalocean/