Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Intro To Heroku

Craig Kerstiens
February 21, 2012
1.4k

Intro To Heroku

Craig Kerstiens

February 21, 2012
Tweet

Transcript

  1. Heroku
    Ruby, Python, Java, Scala, Clojure, Node.js, Logo
    Tuesday, February 21, 12

    View Slide

  2. Craig Kerstiens
    @craigkerstiens
    Tuesday, February 21, 12

    View Slide

  3. Safe Harbor
    Safe 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
    uncertainties materialize or if any of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially
    from the results expressed or implied by the forward looking-statements we make. All statements other than statements of
    historical fact could be deemed forward-looking, including any projections of product or service availability, subscriber growth,
    earnings, revenues, or other financial items and any statements regarding strategies or plans of management for future
    operations, statements of belief, any statements concerning new, 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
    new functionality for our service, new products and services, our new business model, our past operating losses, possible
    fluctuations in our operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security
    measures, the outcome of intellectual property and other litigation, risks associated with possible mergers and acquisitions, the
    immature market in which we operate, our relatively limited operating history, our ability to expand, retain, and motivate our
    employees and manage our growth, new releases of our service and successful customer deployment, our limited history
    reselling non-salesforce.com products, and utilization and selling to larger enterprise customers. Further information on potential
    factors that could affect the financial results of salesforce.com, inc. is included in our annual report on Form 10-Q for the most
    recent fiscal quarter ended. This documents and others containing important disclosures are available on the SEC Filings section
    of the Investor Information section of ou Web site.
    Any unreleased services or features referenced in this or other presentations, press releases or public statements are not
    currently available and may not be delivered on time or at all. Customers who purchase our services should make the purchase
    decisions based upon features that are currently available. Salesforce.com, inc. assumes no obligation and does not intend to
    update these forward-looking statements.
    Tuesday, February 21, 12

    View Slide

  4. as a Service
    Tuesday, February 21, 12

    View Slide

  5. Software
    as a Service
    Tuesday, February 21, 12

    View Slide

  6. Software
    Infrastructure as a Service
    Tuesday, February 21, 12

    View Slide

  7. Software
    Infrastructure
    Platform
    as a Service
    Tuesday, February 21, 12

    View Slide

  8. SaaS
    IaaS
    PaaS
    Tuesday, February 21, 12

    View Slide

  9. SaaS
    IaaS
    PaaS
    For software users
    More features, transparent updates
    Tuesday, February 21, 12

    View Slide

  10. SaaS
    IaaS
    PaaS
    For software users
    More features, transparent updates
    For ops people
    On demand machines
    Tuesday, February 21, 12

    View Slide

  11. SaaS
    IaaS
    PaaS
    For software users
    More features, transparent updates
    For ops people
    On demand machines
    For developers
    Transparent updates, don’t think about servers
    Tuesday, February 21, 12

    View Slide

  12. Heroku
    Ruby, Python, Java, Scala, Clojure, Node.js, Logo
    Tuesday, February 21, 12

    View Slide

  13. [Demo Gods, Have Mercy]
    Tuesday, February 21, 12

    View Slide

  14. [Demo Gods, Have Mercy]
    Samurai
    Tuesday, February 21, 12

    View Slide

  15. Heroku
    Run the processes you
    tell us to run
    Tuesday, February 21, 12

    View Slide

  16. Python Locally
    pip/virtualenv
    virtualenv --no-site-package venv
    source bin/activate
    pip install -r requirements.txt
    Tuesday, February 21, 12

    View Slide

  17. Python on Heroku
    pip/virtualenv
    virtualenv --no-site-package venv
    source bin/activate
    pip install -r requirements.txt
    Tuesday, February 21, 12

    View Slide

  18. Python Locally
    Running
    python app/manage.py runserver 0.0.0.0:8000
    Tuesday, February 21, 12

    View Slide

  19. Python on Heroku
    Running
    Procfile:
    web: python app/manage.py runserver 0.0.0.0:$PORT
    Tuesday, February 21, 12

    View Slide

  20. Python
    pip/virtualenv
    runserver
    Locally Heroku
    pip/virtualenv
    Procfile w/ runserver
    Tuesday, February 21, 12

    View Slide

  21. Dyno
    Tuesday, February 21, 12

    View Slide

  22. Dyno
    Server
    Tuesday, February 21, 12

    View Slide

  23. Dyno
    Server
    Tuesday, February 21, 12

    View Slide

  24. Dyno
    Server
    VM
    Tuesday, February 21, 12

    View Slide

  25. Dyno
    Server
    VM
    Tuesday, February 21, 12

    View Slide

  26. Dyno
    Server
    VM
    Process
    Tuesday, February 21, 12

    View Slide

  27. Dyno
    $ cat Procfile
    web: python app/manage.py runserver
    worker: python app/manage.py celeryd -E -B
    celery: python app/manage.py celerybeat -S
    djcelery.schedulers.DatabaseScheduler
    $ heroku scale web=2
    $ heroku scale worker=4
    $ heroku scale celery=1
    Tuesday, February 21, 12

    View Slide

  28. Web.1
    Web.2
    Worker.1
    Worker.2
    Worker.3
    Worker.4
    Celery.1
    Dyno Processes
    Scale
    (Running Processes)
    Workload Diversity
    (Process Types)
    Tuesday, February 21, 12

    View Slide

  29. Dyno Processes
    Run Anything...
    Tuesday, February 21, 12

    View Slide

  30. Dyno Processes
    Run Anything...
    $ heroku run python app/manage.py runserver
    Tuesday, February 21, 12

    View Slide

  31. Dyno Processes
    Run Anything...
    $ heroku run python app/manage.py runserver
    $ heroku run python app/manage.py syncdb
    Tuesday, February 21, 12

    View Slide

  32. Dyno Processes
    Run Anything...
    $ heroku run python app/manage.py runserver
    $ heroku run python app/manage.py syncdb
    $ heroku run python
    Tuesday, February 21, 12

    View Slide

  33. Dyno Processes
    Run Anything...
    $ heroku run python app/manage.py runserver
    $ heroku run python app/manage.py syncdb
    $ heroku run python
    $ heroku run bash
    Tuesday, February 21, 12

    View Slide

  34. Additional Services
    Tuesday, February 21, 12

    View Slide

  35. Additional Services
    (Addons)
    Tuesday, February 21, 12

    View Slide

  36. Additional Services
    Memcache
    Redis
    Mongo
    Email
    App Performance
    Logging
    (Addons)
    Tuesday, February 21, 12

    View Slide

  37. Additional Services
    Memcache
    Redis
    Mongo
    Email
    App Performance
    Logging
    (Addons)
    Tuesday, February 21, 12

    View Slide

  38. Additional Services
    Memcache
    Redis
    Mongo
    Email
    App Performance
    Logging
    (Addons)
    Tuesday, February 21, 12

    View Slide

  39. Additional Services
    Memcache
    Redis
    Mongo
    Email
    App Performance
    Logging
    (Addons)
    Tuesday, February 21, 12

    View Slide

  40. Additional Services
    Memcache
    Redis
    Mongo
    Email
    App Performance
    Logging
    (Addons)
    Tuesday, February 21, 12

    View Slide

  41. Addons
    $ heroku addons:add memcache
    $ heroku addons:add registogo
    $ heroku addons:add mongohq
    $ heroku addons:add sentry
    Tuesday, February 21, 12

    View Slide

  42. Addons
    $ heroku config
    MEMCACHE_PASSWORD => Ggil...
    MEMCACHE_SERVERS => mc10.ec2.northscale.net
    MEMCACHE_USERNAME => app123%40heroku.com
    MONGOHQ_URL => mongodb://heroku:[email protected]:123/
    app123
    REDISTOGO_URL => redis://redistogo:[email protected]:123/
    SENTRY_DSN => https://4c81...:[email protected]/123
    Tuesday, February 21, 12

    View Slide

  43. Configuration
    $ heroku config:add MY_OTHER_DB=someurlhere
    $ heroku config
    MY_OTHER_DB=someurlhere
    Setting
    Tuesday, February 21, 12

    View Slide

  44. Configuration
    $ cat example.py
    import os
    MY_OTHER_DB=os.environ.get(‘MY_OTHER_DB’)
    Reading
    Tuesday, February 21, 12

    View Slide

  45. Fin.
    Resources
    http://devcenter.heroku.com/articles/python
    http://python.heroku.com
    http://bit.ly/ladjango
    Tuesday, February 21, 12

    View Slide