{"id":3215,"date":"2014-09-23T22:00:07","date_gmt":"2014-09-23T16:30:07","guid":{"rendered":"https:\/\/www.qadit.com\/blog\/?p=3215"},"modified":"2014-09-23T22:00:07","modified_gmt":"2014-09-23T16:30:07","slug":"heroku-101-a-beginners-guide-to-hosting-apps-in-the-cloud","status":"publish","type":"post","link":"https:\/\/qadit.com\/blog\/heroku-101-a-beginners-guide-to-hosting-apps-in-the-cloud\/","title":{"rendered":"Heroku 101: A Beginner&#8217;s Guide To Hosting Apps In The Cloud"},"content":{"rendered":"<p>Apps are big business. Everyone is using them for games, messaging, and information. Some people are even making their own. <\/p>\n<p>Small businesses and amateur programmers might be interested in getting into the app game, too. There are plenty of tutorials online for building an app. The hard part is figuring out what to do once the app has been built. How do you get it to people?<\/p>\n<blockquote>\n<p><strong>See also: <\/strong><a href=\"https:\/\/ift.tt\/1q7u8Wm\"><strong>How To Build A WinJS App In 10 Easy Steps <\/strong><\/a><\/p>\n<\/blockquote>\n<p>If you&#8217;ve built a Web app\u2014that is, a self-contained program designed to run in Web browsers, as opposed to the kind of app you might download from an app store\u2014then it needs a home on the Web. Specifically, it needs a Web address so people can find it, storage for the app&#8217;s code and associated data and background support to ensure that traffic spikes won&#8217;t knock it offline.<\/p>\n<p>That\u2019s where Heroku comes in. Heroku is a service that simplifies the process of getting your finished app to your potential users\u2014in just a couple of clicks. <\/p>\n<h2>What Is Heroku?<\/h2>\n<p><a href=\"https:\/\/ift.tt\/1x6UkGC\">According to Orion Henry<\/a>, one of the three cofounders, \u201cHeroku\u201d is a nonsense word comprised of \u201chero\u201d and \u201chaiku.\u201d The founders\u2019 reason for a Japanese-sounding name is a node to Yukihiro \u201cMatz\u201d Matsumoto, the inventor of the Ruby programming language.<\/p>\n<p>Founded in June 2007, Heroku predates most of the buzzword-laden phrases we now use to describe it. \u201cIt\u2019s a PaaS [Platform as a Service].\u201d \u201cIt lets you deploy apps from the cloud!\u201d<\/p>\n<p>In plain English, Heroku gives apps a place to live on the Internet. Much the way a website host puts your site up on the Web and keeps it running using its own servers, Heroku puts an app you&#8217;ve developed on the Internet for others to use. With a few clicks you can &quot;deploy&quot; your app, thus making it possible for others to find and load into their browsers the same way they&#8217;d load a Web site.<\/p>\n<p>There are, of course, alternatives to Heroku. Appfog and Dotcloud are comparable services. However, they are much younger than Heroku, the granddaddy of online app hosting, and have had a lot less time to cement their reputations.<\/p>\n<p>It&#8217;s also possible to host apps on big cloud services like Amazon Web Services or a Web hosting service like DreamHost, although it&#8217;s far more complicated to do so. And they charge a lot even for that level of service.<\/p>\n<p>Since Heroku\u2019s identity is so firmly entrenched in app deployment, I originally mistook it for a platform where developers could also build their apps. However, while you can easily test your applications with Heroku, it\u2019s not designed to help you build them from scratch.<\/p>\n<h2>Who Uses Heroku And Why?<\/h2>\n<p>Some of Heroku\u2019s most well known clients include <a href=\"https:\/\/ift.tt\/Vo16Bk\">Asics and Miley Cyrus<\/a>. But companies of all sizes\u2014and no small amount of independent developers\u2014use it, too.<\/p>\n<p>Sure, you can host your own website by running a networked server to, well, \u201cserve\u201d it out of your home or office. But it\u2019s a lot of responsibility, and that\u2019s why a lot of companies entrust this to outside hosting services. And as it turns out, hosting an app\u2014which can be subject to occasional surges of user interest\u2014is a lot more strenuous than website hosting can be. When the inevitable downtime happens, you have to deal with it yourself, rather than just check <a href=\"https:\/\/ift.tt\/ArFV5i\">Heroku Status<\/a>.<\/p>\n<p>In fact, if you build your own infrastructure around an app, you\u2019ll be lucky if you can do it in <a href=\"https:\/\/ift.tt\/1fUeara\">fewer than three days<\/a>. And if things go wrong, you\u2019re on your own. By contrast, Heroku allows you to deploy quickly, forget about the infrastructure, and just focus on improving your app.<\/p>\n<p>Heroku is also great for beginners since its free tier of service covers everything newbies need. You can deploy as many apps as you like on Heroku, so long as they&#8217;re not too large (in terms of the associated data you&#8217;re hosting) and you don\u2019t mind the possibility that Heroku might randomly take them offline for what it calls &quot;unscheduled downtime.&quot;<\/p>\n<p>I&#8217;m currently hosting five different apps on Heroku\u2014all Twitter bots\u2014and they only become active about once an hour when they attempt to send a tweet to Twitter. The rest of the time, I don\u2019t care if they\u2019re down. <\/p>\n<blockquote>\n<p><strong>See also: <\/strong><a href=\"https:\/\/ift.tt\/UniLih\"><strong>Five Steps To Build Your Own Random Non-Sequitur Twitter Bot<\/strong><\/a><\/p>\n<\/blockquote>\n<p>Scale is another major reasons people use Heroku. What if your modest app suddenly goes viral? Heroku will automatically devote extra servers to keep it from crumbling under the pressure. When Chris Whong, a civic hacker, suddenly saw his <a href=\"https:\/\/ift.tt\/1scXAh8\">data visualization app of New York taxi drivers<\/a> make the front page of Hacker News, Heroku adjusted it to support a flood of new users. <\/p>\n<h2>How Heroku Works<\/h2>\n<p>When you create an app on Heroku, it deploys to the Cedar Stack, an online runtime environment that supports apps built in Java, Node.js, Scala, Clojure, Python and PHP\u2014all the programming languages that Heroku supports.<\/p>\n<p>The current version of the Cedar Stack is <a href=\"https:\/\/ift.tt\/JvAWHz\">Celadon Cedar<\/a>. It supports hundreds of thousands of developer apps. When you deploy a new app, Heroku assigns it a unique name based on a natural theme, like \u201ccalm-springs3345\u201d or \u201cdesolate-cliffs1221.\u201d <\/p>\n<div>\n<figure><img decoding=\"async\" src=\"https:\/\/ift.tt\/1wJtWzn\"><figcaption>My many apps, labeled with nature-inspired names for the Cedar stack<\/figcaption><\/figure>\n<\/div>\n<p>When it comes to your app, think of Heroku as home to a vast array of virtual computers, or &quot;instances,&quot; that can be powered up and down. Heroku calls these instances <a href=\"https:\/\/ift.tt\/14bRY5W\">dynos<\/a>; these are\u00a0lightweight containers that each run a single command for your app. In my experience as a beginner building apps that only perform one action, I\u2019ve never had more than one dyno per app.<\/p>\n<p>It turns out that a lot of apps require the same actions. Heroku keeps developers from reinventing the wheel with the <a href=\"https:\/\/ift.tt\/y2UmIt\">Addon Store<\/a>, which provides actions you can assign to dynos for free or, sometimes, a fee. I am using a free addon called <a href=\"https:\/\/ift.tt\/XViaOK\">Heroku Scheduler<\/a>, which prompts my apps to become active once every hour.<\/p>\n<p>For a more high level explanation, here\u2019s an <a href=\"https:\/\/ift.tt\/1wJtWzv\">overview of Heroku\u2019s architecture<\/a>. <\/p>\n<h2>Heroku And Git<\/h2>\n<p>One of the reasons Heroku is easy for people to use is that it relies on a widely used revision control system\u2014that is, a way of managing the program code for your app\u2014called Git. If you\u2019re not already familiar with Git, you might want to review ReadWrite\u2019s <a href=\"https:\/\/ift.tt\/15FxkwV\">beginner tutorial for Git and GitHub<\/a>.<\/p>\n<blockquote>\n<p><strong>See also: <a href=\"https:\/\/ift.tt\/15FxkwV\">GitHub For Beginners\u2014Don&#8217;t Get Scared, Get Started<\/a><\/strong><\/p>\n<\/blockquote>\n<p>In fact, you can\u2019t deploy an app on Heroku unless you are using Git to manage your app clode. The \u201c<a href=\"https:\/\/ift.tt\/1jvSPuR\">push<\/a>\u201d command, \u201cHeroku push master,\u201d is what you input on the command line to send the app from your repository to the cloud. That\u2019s why Heroku is considered a \u201cone click\u201d deploy. <\/p>\n<blockquote>\n<p><strong>See also: <\/strong><a href=\"https:\/\/ift.tt\/1kLH8CI\"><strong>See What The Code Behind An App Does With Just One Click<\/strong><\/a><\/p>\n<\/blockquote>\n<div>\n<figure><img decoding=\"async\" src=\"https:\/\/ift.tt\/V1owSN\"><figcaption>The &quot;Deploy to Heroku&quot; button on GitHub in Heroku&#8217;s signature purple&amp;nbsp;<\/figcaption><\/figure>\n<\/div>\n<p>It\u2019s not just your own Heroku app that Git makes simple, but any finished app you might encounter on GitHub. Earlier this year, Heroku and GitHub teamed up to create a one click deploy button for repositories on GitHub. So if you see an app you\u2019re interested in learning more about, you can click the deploy button and try it for yourself on Heroku. <\/p>\n<h2>Signing Up For Heroku<\/h2>\n<p>Interested in trying Heroku out for yourself? Signing up is easy, with one caveat. <\/p>\n<p>To create your Heroku account, all you need is an email and password. But if you want to do anything with your Heroku-hosted app, like take advantage of one of the many useful free addons, you need to put in a credit card number. Heroku says it\u2019s for <a href=\"https:\/\/ift.tt\/1wJtXDq\">account verification<\/a>. Though it obviously makes it easier for Heroku to tempt you with paid services as well.<\/p>\n<p>If all you want to do with your Heroku account is test other people\u2019s apps using the GitHub one-click-deploy button, you can stop here. But if you want to deploy your own apps from your desktop, you\u2019ll also want to install the <a href=\"https:\/\/ift.tt\/GIT563\">Heroku Toolbelt<\/a>. <\/p>\n<p>Heroku Toolbelt is a resource that bundles three tools: <a href=\"https:\/\/ift.tt\/1x6UmhI\">Heroku client<\/a>, a command line interface tool for creating and managing Heroku apps; <a href=\"https:\/\/ift.tt\/1wJtWzF\">Foreman<\/a>, which lets you run your apps locally; and <a href=\"https:\/\/ift.tt\/MYCc6d\">Git<\/a>, which we already know allows you to push apps to the Heroku stack.<\/p>\n<p>With Heroku Toolbelt, you can easily create, manage, test, and deploy apps from your PC. <\/p>\n<h2>Learning More About Heroku<\/h2>\n<p>If you learn by watching videos, Code School might be your best bet. Watch instructor Jay McGavren <a href=\"https:\/\/ift.tt\/1wJtXDt\">deploy a Ruby on Rails app with Heroku<\/a>.<\/p>\n<p>If you prefer written instructions, you can use <a href=\"https:\/\/ift.tt\/UniLih\">my tutorial<\/a> for deploying an app built with Python and Ruby. Or Dave Winer\u2019s straight-to-the-point <a href=\"https:\/\/ift.tt\/1fzZyOX\">Node.js app walkthrough<\/a>. <\/p>\n<p>But ultimately, the best place to learn about using Heroku is the service&#8217;s own\u00a0<a href=\"https:\/\/ift.tt\/Lw1tqx\">Heroku Dev Center<\/a>. Choose one of the <a href=\"https:\/\/ift.tt\/1wjEurD\">Get Started Guides<\/a> according to your preferred programming language. Though Heroku can get extremely high level, a refreshing amount of its development center resources are dedicated to people who want to <a href=\"https:\/\/ift.tt\/1wJtXDx\">learn new skills<\/a>. <\/p>\n<p>Heroku is just one way to host your apps online, albeit a particularly established and popular one. Hopefully this article helps you make an informed decision about which service is best for your app.<\/p>\n<p><em>Lead image courtesy of Heroku<\/em><\/p>\n<div>\n<a href=\"https:\/\/ift.tt\/1x6UmOB\"><img decoding=\"async\" src=\"https:\/\/ift.tt\/pLLLX3\" border=\"0\"><\/a> <a href=\"https:\/\/ift.tt\/1wJtXDF\"><img decoding=\"async\" src=\"https:\/\/ift.tt\/1wJtWQ0\" border=\"0\"><\/a> <a href=\"https:\/\/ift.tt\/1x6UmOM\"><img decoding=\"async\" src=\"https:\/\/ift.tt\/i4UtTu\" border=\"0\"><\/a> <a href=\"https:\/\/ift.tt\/1x6Uo9o\"><img decoding=\"async\" src=\"https:\/\/ift.tt\/hau7uJ\" border=\"0\"><\/a> <a href=\"https:\/\/ift.tt\/1x6UopM\"><img decoding=\"async\" src=\"https:\/\/ift.tt\/e1EM3a\" border=\"0\"><\/a> <a href=\"https:\/\/ift.tt\/ZG3s73\"><img decoding=\"async\" src=\"https:\/\/ift.tt\/nYvJve\" border=\"0\"><\/a> <a href=\"https:\/\/ift.tt\/1wJtX6t\"><img decoding=\"async\" src=\"https:\/\/ift.tt\/nj7BwU\" border=\"0\"><\/a> <a href=\"https:\/\/ift.tt\/1wJtXU7\"><img decoding=\"async\" src=\"https:\/\/ift.tt\/gOTBYX\" border=\"0\"><\/a>\n<\/div>\n<p><img loading=\"lazy\" decoding=\"async\" height=\"1\" width=\"1\" src=\"https:\/\/ift.tt\/1x6UoGb\"><\/p>\n<p>via https:\/\/ift.tt\/1r437Xx<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Apps are big business. Everyone is using them for games, messaging, and information. Some people are even making their own. Small businesses and amateur programmers might be interested in getting into the app game, too. There are plenty of tutorials online for building an app. The hard part is figuring out what to do once &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/qadit.com\/blog\/heroku-101-a-beginners-guide-to-hosting-apps-in-the-cloud\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Heroku 101: A Beginner&#8217;s Guide To Hosting Apps In The Cloud&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[1],"tags":[],"class_list":["post-3215","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9AH7Q-PR","_links":{"self":[{"href":"https:\/\/qadit.com\/blog\/wp-json\/wp\/v2\/posts\/3215","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/qadit.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qadit.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qadit.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/qadit.com\/blog\/wp-json\/wp\/v2\/comments?post=3215"}],"version-history":[{"count":0,"href":"https:\/\/qadit.com\/blog\/wp-json\/wp\/v2\/posts\/3215\/revisions"}],"wp:attachment":[{"href":"https:\/\/qadit.com\/blog\/wp-json\/wp\/v2\/media?parent=3215"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qadit.com\/blog\/wp-json\/wp\/v2\/categories?post=3215"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qadit.com\/blog\/wp-json\/wp\/v2\/tags?post=3215"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}