Building Java Apps on Heroku and Force.com

25
Building Java Apps on Heroku and Force.com James Ward, Heroku @_JamesWard

description

In this session you will learn how to build Social Enterprise applications using Salesforce, Heroku, and Java. Through live coding and demonstrations you will learn how to instantly deploy and scale Java apps on the cloud with Heroku. You will also learn how to integrate those applications with Salesforce and Force.com through REST.

Transcript of Building Java Apps on Heroku and Force.com

Page 1: Building Java Apps on Heroku and Force.com

Building Java Apps on Heroku and Force.com

James Ward, Heroku @_JamesWard

Page 2: Building Java Apps on Heroku and Force.com

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 July 31, 2012. 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.

Page 3: Building Java Apps on Heroku and Force.com

Why Heroku?

Page 4: Building Java Apps on Heroku and Force.com
Page 5: Building Java Apps on Heroku and Force.com

Logging Indexing

Messaging

Deployment

Scaling Security Updates

Monitoring Backups Disaster Recovery

File Servers Web Servers

Load Balancers Routing Firewall

IP Assignmet

Power Network Physical Space

Page 6: Building Java Apps on Heroku and Force.com

Let's Deploy Some Apps!

Page 7: Building Java Apps on Heroku and Force.com

heroku.com/java

Page 8: Building Java Apps on Heroku and Force.com

2,308,940+ Apps Running on Heroku

Page 9: Building Java Apps on Heroku and Force.com

Owner App 0..*

git repo

1..1

0..*

Process 0..*

Dyno

0..* Add-on

*..1

Logplex

0..* Env Var

Collaborator *..*

Load Balancer

*..1

Heroku Terminology

Page 10: Building Java Apps on Heroku and Force.com

User Slug Compiler

git push heroku master

Buildpack Load Balancer Dyno Manifold

create slug

slug file

mvn package

shutdown existing dynos pause routing

deploy slug on dynos start processes

resume routing

Zero-Error Deployment

Page 11: Building Java Apps on Heroku and Force.com

Unlimited Real-Time Customization

Granular Security & Sharing

Programmable Cloud Logic

Real-Time Workflow & Approvals

Programmable User Interface

Real-Time Mobile Deployment Real-Time Websites

Real-Time Content Library Real-Time Analytics 850+ Integrated

Applications

cloud platform

Page 12: Building Java Apps on Heroku and Force.com

eclipse-plugin.herokuapp.com

Page 13: Building Java Apps on Heroku and Force.com

Environment Variables

•  Zero intervention deployment

•  Running systems only differ through env vars

•  Add-ons own their config

Page 14: Building Java Apps on Heroku and Force.com

OAuth Setup

•  Create Remote Access Application for App

•  Set: •  SFDC_OAUTH_CLIENT_ID

•  SFDC_OAUTH_CLIENT_SECRET

Page 15: Building Java Apps on Heroku and Force.com

Code Walk-Through

Page 16: Building Java Apps on Heroku and Force.com

<dependency> <groupId>com.github.jsimone</groupId> <artifactId>webapp-runner</artifactId> <version>7.0.22</version> <scope>provided</scope> </dependency>

No Proprietary APIs. BYOC.

Page 17: Building Java Apps on Heroku and Force.com

web: java -jar target/web.jar --port $PORT worker1: java -jar target/somejar.jar scheduledjob1: java -jar target/another.jar

Run Anything

Procfile

Page 18: Building Java Apps on Heroku and Force.com

Logging

•  Logplex is Heroku's central logging system

•  Stream of STDOUT from Dynos, load balancer requests, slug compiler

•  Stream is pipe-able

•  Accessible via API

•  Heroku Add-ons can receive logs

Page 19: Building Java Apps on Heroku and Force.com

Collaborators

•  Can push changes to an app

•  Could be a CI build system

Page 20: Building Java Apps on Heroku and Force.com

addons.heroku.com

•  Use the Memcache Add-on for simple session externalization

•  Many other Heroku Add-ons

Page 21: Building Java Apps on Heroku and Force.com

Scale == "allocating Dynos a process"

Methods:

•  API

•  CLI

•  Eclipse Plugin

•  Third-Party Auto-Scaling Tools

Page 22: Building Java Apps on Heroku and Force.com

Individual Developers

• $0.05 / Dyno Hour

• 750 free Dyno hours / app / month

New Enterprise Package!

• heroku.com/enterprise

Page 23: Building Java Apps on Heroku and Force.com

heroku.com/java

Page 24: Building Java Apps on Heroku and Force.com
Page 25: Building Java Apps on Heroku and Force.com