Boxcars and Cabooses: When One More XHR Is Too Much

49
Boxcars and Cabooses When one more XHR is too much Peter Chittum Developer Evangelist @pchittum github.com/pchittum

Transcript of Boxcars and Cabooses: When One More XHR Is Too Much

Page 1: Boxcars and Cabooses: When One More XHR Is Too Much

Boxcars and Cabooses When one more XHR is too much

Peter Chittum Developer Evangelist @pchittum github.com/pchittum

Page 2: Boxcars and Cabooses: When One More XHR Is Too Much

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: Boxcars and Cabooses: When One More XHR Is Too Much
Page 4: Boxcars and Cabooses: When One More XHR Is Too Much
Page 5: Boxcars and Cabooses: When One More XHR Is Too Much

The Goal

 Suggest design principles

 Try Salesforce platform

 Lots of Salesforce projects looking for developers

Page 6: Boxcars and Cabooses: When One More XHR Is Too Much

Salesforce Background

Page 7: Boxcars and Cabooses: When One More XHR Is Too Much
Page 8: Boxcars and Cabooses: When One More XHR Is Too Much

 Business and Enterprise Application Platform Company

Page 9: Boxcars and Cabooses: When One More XHR Is Too Much

Sales Service

Marketing

Community Apps

Analytics

Page 10: Boxcars and Cabooses: When One More XHR Is Too Much

Bulk

REST

Metadata

SOAP

Tooling

Streaming

INTE

GR

ATIO

N L

AYER

Point & Click Integration

Tools

Page Builder

DECLARATIVE DEVELOPMENT

GLOBAL ENTERPRISE CLOUD INFRASTRUCTURE

PLATFORM SERVICES

APP MANAGEMENT & DEPLOYMENT

Workflow Engine

UI Framework

Sharing & Permissions

Global Search

Reports & Dashboards

Files & Content

Authentication

Collaboration Event Log Framework

Translation Workbench

App Builder

Process Builder

Schema Builder

Multi-Tenant Network & Firewall

Auto Updates

Backup & Geodiversity

Security Trust

IDE CLI Agile Accelerator

Store Builder

Dev Console

Sandbox

Metadata

Heroku DX node.js

PROGRAMMATIC DEVELOPMENT

Database Smart Containers

Heroku Add-ons

Heroku Button

Ruby

Identity

Global Data Centers

Data Storage

Single code base

Python Java APEX PHP

Offline Salesforce1 Mobile

Container Geolocation Push

Notifications SDK Mobile Identity

MOBILE SERVICES

Community Builder

Page Builder

Everything You Need to Build Apps  Full spectrum of capabilities from enterprise control to elastic flexibility

Page 11: Boxcars and Cabooses: When One More XHR Is Too Much
Page 12: Boxcars and Cabooses: When One More XHR Is Too Much

Agile and elastic platform that developers love

Smarter infrastructure lets you build apps that scale

Open and extensible

Modern language support and ecosystem of 150+ add-ons

Connected to Force.com

Sync customer apps with business processes

Build Customer-Facing Apps with Heroku

Page 13: Boxcars and Cabooses: When One More XHR Is Too Much

HR Help Desk

Employee Intranet

Recruiting & Onboarding

Performance & Coaching

IT Help Desk / Self-Service Community

Legacy Applications Consolidation

Enterprise Knowledge

Identity Mgmt

Custom Web / Mobile Applications

Business Agility Layer (e.g. Claims, Underwriting, …)

Asset & Facilities Management

Financial Shared Services

M&A Enablement

Early Warning Management

Product Ideas & Innovation

Pre-Production Testing

Warrant Coverage Decisioning

Procurement

Vendor Management

Transportation

Logistics

Contract Management

Budget Management

Contract Management

Pricing

Billing Management

Audit Management

Force.com - Employee Facing Apps  

Apps

HR Product

Supply Chain IT Financ

e Ops

Page 14: Boxcars and Cabooses: When One More XHR Is Too Much

Multi Tenant

>150k customers 40 Prod POD’s 40 Prod DB’s

Page 15: Boxcars and Cabooses: When One More XHR Is Too Much

Core Force.com Characteristics

 Single Code Base

 Single Schema

 3 Upgrades Per Year

 Secure

 Durable and Scalable

 Customizable

 Easy enough for a Business Analyst

 Flexible enough for a Coder

Page 16: Boxcars and Cabooses: When One More XHR Is Too Much

Pre-Built Apps  AppExchange is the #1 Business App Marketplace

Customized for Salesforce

Trusted and Secure

Reviewed by Peers

Over 2,800 apps 3 million installs

Page 17: Boxcars and Cabooses: When One More XHR Is Too Much

 Overall site peak day

•  >3.5 Billion transactions

•  200 milliseconds average

•  60% of transactions via API

requests

 Typically production instance

•  >8,000 Customer Orgs

•  30 App Servers and 8 DB Servers

Salesforce’s Daily Performance

Friday: 3,173,762,799 Transactions

Page 18: Boxcars and Cabooses: When One More XHR Is Too Much

3 Releases Per Year API backward compatibility ensures ease of deployment

47 Major Releases 100’s of Small Releases Yearly

All Integrations and Customizations Auto-Upgraded

6B Lines of

Apex Code

1B API Calls Per Day,

32 versions

12M Visualforce

Pages

15M Custom

Database Tables

1 Version

Page 19: Boxcars and Cabooses: When One More XHR Is Too Much

The Composite App

Page 20: Boxcars and Cabooses: When One More XHR Is Too Much

The Client Problem

Page 21: Boxcars and Cabooses: When One More XHR Is Too Much

Problem: Old Custom UI Technology  Server-side generated, page based HTML

HTML <div>...</div>

Page 22: Boxcars and Cabooses: When One More XHR Is Too Much

New UI: Component-based Client-rendered

JSON component:{...}

<div>...</div>

Page 23: Boxcars and Cabooses: When One More XHR Is Too Much

Aura and Lightning Component Framework

Lightning Component Framework

Page 24: Boxcars and Cabooses: When One More XHR Is Too Much

Lightning Component Design Principles

•  Component author namespacing

•  Automatic component-based CSS namespacing

•  Everything is a component

•  Allow for programmatic or point-and-click UI composition

•  Enable Salesforce, customers, and partners to build composite UIs

•  Works on any form factor

Page 25: Boxcars and Cabooses: When One More XHR Is Too Much
Page 26: Boxcars and Cabooses: When One More XHR Is Too Much

Many Components Many Server Trips

XMLHttpRequest

XMLHttpRequest

XMLHttpRequest

Page 27: Boxcars and Cabooses: When One More XHR Is Too Much

Actions: Interact with the Server

•  Apex Method Surfaced to Lightning Components •  @AuraEnabled annotation

Page 28: Boxcars and Cabooses: When One More XHR Is Too Much

Boxcarring: Many Actions, One XHR

Action S

ervice

Page 29: Boxcars and Cabooses: When One More XHR Is Too Much

Caboose: Postpone High Volume Actions

Action S

ervice •  Defer High-Volume Actions •  Action.setCaboose()

Page 30: Boxcars and Cabooses: When One More XHR Is Too Much

Action Service: Server Side API  Apex: Code on Force.com

Page 31: Boxcars and Cabooses: When One More XHR Is Too Much

Action Service Client API

Page 32: Boxcars and Cabooses: When One More XHR Is Too Much

Demo

Page 33: Boxcars and Cabooses: When One More XHR Is Too Much

Possible Future Features

 Making actions cacheable

 Ability to prioritize actions

Page 34: Boxcars and Cabooses: When One More XHR Is Too Much

What About the API

Page 35: Boxcars and Cabooses: When One More XHR Is Too Much

Comprehensive Suite of APIs and Toolkits

Web Service Endpoint

Web Service Endpoint

Apex WS/REST

Outbound Messaging

Business Logic

Sync Bulk API

Streaming API Topic

CRUD

Data

Bayeux Client

Applications and Middleware Java SDK Ruby gem PHP

Toolkit Mobile

SDK Mobile

SDK 3rd Party Adapters

Apex Callouts

Page 36: Boxcars and Cabooses: When One More XHR Is Too Much

Salesforce1 Enterprise APIs  The Salesforce “Data” APIs

•  Allow programmatic access to your salesforce data through various API technologies

•  Many different APIs to suit your specific needs

Rest APIs

Access and manipulate data with a RESTful pattern with JSON and XML payloads

Soap APIs

Access and manipulate data using SOAP.

Streaming APIs

Subscribe to updates using a Bayeux / CometD HTTP Streaming API.

Bulk APIs

Perform Bulk Queries and Inserts/Updates Asynchronously.

Page 37: Boxcars and Cabooses: When One More XHR Is Too Much

Boxcarring, what a great idea!

 Boxcarring is dependent on Lightning Components

 Only works with one client interface

 What about all those API apps out there?

 If only we could let any client batch together requests…

Page 38: Boxcars and Cabooses: When One More XHR Is Too Much

Many Requests Many Server Trips

POST Record

GET Server Gen Data

GET API Limits

Page 39: Boxcars and Cabooses: When One More XHR Is Too Much

Composite Batch REST API

.../composite/batch POST Batch

{ "batchRequests":[ {POST}, {GET}, {GET} ] }

Page 40: Boxcars and Cabooses: When One More XHR Is Too Much

Sample Batch Request  POST: <salesforcedomain>/services/data/v35.0/composite/batch

 {"batchRequests" : [   {"method" : "POST",   "url" : "v35.0/sobjects/account/",   "richInput" : {"Name" : "NewName", "Industry" : "Tech"}},   {"method" : "GET",   "url" : "v35.0/sobjects/account/describe/"},   {"method" : "GET",   "url" : "v35.0/query?q=select id, name, industry from account

 order by createddate desc limit 10"   }]  }

Page 41: Boxcars and Cabooses: When One More XHR Is Too Much

Parent/Child Related Data

POST Account

POST related Contacts

POST related Cases

RESP: Account ID

RESP: Contact IDs

RESP: Case IDs

Page 42: Boxcars and Cabooses: When One More XHR Is Too Much

Composite Tree REST API

.../composite/tree/entity

POST Tree

”records":[ {parent1}, {parent2}, {parent3} ]

Page 43: Boxcars and Cabooses: When One More XHR Is Too Much

Sample Batch Request  POST: <salesforcedomain>/services/data/v35.0/composite/tree/Account

 {"records" :[   {"attributes": {"type":"Account", "referenceId":"ref1"},   "name" : "SampleAccount", "phone" : "1234567890",   "type" : "Analyst", "industry" : "Banking",   "Contacts" : {   "records" : [   {"attributes": {"type":"Contact", "referenceId":"ref2"},   "lastname" : "Smith", "title" : "President"},   ...]},   "Cases" : {   "records" : [   {"attributes": {"type":"Case", "referenceId":"ref3"},   "" : "", "" : "", "" : ""}   ...]}, }}, ...] }

Page 44: Boxcars and Cabooses: When One More XHR Is Too Much

Demo

Page 45: Boxcars and Cabooses: When One More XHR Is Too Much

Possible Future Features

 Parameter-based values

 Basic Orchestration

 Updates on /tree

Page 46: Boxcars and Cabooses: When One More XHR Is Too Much

Free Developer Edition of Force.com

 http://bit.ly/webcamp-salesforce

Page 47: Boxcars and Cabooses: When One More XHR Is Too Much

developer.salesforce.com/trailhead

Page 48: Boxcars and Cabooses: When One More XHR Is Too Much

Q & A

Peter Chittum Developer Evangelist @pchittum github.com/pchittum

 Signup: http://bit.ly/webcamp-salesforce

 Learn: https://developer.salesforce.com/trailhead

RATE ME!

https://joind.in/15243

Page 49: Boxcars and Cabooses: When One More XHR Is Too Much

Thank you