+ All Categories
Home > Technology > Salesforce Multitenant Architecture: How We Do the Magic We Do

Salesforce Multitenant Architecture: How We Do the Magic We Do

Date post: 01-Jul-2015
Category:
Upload: salesforce-developers
View: 1,341 times
Download: 1 times
Share this document with a friend
Description:
Join us as we take a deep dive into the architecture of the Salesforce1 Platform, explain how multitenancy actually works, and how it affects you as a developer. Showing the technology we use and the design principles we adhere to, you'll see how our platform teams manage three major upgrades a year without causing any issues to existing development. We'll cover the performance and security implications around the platform to give you an understanding of how limits have evolved. By the end of the session, you'll have a better grasp of the architecture underpinning Force.com and understand how to get the most out of it.
49
Salesforce.com’s Multitenant Architecture How we do the magic we do…
Transcript
Page 1: Salesforce Multitenant Architecture: How We Do the Magic We Do

Salesforce.com’s Multitenant ArchitectureHow we do the magic we do…

Page 2: Salesforce Multitenant Architecture: How We Do the Magic We Do

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: Salesforce Multitenant Architecture: How We Do the Magic We Do

Doug MerrettPrincipal Architect – Northern Europe

Page 4: Salesforce Multitenant Architecture: How We Do the Magic We Do

In the Internet of Customers, Apps Connect Everything

Connected

Employees

Connected

Products

Social

Mobile

Cloud

ConnectedPartners

ConnectedCustomer

s

Customer

Page 5: Salesforce Multitenant Architecture: How We Do the Magic We Do

Trunk ClubCONSUMER FASHION APPHoneywell

CONTRACTOR APP

ZimmerPRODUCT CATALOG APP

Virgin AmericaEMPLOYEE INTRANET APP

Academy of ArtSTUDENT SCHEDULING APP

Time Warner Cable

FIELD SALES APP

Build Next Gen Apps. Lead Next Gen IT.

Page 6: Salesforce Multitenant Architecture: How We Do the Magic We Do

The World’s #1 Cloud Platform

The Fastest Path From Idea To App

Page 7: Salesforce Multitenant Architecture: How We Do the Magic We Do

Salesforce1: A New Customer Platform for the Future

Your Customers

Page 8: Salesforce Multitenant Architecture: How We Do the Magic We Do

At The Core Of The Customer Success PlatformMultitenant Cloud Computing

EnterpriseCloud Computing

Fast Innovative Open Easy Trusted

No Hardware

No Software

Faster ROI

Automatic Upgrades

Continuous Improvement

Flexible

Any Device

API First

Data Portability

Transparent

Secure

Performance at Scale

Real-time Customizations

AppExchange

Scalable

Page 9: Salesforce Multitenant Architecture: How We Do the Magic We Do

What Salesforce.com does for you

YOU get to focus on

innovation

We doInfrastructure

Services

We doApplication

Services

We doOperations

Services

Customize your CRM

Build your data model

Build your business logic

Build your user interface

Network

Storage

Operating System

Database

App Server

Web Server

Data Center

Security

Sharing

Integration

Customization

Web Services

API

Multi-Language

Authentication

Availability

Monitoring

Patch Mgmt

Upgrades

Backup

NOC

Page 10: Salesforce Multitenant Architecture: How We Do the Magic We Do

Multitenancy

Page 11: Salesforce Multitenant Architecture: How We Do the Magic We Do

One Cloud with Many Customers

Shared Elastic ServicesOne Primary Data Store per Production Instance8K+ Customers per Instance50+ Production Instances

All data segregated by customerAll operations include Org IDDisaster RecoveryPer Org encryption keys

Page 12: Salesforce Multitenant Architecture: How We Do the Magic We Do

What is in an Instance

Pivot tables

Data tables

Metadata tables

Shared Database Metadata Cache

Bulk data processing

Multitenant aware Query optimizer

Runtime App Generator

Full text search engine

Virtual Application Components

Common Application Screens

Tenant Specific Screens

Objects (Tables)

Page 13: Salesforce Multitenant Architecture: How We Do the Magic We Do

What Multitenancy means for Salesforce.com R&D

No Legacy TeamsBugs fixed for everyone

One Version

Page 14: Salesforce Multitenant Architecture: How We Do the Magic We Do

What Multitenancy means for Salesforce.com R&D

No Legacy TeamsBugs fixed for everyone

One Version260K+ of our TestsRun your tests as well

Automation

Page 15: Salesforce Multitenant Architecture: How We Do the Magic We Do

What Multitenancy means for Salesforce.com R&D

No Legacy TeamsBugs fixed for everyone

One Version

Instance Architecture

260K+ of our TestsRun your tests as well

Automation

Staggered ReleasesScalability across all sizes

Page 16: Salesforce Multitenant Architecture: How We Do the Magic We Do

What Multitenancy means for Salesforce.com R&D

Three major releases per yearBug fixes every week

Predictability

No Legacy TeamsBugs fixed for everyone

One Version

Instance Architecture

260K+ of our TestsRun your tests as well

Automation

Staggered ReleasesScalability across all sizes

Page 17: Salesforce Multitenant Architecture: How We Do the Magic We Do

What Multitenancy means for Salesforce.com R&D

Three major releases per yearBug fixes every week

Predictability

No Legacy TeamsBugs fixed for everyone

One Version

Instance Architecture

260K+ of our TestsRun your tests as well

Automation

Staggered ReleasesScalability across all sizes

Page 18: Salesforce Multitenant Architecture: How We Do the Magic We Do

Key Architectural Principles• Stateless Appservers• Database system of record• No Database Definition Language (DDL) at Runtime• All tables partitioned by OrgId• Smart Primary Keys, Polymorphic Foreign Keys• Creative de-normalization and pivoting• Use every RDBMS feature & optimization

Page 19: Salesforce Multitenant Architecture: How We Do the Magic We Do

Metadata, data, and pivot table structures store data corresponding to virtual data structures

Page 20: Salesforce Multitenant Architecture: How We Do the Magic We Do

The Objects table stores metadata about custom objects (tables)

Page 21: Salesforce Multitenant Architecture: How We Do the Magic We Do

The Fields table stores metadata about custom fields (columns)

Page 22: Salesforce Multitenant Architecture: How We Do the Magic We Do

The Data heap table stores all structured data corresponding to custom objects

Page 23: Salesforce Multitenant Architecture: How We Do the Magic We Do

A single slot can store various types of data that originate from different objects

Page 24: Salesforce Multitenant Architecture: How We Do the Magic We Do

The Indexes pivot table manages tenant-specific selective indexes

Page 25: Salesforce Multitenant Architecture: How We Do the Magic We Do

The UniqueFields pivot table facilitates uniqueness for custom fields

Page 26: Salesforce Multitenant Architecture: How We Do the Magic We Do

The Relationships pivot table facilitates referential integrity and optimizes joins

Page 27: Salesforce Multitenant Architecture: How We Do the Magic We Do

All data & metadata structures are partitioned to improve performance and manageability• Tables hash partitioned by OrgId• Separate connection pools point to physical hosts• App tier is also dynamically partitioned by OrgId• Distributed metadata cache with transactional invalidation

Page 28: Salesforce Multitenant Architecture: How We Do the Magic We Do

Application Framework: a whole lot for free• Native Declarative features• Bulk Processing• The Recycle Bin• Full Text Search• Smart Bulk Data Manipulation Language (DML)• Web Services APIs

Page 29: Salesforce Multitenant Architecture: How We Do the Magic We Do

Force.com’s native Application Framework provides declarative development, no coding

Page 30: Salesforce Multitenant Architecture: How We Do the Magic We Do

Validation rules and simple formulas:Business analysts can “code” these

Page 31: Salesforce Multitenant Architecture: How We Do the Magic We Do

Not so simple: Rollup-summary fields provide for easy cross-object summaries

Page 32: Salesforce Multitenant Architecture: How We Do the Magic We Do

Force.com’s bulk processing optimizations reduce overhead for data loads

Page 33: Salesforce Multitenant Architecture: How We Do the Magic We Do

Data definition processing is optimized to avoid performance hits or concurrency limitsExamples:• Sort all records by primary key before attempting DML• Operate on tables in deterministic order• Slot reallocation for field datatype change• Deferred calculation for new rollup-summary field• Background processing of mass changes

Page 34: Salesforce Multitenant Architecture: How We Do the Magic We Do

The Recycle Bin: Smart Undeletes

Restore

Individual object instances (records)

Related object instances (parent/child records)

Entire fields and objects(dropped columns and tables)

Page 35: Salesforce Multitenant Architecture: How We Do the Magic We Do

DR Instance

Multitenant Search, anything but simple

Index Backup

Replication

Primary Instance

Page 36: Salesforce Multitenant Architecture: How We Do the Magic We Do

Multitenancy delivers Blazing Performance

Transactions Per Quarter131B Transactions in Q2FY15

51% YOY Growth

Average Page Time217ms Latency in Q2FY15

13% YOY Improvement

Page 37: Salesforce Multitenant Architecture: How We Do the Magic We Do

• 4 Online copies of database• 2 Online backup copies

Multitenant Core Data Storage

AsyncReplication

Data GuardReplication

Primary Instance

ApplicationServers

ProductionRAC Cluster

StandbyRAC Cluster

Secondary Instance

Data GuardReplication

ApplicationServers

ProductionRAC Cluster

StandbyRAC Cluster

Page 38: Salesforce Multitenant Architecture: How We Do the Magic We Do

Multitenant Query Optimization Principles• Consistent SQL generation across the application• Deep awareness of pivot table structure

– Flex schema does impose a cost

• Tenant, user, object, fields statistics are crucial• No runaway queries allowed• Deep integration with the sharing model

Page 39: Salesforce Multitenant Architecture: How We Do the Magic We Do

Multitenant Query Optimizer

Check user visibility

Check filer selectivity

Dynamically write query based on pre-queries

Run Pre-Queries

Execute optimized query

user visibility = number of rows user can access

filter selectivity = index corresponding to filter column

Search originates from API or global search

return results

Page 40: Salesforce Multitenant Architecture: How We Do the Magic We Do

The optimizer considers pre-query selectivity measurements when writing a query

Pre-Query Selectivity

Measurements

… use of index related to filter.HighHigh

… ordered hash join; drive using Data table.LowHigh

… use of index related to filter.HighLow

… nested loops join; drive using view of rows that the user can see.LowLow

Write final database access query, forcing …FilterUser

Page 41: Salesforce Multitenant Architecture: How We Do the Magic We Do

Apex: Force.com’s procedural frontierInteger NUM = 10; Account[] accs;

// Clean up old data accs = [select id from account where name like 'test%']; delete accs; commit;

accs = new Account[NUM]; for (Integer i = 0; i < NUM; i++){ accs[i] = new Account(name='test ' + i, outstandingshares__c=i); } insert accs;

Contact[] cons = new Contact [0];

for (Account acc : accs){ cons.add(new Contact(lastName=acc.name + '1', accountid=acc.id)); cons.add(new Contact(lastName=acc.name + '2', accountid=acc.id)); }

insert cons;

SOQL Query

VariableDeclaration

Control Structure

Array

Data Operation

CommitTransaction

Page 42: Salesforce Multitenant Architecture: How We Do the Magic We Do

Apex code is stored as metadata, interpreted at runtime, and cached for scalability

Page 43: Salesforce Multitenant Architecture: How We Do the Magic We Do

Apex is deeply integrated with platform features• Bulk DML• Email and messaging• Asynchronous processing (Futures)• XmlStream / HTTP (RESTful) services classes• Declarative exposure as new Web Services

Page 44: Salesforce Multitenant Architecture: How We Do the Magic We Do

FeedsProfiles

FilesSocial Graph

Social

Right ExperienceAny Device

Customizable

Mobile

Real-time notificationsReal-time workflow

Real-time feeds

Real-time

Customer Success PlatformPowered by Multitenancy

Open

Open StandardsOpen Technologies

Open InterfacesOpen Languages

What Makes Us Different?

Page 45: Salesforce Multitenant Architecture: How We Do the Magic We Do

Where to go for more information...• http://developer.force.com/architect• http://developer.force.com/security

• Other Sessions

Page 46: Salesforce Multitenant Architecture: How We Do the Magic We Do

Where to go for more information... (cont)

• Other Sessions

Page 47: Salesforce Multitenant Architecture: How We Do the Magic We Do

Wednesday, October 15, 2 p.m.Moscone South, Main Keynote Hall

BUILD APPS FAST. BUILD BUSINESS FASTER.

Don’t miss the Salesforce1 Platform Keynote with

Mike RosenbaumEVP, Salesforce1 Platform

Tod NielsenCEO, Heroku

Toby LesterVP, Technology Architecture

And Innovation, Brown-Forman

Mike MeadowsVP, Chief Technology Officer

Eli Lilly and Company

Page 48: Salesforce Multitenant Architecture: How We Do the Magic We Do

Q & A

Please fill out your survey in Dreamforce App

Page 49: Salesforce Multitenant Architecture: How We Do the Magic We Do

Recommended