Introduction to Heroku - CCT London 2013
Upcoming SlideShare
Loading in...5

Like this? Share it with your network


Introduction to Heroku - CCT London 2013



An introduction to Heroku, a cloud application platform. Covering the value from deploying your apps to an elastic, ployglot platform as a service. We also cover the features of Heroku and how to ...

An introduction to Heroku, a cloud application platform. Covering the value from deploying your apps to an elastic, ployglot platform as a service. We also cover the features of Heroku and how to use them on the command line and via the website control panel.



Total Views
Views on SlideShare
Embed Views



0 Embeds 0

No embeds



Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment
  • ----- Meeting Notes (16/01/2013 11:59) -----Create a new app via the website & on the command line.Show the addon market place, apps control panel & the dev center.

Introduction to Heroku - CCT London 2013 Presentation Transcript

  • 1. Introduction toHerokuJohn StevensonDeveloper AdvocateSalesforce / Heroku
  • 2. Proprietary &Safe HarborSafe harbor statement under the Private Securities Litigation Reform Act of 1995:This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertaintiesmaterialize or if any of the assumptions proves incorrect, the results of, inc. could differ materially from the resultsexpressed or implied by the forward-looking statements we make. All statements other than statements of historical fact could be deemedforward-looking, including any projections of product or service availability, subscriber growth, earnings, revenues, or other financial itemsand any statements regarding strategies or plans of management for future operations, statements of belief, any statements concerningnew, planned, or upgraded services or technology developments and customer contracts or use of our services.The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering newfunctionality for our service, new products and services, our new business model, our past operating losses, possible fluctuations in ouroperating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, the outcome ofintellectual property and other litigation, risks associated with possible mergers and acquisitions, the immature market in which weoperate, our relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, newreleases of our service and successful customer deployment, our limited history reselling products, and utilization andselling to larger enterprise customers. Further information on potential factors that could affect the financial results of, included in our annual report on Form 10-Q for the most recent fiscal quarter ended April 30, 2011. This documents and otherscontaining important disclosures are available on the SEC Filings section of the Investor Information section of our Web site.Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currentlyavailable and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions basedupon features that are currently available., inc. assumes no obligation and does not intend to update these forward-looking statements.
  • 4. Deployment is challenging“Ops teams are overwhelmed by developer requests”“Different environments are not always the same.Patching and internal processes often not automated”“There is a divide in many enterprises between thedevelopers & operations teams.”
  • 5. Continuous Delivery“..reducing the cycle time between an idea and usablesoftware”- Martin Fowler“Software delivers no revenue until it is in the handsof its users.”-Jez Humble“.. leads to deeper relationship between IT, theirbusiness customer, and their final customers.”-Jez Humble
  • 6. Cloud Services should be easy“Should have a natural way to use the services that fits intoeach teams existing workflow”“Should be easy to see the value & cost benefits”“Should be as trust worthy as any internal service, if not moreso.”
  • 7. DEMO: 30 SECOND APPCreating live apps should be fast…
  • 9. ForgetServersRunAnythingSeeEverythingTrust &Manage4 core principles
  • 10. FORGET SERVERSWhat is Heroku ?
  • 11. Introducing Dynos A self contained resource in which to runyour application (Linux container)A logical abstraction over serversApplication scalability is more valuable thannumber of servers
  • 12. Introducing Dynos A self contained resource in which to runyour application (Linux container)Allows a trivial way to scale your appand know how much its costing you!
  • 13. Inside an Heroku DynoApplicationDependenciesYourApplicationcodeEmbeddedContainer• Any application• Any framework(Spring, Play!, django, compojure,etc.)• Maven, Gradle, SBT,Leiningen, Bundle, etc.• Jetty, Tomcat, etc
  • 14. Heroku For DevelopersFor each developer app created- 1 Dyno with 750 hours per month freeNote: 31 days X 24 hours = 744 hoursYou can create as many Heroku applications as required
  • 15. Forget Servers Focus 100% on code Fully managed platform Trust Heroku to be your DevOpssupport
  • 16. RUN ANYTHINGWhat is Heroku ?
  • 17. An Elastic“polyglot”Platform-as-a-Servicepol·y·glot [pol-ee-glot]adjective1. able to speak or write several languages; multilingual.2. containing, composed of, or written in several languages
  • 18. First class languages on Heroku
  • 19. Heroku BuildPacks
  • 20. Additional languages through “Build packs”Use a 3rd party build packDefine your own build, deploy & run cycleCreate your Heroku application with a build packheroku create myapp –buildpack
  • 21. Many build packs on Github
  • 22. Open LanguagesRuby Clojure Node.JSOpen DatabasesMongo DB Amazon RDS PostgresCouch DB Redisdatabase.comOpenFrameworksSinatra Ruby on RailsCompojureRingNoirPadrinoHalcyonWavesPlay!Spring LiftJava ScalaPolyglot frameworks & data sources
  • 23. TRUST & MANAGE
  • 24. Effortless ScalingScale(runningprocesses)Web WorkerWorkload Diversity(Process types)
  • 25. Running your app processes – The ProcfileProcfileA simple, declarative way to define applicationprocess types, so they can be easilymanaged in unison when scaling.A text file in the root of your project containingruntime commands & parameters
  • 26. Procfile examplesSimple web serverweb: python -m SimpleHTTPServer $PORTClojureweb: lein with-profile production trampolinerun -m my-clojure-website.web
  • 27. Procfile examplesJava, Play framework & Postgres databaseweb: target/start -Dhttp.port=${PORT}${JAVA_OPTS}-DapplyEvolutions.default=true-Ddb.default.driver=org.postgresql.Driver-Ddb.default.url=${DATABASE_URL}
  • 28. Process Types Define web processes that listen for http/s requestsweb: command options Define other processes with any naming convention thatis meaningful in your appworker: … queue: … priorityworker: …batch: … scheduler: … maintenance: …
  • 29. Scaling your app – by process type$ cat Procfileweb: java $JAVA_OPTS EmbeddedServerworker: java $JAVA_OPTS YourJavaClass$ heroku scale web=4 worker=10Scaling processes... done
  • 30. Scaling via web control panel
  • 31. Control apps via
  • 32. Controlling your application Processes$ heroku psProcess State Command------- ----- -------web.1 up for 6s java $JAVA_OPTS EmbeddedServerworker.1 up for 5s java $JAVA_OPTS YourJavaClass$ heroku ps:restart worker.1Restarting worker.1 process... Done
  • 33. Trust & Manage24x7 platformmonitoringHerokai want to know when there is trouble before you do!
  • 34. Heroku Status$ heroku status=== Heroku StatusDevelopment: No known issues at this time.Production: No known issues at this time.
  • 35.
  • 36. SEE EVERYTHINGWhat is Heroku ?
  • 37. logplexUnified logging- application logs- administrative commands- infrastructure messages- realtime Dyno informationtime-ordered events aggregated from theoutput streams of all your app’s runningprocesses, system components, andbacking services.
  • 38. heroku logsheroku logs --source appsheroku logs --source herokuheroku logs --source heroku --ps api
  • 39. Example of errors in logs
  • 40. HEROKU ADD-ONSWhat else is there to Heroku ?
  • 41. New Relic – end 2 end analysis
  • 42. StillAlive – High availability
  • 43. Ranger – monitor domains
  • 44. HireFire – auto-scaling
  • 45. Extensibility A range of Relational & NoSQLdatabases Monitoring for your app …and too much to cover here
  • 46. Heroku Postgres - as a servicePowerful data storage– Irrespective of if you app is deployed on Heroku
  • 47. Heroku Postgres - adds more features
  • 48. CALCULATING THE VALUEHow much does it cost?
  • 49. Heroku cost calculator
  • 50. How much does it really cost todeploy software in yourorganisation?
  • 52. Setup your Heroku account1) Create an account on Heroku2) Download the Heroku Toolbelt3) Upload you public keyheroku loginOr check if you already have a key:
  • 53. Whats in the Toolbelt? Heroku command line tools– create | logs | ps | releases |run | addons | config A Git client Foreman– run apps locally as they would run on Heroku
  • 54. 5 steps to first deployCreate you app (using your build tool)Initialise a git repository for your projectCreate your heroku app (heroku create)Git Commit your files to the local repositoryGit Push your app to heroku
  • 55. Basic continuous deployment workflow
  • 56. Developer workflow
  • 57. COLLABORATION IN THE CLOUDGithub and Heroku
  • 58. Heroku Collaboration Add multiple developers to an app
  • 59. Heroku Collaboration All collaborators can:– push updates & trigger deployment– view and change app settings Only Owners can delete the app– or transfer ownership to a different account
  • 60. Github – Social CodingCollaborate on public or private projectsCollaborate 24/7 all over the world
  • 61. Add Github repo to your appCreate a new repository on GithubAdd the repository to your projectgit remote add your code to githubgit push –u github master
  • 62. Collaborative coding on GithubAdd developers to your Github repoonly those that you trust!Encourage pull requests from everyone elseallows collaboration around commitsFacilitate code reviews
  • 63. Pull request discussion
  • 64. Pull request code review
  • 65. Adding more environmentsCommon environments established include:production, staging, uat, testing, dev (foreman on dev machine)Create the environments you wantheroku create my-app-stagingheroku create my-app-uatheroku create my-app-testingCheck add-ons used firstheroku addons --remote heroku
  • 66. More Envs = more repositories Every time you create a new Heroku environment aremote git repository is added– git remote –v
  • 67. Managing multiple repos Learn to love git log– Configure it to use –graph Or get a good visual git tool– SourceTree for MacOSX & Windows is great (and free)
  • 68. git log --graph --oneline --decorate
  • 69. Heroku (origin/master) often behind HEAD & test
  • 71. Heroku rollback mechanism
  • 72. Release History
  • 73. View info about a release
  • 74. Rollback to a specific version
  • 75. History after rollback & pushRollback is a temporary solution, fix the root cause!
  • 76. Try for yourselfGet Started at started with Heroku guidesLondon Salesforce Developers you !!!