Avoid Growing Pains: Scale Your App for the Enterprise (October 14, 2014)

38
Avoid Growing Pains: Scale your App for the Enterprise Randy Case ISV Technical Evangelist @randyscase

description

Avoid Growing Pains: Scale Your App for the Enterprise (October 14, 2014)

Transcript of Avoid Growing Pains: Scale Your App for the Enterprise (October 14, 2014)

Page 1: Avoid Growing Pains: Scale Your App for the Enterprise (October 14, 2014)

Avoid Growing Pains: Scale your App for the Enterprise Randy Case ISV Technical Evangelist @randyscase

Page 2: Avoid Growing Pains: Scale Your App for the Enterprise (October 14, 2014)

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.

Page 3: Avoid Growing Pains: Scale Your App for the Enterprise (October 14, 2014)

Agenda

–  Introduction – Thinking at enterprise scale – Force.com database architecture and tuning – Architecting your application for scale – Testing your application at scale – Peek into the future – Question and Answers

Page 4: Avoid Growing Pains: Scale Your App for the Enterprise (October 14, 2014)

Understand application and user requirements

Estimate volumes at enterprise scale

Operational vs. Historical Data

Understand where scale will be used

Page 5: Avoid Growing Pains: Scale Your App for the Enterprise (October 14, 2014)

Estimate the growth and volume of data

Can you achieve a steady state on volume?

Where does growth come from?

How fast will data volume increase?

Page 6: Avoid Growing Pains: Scale Your App for the Enterprise (October 14, 2014)

Design your app for scale

Always think big (be reasonable)!

Test, Test, Test, … Understand the impact areas of LDV

Page 7: Avoid Growing Pains: Scale Your App for the Enterprise (October 14, 2014)

Use to introduce a

demo, video, Q&A, etc.

Force.com Database Architecture and Tuning

Page 8: Avoid Growing Pains: Scale Your App for the Enterprise (October 14, 2014)

Force.com Database Architecture

Shared Database

Data and Pivot Tables

Page 9: Avoid Growing Pains: Scale Your App for the Enterprise (October 14, 2014)

Check user Visibility

Check filter selectivity

Write query-based on results

of pre-queries

Execute query

User Visibility

# of rows that the user can access

=

Filter Selectivity

How specific is this filter? =

Stop

Go

Multi-tenant Optimizer Statistics

Multi-tenant Query Optimizer

Page 10: Avoid Growing Pains: Scale Your App for the Enterprise (October 14, 2014)

Use to introduce a

demo, video, Q&A, etc. Architecting Your Application for Scale

What you need to do

Page 11: Avoid Growing Pains: Scale Your App for the Enterprise (October 14, 2014)

The Key to Performance

Selectivity

Data Reduction

§  Reduce the amount of data accessed during query. §  Make query parameters specific as possible.

§  Less data means better performance §  Consider archiving in initial design §  Many features to facilitate archiving process.

Page 12: Avoid Growing Pains: Scale Your App for the Enterprise (October 14, 2014)

Reports

1. Use focused report filters 2. Pre-aggregate the data

3. De-normalize the data 4. Use a data warehouse

Page 13: Avoid Growing Pains: Scale Your App for the Enterprise (October 14, 2014)

API Best Practices

1. No Apex triggers and workflow 2. Operation choice

3. Record sizes 4. Optimize sharing if possible

Page 14: Avoid Growing Pains: Scale Your App for the Enterprise (October 14, 2014)

API Best Practices

1.  Delta-only loads 2. Parent record locking

3. Keep large volumes out of DB

4. Database statistics

Page 15: Avoid Growing Pains: Scale Your App for the Enterprise (October 14, 2014)

Sharing

•  Used by all features and can have huge impact with LDV. •  Data accessibility is governed by:

– Organization-wide defaults – Role hierarchy – Sharing rules – Criteria-based sharing – Manual shares – Programmatic sharing – Implicit sharing

Page 16: Avoid Growing Pains: Scale Your App for the Enterprise (October 14, 2014)

1. Avoid over-protection of data

3. Avoid skew 4. Don’t nest groups too deeply

Sharing Best Practices

2. Leverage the right tools for the Task

Page 17: Avoid Growing Pains: Scale Your App for the Enterprise (October 14, 2014)

SOQL Best Practices §  Make queries selective §  Use alternative approach

§  Utilize Apex to do the work §  Decompose relationship queries

§  Some use cases that will cause issues: §  Performing large data loads and immediate query §  LIKE with leading wildcards “%Acme” §  Use of NOT and “!=“ §  Complex queries with multiple joins §  Data in the Recycle Bin

Query Resource Feedback Parameter Pilot

Page 18: Avoid Growing Pains: Scale Your App for the Enterprise (October 14, 2014)

DB

SEARCH INDEX

DB processing includes sharing access check

Millions of records

Query across entire index for matches to search string

Record IDs of matches to query are sent to DB for processing

Page 19: Avoid Growing Pains: Scale Your App for the Enterprise (October 14, 2014)

1. Keep search text specific 2. Avoid complex sharing

3. Single object searches

Search Best Practices

4. LDV data changes

Page 20: Avoid Growing Pains: Scale Your App for the Enterprise (October 14, 2014)

Use to introduce a

demo, video, Q&A, etc. Architecting Your Application for Scale

How Salesforce may help you

Page 21: Avoid Growing Pains: Scale Your App for the Enterprise (October 14, 2014)

What are Indexes?

ID First Name Last Name 1000001 John Smith

1000002 Jane Jones

1000003 Buzz Baker

ID First Name Last Name 1000003 Buzz Baker

1000002 Jane Jones

1000001 John Smith

Page 22: Avoid Growing Pains: Scale Your App for the Enterprise (October 14, 2014)

Index Rules •  Must be below thresholds to be useful:

– Custom Indexes: Lower of (10% of 1M + 5% over 1M) or 333,333. – Standard Indexes: Lower of (30% of 1M + 15% over 1M) or 1M.

•  Modified by “AND” and “OR” – AND – Below 20% of total records or 666K for custom index – OR – Below 10% of total records or 333K in summation of all indexes.

•  Predicates that won’t use indexes – Not equal to (i.e. “!=“) – NOT(i.e. NOT IN)

Page 23: Avoid Growing Pains: Scale Your App for the Enterprise (October 14, 2014)

Skinny Tables •  Reduced I/O •  Better cache Utilization •  Reduced Joins •  Invisible to End users •  Supported in reports, list views and

SOQL queries •  All fields must be in skinny table

Page 24: Avoid Growing Pains: Scale Your App for the Enterprise (October 14, 2014)

Use to introduce a

demo, video, Q&A, etc. Testing Your Application at Scale

Page 25: Avoid Growing Pains: Scale Your App for the Enterprise (October 14, 2014)

What Is Performance Testing?

Response Time Based Testing Confirm that a set of process flows perform in such a manner as to give the end user a positive experience

User Load Based Testing Confirm that a set of process flows will be able to support a particular user load.

Page 26: Avoid Growing Pains: Scale Your App for the Enterprise (October 14, 2014)

Candidates for Performance Testing •  Areas effected by large data volumes

–  Custom code (VF, Apex) –  Reports, List views –  Page detail with possible skew

•  Usage Patterns –  Large number of records –  Large number of users –  Large number of transactions

Page 27: Avoid Growing Pains: Scale Your App for the Enterprise (October 14, 2014)

What is response time based testing? •  This is functional and execution performance testing at scale.

–  Functional testing •  Ensure all app functionality executes without error •  Ensure UX is optimal at large data volumes

–  Execution performance testing •  Understand relative response times •  Focus on improving relative performance

Page 28: Avoid Growing Pains: Scale Your App for the Enterprise (October 14, 2014)

What is user load based testing?

Simulate Users

Load Generators

Load Controller

Load Metrics

Page 29: Avoid Growing Pains: Scale Your App for the Enterprise (October 14, 2014)

Use to introduce a

demo, video, Q&A, etc. Peek into the Future

Page 30: Avoid Growing Pains: Scale Your App for the Enterprise (October 14, 2014)

•  Efficient storage for non-transactional data •  Unstructured and Semi-structured Blob Store

•  Highly-scalable batch processing Programmatic data lifecycle from live to archive state

Future Enhancements

Big Objects Fileforce API

Data Pipelining

Data Archiving

Page 31: Avoid Growing Pains: Scale Your App for the Enterprise (October 14, 2014)

Dreamforce Sessions •  Introducing Force.com Data Management Services

– Wednesday, 4:00 PM - 4:40 PM – Century Theaters – Theater 5

•  Get Out of Cold Storage, Get into Data Archiving on Salesforce – Wednesday, 11:00 AM - 11:40 AM – Century Theaters – Theater 2

Page 32: Avoid Growing Pains: Scale Your App for the Enterprise (October 14, 2014)

Summary •  Develop your app with scale in mind. •  Use best practices when building.

–  Keep data volumes to a minimum. –  Optimize and tune programmatic components

•  Test for scale before your customer does.

Page 33: Avoid Growing Pains: Scale Your App for the Enterprise (October 14, 2014)

Resources •  Developer Website

•  The ISV team will help you!

Page 34: Avoid Growing Pains: Scale Your App for the Enterprise (October 14, 2014)

+ “Forgot the ring” =

+ “What work?” =

+ “Application Scalability” =

Page 35: Avoid Growing Pains: Scale Your App for the Enterprise (October 14, 2014)

Check out the new Partner Community

https://partners.salesforce.com/

Page 36: Avoid Growing Pains: Scale Your App for the Enterprise (October 14, 2014)

Connect with Partners in the Partner Zone The Westin Hotel, Market Street 2nd Floor – Metropolitan Ballroom INNOVATE with the leading technology •  Demos of new Salesforce technology CONNECT with members of the partner community •  Partner Community Theater •  Networking areas •  Welcome reception and daily lunch service GROW your business with resources •  70+ partner-specific sessions •  ‘Ask the Experts’ consultation stations

Page 37: Avoid Growing Pains: Scale Your App for the Enterprise (October 14, 2014)

AppBash 2014 on Wednesday Night!

Page 38: Avoid Growing Pains: Scale Your App for the Enterprise (October 14, 2014)