Heroku is a powerful platform for building and deploying custom enterprise-class solutions in a rapid fashion. Force.com is the gateway to your customers and sales data. In this session we will present an application that brings the power of a custom Java application running on Heroku together with the Force.com platform for a fully integrated e-commerce solution. We will discuss design patterns and best practices for creating dynamic e-commerce driven web sites using Heroku and Force.com. Join us to learn how to bring these two platforms together to drive your innovation forward and connect with your customers like never before!
Introduction to Building E-Commerce Solutions on Heroku and Salesforce
1. Introduction to Building E-Commerce
Solutions on Heroku and Salesforce
Scott Geosits, Trifecta Technologies Inc., Salesforce.com Solutions Architect and Team Lead
@scottgeosits
2. All about Trifecta Technologies
▪ IT Business Solutions Company
▪ Custom Enterprise and Highly Integrated Solutions
▪ Specializing in Salesforce, Mobile, and Web
▪ Engaged by leading brands across many industries
▪ 22+ years of Customer Success
3. Who is Varsity? We are cheerleading!!!
Leading provider of
apparel and accessories
to cheer and dance
teams across North
America
4. The Varsity Colors business story
Business Need:
•Create fully branded online
fundraising stores on demand
for school teams
•Leverage existing
Salesforce implementation
•Quick and simple setup and
configuration for users
5. Solution overview
In
te
gr
at
io
n
Ti
er
- A
S
4
0
0
i
S
e
r
i
e
s
E
R
P
Team Store
Microsites
Product
Catalog
heroku add-ons
heroku add-ons
database.com
Worker
Services
Microsite
Configuration
- A
d
o
b
e
S
c
e
n
e
7
- C
y
b
e
r
Environment
Configuration
Microsite
Admin
Varsity Legacy Platform
Adobe
Scene7
-AS400 iSeries ERP
-Order Management System
-CyberSource Payment
Gateway
7. Solution Details – Force.com
Why we chose Force.com
▪ Varsity has embraced Force.com across all levels of the business
▪ Significantly lower development costs
▪ Workflow for store approvals
▪ Sales reps do most of their work in Salesforce
▪ Reporting on fundraising program sales
8. Force.com – Product catalog and store maintenance
▪ Product data sourced from corporate ERP system
▪ Administrators configure product data
▪ Markup and web content controlled by administrator
▪ Configure customizable product layers
▪ Adobe Scene 7 integration updates images immediately
▪ Color scheme groupings for easy maintenance
▪ Sales reps configure store style and content
▪ Catalog per school allows reps to select products for sale
▪ One click to publish site to Heroku
10. Force.com – Order capture and dashboards
▪ Orders captured in both Salesforce and ERP
▪ Dashboards provide easy visibility to sales totals
11. Force.com – Best practices and lessons learned
▪ Salesforce pushes updates for products, accounts to Heroku
▪ Heroku integration via Salesforce REST API
▪ Be aware of governor limits!
▪
Script limits - this has been removed
▪
DML Statements / query limits
▪
Downstream trigger cascade effects and considerations
▪
Large complex data model can cause you to exceed limits
▪
External email limit exceptions
▪ Limit your API calls
▪
Use custom Apex REST services where appropriate to reduce API calls and define
transaction boundaries
12. Solution overview – Heroku
In
te
gr
at
io
n
Ti
er
- A
S
4
0
0
i
S
e
r
i
e
s
E
R
P
Team Store
Microsites
Environment
Configuration
heroku add-ons
heroku add-ons
Worker
Services
- A
d
o
b
e
S
c
e
n
e
7
- C
y
b
e
r
Microsite
Admin
Varsity Legacy Platform
Adobe
Scene7
-AS400 iSeries ERP
-Order Management System
-CyberSource Payment
Gateway
13. Solution Details – Heroku
Why we chose Heroku
▪ Customer facing application functionality
• Java gives us more flexibility for pure custom solution.
• Customer facing sites do not need full Salesforce capabilities and would be cost
prohibitive for user licensing.
▪ Integration
• Real-time processing on Heroku vs. scheduled jobs in Force.com.
▪ Service options
• Availability of more ready-to-go functionality via add-ons
▪ Scalability
• Start small and add dynos as the application grows
14. Team store and fundraising site
▪ School specific branding, style, and content
▪ Hundreds of school sites rendered via single set of CSS and HTML templates
15. Custom fundraising e-commerce solution
▪
Full cart and checkout e-Commerce functionality
▪
Adobe Scene 7 renders dynamic product images
▪
Social links allow shoppers to share items
▪
Custom Heroku authentication for customers
17. Heroku architecture constraints
▪ Web dynos must respond in 30 seconds or less
▪ Dynos must start up in 60 seconds or less
▪ Heap size
▪ 1x dynos get 512 MB, 2x dynos get 1024MB
▪ No session state
▪ Need persistence solution such as Cloudant
▪ No web server or filesystem
▪ S3 or similar solution for static assets (CSS, javascript, images, etc.)
18. Heroku – Best practices and lessons learned
▪ Caching strategy
▪
Frequently accessed pages pre-generated and cached for fast web dyno response
▪
Two level cache for header, footer, catalog and product HTML components
▪
Memcache provides fast primary lookup
▪
If item not present in memcache, retrieve from Cloudant if not dirty
▪
If dirty, request regeneration of HTML component
▪
Product and account information also cached in this manner
▪ Long running processes
▪
Use worker dynos, message queues and AJAX calls to check status on web pages
▪
Page generation, order completion
19. Heroku – Best practices and lessons learned
▪ Also use worker dynos for batch processing
▪
Integration worker to update Salesforce from AS/400 ERP
▪
Batch job to re-generate dirty HTML page components in the background
▪ Cloudant for session persistence
▪ Take advantage of add-on services to reduce implementation time
▪
No need to rebuild functionality
▪
Use developer level services for prototyping and development
▪ Throughput and scaling
▪
Java web dynos support multithreading – use this to boost your throughput
20. For more information…
▪ Heroku Dev Center
•
https://devcenter.heroku.com
•
Heroku is free to try and develop on – sign up for an account at http://www.heroku.com
▪ Salesforce REST API
•
http://www.salesforce.com/us/developer/docs/api_rest/
▪ Developer.force.com
•
http://developer.force.com/
▪ Trifecta Technologies
•
http://www.trifecta.com