AppFog vs. Heroku

AppFog vs. Heroku

Choosing a platform as a service (PAAS) for your new web application can be a difficult and confusing task. There are countless platforms to choose from, each having their own strengths and weaknesses. To aid in your decision, I have selected two of the best options available. I will go over some of the key aspects in each PAAS so that you can make a more informed decision.

Applications running on Heroku are self contained…

For the unfamiliar, PAAS usually refers to a service that takes care of the underlying hardware and OS that comes with building a web application. As developers, these platforms allow us to easily build or prototype applications without handling any hardware or configuring servers.

Now enough about what PAASs are, let’s get down to the two chosen candidates: Heroku and AppFog. At a glance, these services may seem quite similar. They both have support for multiple languages, provide databases and add-ons, and allow you to run your application in the cloud. But these companies took a very different approach from one another, in terms of execution.


Pricing

You might think pricing between these two competitors are basically the same, but that couldn’t be further from the truth.

AppFog’s pricing revolves around RAM. You can create as many apps and instances as you want as long as you stay within your RAM limits.

The free AppFog plan comes with 2GB of RAM. The next plan gives you 4GB of RAM, but at a steep $100/month.

Your RAM is shared across all the applications in your account. The minimum RAM per instance is 128MB. So you can have up to 16 instances at 128MB, a single instance with a whopping 2GB, or anything in between.

Heroku, on the other hand, charges you for your instance’s CPU time; RAM comes free with each instance. Your applications do not share billing hours, and Heroku gives you 750 free hours per month per application. This is enough to run one instance for a month and still have time left over (30 days x 24 hours = 720).

The cost for additional time is $0.05 an hour, and time is tracked by the second. So if you have a background worker that can do its job in 15 seconds, you will only be charged for that 15 seconds at the price mentioned above.

It’s difficult to compare these pricing plans, because they both have their strengths and weaknesses. Let’s compare a few cases on both of these platforms and calculate how much you would pay. I’m going to calculate the prices based on 512MB RAM AppFog instances; this is what you get from Heroku. Naturally, optimizing your app’s RAM footprint will give you more out of your account.

Database support is extremely important, and…Heroku is the clear winner.

  • Scenario #1 – You have one app running four instances for a complete month. This would be free on AppFog, but you would pay $107 on Heroku.
  • Scenario #2 – You have more than four apps, each running only one instance. On Heroku, this would be free, while this could start to add up (5-8 apps = $100, 9-32 = $380, 33-64 = $720) on AppFog.
  • I personally prefer Heroku’s pricing because of the “per app” model, as opposed to AppFog’s “per account”. This allows you to build both a full-time app and a part-time background worker while still being within the free plan’s limits. Of course, you would have to start paying for an app if it becomes popular. Contrast that with AppFog, where, eventually, you would have to start to shell out some cash before gauging the demand.

    Again, please note that this is only my personal opinion. I like to build random apps and tools in my spare time without any funding, and Heroku is better suited for that purpose. However, if you plan to build only one app, or need instances that have more than 512MB RAM, then AppFog may be the better fit.

    Heroku’s pricing is also more predictable, and you can easily calculate how to make your applications profitable.

    When it comes to support, AppFog is the clear winner.

    Consider for a moment that one instance of your app can handle 100 customers. At $36/month per instance, you can easily divide the cost among the customers and come up with a sustainable price that scales with your application.

    AppFog, on the other hand, may be a bit cheaper, but the payment thresholds seem to be spread too far apart. Using the above example, when you switch from eight instances to nine, you have to pay an extra $180 for just one instance. But then again, you don’t pay anything until you reach 33 instances, at which point you basically double your bill from $380 to $720. Therefore, sometimes you pay over $42 for each instance, and other times you pay under $12 each.


    Project Management

    This is another area where Heroku greatly differs from AppFog. Applications running on Heroku are self contained; all the workers and web instances are combined into one Git repository. This works by placing your whole application (Web server, background workers, scripts, etc) in a Git repository, and making a Procfile. This is where you assign names to the different instances along with how they are started. For example, if you have a Python project that serves as the web instance and a file for a background emailer, then your Procfile might look like the following:

    web: python site.py
    emailer: python emailer.py
    

    The first word of each line is the instance’s name. The second portion (after the colon) is the command to run the app. With a Procfile, you can scale any instance at will through the site, command-line, or API.

    AppFog is a bit different. You must create a separate ‘app’ for each background process, making your app not feel completely cohesive. Additionally, all your apps on one account get mixed together. For example, if you have multiple apps in Heroku, then your app structure would look something like so:

    	App1
    		-web instance
    		-worker_1 instance
    		-worker_2 instance
    	App2
    		-web instance
    		-worker instance
    

    This is straightforward, but compare that to AppFog:

    	App1_web
    	App1_worker_1
    	App1_worker_2
    	App2_web
    	App2_worker
    

    In my opinion, AppFog’s approach is less clear, but this comes down to the fact that AppFog resources are shared across apps.


    Databases

    Database support is extremely important, and between these two PAASs, Heroku is the clear winner. Heroku only offers PostgreSQL, but their native PostgreSQL database is a superb, production-quality database. It’s not something they slapped together; they even offer it as a standalone product.

    AppFog, on the other hand, supports MongoDB, MySQL, and PostgreSQL. Unfortunately, however, MongoDB and Postgres are still in beta; AppFog imposes a 100MB limit on all databases. Please note, though, that AppFog says this is only temporary; they’re currently in the processing of adding more database settings.

    If your application is small, or if you’re not really concerned about downtime or disk space limitations, then you can really go with either PAAS. But if you are building a production application and need a reliable, feature rich database system, I suggest you use Heroku’s Postgres databases, even if you are planning to go with AppFog for your hosting. As I already mentioned, Heroku does offer their database as a standalone product at a very competitive price.


    Addons

    Both services provide many of the same add-ons, but Heroku provides considerably more, due to the fact that they’ve been in business longer than AppFog. Heroku offers over 100 add-ons, while AppFog, at the time of this wring, offers around 13. Do I think this should be a deciding factor? Not really. It’s certainly nice to set up a 3rd party service with one click, but you’ll want to directly signup for the add-on instead of going through Heroku or AppFog. Doing so sometimes gives you better features and clearer pricing information.


    Support

    When it comes to support, AppFog is the clear winner. Heroku has been around a while, and you can probably find some information on what you need online, but their support feels outdated. You first have to search their knowledge base, and only then can you open a new ticket. AppFog, on the other hand, offers live chat support. It’s hard to beat instant results.

    Heroku does offer 24×7 support… but only for a price. You have to pay for their ‘buisness critical’ package. I’m not saying Heroku has bad support, but I’m not sure you can compete with instant answers.


    Summary

    To help make your decision easier, I’ve created the following table to summarize all the points made above:

    Does this mean you should go with Heroku, because it won 3.5/5 times? Not necessarily. Everything above is true, but can you compare a win in add-ons as important to a win in pricing? Ultimately, this is something that only you can decide based on your application’s needs.

    As always, leave a comment if you have any questions or thoughts on Heroku or AppFog. Thanks for reading.

Note: Want to add some source code? Type <pre><code> before it and </code></pre> after it. Find out more
  • Anon

    Good article! Can you explain what an instance is?

    • http://gabrielmanricks.com/ Gabriel
      Author

      Ya sorry, by instance I mean any “process / server”. So if you have a ruby program that serves your website that would be one instance if you then scale it up by telling heroku / appfog to run five copies of your program for additional concurrency then you would be running five instances.

  • http://roadha.us/ haliphax

    I’ve been using PHPFog and AppFog a bit over the last month, and as far as I can tell, they use git repositories for their project management, as well. PHPFog gives you direct git access, whereas AppFog uses a ruby-driven command line client (the “af” gem).

    • Mihkel

      Yeap, Appfog has a project management utility

      • http://gabrielmanricks.com/ Gabriel
        Author

        I find ‘af’ does the job just fine when you are developing alone. But I don’t think that it is as feature rich and industry proven as git. You can’t seem to make branches or pull specific versions, I do like the ‘af download’ function though.

      • Ptg

        I think the point of AppFog’s system is that you should still be version controlling your project (with git or whatever tool you like), but the deployments aren’t tied to it. So all the things you mention (branch/pull specific version) should be done with your vcs of choice, and then you use their af tool to push it live.

      • http://gabrielmanricks.com/ Gabriel
        Author

        That does make sense, but it’s still an extra step. I guess it enables you to separate between who’s allowed to work on the code and who’s allowed to push the code to the server.

    • http://gabrielmanricks.com/ Gabriel
      Author

      I looked through the gem and as far as I can tell it doesn’t use git. Someone can correct me if I’m wrong but I think they created their own tool that just uses a similar lingo (push, pull). PhpFog on the other hand does use real git.

  • Hasin Hayder

    Heroku with no PHP (actually PHP is supported only for FB apps) is a bit frustration for a huge number of PHP app developers. I’ve been using AppFog since their starting and I must say that I am very happy with them.

    There is another one from RedHat called OpenShift – is also very good.

    • http://gabrielmanricks.com/ Gabriel
      Author

      Heroku does support PHP applications although it isn’t documented. You can find a quick tip written by Jonathan Cutrell that was also posted today.

      I have been using PhpFog for almost 2 years now so they definitely have some experience in that market.

      OpenShift looks pretty cool I’ll give it a try.

  • tonylara

    I’ve tried Heroku and Appfog briefly for small projects and I would agree that Heroku is better at testing it with small apps and their database gives me less problems than Appfog. However Appfog pricing for larger projects is a very good alternative. I haven’t tried Appfog’s support yet, I haven’t use Heroku’s ticket system either, but their documentation is a good start to get things fixed, plus stackoverflow has a lot of 3rd party documentation for both PAAS.

    Thanks for this article, I didn’t know somethings about Appfog like their chat support.

  • http://twitter.com/yanni_boi yanniboi

    Nice! very helpful…

  • http://twitter.com/anthonysutardja Anthony Sutardja

    Another thing worth noting is SSL support. Both Heroku and Appfog give you SSL support with the sub-domain names they provide you. However, Appfog only allows custom domains with SSL for their paid accounts (starting at 100$/mo) where as Heroku allows you custom domains with SSL for 39$/mo.

    • Oliver Bachmann

      Isn’t it 20$

      • Eduardo Bautista

        Correct,

  • Curious

    What do you think of dotcloud? Just curious why you think appfog is better than dotcloud? Thanks.

    • eberfreitas

      I have never used it for real apps (yet) but they are awesome. Just look at their docs and be amazed!

    • http://gabrielmanricks.com/ Gabriel
      Author

      I thought about comparing Heroku to dotCloud but I think Heroku v.s. AppFog is a better view on the two extremes. If I would rate dotCloud I would say it is kind of a mix between Heroku and AppFog.

      You pay by the ram (it’s more expensive than Heroku and AppFog) but their are no pricing packages so you can scale at whatever pace you want. You can group your applications together and scale each individually like in Heroku, The databases seem stable and you scale them exactly the same way you scale everything on the site (by RAM, you get 10GB of storage for every 1GB of RAM). Overall it looks like it has a lot of great options both in terms of instance types and scaling but may be a bit more expensive than both AppFog and Heroku.

      What is your view on dotCloud? I haven’t really tried it out.

      • curious

        I have tried them with very small, toy applications. With those, I like the responsiveness of the hosted applications. They load quickly and work well, as well as if they are on my local server. I wanted to have an opinion of someone more experienced with bigger, more demanding applications. The flexibility of choosing databases and server language in dotcloud is great. Deployment is also very easy on dotcloud.

        I don’t know why but it always felt that dotcloud is cheaper than Heroku. I need to compare the pricing more carefully.

      • http://gabrielmanricks.com/ Gabriel
        Author

        It can be cheaper because you pay per 32MB RAM but comparing a 512MB server in both providers Heroku is cheaper (36$ vs 69$). Although you probably can get away with less RAM (e.g. 128MB).

  • aomran

    I need to try Heroku then! I tried appfog but the volatile disk space was a bit of a problem (there is a 100MB limit and it gets reset every application start unless the files are part of the git repository).

    Openshift by red hat is a great option too.

    • http://gabrielmanricks.com/ Gabriel
      Author

      Heroku works the same way (volatile disk space), Apparently they do it because they want to force ‘best practices’ on you, If one of your servers has information that another one doesn’t (i.e. a user uploaded a photo, etc) your users would get an inconsistent experience. They suggest using a file store like amazon s3 (you could even probably use google drive, ubuntu one etc) doing so makes sure your files are available to all servers.

    • http://twitter.com/jaipandya Jai Pandya

      A similar limitation you’ll find with heroku as well. I would suggest to use amazon s3 or similar for persisted storage. A smart / free solution can also be to use Dropbox for this.

  • JBR

    Good article, but you missed a point: heroku will kill your (free) single web instance after a few minutes of inactivity. Some of my sites have less than 200 visitors daily and without “hacks” heroku may shutdown the single process instance. The result is a 10-20 seconds response time on the first request after shutdown. ps: I <3 heroku.

    • http://chris-schmitz.com/ Chris Schmitz

      Yeah, this is annoying, but there are ways around it… We setup availability monitoring through the New Relic addon and have it ping the site every 2 minutes to keep the instance alive. An easy, free fix and it can’t hurt to have the monitoring anyways :)

      • http://twitter.com/pythondj Diane Mueller

        Cool use case for New Relic – I hadn’t thought about using it for that purpose – thanks for the tip!

  • http://twitter.com/loasca Lorenzo

    Hi, what about Heroku vs Pagodabox?

    • http://gabrielmanricks.com/ Gabriel
      Author

      I like pagodaBox’s UI and clear documentation but they are PHP only and while that’s not a bad thing if you are a PHP developer (which I mostly am) but it wouldn’t be a direct comparison to Heroku or appFog. Maybe PhpFog though.

      • http://twitter.com/loasca Lorenzo

        Yeah sorry. I was also reading the Heroku PHP deployment article and so I only focused on PHP.
        A comparison with Pagodabox deployment would be great thought.

  • http://www.facebook.com/people/Jonas-Ohlund/692881380 Jonas Öhlund

    The reason I will go with AppFog is that is the only PaaS I know of which lets you choose location and has support for Play Framework! I live in Sweden and most other PaaS is located in the U.S which is suboptimal.

    • http://twitter.com/sjorg Scott Jorgensen

      The Play Framework is one of Heroku’s officially supported frameworks. Here are some docs on how to get started with it: https://devcenter.heroku.com/articles/play

      • http://www.facebook.com/people/Jonas-Ohlund/692881380 Jonas Öhlund

        yeah, but heroku only has servers in the U.S – not in Europe. Otherwise I would go with heroku.

  • ihti

    Idea behind AppFog is amazing but they are still not ready for production apps. I tried but to many problems with performances, af cli tool etc…

  • Gijs

    Nice article, i tryed pagodabox.com also a nice solution.

  • http://www.facebook.com/skjelfoss Patrik Skjelfoss

    Ive tried playing around with both Heroku, Appfog and dotcloud previously. Out of these I definitely, as this article suggests, prefer Heroku. However, I finally ended up going with cloudcontrol.com which is a Berlin based PaaS which use aws Europe. I have a couple of smaller applications running on their free-tier and a bigger app where I pay a minor fee/month. Their pricing is as predictable as Heroku, I can use Git (same as Heroku) and can also have multiple deployments in one application (e.g for staging, developement, production) which is currently not possible on Heroku. They dont have as an extensive add-on marketplace as Heroku (approx. 40 compared to 100), but all I need is there.

    • http://gabrielmanricks.com/ Gabriel
      Author

      What kind of response times do you get from cloudcontrol both free and paid?

      • http://www.facebook.com/skjelfoss Patrik Skjelfoss

        Response time seems the same for both free and paid plans. According to
        cloudcontrols support all apps run on the same infrastructure. Also,
        they do not shut down idle containers from what I can tell.

      • http://gabrielmanricks.com/ Gabriel
        Author

        Thanks

    • http://www.facebook.com/pixel67 Tony Brown

      Thanks for the tip :)

    • http://www.facebook.com/ivanfr26 Ivan Roth Rolnik

      Thanks, will try out.

  • Guest

    Why use these severices over Amazon elastic beanstalk?

  • rt

    Why use these services instead of Amazon Elastic Beanstalk?

    • http://gabrielmanricks.com/ Gabriel
      Author

      Elastic beanstalk is just an interface to provision the necessary infrastructure for your application, it’s a free service provided by amazon to help people get started. You can technically use it in the same way you would use a PAAS, but I’m not sure I would call it one. Pricing is hard to compare, because it is not a full fledged PAAS you pay for load balancing and outbound data. On the flip side if you are comfortable with server and configuring them, then you will have a lot more flexibility then you would with a conventional PAAS. So it really depends on what you need. I would say, if you are going to customize the servers manually then it’s probably worth it otherwise I would go with a standard PAAS.

  • codemasala

    I’m using Appfog for one of my app and I’m pretty much satisfied with their service :)

  • http://scrumway.asia/ jpartogi

    Thanks. This really helps. Have you ever compared Heroku pricing model with Dotcloud latest pricing model?

  • Ejaz Siddiqui

    I have been using PhpFog with a MySQL db for more than a year and feels that it is a very good service. I do use Git for version control. Currently I am experimenting with OpenShift. Although I have not used Heroku but shutting down of the instance seems to me a bigger issue.

  • Sid

    The best pricing structure belongs to Pagodabox. Simplicity defined. Their pricing page UI is worth a look.

  • Mikkel Breum

    Also check out Berlin based Fortrabbit: http://fortrabbit.com/

    • PHPCoder

      yea, very nice.. great pricing,,, they also have persistent storage with a very cool Sync Tool.
      No Addons to speak of, and a bit slow from the Americas (ping). They only serve from Europe.
      I hope they update that ASAP.

  • stondo

    Hello everyone,

    since it was mentioned here and I live in Europe, does cloudcontrol support Django/Mezzanine? I’m currently using Heroku to deploy Django/Mezzanine apps, but my clients r mostly from EU zone, so bette response times is a must.

    Thanks

  • http://www.desinle.com/ Desinle

    Its ridiculous, how you have compared the pricing of heroku and appfog.. if you 4 apps on appfog with 512MB RAM, it still be free, as four Single apps on Heroku will have the same 512MB RAM.. Get the facts right at first..

  • http://twitter.com/_Diit Aditya Dwi Putra

    So far, my nodejs on appfog still running well to support my web services..

  • http://joker.linuxstuff.pl Michał Kwiatkowski

    Good article, I liked your detailed comparison.

    Another interesting alternative to Heroku, at least in Ruby space, is Shelly Cloud: https://shellycloud.com/ Model is different than Heroku’s or AppFog’s in that you get virtual servers like on EC2, yet without sacrificing the ease of use: still a git push to deploy and a simple config file to setup and scale. There’s PostgreSQL and an option for replicated MongoDB if you care about reliability. For medium-to-big high-performance application it surely seems like a very cost-effective solution.

    It’s hosted in Europe (with datacenters in Germany and France), as that matters to some.