SlideShare a Scribd company logo
Heroku – Best Practices
for Creating Scalable Apps with Heroku
Vincent Spehner, Tquila, Heroku Practice Manager
@vzmind and @herokusalesforceplaybook
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 any
litigation, risks associated with completed and any 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-K for the most recent fiscal year and in our quarterly report on Form 10-Q for the most recent
fiscal quarter. These 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.
Introduction
Last year at Dreamforce to discuss with speakers talking about
Heroku and meet early adopters of the Platform.
▪ Released the first version of Heroku Salesforce Playbook on Xmas
2012
• Heroku history
• Introduction to Heroku Toolbelt
• Java and Ruby tutorial to get started

▪ Next release available soon (Xmas 2013)
• Presenting 15+ detailed use cases

http://herokusalesforceplaybook.com
Introduction
Today the objective is to present some common mistakes done
when building Cloud app (including on Heroku) and learn how to
avoid them
▪ Platform / language neutral
▪ First we need to understand how Cloud Apps are different ?
• Heroku 12 factors
• Cloud App with remote Data/API
PaaS 12 factors
I. Codebase
One codebase tracked in revision control, many deploys

II. Dependencies
Explicitly declare and isolate dependencies

III. Config
Store config in the environment

IV. Backing Services
Treat backing services as attached resources

V. Build, release, run
Strictly separate build and run stages

VI. Processes
Execute the app as one or more stateless processes

VII. Port binding
Export services via port binding

VIII. Concurrency

http://12factor.net/
DE
PE
ND
EN
EV EN
D
ID
ER IECI H
S
CW ES E !!
NY
E
ARH
AT
W
L
YHE
ID
ER
RE DE
EV
N
!!

Cloud App Architecture
The API latency syndrome
How to detect it ?
▪ Pages taking ages to display
▪ API Quota reached quickly (few hours)
▪ More than 5 API calls per action
▪ App not working at specific moment of the day

SOLUTION : CACHE EVERYWHERE IT’S REQUIRED !!
Cache OR Call pattern
Reduce overall API Latency:
Understanding Caching options
Cache vs Data replication vs Data synchronization:
▪ Cache: store temporarily data locally to avoid further calls
▪ Data replication: copy remote data locally
▪ Data synchronization: best of both, local and synchronized
Understanding Caching options
Cache vs Data replication vs Data synchronization:
▪ Caching weakness: you need to sweep it regularly and automate it
▪ Data replication weakness: bi-directional update replication implies potential
conflict which need a proper management
▪ Data synchronization: most robust option, hard to implement
Understanding Caching options: HerokuConnect
API cache warming
Principle
▪ You already know that your application need to get the list of remote
static objects
▪ Add a worker dedicated to Cache warming
▪ Store all remote Static records locally
▪ Define refreshing strategy on the worker itself
API cache warming
Salesforce custom APEX End Point
Objective:
▪ Reduce API calls
▪ Access Hidden Business Logic

Creating custom APEX endpoint:
▪ Group API calls
▪ Aggregate objects/records/business process results in ONE call
▪ Trigger complex Apex code from a REST endpoint
Environment management
Is your local machine the Test env ?
▪ Cloud app might behave differently than on your Local Machine or Test
Server
• Assets compilation failing
• Process running differently
• Static Configuration
• Memory management
• Remote API calls
Environment management
Solutions:
▪ Dev ENV as clause of Heroku PROD ENV than possible
▪ Duplicate your Production ENV for TEST
▪ Use Foreman locally
▪ Share Heroku config with your team and load it as part of your ENV
▪ Of course you can spin up and down Heroku TEST env
No clues on errors
Logplex principle
▪ Logs are an event Stream (12 Factor number XI)

Monitor early, drive safely:
▪ Start recording logs from the beginning with enough storage capacity
▪ Monitor your app
▪ Make sure your logs are relevant
Log stream , Papertrail, New Relic
App capacity estimation
Load test your app
Conclusion
▪ Cloud apps - Heroku apps - require specific care
▪ Caching, Log stream, Env management as described in 12 Factor-app
▪ Rethink data storage and data exchange as they are not local
▪ Check the playbook, share your ideas with Book authors
All about Tquila
Tquila is the main european Salesforce Partner specialized
on Salesforce implementation, Mobile and Social
applications with 250 consultants in Europe, Asia, Australia.
▪ 102 customers
▪ 304 projects
▪ 204 certifications
Vincent Spehner
Heroku Practice Manager,
@vzmind
http://herokusalesforceplaybook.com
Best Practices for Creating Scalable Apps with Heroku

More Related Content

PDF
Examples of Using Heroku With Force.com to Build Apps
PPTX
Dreamforce 2013 - Heroku 5 use cases
PPTX
Build Consumer-Facing Apps with Heroku Connect
PDF
Salesforce API Series: Integrating Applications with Force.com Webinar
PDF
Sample Gallery: Reference Code and Best Practices for Salesforce Developers
PPTX
Coding Apps in the Cloud with Force.com - Part 2
PPTX
Integrating with salesforce
PPTX
Real Time Integration with Salesforce Platform Events
Examples of Using Heroku With Force.com to Build Apps
Dreamforce 2013 - Heroku 5 use cases
Build Consumer-Facing Apps with Heroku Connect
Salesforce API Series: Integrating Applications with Force.com Webinar
Sample Gallery: Reference Code and Best Practices for Salesforce Developers
Coding Apps in the Cloud with Force.com - Part 2
Integrating with salesforce
Real Time Integration with Salesforce Platform Events

What's hot (20)

PPTX
Building apps faster with lightning and winter '17
PDF
Lightning web components episode 2- work with salesforce data
PDF
Build Amazing Website without coding using Salesforce SiteForce
PPTX
Secure Development on the Salesforce Platform - Part 2
PPTX
TrailheaDX India : Developer Highlights
PDF
Why developers shouldn’t miss TrailheaDX India
PDF
LWC Episode 3- Component Communication and Aura Interoperability
PPTX
Webinar: Integrating Salesforce and Slack (05 12-16)
PPTX
TrailheaDX and Summer '19: Developer Highlights
PPT
Build your API with Force.com and Heroku
PDF
Two-Way Integration with Writable External Objects
PPTX
Lightning components performance best practices
PDF
Lightning web components - Episode 4 : Security and Testing
PDF
Introduction to Building E-Commerce Solutions on Heroku and Salesforce
PPTX
Building BOTS on App Cloud
PPTX
Mastering Force.com: Advanced Visualforce
PPTX
Dreamforce Developer Recap
PDF
Local development with Open Source Base Components
PDF
Building a RESTful API on Heroku for Your Force.com App
PPTX
Build, Manage, and Deploy Mobile Apps Faster with App Cloud Mobile
Building apps faster with lightning and winter '17
Lightning web components episode 2- work with salesforce data
Build Amazing Website without coding using Salesforce SiteForce
Secure Development on the Salesforce Platform - Part 2
TrailheaDX India : Developer Highlights
Why developers shouldn’t miss TrailheaDX India
LWC Episode 3- Component Communication and Aura Interoperability
Webinar: Integrating Salesforce and Slack (05 12-16)
TrailheaDX and Summer '19: Developer Highlights
Build your API with Force.com and Heroku
Two-Way Integration with Writable External Objects
Lightning components performance best practices
Lightning web components - Episode 4 : Security and Testing
Introduction to Building E-Commerce Solutions on Heroku and Salesforce
Building BOTS on App Cloud
Mastering Force.com: Advanced Visualforce
Dreamforce Developer Recap
Local development with Open Source Base Components
Building a RESTful API on Heroku for Your Force.com App
Build, Manage, and Deploy Mobile Apps Faster with App Cloud Mobile
Ad

Similar to Best Practices for Creating Scalable Apps with Heroku (20)

PPTX
Dreamforce 2013 - Pitfalls and solutions
PDF
Introduction to Heroku
PPTX
Igor Androsov on Mobilizing Salesforce Data with 12 Factor App on Heroku
PPTX
Building Command-line Tools with the Tooling API
PPT
Dreamforce 13 developer session: Introduction to Heroku
PDF
Lightning web components - Episode 1 - An Introduction
PPT
How Force.com developers do more in less time
PPTX
Using Python on Heroku and Force.com Canvas to Enhance Salesforce.com
PDF
API Design for Your Packaged App
PPTX
Dreamforce 2014 - Salesforce Python SDK for REST/SOAP APIs
PDF
Spring '14 Release Developer Preview Webinar
PPTX
Winter '16 Release - Overview and Highlights
PPTX
Heroku - developer playground
PDF
Salesforce platform session 2
PPTX
Lightning Developer Experience, Eclipse IDE Evolved
PDF
Workbench: The API Swiss Army Knife
PDF
Force.com Friday: Intro to Force.com
PDF
Java Tech & Tools | Deploying Java & Play Framework Apps to the Cloud | Sande...
PDF
Create a Hybrid Mobile App With the Salesforce Mobile SDK
PDF
Build Customer Centric Applications Using the Salesforce Toolkits for .NET
Dreamforce 2013 - Pitfalls and solutions
Introduction to Heroku
Igor Androsov on Mobilizing Salesforce Data with 12 Factor App on Heroku
Building Command-line Tools with the Tooling API
Dreamforce 13 developer session: Introduction to Heroku
Lightning web components - Episode 1 - An Introduction
How Force.com developers do more in less time
Using Python on Heroku and Force.com Canvas to Enhance Salesforce.com
API Design for Your Packaged App
Dreamforce 2014 - Salesforce Python SDK for REST/SOAP APIs
Spring '14 Release Developer Preview Webinar
Winter '16 Release - Overview and Highlights
Heroku - developer playground
Salesforce platform session 2
Lightning Developer Experience, Eclipse IDE Evolved
Workbench: The API Swiss Army Knife
Force.com Friday: Intro to Force.com
Java Tech & Tools | Deploying Java & Play Framework Apps to the Cloud | Sande...
Create a Hybrid Mobile App With the Salesforce Mobile SDK
Build Customer Centric Applications Using the Salesforce Toolkits for .NET
Ad

More from Salesforce Developers (20)

PDF
Maximizing Salesforce Lightning Experience and Lightning Component Performance
PPTX
CodeLive: Build Lightning Web Components faster with Local Development
PPTX
CodeLive: Converting Aura Components to Lightning Web Components
PPTX
Enterprise-grade UI with open source Lightning Web Components
PDF
Live coding with LWC
PDF
Migrating CPQ to Advanced Calculator and JSQCP
PDF
Scale with Large Data Volumes and Big Objects in Salesforce
PDF
Replicate Salesforce Data in Real Time with Change Data Capture
PDF
Modern Development with Salesforce DX
PDF
Get Into Lightning Flow Development
PDF
Integrate CMS Content Into Lightning Communities with CMS Connect
PDF
Introduction to MuleSoft
PDF
Modern App Dev: Modular Development Strategies
PDF
Vs Code for Salesforce Developers
PDF
Vs Code for Salesforce Developers
PDF
Manage Massive Datasets with Big Objects & Async SOQL
PDF
Introduction to Einstein Bots
PDF
Introduction to MuleSoft Anytime Platform
PDF
Developing Smarter Apps with Einstein Platform Services
PDF
Scaling Developer Efforts with Salesforce Marketing Cloud
Maximizing Salesforce Lightning Experience and Lightning Component Performance
CodeLive: Build Lightning Web Components faster with Local Development
CodeLive: Converting Aura Components to Lightning Web Components
Enterprise-grade UI with open source Lightning Web Components
Live coding with LWC
Migrating CPQ to Advanced Calculator and JSQCP
Scale with Large Data Volumes and Big Objects in Salesforce
Replicate Salesforce Data in Real Time with Change Data Capture
Modern Development with Salesforce DX
Get Into Lightning Flow Development
Integrate CMS Content Into Lightning Communities with CMS Connect
Introduction to MuleSoft
Modern App Dev: Modular Development Strategies
Vs Code for Salesforce Developers
Vs Code for Salesforce Developers
Manage Massive Datasets with Big Objects & Async SOQL
Introduction to Einstein Bots
Introduction to MuleSoft Anytime Platform
Developing Smarter Apps with Einstein Platform Services
Scaling Developer Efforts with Salesforce Marketing Cloud

Recently uploaded (20)

PDF
Web App vs Mobile App What Should You Build First.pdf
PDF
project resource management chapter-09.pdf
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PPTX
Tartificialntelligence_presentation.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Chapter 5: Probability Theory and Statistics
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
A comparative analysis of optical character recognition models for extracting...
PPTX
TLE Review Electricity (Electricity).pptx
PDF
DP Operators-handbook-extract for the Mautical Institute
PDF
Hybrid model detection and classification of lung cancer
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PPTX
cloud_computing_Infrastucture_as_cloud_p
Web App vs Mobile App What Should You Build First.pdf
project resource management chapter-09.pdf
Heart disease approach using modified random forest and particle swarm optimi...
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
Tartificialntelligence_presentation.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Encapsulation_ Review paper, used for researhc scholars
Chapter 5: Probability Theory and Statistics
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
A comparative analysis of optical character recognition models for extracting...
TLE Review Electricity (Electricity).pptx
DP Operators-handbook-extract for the Mautical Institute
Hybrid model detection and classification of lung cancer
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Univ-Connecticut-ChatGPT-Presentaion.pdf
cloud_computing_Infrastucture_as_cloud_p

Best Practices for Creating Scalable Apps with Heroku

  • 1. Heroku – Best Practices for Creating Scalable Apps with Heroku Vincent Spehner, Tquila, Heroku Practice Manager @vzmind and @herokusalesforceplaybook
  • 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 any litigation, risks associated with completed and any 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-K for the most recent fiscal year and in our quarterly report on Form 10-Q for the most recent fiscal quarter. These 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.
  • 3. Introduction Last year at Dreamforce to discuss with speakers talking about Heroku and meet early adopters of the Platform. ▪ Released the first version of Heroku Salesforce Playbook on Xmas 2012 • Heroku history • Introduction to Heroku Toolbelt • Java and Ruby tutorial to get started ▪ Next release available soon (Xmas 2013) • Presenting 15+ detailed use cases http://herokusalesforceplaybook.com
  • 4. Introduction Today the objective is to present some common mistakes done when building Cloud app (including on Heroku) and learn how to avoid them ▪ Platform / language neutral ▪ First we need to understand how Cloud Apps are different ? • Heroku 12 factors • Cloud App with remote Data/API
  • 5. PaaS 12 factors I. Codebase One codebase tracked in revision control, many deploys II. Dependencies Explicitly declare and isolate dependencies III. Config Store config in the environment IV. Backing Services Treat backing services as attached resources V. Build, release, run Strictly separate build and run stages VI. Processes Execute the app as one or more stateless processes VII. Port binding Export services via port binding VIII. Concurrency http://12factor.net/
  • 6. DE PE ND EN EV EN D ID ER IECI H S CW ES E !! NY E ARH AT W L YHE ID ER RE DE EV N !! Cloud App Architecture
  • 7. The API latency syndrome How to detect it ? ▪ Pages taking ages to display ▪ API Quota reached quickly (few hours) ▪ More than 5 API calls per action ▪ App not working at specific moment of the day SOLUTION : CACHE EVERYWHERE IT’S REQUIRED !!
  • 8. Cache OR Call pattern Reduce overall API Latency:
  • 9. Understanding Caching options Cache vs Data replication vs Data synchronization: ▪ Cache: store temporarily data locally to avoid further calls ▪ Data replication: copy remote data locally ▪ Data synchronization: best of both, local and synchronized
  • 10. Understanding Caching options Cache vs Data replication vs Data synchronization: ▪ Caching weakness: you need to sweep it regularly and automate it ▪ Data replication weakness: bi-directional update replication implies potential conflict which need a proper management ▪ Data synchronization: most robust option, hard to implement
  • 12. API cache warming Principle ▪ You already know that your application need to get the list of remote static objects ▪ Add a worker dedicated to Cache warming ▪ Store all remote Static records locally ▪ Define refreshing strategy on the worker itself
  • 14. Salesforce custom APEX End Point Objective: ▪ Reduce API calls ▪ Access Hidden Business Logic Creating custom APEX endpoint: ▪ Group API calls ▪ Aggregate objects/records/business process results in ONE call ▪ Trigger complex Apex code from a REST endpoint
  • 15. Environment management Is your local machine the Test env ? ▪ Cloud app might behave differently than on your Local Machine or Test Server • Assets compilation failing • Process running differently • Static Configuration • Memory management • Remote API calls
  • 16. Environment management Solutions: ▪ Dev ENV as clause of Heroku PROD ENV than possible ▪ Duplicate your Production ENV for TEST ▪ Use Foreman locally ▪ Share Heroku config with your team and load it as part of your ENV ▪ Of course you can spin up and down Heroku TEST env
  • 17. No clues on errors Logplex principle ▪ Logs are an event Stream (12 Factor number XI) Monitor early, drive safely: ▪ Start recording logs from the beginning with enough storage capacity ▪ Monitor your app ▪ Make sure your logs are relevant
  • 18. Log stream , Papertrail, New Relic
  • 20. Conclusion ▪ Cloud apps - Heroku apps - require specific care ▪ Caching, Log stream, Env management as described in 12 Factor-app ▪ Rethink data storage and data exchange as they are not local ▪ Check the playbook, share your ideas with Book authors
  • 21. All about Tquila Tquila is the main european Salesforce Partner specialized on Salesforce implementation, Mobile and Social applications with 250 consultants in Europe, Asia, Australia. ▪ 102 customers ▪ 304 projects ▪ 204 certifications
  • 22. Vincent Spehner Heroku Practice Manager, @vzmind http://herokusalesforceplaybook.com