SlideShare a Scribd company logo
Deploying Java and Play!
    Apps on Heroku

     Sandeep Bhanot
       @cloudysan
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 April 30, 2011. This documents
   and others containing 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
   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.




Proprietary & Confidential
Once upon a time….


  Tim wanted to develop a Java app……
So he got to work….
•   Acquire and provision all the H/W (Servers, Load Balancers, Routers etc.)

•   Install, configure and tune the entire S/W stack (OS, Web/App Server, DB etc.)

•   Configure env. for Application services like Routing, Clustering, Load Balancing,
    DR, Caching, DB Replication etc ($$$)

• Patch and upgrade the H/W and S/W stack



              Cost

              Agility
One day….


Tim decided to try this ‘Cloud’ thingy……
So he tried an IAAS provider….
•   NO H/W to buy/install/configure!

•   Still has to configure and tune the entire S/W stack (OS, Web/App Server, DB etc.)

•   Still has to configure (and sometime code) env. for Application services like
    Scaling, Routing, Clustering, Load Balancing, DR, DB replication etc

•   Patch and upgrade the S/W stack




               Cost

               Agility
Finally….


Tim heard of Heroku
When Tim met Heroku….
• NO Servers

• Managed S/W stack (OS, Web/App Server, DB etc.)

• Application services like Routing, Load Balancing and DR built-in

• Elastic scaling

• git push heroku master
                                        Focus on your Code. Period.


               Cost

              Agility
Heroku = Polyglot Cloud Platform




        402,550+ Apps Running on Heroku
$ heroku create –s cedar

$ git push heroku master
Create more web processes:
$ heroku scale web=2


What processes are running:
$ heroku ps
Check the logs:
$ heroku logs
View releases:
$ heroku releases


Rollback:
$ heroku rollback
Run a process:
$ heroku run "your bash command"
Java Tech & Tools | Deploying Java & Play Framework Apps to the Cloud | Sandeep Bhanot
Deploying web apps...


Environment (Runtime, configuration, etc)
Ingredients (Dependencies, app, services, etc)
Process (Build, assemble, start, etc)

Environment + Ingredients + Process = web 1!
Environment + Ingredients + Process = web 2!
Externalize Environment Variables

$ heroku config


DATABASE_URL    =   postgres://blah:blah@ec2.compute-1.amazonaws.com/blah
JAVA_OPTS       =   -Xmx384m -Xss256k -XX:+UseCompressedOops
MAVEN_OPTS      =   -Xmx384m -Xss256k -XX:+UseCompressedOops
PATH            =   .maven/bin:/usr/local/bin:/usr/bin:/bin
REDISTOGO_URL   =   redis://redistogo:1234asdf@angler.redistogo.com:9291/
REPO            =   /app/.m2/repository
Ingredients defined (pom.xml)
<dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-webapp</artifactId>
      <version>${jetty.version}</version>
</dependency>
<dependency>
      <groupId>org.mortbay.jetty</groupId>
      <artifactId>jsp-2.1-glassfish</artifactId>
      <version>2.1.v20100127</version>
</dependency>
<dependency>
      <groupId>postgresql</groupId>
      <artifactId>postgresql</artifactId>
      <version>9.0-801.jdbc4</version>
</dependency>
Process defined (Maven + Procfile)



web: sh target/bin/webapp
Don't Share-Something
Share-Nothing
Move state to the isolated & independent edges
    - UI state -> client
    - Permanent state -> external data stores
Deploy an app on Heroku

1. Create a Java Web App
2. Add a Procfile
3. Commit to a git repo
4. Create an app on Heroku
5. “git push” to Heroku
6. Scale and monitor on Heroku
Connect to a Database

• Free shared PostgreSQL DB
• Dedicated & managed PostgreSQL DB
• Amazon RDS MySQL & Oracle
• NoSQL Add-ons (Redis, MongoDB, etc)
• Database.com
• Or do your own thing
Transform DATABASE_URL
Heroku:
postgres://[username]:[password]@[server]/[db-name]



JDBC:
jdbc:postgresql://[server]/[db-name]?user=[username]&password=[password]



Transform:
dbUrl = dbUrl.replaceAll("postgres://(.*):(.*)@(.*)",
               "jdbc:postgresql://$3?user=$1&password=$2");
Create a Worker Process


1. Create a process
2. Update the Procfile
3. Push to Heroku
4. Scale the workers
Using a Heroku Add-on
• Find an Add-on: http://addons.heroku.com
• Activate the Add-on
• Use the service
• Push to Heroku
Play!
•   A Java framework for Web Applications
•   Non Servlet or JEE based
•   A full stack framework
•   Focuses on productivity and fun
Play! on Heroku


1. Create Play app
2. Add app to git repo
3. Create app on Heroku
4. Push app to Heroku
750 free dyno hours
 per month per app
heroku.com/java

github.com/heroku/java-workbook

@cloudysan
Java Tech & Tools | Deploying Java & Play Framework Apps to the Cloud | Sandeep Bhanot
Ad

Recommended

WATS 2014 WA Agents Overview - CA Workload Automation Technology Summit (WATS...
WATS 2014 WA Agents Overview - CA Workload Automation Technology Summit (WATS...
Extra Technology
 
SharePoint 2010 Upgrade User Group and SharePoint Saturday
SharePoint 2010 Upgrade User Group and SharePoint Saturday
Joel Oleson
 
Breaking SAP portal (HashDays)
Breaking SAP portal (HashDays)
ERPScan
 
SharePoint 2010 Upgrade Drill Down
SharePoint 2010 Upgrade Drill Down
Joel Oleson
 
Deborap
Deborap
Neyde Seap
 
Lengua anuncio
Lengua anuncio
franky226
 
Zhaojinbiao self introduction
Zhaojinbiao self introduction
zhaojinbiao
 
Why i want to work in a call center (and why i ultimately don't)
Why i want to work in a call center (and why i ultimately don't)
Steve Talks
 
1015026
1015026
46191077
 
Using GEOBIA to assess crown diameter classes of Acacia tortilis in Bou-Hedma...
Using GEOBIA to assess crown diameter classes of Acacia tortilis in Bou-Hedma...
kdlaplac
 
Piano tuner
Piano tuner
13jkjordan
 
Hum2310 fa2014 proust questionnaire
Hum2310 fa2014 proust questionnaire
ProfWillAdams
 
Performance Metrics for your Build Pipeline - presented at Vienna WebPerf Oct...
Performance Metrics for your Build Pipeline - presented at Vienna WebPerf Oct...
Andreas Grabner
 
квест Pons 1
квест Pons 1
MarkovDA
 
Nascent Financial Services
Nascent Financial Services
nascentfs
 
Hum2220 fa2015 research project packet
Hum2220 fa2015 research project packet
ProfWillAdams
 
Alberti Center Slideshow
Alberti Center Slideshow
UB Alberti Center for Bullying Abuse Prevention
 
Fall newsletter-2003
Fall newsletter-2003
Direct Relief
 
Hugs instead of Bugs: Dreaming of Quality Tools for Devs and Testers
Hugs instead of Bugs: Dreaming of Quality Tools for Devs and Testers
Andreas Grabner
 
Spring Day | Spring 3.1 in a Nutshell | Sam Brannen
Spring Day | Spring 3.1 in a Nutshell | Sam Brannen
JAX London
 
フラグ色々&その遅延評価-仮想機械インタープリタ書きのための-
フラグ色々&その遅延評価-仮想機械インタープリタ書きのための-
たけおか しょうぞう
 
Health Status of Children in Isabel, Leyte
Health Status of Children in Isabel, Leyte
Marc Macalua
 
2006 Winter Newsletter
2006 Winter Newsletter
Direct Relief
 
Kimia Terapan - Cassace (Cassava Rice/Nasi Singkong)
Kimia Terapan - Cassace (Cassava Rice/Nasi Singkong)
21 Memento
 
Opportunity Execution Project - Career Mentor Online
Opportunity Execution Project - Career Mentor Online
Charles Sun
 
DIY to CMS
DIY to CMS
Jeremy Rosenberg
 
Introduction to Heroku
Introduction to Heroku
Salesforce Developers
 
Spring '14 Release Developer Preview Webinar
Spring '14 Release Developer Preview Webinar
Salesforce Developers
 

More Related Content

Viewers also liked (20)

Why i want to work in a call center (and why i ultimately don't)
Why i want to work in a call center (and why i ultimately don't)
Steve Talks
 
1015026
1015026
46191077
 
Using GEOBIA to assess crown diameter classes of Acacia tortilis in Bou-Hedma...
Using GEOBIA to assess crown diameter classes of Acacia tortilis in Bou-Hedma...
kdlaplac
 
Piano tuner
Piano tuner
13jkjordan
 
Hum2310 fa2014 proust questionnaire
Hum2310 fa2014 proust questionnaire
ProfWillAdams
 
Performance Metrics for your Build Pipeline - presented at Vienna WebPerf Oct...
Performance Metrics for your Build Pipeline - presented at Vienna WebPerf Oct...
Andreas Grabner
 
квест Pons 1
квест Pons 1
MarkovDA
 
Nascent Financial Services
Nascent Financial Services
nascentfs
 
Hum2220 fa2015 research project packet
Hum2220 fa2015 research project packet
ProfWillAdams
 
Alberti Center Slideshow
Alberti Center Slideshow
UB Alberti Center for Bullying Abuse Prevention
 
Fall newsletter-2003
Fall newsletter-2003
Direct Relief
 
Hugs instead of Bugs: Dreaming of Quality Tools for Devs and Testers
Hugs instead of Bugs: Dreaming of Quality Tools for Devs and Testers
Andreas Grabner
 
Spring Day | Spring 3.1 in a Nutshell | Sam Brannen
Spring Day | Spring 3.1 in a Nutshell | Sam Brannen
JAX London
 
フラグ色々&その遅延評価-仮想機械インタープリタ書きのための-
フラグ色々&その遅延評価-仮想機械インタープリタ書きのための-
たけおか しょうぞう
 
Health Status of Children in Isabel, Leyte
Health Status of Children in Isabel, Leyte
Marc Macalua
 
2006 Winter Newsletter
2006 Winter Newsletter
Direct Relief
 
Kimia Terapan - Cassace (Cassava Rice/Nasi Singkong)
Kimia Terapan - Cassace (Cassava Rice/Nasi Singkong)
21 Memento
 
Opportunity Execution Project - Career Mentor Online
Opportunity Execution Project - Career Mentor Online
Charles Sun
 
DIY to CMS
DIY to CMS
Jeremy Rosenberg
 
Why i want to work in a call center (and why i ultimately don't)
Why i want to work in a call center (and why i ultimately don't)
Steve Talks
 
Using GEOBIA to assess crown diameter classes of Acacia tortilis in Bou-Hedma...
Using GEOBIA to assess crown diameter classes of Acacia tortilis in Bou-Hedma...
kdlaplac
 
Hum2310 fa2014 proust questionnaire
Hum2310 fa2014 proust questionnaire
ProfWillAdams
 
Performance Metrics for your Build Pipeline - presented at Vienna WebPerf Oct...
Performance Metrics for your Build Pipeline - presented at Vienna WebPerf Oct...
Andreas Grabner
 
квест Pons 1
квест Pons 1
MarkovDA
 
Nascent Financial Services
Nascent Financial Services
nascentfs
 
Hum2220 fa2015 research project packet
Hum2220 fa2015 research project packet
ProfWillAdams
 
Hugs instead of Bugs: Dreaming of Quality Tools for Devs and Testers
Hugs instead of Bugs: Dreaming of Quality Tools for Devs and Testers
Andreas Grabner
 
Spring Day | Spring 3.1 in a Nutshell | Sam Brannen
Spring Day | Spring 3.1 in a Nutshell | Sam Brannen
JAX London
 
フラグ色々&その遅延評価-仮想機械インタープリタ書きのための-
フラグ色々&その遅延評価-仮想機械インタープリタ書きのための-
たけおか しょうぞう
 
Health Status of Children in Isabel, Leyte
Health Status of Children in Isabel, Leyte
Marc Macalua
 
2006 Winter Newsletter
2006 Winter Newsletter
Direct Relief
 
Kimia Terapan - Cassace (Cassava Rice/Nasi Singkong)
Kimia Terapan - Cassace (Cassava Rice/Nasi Singkong)
21 Memento
 
Opportunity Execution Project - Career Mentor Online
Opportunity Execution Project - Career Mentor Online
Charles Sun
 

Similar to Java Tech & Tools | Deploying Java & Play Framework Apps to the Cloud | Sandeep Bhanot (20)

Introduction to Heroku
Introduction to Heroku
Salesforce Developers
 
Spring '14 Release Developer Preview Webinar
Spring '14 Release Developer Preview Webinar
Salesforce Developers
 
Quit Jesting and Test your Lightning Web Components, Phillipe Ozil
Quit Jesting and Test your Lightning Web Components, Phillipe Ozil
CzechDreamin
 
Developing Offline Mobile Apps with Salesforce Mobile SDK SmartStore
Developing Offline Mobile Apps with Salesforce Mobile SDK SmartStore
Tom Gersic
 
How Force.com developers do more in less time
How Force.com developers do more in less time
Abhinav Gupta
 
Best Practices for Creating Scalable Apps with Heroku
Best Practices for Creating Scalable Apps with Heroku
Salesforce Developers
 
Hands-on Workshop: Intermediate Development with Heroku and Force.com
Hands-on Workshop: Intermediate Development with Heroku and Force.com
Salesforce Developers
 
Tour of Heroku + Salesforce Integration Methods
Tour of Heroku + Salesforce Integration Methods
Salesforce Developers
 
Force.com Friday : Intro to Visualforce
Force.com Friday : Intro to Visualforce
Salesforce Developers
 
Lightning Web Components - A new era, René Winkelmeyer
Lightning Web Components - A new era, René Winkelmeyer
CzechDreamin
 
Force.com Friday : Intro to Apex
Force.com Friday : Intro to Apex
Salesforce Developers
 
Introduction to Heroku - CCT London 2013
Introduction to Heroku - CCT London 2013
John Stevenson
 
Operationalizing Big Data as a Service
Operationalizing Big Data as a Service
Salesforce Engineering
 
Introduction to Heroku
Introduction to Heroku
Salesforce Developers
 
Reusable Build Scripts for Managed Package Development (October 14, 2014)
Reusable Build Scripts for Managed Package Development (October 14, 2014)
Salesforce Partners
 
Environment & Release Management
Environment & Release Management
elliando dias
 
Salesforce platform session 2
Salesforce platform session 2
Salesforce - Sweden, Denmark, Norway
 
Visualforce: Using ActionFunction vs. RemoteAction
Visualforce: Using ActionFunction vs. RemoteAction
Salesforce Developers
 
Building Apps Faster with Lightning and Winter '17
Building Apps Faster with Lightning and Winter '17
Mark Adcock
 
Building apps faster with lightning and winter '17
Building apps faster with lightning and winter '17
Salesforce Developers
 
Spring '14 Release Developer Preview Webinar
Spring '14 Release Developer Preview Webinar
Salesforce Developers
 
Quit Jesting and Test your Lightning Web Components, Phillipe Ozil
Quit Jesting and Test your Lightning Web Components, Phillipe Ozil
CzechDreamin
 
Developing Offline Mobile Apps with Salesforce Mobile SDK SmartStore
Developing Offline Mobile Apps with Salesforce Mobile SDK SmartStore
Tom Gersic
 
How Force.com developers do more in less time
How Force.com developers do more in less time
Abhinav Gupta
 
Best Practices for Creating Scalable Apps with Heroku
Best Practices for Creating Scalable Apps with Heroku
Salesforce Developers
 
Hands-on Workshop: Intermediate Development with Heroku and Force.com
Hands-on Workshop: Intermediate Development with Heroku and Force.com
Salesforce Developers
 
Tour of Heroku + Salesforce Integration Methods
Tour of Heroku + Salesforce Integration Methods
Salesforce Developers
 
Force.com Friday : Intro to Visualforce
Force.com Friday : Intro to Visualforce
Salesforce Developers
 
Lightning Web Components - A new era, René Winkelmeyer
Lightning Web Components - A new era, René Winkelmeyer
CzechDreamin
 
Introduction to Heroku - CCT London 2013
Introduction to Heroku - CCT London 2013
John Stevenson
 
Operationalizing Big Data as a Service
Operationalizing Big Data as a Service
Salesforce Engineering
 
Reusable Build Scripts for Managed Package Development (October 14, 2014)
Reusable Build Scripts for Managed Package Development (October 14, 2014)
Salesforce Partners
 
Environment & Release Management
Environment & Release Management
elliando dias
 
Visualforce: Using ActionFunction vs. RemoteAction
Visualforce: Using ActionFunction vs. RemoteAction
Salesforce Developers
 
Building Apps Faster with Lightning and Winter '17
Building Apps Faster with Lightning and Winter '17
Mark Adcock
 
Building apps faster with lightning and winter '17
Building apps faster with lightning and winter '17
Salesforce Developers
 
Ad

More from JAX London (20)

Java Tech & Tools | Continuous Delivery - the Writing is on the Wall | John S...
Java Tech & Tools | Continuous Delivery - the Writing is on the Wall | John S...
JAX London
 
Java Tech & Tools | Mapping, GIS and Geolocating Data in Java | Joachim Van d...
Java Tech & Tools | Mapping, GIS and Geolocating Data in Java | Joachim Van d...
JAX London
 
Keynote | Middleware Everywhere - Ready for Mobile and Cloud | Dr. Mark Little
Keynote | Middleware Everywhere - Ready for Mobile and Cloud | Dr. Mark Little
JAX London
 
Spring Day | WaveMaker - Spring Roo - SpringSource Tool Suite: Choosing the R...
Spring Day | WaveMaker - Spring Roo - SpringSource Tool Suite: Choosing the R...
JAX London
 
Spring Day | Behind the Scenes at Spring Batch | Dave Syer
Spring Day | Behind the Scenes at Spring Batch | Dave Syer
JAX London
 
Spring Day | Identity Management with Spring Security | Dave Syer
Spring Day | Identity Management with Spring Security | Dave Syer
JAX London
 
Spring Day | Spring and Scala | Eberhard Wolff
Spring Day | Spring and Scala | Eberhard Wolff
JAX London
 
Spring Day | Data Access 2.0? Please Welcome Spring Data! | Oliver Gierke
Spring Day | Data Access 2.0? Please Welcome Spring Data! | Oliver Gierke
JAX London
 
Keynote | The Rise and Fall and Rise of Java | James Governor
Keynote | The Rise and Fall and Rise of Java | James Governor
JAX London
 
Java Tech & Tools | OSGi Best Practices | Emily Jiang
Java Tech & Tools | OSGi Best Practices | Emily Jiang
JAX London
 
Java Tech & Tools | Beyond the Data Grid: Coherence, Normalisation, Joins and...
Java Tech & Tools | Beyond the Data Grid: Coherence, Normalisation, Joins and...
JAX London
 
Java Tech & Tools | Big Blobs: Moving Big Data In and Out of the Cloud | Adri...
Java Tech & Tools | Big Blobs: Moving Big Data In and Out of the Cloud | Adri...
JAX London
 
Java Tech & Tools | Social Media in Programming in Java | Khanderao Kand
Java Tech & Tools | Social Media in Programming in Java | Khanderao Kand
JAX London
 
Java Tech & Tools | Just Keep Passing the Message | Russel Winder
Java Tech & Tools | Just Keep Passing the Message | Russel Winder
JAX London
 
Java Tech & Tools | Grails in the Java Enterprise | Peter Ledbrook
Java Tech & Tools | Grails in the Java Enterprise | Peter Ledbrook
JAX London
 
Java EE | Modular EJBs for Enterprise OSGi | Tim Ward
Java EE | Modular EJBs for Enterprise OSGi | Tim Ward
JAX London
 
Java EE | Apache TomEE - Java EE Web Profile on Tomcat | Jonathan Gallimore
Java EE | Apache TomEE - Java EE Web Profile on Tomcat | Jonathan Gallimore
JAX London
 
Java Core | Understanding the Disruptor: a Beginner's Guide to Hardcore Concu...
Java Core | Understanding the Disruptor: a Beginner's Guide to Hardcore Concu...
JAX London
 
Java Core | Java 8 and OSGi Modularisation | Tim Ellison & Neil Bartlett
Java Core | Java 8 and OSGi Modularisation | Tim Ellison & Neil Bartlett
JAX London
 
Java Core | JavaFX 2.0: Great User Interfaces in Java | Simon Ritter
Java Core | JavaFX 2.0: Great User Interfaces in Java | Simon Ritter
JAX London
 
Java Tech & Tools | Continuous Delivery - the Writing is on the Wall | John S...
Java Tech & Tools | Continuous Delivery - the Writing is on the Wall | John S...
JAX London
 
Java Tech & Tools | Mapping, GIS and Geolocating Data in Java | Joachim Van d...
Java Tech & Tools | Mapping, GIS and Geolocating Data in Java | Joachim Van d...
JAX London
 
Keynote | Middleware Everywhere - Ready for Mobile and Cloud | Dr. Mark Little
Keynote | Middleware Everywhere - Ready for Mobile and Cloud | Dr. Mark Little
JAX London
 
Spring Day | WaveMaker - Spring Roo - SpringSource Tool Suite: Choosing the R...
Spring Day | WaveMaker - Spring Roo - SpringSource Tool Suite: Choosing the R...
JAX London
 
Spring Day | Behind the Scenes at Spring Batch | Dave Syer
Spring Day | Behind the Scenes at Spring Batch | Dave Syer
JAX London
 
Spring Day | Identity Management with Spring Security | Dave Syer
Spring Day | Identity Management with Spring Security | Dave Syer
JAX London
 
Spring Day | Spring and Scala | Eberhard Wolff
Spring Day | Spring and Scala | Eberhard Wolff
JAX London
 
Spring Day | Data Access 2.0? Please Welcome Spring Data! | Oliver Gierke
Spring Day | Data Access 2.0? Please Welcome Spring Data! | Oliver Gierke
JAX London
 
Keynote | The Rise and Fall and Rise of Java | James Governor
Keynote | The Rise and Fall and Rise of Java | James Governor
JAX London
 
Java Tech & Tools | OSGi Best Practices | Emily Jiang
Java Tech & Tools | OSGi Best Practices | Emily Jiang
JAX London
 
Java Tech & Tools | Beyond the Data Grid: Coherence, Normalisation, Joins and...
Java Tech & Tools | Beyond the Data Grid: Coherence, Normalisation, Joins and...
JAX London
 
Java Tech & Tools | Big Blobs: Moving Big Data In and Out of the Cloud | Adri...
Java Tech & Tools | Big Blobs: Moving Big Data In and Out of the Cloud | Adri...
JAX London
 
Java Tech & Tools | Social Media in Programming in Java | Khanderao Kand
Java Tech & Tools | Social Media in Programming in Java | Khanderao Kand
JAX London
 
Java Tech & Tools | Just Keep Passing the Message | Russel Winder
Java Tech & Tools | Just Keep Passing the Message | Russel Winder
JAX London
 
Java Tech & Tools | Grails in the Java Enterprise | Peter Ledbrook
Java Tech & Tools | Grails in the Java Enterprise | Peter Ledbrook
JAX London
 
Java EE | Modular EJBs for Enterprise OSGi | Tim Ward
Java EE | Modular EJBs for Enterprise OSGi | Tim Ward
JAX London
 
Java EE | Apache TomEE - Java EE Web Profile on Tomcat | Jonathan Gallimore
Java EE | Apache TomEE - Java EE Web Profile on Tomcat | Jonathan Gallimore
JAX London
 
Java Core | Understanding the Disruptor: a Beginner's Guide to Hardcore Concu...
Java Core | Understanding the Disruptor: a Beginner's Guide to Hardcore Concu...
JAX London
 
Java Core | Java 8 and OSGi Modularisation | Tim Ellison & Neil Bartlett
Java Core | Java 8 and OSGi Modularisation | Tim Ellison & Neil Bartlett
JAX London
 
Java Core | JavaFX 2.0: Great User Interfaces in Java | Simon Ritter
Java Core | JavaFX 2.0: Great User Interfaces in Java | Simon Ritter
JAX London
 
Ad

Recently uploaded (20)

9-1-1 Addressing: End-to-End Automation Using FME
9-1-1 Addressing: End-to-End Automation Using FME
Safe Software
 
Connecting Data and Intelligence: The Role of FME in Machine Learning
Connecting Data and Intelligence: The Role of FME in Machine Learning
Safe Software
 
“Key Requirements to Successfully Implement Generative AI in Edge Devices—Opt...
“Key Requirements to Successfully Implement Generative AI in Edge Devices—Opt...
Edge AI and Vision Alliance
 
10 Key Challenges for AI within the EU Data Protection Framework.pdf
10 Key Challenges for AI within the EU Data Protection Framework.pdf
Priyanka Aash
 
MuleSoft for AgentForce : Topic Center and API Catalog
MuleSoft for AgentForce : Topic Center and API Catalog
shyamraj55
 
Techniques for Automatic Device Identification and Network Assignment.pdf
Techniques for Automatic Device Identification and Network Assignment.pdf
Priyanka Aash
 
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Safe Software
 
AI vs Human Writing: Can You Tell the Difference?
AI vs Human Writing: Can You Tell the Difference?
Shashi Sathyanarayana, Ph.D
 
PyCon SG 25 - Firecracker Made Easy with Python.pdf
PyCon SG 25 - Firecracker Made Easy with Python.pdf
Muhammad Yuga Nugraha
 
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Priyanka Aash
 
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Alliance
 
The Future of Data, AI, and AR: Innovation Inspired by You.pdf
The Future of Data, AI, and AR: Innovation Inspired by You.pdf
Safe Software
 
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
caoyixuan2019
 
From Manual to Auto Searching- FME in the Driver's Seat
From Manual to Auto Searching- FME in the Driver's Seat
Safe Software
 
Cyber Defense Matrix Workshop - RSA Conference
Cyber Defense Matrix Workshop - RSA Conference
Priyanka Aash
 
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Alliance
 
Security Tips for Enterprise Azure Solutions
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
You are not excused! How to avoid security blind spots on the way to production
You are not excused! How to avoid security blind spots on the way to production
Michele Leroux Bustamante
 
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
revolcs10
 
OWASP Barcelona 2025 Threat Model Library
OWASP Barcelona 2025 Threat Model Library
PetraVukmirovic
 
9-1-1 Addressing: End-to-End Automation Using FME
9-1-1 Addressing: End-to-End Automation Using FME
Safe Software
 
Connecting Data and Intelligence: The Role of FME in Machine Learning
Connecting Data and Intelligence: The Role of FME in Machine Learning
Safe Software
 
“Key Requirements to Successfully Implement Generative AI in Edge Devices—Opt...
“Key Requirements to Successfully Implement Generative AI in Edge Devices—Opt...
Edge AI and Vision Alliance
 
10 Key Challenges for AI within the EU Data Protection Framework.pdf
10 Key Challenges for AI within the EU Data Protection Framework.pdf
Priyanka Aash
 
MuleSoft for AgentForce : Topic Center and API Catalog
MuleSoft for AgentForce : Topic Center and API Catalog
shyamraj55
 
Techniques for Automatic Device Identification and Network Assignment.pdf
Techniques for Automatic Device Identification and Network Assignment.pdf
Priyanka Aash
 
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Safe Software
 
AI vs Human Writing: Can You Tell the Difference?
AI vs Human Writing: Can You Tell the Difference?
Shashi Sathyanarayana, Ph.D
 
PyCon SG 25 - Firecracker Made Easy with Python.pdf
PyCon SG 25 - Firecracker Made Easy with Python.pdf
Muhammad Yuga Nugraha
 
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Priyanka Aash
 
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Alliance
 
The Future of Data, AI, and AR: Innovation Inspired by You.pdf
The Future of Data, AI, and AR: Innovation Inspired by You.pdf
Safe Software
 
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
caoyixuan2019
 
From Manual to Auto Searching- FME in the Driver's Seat
From Manual to Auto Searching- FME in the Driver's Seat
Safe Software
 
Cyber Defense Matrix Workshop - RSA Conference
Cyber Defense Matrix Workshop - RSA Conference
Priyanka Aash
 
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Alliance
 
Security Tips for Enterprise Azure Solutions
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
You are not excused! How to avoid security blind spots on the way to production
You are not excused! How to avoid security blind spots on the way to production
Michele Leroux Bustamante
 
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
revolcs10
 
OWASP Barcelona 2025 Threat Model Library
OWASP Barcelona 2025 Threat Model Library
PetraVukmirovic
 

Java Tech & Tools | Deploying Java & Play Framework Apps to the Cloud | Sandeep Bhanot

  • 1. Deploying Java and Play! Apps on Heroku Sandeep Bhanot @cloudysan
  • 2. 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 April 30, 2011. This documents and others containing 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 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. Proprietary & Confidential
  • 3. Once upon a time…. Tim wanted to develop a Java app……
  • 4. So he got to work…. • Acquire and provision all the H/W (Servers, Load Balancers, Routers etc.) • Install, configure and tune the entire S/W stack (OS, Web/App Server, DB etc.) • Configure env. for Application services like Routing, Clustering, Load Balancing, DR, Caching, DB Replication etc ($$$) • Patch and upgrade the H/W and S/W stack Cost Agility
  • 5. One day…. Tim decided to try this ‘Cloud’ thingy……
  • 6. So he tried an IAAS provider…. • NO H/W to buy/install/configure! • Still has to configure and tune the entire S/W stack (OS, Web/App Server, DB etc.) • Still has to configure (and sometime code) env. for Application services like Scaling, Routing, Clustering, Load Balancing, DR, DB replication etc • Patch and upgrade the S/W stack Cost Agility
  • 8. When Tim met Heroku…. • NO Servers • Managed S/W stack (OS, Web/App Server, DB etc.) • Application services like Routing, Load Balancing and DR built-in • Elastic scaling • git push heroku master Focus on your Code. Period. Cost Agility
  • 9. Heroku = Polyglot Cloud Platform 402,550+ Apps Running on Heroku
  • 10. $ heroku create –s cedar $ git push heroku master
  • 11. Create more web processes: $ heroku scale web=2 What processes are running: $ heroku ps
  • 12. Check the logs: $ heroku logs
  • 13. View releases: $ heroku releases Rollback: $ heroku rollback
  • 14. Run a process: $ heroku run "your bash command"
  • 16. Deploying web apps... Environment (Runtime, configuration, etc) Ingredients (Dependencies, app, services, etc) Process (Build, assemble, start, etc) Environment + Ingredients + Process = web 1! Environment + Ingredients + Process = web 2!
  • 17. Externalize Environment Variables $ heroku config DATABASE_URL = postgres://blah:[email protected]/blah JAVA_OPTS = -Xmx384m -Xss256k -XX:+UseCompressedOops MAVEN_OPTS = -Xmx384m -Xss256k -XX:+UseCompressedOops PATH = .maven/bin:/usr/local/bin:/usr/bin:/bin REDISTOGO_URL = redis://redistogo:[email protected]:9291/ REPO = /app/.m2/repository
  • 18. Ingredients defined (pom.xml) <dependency> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-webapp</artifactId> <version>${jetty.version}</version> </dependency> <dependency> <groupId>org.mortbay.jetty</groupId> <artifactId>jsp-2.1-glassfish</artifactId> <version>2.1.v20100127</version> </dependency> <dependency> <groupId>postgresql</groupId> <artifactId>postgresql</artifactId> <version>9.0-801.jdbc4</version> </dependency>
  • 19. Process defined (Maven + Procfile) web: sh target/bin/webapp
  • 21. Share-Nothing Move state to the isolated & independent edges - UI state -> client - Permanent state -> external data stores
  • 22. Deploy an app on Heroku 1. Create a Java Web App 2. Add a Procfile 3. Commit to a git repo 4. Create an app on Heroku 5. “git push” to Heroku 6. Scale and monitor on Heroku
  • 23. Connect to a Database • Free shared PostgreSQL DB • Dedicated & managed PostgreSQL DB • Amazon RDS MySQL & Oracle • NoSQL Add-ons (Redis, MongoDB, etc) • Database.com • Or do your own thing
  • 25. Create a Worker Process 1. Create a process 2. Update the Procfile 3. Push to Heroku 4. Scale the workers
  • 26. Using a Heroku Add-on • Find an Add-on: http://addons.heroku.com • Activate the Add-on • Use the service • Push to Heroku
  • 27. Play! • A Java framework for Web Applications • Non Servlet or JEE based • A full stack framework • Focuses on productivity and fun
  • 28. Play! on Heroku 1. Create Play app 2. Add app to git repo 3. Create app on Heroku 4. Push app to Heroku
  • 29. 750 free dyno hours per month per app