{"id":2312,"date":"2016-11-01T19:43:44","date_gmt":"2016-11-02T01:43:44","guid":{"rendered":"http:\/\/www.mooreds.com\/wordpress\/?p=2312"},"modified":"2017-10-10T19:29:25","modified_gmt":"2017-10-11T01:29:25","slug":"bare-minimum-of-ops-tasks-for-heroku","status":"publish","type":"post","link":"https:\/\/www.mooreds.com\/wordpress\/archives\/2312","title":{"rendered":"Bare minimum of ops tasks for heroku"},"content":{"rendered":"<p>Awesome, you are a CTO or founding engineer of a newborn startup.\u00a0 You have an web app up on Heroku and someone is paying you money for it!\u00a0 Nice job.<\/p>\n<p>Now, you need to think about supporting it.\u00a0 Heroku makes things way easier (no racking and stacking, no purchasing hardware, no configuring apache) but you still to set up some operations.<\/p>\n<p>Here is the bare minimum you need to do to make sure you can sleep at night.\u00a0 (Based on a couple of years of heroku projects, and being really really cheap.)<\/p>\n<ul>\n<li>Have a staging environment\n<ul>\n<li>You don&#8217;t want to push code direct to prod, do you?<\/li>\n<li>This can be a free dyno, depending on the complexity of your app.<\/li>\n<li><a href=\"https:\/\/devcenter.heroku.com\/articles\/pipelines\">Pipelines<\/a> are nice, as is <a href=\"https:\/\/devcenter.heroku.com\/articles\/preboot\">preboot<\/a>.<\/li>\n<li>Cost: free<\/li>\n<\/ul>\n<\/li>\n<li>Have a one line deploy.\n<ul>\n<li>Or, if you like CD\/CI, an automatic deploy or a one click deploy.\u00a0 But make it really easy to deploy.<\/li>\n<li>Have a deploy script that goes straight to production for emergencies.<\/li>\n<li>Cost: free<\/li>\n<\/ul>\n<\/li>\n<li>\u00a0Backups\n<ul>\n<li>User data.\u00a0 If you aren&#8217;t using a shared object store like S3, make sure you are doing a backup.<\/li>\n<li>Database.\u00a0 Both <a href=\"https:\/\/devcenter.heroku.com\/articles\/heroku-postgres-backups\">heroku postgresql<\/a> and <a href=\"http:\/\/docs.aws.amazon.com\/AmazonRDS\/latest\/UserGuide\/USER_WorkingWithAutomatedBackups.html\">amazon RDS<\/a> have point and click solutions.\u00a0 All you have to do is set them up.\u00a0 (Test them, at least once.)<\/li>\n<li>Cost: freeish, depending on the solution.\u00a0 But, user data is worth spending money on.<\/li>\n<\/ul>\n<\/li>\n<li>Alerting\n<ul>\n<li>Heroku has <a href=\"https:\/\/devcenter.heroku.com\/articles\/metrics#threshold-alerting\">options<\/a> if you are running professional dynos.<\/li>\n<li><a href=\"http:\/\/uptimerobot.com\/\">Uptimerobot<\/a> is a great free third party service that will check ports every 5 minutes and has a variety of alert options.\u00a0 If you want SMS, you have to pay for it, but it&#8217;s not outrageous.<\/li>\n<li>Cost: free<\/li>\n<\/ul>\n<\/li>\n<li>Logging\n<ul>\n<li>Use a logging framework (like slf4j or the rails logger, and mark error conditions with a string that will be easy to search for.<\/li>\n<li>Yes, you can use <code>heroku logs<\/code> but having a log management solution like papertrail will make you much happier.\u00a0 Plus, <a href=\"https:\/\/elements.heroku.com\/addons\/papertrail\">it&#8217;s free<\/a> for 2 days of logfiles.<\/li>\n<li>Set up <a href=\"http:\/\/help.papertrailapp.com\/kb\/how-it-works\/alerts\/\">alerts<\/a> with papertrail as well.\u00a0 These can be more granular.<\/li>\n<li>Cost: free<\/li>\n<\/ul>\n<\/li>\n<li>Create a list of third party dependencies.\n<ul>\n<li>Sign up for status alerts from these.\u00a0 If you have pro slack, you can have them push an email to a channel.\u00a0 If you don&#8217;t, create an alias that receives them.\u00a0 You want to be the person that tells your clients about outages, not the other way around.<\/li>\n<li>Cost: free<\/li>\n<\/ul>\n<\/li>\n<li>Communication\n<ul>\n<li>Internal\n<ul>\n<li>a devops_alert slack channel is my preferred solutions.\u00a0 All deploys and other alerts go there.<\/li>\n<\/ul>\n<\/li>\n<li>External\n<ul>\n<li>create a mailing list for your clients so you can inform them of issues easily.\u00a0 Google groups is fine, but use whatever other folks are using.\u00a0 Don&#8217;t use an alias in your email&#8211;you&#8217;ll forget to add new clients.<\/li>\n<li>do not use this mailing list for marketing purposes, unless you want to offload the burden of keeping the list up to date to the marketing department.<\/li>\n<li>do make sure when you gain or lose clients you keep this up to date<\/li>\n<\/ul>\n<\/li>\n<li>Run through a disaster in your mind and make notes on how you would communicate the issue, both internally and externally.\u00a0 How often do you update your team?\u00a0 How often do you update your clients?\u00a0 What about an internal issue (some of your code screwed up) vs an external issue.\u00a0 This doesn&#8217;t need to be exhaustive, but thinking about it ahead of time and making some notes will help you in the crisis.<\/li>\n<li>Cost: free<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>All of this is probably a four hour project, max.<\/p>\n<p>But once this is done, you&#8217;ll rest easier at night, knowing you have what you need to troubleshoot and recover from production issues.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Awesome, you are a CTO or founding engineer of a newborn startup.\u00a0 You have an web app up on Heroku and someone is paying you money for it!\u00a0 Nice job. [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[39,4,81,37],"tags":[],"class_list":["post-2312","post","type-post","status-publish","format-standard","hentry","category-cloud-computing","category-technology","category-the-food-corridor","category-tips"],"_links":{"self":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/2312","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/comments?post=2312"}],"version-history":[{"count":5,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/2312\/revisions"}],"predecessor-version":[{"id":2458,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/2312\/revisions\/2458"}],"wp:attachment":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/media?parent=2312"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/categories?post=2312"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/tags?post=2312"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}