Using custom objects or custom settings to store app configuration metadata is an anti-pattern because it prevents the configuration from being packaged. Custom metadata types provide a better solution that allows packaging of configuration metadata.
Using @future annotations to make asynchronous callouts can be an anti-pattern because it does not guarantee near real-time behavior due to sharing the async queue with all orgs. Alternatives like apex continuations or scheduling batch jobs may provide more consistent experiences.
Building too many custom components rather than leveraging platform features can lead an app to not align with platform innovations. It is better to look for ways to extend the platform than rebuild functionality.
3. āāÆ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.
Safe Harbor
5. Pattern is
a common reusable solution to a
recurring problem within a given context
Anti-pattern is
a common response to a recurring
problem that is usually ineffective and
risks being highly counterproductive.
Session Theme: Patterns and Anti-patterns
11. Asynchronous Apex
Four āļ¬avorsā
Single request
ā¢āÆ Queueable Apex
ā¢āÆ @future
Batch requests
ā¢āÆ Batch Apex
ā¢āÆ Scheduled Apex
Example
āSave and Submit Orderā Visualforce Page
1.āÆ Update an Order
2.āÆ Save
3.āÆ Submit for Shipment (external web service callout)
4.āÆ Update the page (saved order)
5.āÆ Update the page (shipment status)
14. Asynchronous Apex
Shared Queue: Async != Near Real Time
ā¢āÆ Shared queue across all tenants
ā¢āÆ Time to dequeue request will vary
ā¢āÆ Pod load
ā¢āÆ Org load
ā¢āÆ Flow control (āFair Request Handlingā)
ā¢āÆ High request volume triggers extended
delay (āPenalty Boxā)
15. Asynchronous Apex
What aboutā¦
āāÆā¦ Queueable Apex?
Better than @future
BUT - it wonāt guarantee consistency
āāÆā¦ Scheduled Batch Apex?
Should scale better
Queue is not āļ¬oodedā with single requests
Users will expect a delay from the beginning
BUT - it still wonāt guarantee consistency
16. Asynchronous Apex
SLAs and Customer Expectations
Expectation of Consistency (Implicit SLA)
Customer perception drives customer satisfaction and trust
Any place where usersā expectations are formed:
ābut it usually runs in 20 seconds and this time it took 30
minutes??ā
Explicit SLA
Order processed within 5 minutes of receipt
Quarterly Statements Generated by Monday morning
19. Asynchronous Apex
Recap and Good Patterns
āāÆUse the right tool for the right job
āāÆUnderstand platform architecture
āāÆEngineer to scale
āāÆThe bar is set higher for ISVs
āāÆDo not do thisā¦
āāÆReliable Async Patterns that Scale
āāÆImplicit or Explicit SLA
=> use synchronous context
=> choose consistency over convenience
GREAT FEATURE no SLA
Shared Queue
Variable dequeueing and processing
Dependencies you canāt control (Org, Pod)
BUT REMEMBERā¦Easy to use native async
Relaxed governor limits
Process larger data volumes
Examples
āāÆ Callout scenarios: Apex Continuation Pattern
āāÆ Consistent batch processing: Client side to orchestrate the process
=> Browser (Javascript/Ajax)
=> Server side (Heroku agent)
21. About
GREAT ALONE. BETTER TOGETHER.
ā¢āÆNative to Salesforce1ā¢ Platform
since 2009
ā¢āÆInvestors include Salesforce Ventures
ā¢āÆ650+ employees, San Francisco based
22. āāÆWhy is this bad?
Less likely to align with new features and innovations on the platform
Just because you can build it, doesnāt mean you should!
Anti-pattern: Building too much!
Good patternsā¦.
Be part of the platform, look for ways to extend it rather than just using it
Understand how your customers customize your applications
23. Invocable Methods extend subscriber use of Process Builder and Visual Flow
Good Pattern Example: Invocable Methods
Anti-pattern: Building too much!
24. Just because you can build it, doesnāt mean you should!
Anti-pattern: Building too much!
Lightning Components extend subscriber use of Lightning
App Builder
APIās APIās APIās (including Apex APIās) more critical than
everā¦
Know what the platform APIās provide
Only add value with your own
Internet of Things #IoT growing market, be aware of it!
25. If something feels hard it's likely because you're not thinking āplatformā
Anti-pattern: Fighting the platform
Why is this bad?
Limiting the value the platform can give you and your users
Good patternsā¦.
Make sure your Business Analysts know the platform
ā¢āÆ If they do, they will be more inclined to state requirements that ļ¬t with the platform
ā¢āÆ Platform App Builder certiļ¬cation is a good start (formerly ADM 401)!
Make sure you consider all routes into your code not just your custom pages,
ā¢āÆ Salesforce WebService and Apex APIās, Workļ¬ow, Process Builder etcā¦
ā¢āÆ Ensure your developers understand how customers use the platform to customize
Have the consulting / IT teams talk to developers
26. Anti-pattern: Not understanding how the app is used...
Why is this bad?
Customer satisfaction will suļ¬er
Slow to react to bugs and issues
No metric-based insights
27. Leverage the information License Management App gives you
Investigate and understand what Salesforce Usage Metrics gives you
For composite apps, proļ¬le and monitor things like API usage
See Limits Resource to query this
Anti-pattern: Not understanding how the app is used...
Good Patterns: Drive product change with measurable, observable and quantitative metrics...
28. Route your Apex Exceptions from your manage packages to some place central
Using Inbound Email Services and Regex to Monitor Apex Error Emails
Good Patterns: Drive product change with measurable, observable and quantitative metrics...
Anti-pattern: Not understanding how the app is used...
30. Custom Indexes and Skinny Tables
Background: Selective queries rely on indexes
ISV Scale: How to Scale Your App for Enterprise Customers
Park Central Hotel, Franciscan Ballroom, Tuesday 3pm
31. Custom Indexes
Standard indexed ļ¬elds
Primary keys (Id, Name and Owner)
Foreign keys (lookup or master-detail)
Audit dates (SystemModStamp)
Custom indexes
ā¢āÆ standard multi-tenant construct
ā¢āÆ not package-able
ā¢āÆ created by support via a case
ā¢āÆ supported for ISVs
Custom indexes
Custom Object
Use Unique or ExternalId where possible (packageable!)
Otherwise, request custom index
Standard Object
Do not add Unique or ExternalId ļ¬elds to your package
Request custom index
32. Custom Indexes
How to log a case to request them
āāÆ Now a standard process
TODO: Get exact instructions from support (Greg/Nia) - pending
33. Skinny Tables
Supported for Customers (not guaranteed for ISVs)
Large data volumes (~ millions of rows)
Standard or custom indexes are not suļ¬cient
Also not package-able
Not copied to sandboxes
Requires R&D investigation to create each time
Not truly multi-tenant
Support not guaranteed for ISVs apps
34. Skinny Tables
Warning sign, not a scalable solution
Skinny tables for ISV apps
ā¢āÆ ok as a one-oļ¬
ā¢āÆ Not a scalable solution
ā¢āÆ Consider them a warning sign
Alternative Design Patterns
ā¢āÆ Reduce data set (archive, purge)
ā¢āÆ Pre-aggregate data into a separate object
ā¢āÆ Explore Data Pipelines and Big Objects pilots
ā¢āÆ Reporting: consider building a Wave app
ā¢āÆ Work with your TE to assess the best approach
35. Recommended Sessions
Custom Metadata Types: Save Years of Development on App Conļ¬gurations
Park Central Hotel, Franciscan Ballroom, Wednesday 11:00 a.m
Catch the Wave of ISV Analytics Apps
Park Central Hotel, Franciscan Ballroom, Thursday 3pm
ISV Scale: How to Scale Your App for Enterprise Customers
Park Central Hotel, Franciscan Ballroom, Tuesday 3pm
(Watch the recording)
Building ISV Apps with Force.com + Heroku
Park Central Hotel, Franciscan Ballroom, Tuesday 2pm
(Watch the recording)
Apex Enterprise Patterns: Building Strong Foundations
Moscone West, Innovation Theater, Tuesday 1.30pm
(Watch the recording)