Heroku
-
Upload
eberhard-wolff -
Category
Technology
-
view
1.214 -
download
1
description
Transcript of Heroku
![Page 1: Heroku](https://reader034.fdocuments.us/reader034/viewer/2022051611/54b58f284a795962418b46b0/html5/thumbnails/1.jpg)
Eberhard Wolff
Freelance Consultant / Trainer Head Technology Advisory Board
adesso AG
![Page 2: Heroku](https://reader034.fdocuments.us/reader034/viewer/2022051611/54b58f284a795962418b46b0/html5/thumbnails/2.jpg)
Eberhard Wolff - @ewolff
HISTORY & ORIGIN
![Page 3: Heroku](https://reader034.fdocuments.us/reader034/viewer/2022051611/54b58f284a795962418b46b0/html5/thumbnails/3.jpg)
Eberhard Wolff - @ewolff
History & Origin § Originally started as Ruby PaaS
§ Now: Support for Node.js, Clojure, Grails, Scala and Python
§ Acquired by Salesforce.com
![Page 4: Heroku](https://reader034.fdocuments.us/reader034/viewer/2022051611/54b58f284a795962418b46b0/html5/thumbnails/4.jpg)
Eberhard Wolff - @ewolff
Programming Model § Jetty, Tomcat or Play! web server § Worker for background activities
§ Standard Java Programming Model
![Page 5: Heroku](https://reader034.fdocuments.us/reader034/viewer/2022051611/54b58f284a795962418b46b0/html5/thumbnails/5.jpg)
Eberhard Wolff - @ewolff
Scaling / High Availability § Servers must be manually started for
scaling
§ Failed servers will be restarted
![Page 6: Heroku](https://reader034.fdocuments.us/reader034/viewer/2022051611/54b58f284a795962418b46b0/html5/thumbnails/6.jpg)
Eberhard Wolff - @ewolff
TOOLS
![Page 7: Heroku](https://reader034.fdocuments.us/reader034/viewer/2022051611/54b58f284a795962418b46b0/html5/thumbnails/7.jpg)
Eberhard Wolff - @ewolff
Command Line Tool § heroku § E.g. creates new applications § Other management functions
o addons o logs o etc.
![Page 8: Heroku](https://reader034.fdocuments.us/reader034/viewer/2022051611/54b58f284a795962418b46b0/html5/thumbnails/8.jpg)
Eberhard Wolff - @ewolff
Deployment § heroku tool creates an empty git repository § Deploy new versions with git § Build (maven) done by Heroku § Build automatically deployed § No specialized tools needed – git is enough § Integration with Atlassian Bamboo or Travis
possible
§ Alternative: WAR deployment
![Page 9: Heroku](https://reader034.fdocuments.us/reader034/viewer/2022051611/54b58f284a795962418b46b0/html5/thumbnails/9.jpg)
Eberhard Wolff - @ewolff
DEMO
![Page 10: Heroku](https://reader034.fdocuments.us/reader034/viewer/2022051611/54b58f284a795962418b46b0/html5/thumbnails/10.jpg)
Eberhard Wolff - @ewolff
Code Changes Took the Spring application Converted to PostgreSQL <bean class="java.net.URI" id="dbUrl"> <constructor-arg value="#{systemEnvironment['DATABASE_URL']}" /></bean><bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> <property name="url" value="#{ 'jdbc:postgresql://' + @dbUrl.getHost() + í ':' + @dbUrl.getPort() + @dbUrl.getPath() }" /> <property name="username" value="#{ @dbUrl.getUserInfo().split(':')[0] }" /> <property name="password" value="#{ @dbUrl.getUserInfo().split(':')[1] }" /></bean>
![Page 11: Heroku](https://reader034.fdocuments.us/reader034/viewer/2022051611/54b58f284a795962418b46b0/html5/thumbnails/11.jpg)
Eberhard Wolff - @ewolff
![Page 12: Heroku](https://reader034.fdocuments.us/reader034/viewer/2022051611/54b58f284a795962418b46b0/html5/thumbnails/12.jpg)
Eberhard Wolff - @ewolff
![Page 13: Heroku](https://reader034.fdocuments.us/reader034/viewer/2022051611/54b58f284a795962418b46b0/html5/thumbnails/13.jpg)
Eberhard Wolff - @ewolff
![Page 14: Heroku](https://reader034.fdocuments.us/reader034/viewer/2022051611/54b58f284a795962418b46b0/html5/thumbnails/14.jpg)
Eberhard Wolff - @ewolff
Alternative: Eclipse PlugIn or Web
![Page 15: Heroku](https://reader034.fdocuments.us/reader034/viewer/2022051611/54b58f284a795962418b46b0/html5/thumbnails/15.jpg)
Eberhard Wolff - @ewolff
Full Stack Java EE No Java EE build pack available Would need WAR with Java EE libs Problem: JNDI DataSource
![Page 16: Heroku](https://reader034.fdocuments.us/reader034/viewer/2022051611/54b58f284a795962418b46b0/html5/thumbnails/16.jpg)
Eberhard Wolff - @ewolff
FLEXIBILITY
![Page 17: Heroku](https://reader034.fdocuments.us/reader034/viewer/2022051611/54b58f284a795962418b46b0/html5/thumbnails/17.jpg)
Eberhard Wolff - @ewolff
Flexibility § Dynos: processes run on Heroku § Procfile defines command line to start a
“Dyno” § Can be tuned and changed
§ Can create custom “Buildpack” to run entirely different environments
§ Available as Open Source e.g. for Ruby, PHP, Erlang, EmacsLisp…
![Page 18: Heroku](https://reader034.fdocuments.us/reader034/viewer/2022051611/54b58f284a795962418b46b0/html5/thumbnails/18.jpg)
Eberhard Wolff - @ewolff
Restrictions § Max source and build artifact size:
200MB § No sticky sessions § Dynos may not use more than
512MB RAM § I.e. max JVM heap about 400MB
![Page 19: Heroku](https://reader034.fdocuments.us/reader034/viewer/2022051611/54b58f284a795962418b46b0/html5/thumbnails/19.jpg)
Eberhard Wolff - @ewolff
PLATFORM AND OTHER SERVICES
![Page 20: Heroku](https://reader034.fdocuments.us/reader034/viewer/2022051611/54b58f284a795962418b46b0/html5/thumbnails/20.jpg)
Eberhard Wolff - @ewolff
Platform § Amazon Web Services § US East region § EU West beta § Proven foundation § Can use AWS resources as part of the
solution § 750h per month free
![Page 21: Heroku](https://reader034.fdocuments.us/reader034/viewer/2022051611/54b58f284a795962418b46b0/html5/thumbnails/21.jpg)
Eberhard Wolff - @ewolff
Other Services § Heroku supports Add-ons § Postgresql and memcached by
Heroku § Many 3rd party § E.g. relational databases, NoSQL
databases, logging, caches… § Configuration passed to service via
environment variables
![Page 22: Heroku](https://reader034.fdocuments.us/reader034/viewer/2022051611/54b58f284a795962418b46b0/html5/thumbnails/22.jpg)
Eberhard Wolff - @ewolff
Heroku: Highlights § Very flexible: Supports many
different environments
§ Broad range of additional services
§ Also covers build § https://github.com/ewolff/news-
application-heroku