architecting a social enterprise application

41
Architecting a Social Enterprise Application Developers Track Rob Woollen, CTO Platform, salesforce.com Glenn Weinstein, CTO, Appirio

Upload: salesforce

Post on 29-Nov-2014

1.052 views

Category:

Business


1 download

DESCRIPTION

How do you architect a Social Enterprise application? What are some of the unique considerations when designing a cloud application versus a traditional on-premise application? What are some of the unique use cases, design patterns, and best practices when developing on a cloud platform (like Force.com) and database (like Database.com)? This session will answer these questions and help you architect the next killer cloud app.

TRANSCRIPT

Page 1: Architecting a Social Enterprise Application

Architecting a Social Enterprise Application

Developers Track

Rob Woollen, CTO Platform, salesforce.com

Glenn Weinstein, CTO, Appirio

Page 2: Architecting a Social Enterprise Application

Safe HarborSafe 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, breachof our security measures, the outcome of intellectual property and other litigation, risks associated with 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-Q for the most recent fiscal quarter ended July 31, 2011. This 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: Architecting a Social Enterprise Application

Agenda

What is a “social enterprise application?”

Development themes – mobile

Development themes – social

Development themes – optimized

Force.com data services

Force.com realtime applications

Force.com optimizations

Page 4: Architecting a Social Enterprise Application

Glenn WeinsteinCTO, Appirio

Page 5: Architecting a Social Enterprise Application

What is a “Social Enterprise Application?”

MOBILE Architecture must account for mobile as primary UI device

SOCIAL Taking maximum advantage when “social”-izing apps

OPTIMIZED Accessing ever-larger cloud-based data sources

Page 6: Architecting a Social Enterprise Application

Development Trends -Mobile

Page 7: Architecting a Social Enterprise Application

The New Architecture for Mobile Apps

1980s: Desktop apps

• Complex processing• Rich user experience• Connectivity not required• Examples: MSFT Office, Adobe Photoshop

1990s: Client-server• Desktop apps paired with a server• Complex local architectures• Examples: SAP, Oracle Apps

2000s: Web and RIAs

• Browser as universal HTML client• Rich UI and media; server does most logic• Examples: Web editions of enterprise

software

2011+: Mobile• Maximize use of local CPU• Minimize need for data throughput• Examples: Database.com

Page 8: Architecting a Social Enterprise Application

The New Architecture for Mobile Apps

1980s: Desktop apps

• Complex processing• Rich user experience• Connectivity not required• Examples: MSFT Office, Adobe Photoshop

1990s: Client-server• Desktop apps paired with a server• Complex local architectures• Examples: SAP, Oracle Apps

2000s: Web and RIAs

• Browser as universal HTML client• Rich UI and media; server does most logic• Examples: Web editions of enterprise

software

2011+: Mobile• Maximize use of local CPU• Minimize need for data throughput• Examples: Database.com

Page 9: Architecting a Social Enterprise Application

The New Mobile Architecture Requires a Different Approach

App Server

Page 10: Architecting a Social Enterprise Application

The New Mobile Architecture Requires a Different Approach

Page 11: Architecting a Social Enterprise Application

The New Mobile Architecture Requires a Different Approach

SOAP?REST?

HTML5?Native (iOS, Android)?

Page 12: Architecting a Social Enterprise Application

The New Mobile Architecture Requires a Different Approach

SOAP?REST?

HTML5?Native (iOS, Android)?

Key ThemesNative > genericMulti-tenant > single-tenantCoarse-grained > fine-grained

Page 13: Architecting a Social Enterprise Application

Development Trends -Social

Page 14: Architecting a Social Enterprise Application

Does Your App Have Social Graces?

Phase 1: “Socially Enabled”

Chatter feed on business objects

Page 15: Architecting a Social Enterprise Application

Does Your App Have Social Graces?

Phase 1: “Socially Enabled”

Chatter feed on business objects

Where should users look for the narrative?

• Record History• Notes & Attachments• Activity History• Chatter Feed• All of the above?

Considerations• “Force” feed• Drop followers at close

Page 16: Architecting a Social Enterprise Application

Does Your App Have Social Graces?

Phase 2: “Socially Witty”

Have something interesting to say

Page 17: Architecting a Social Enterprise Application

Does Your App Have Social Graces?

Phase 2: “Socially Witty”

Considerations• Give your app a distinctive “voice”• Go beyond basic field changes

Have something interesting to say

Page 18: Architecting a Social Enterprise Application

Does Your App Have Social Graces?

Phase 3: “Socially Aware”

Phones use geolocation…

Page 19: Architecting a Social Enterprise Application

Does Your App Have Social Graces?

Phase 3: “Socially Aware”

Phones use geolocation…

…Chatter-enabled apps can use “social graph location”My Groups Who I’m Following What I’m Following

Page 20: Architecting a Social Enterprise Application

Development Trends -Optimized

Page 21: Architecting a Social Enterprise Application

Mobile and Social Apps Produce More Data!

Business records change slowly

Page 22: Architecting a Social Enterprise Application

Mobile and Social Apps Produce More Data!

Business records change slowly Chatter changes quickly

Page 23: Architecting a Social Enterprise Application

Mobile and Social Apps Produce More Data!

Larger volumes

Broader variety

Higher velocity

More business value

Business records change slowly Chatter changes quickly

Page 24: Architecting a Social Enterprise Application

Mobile and Social Apps Produce More Data!

Larger volumes

Broader variety

Higher velocity

More business value

Business records change slowly Chatter changes quickly

Security optimizations REST services Bulk data handling

Page 25: Architecting a Social Enterprise Application

Rob WoollenCTO, Platform

salesforce.com

@rwoollen

Page 26: Architecting a Social Enterprise Application

Cloud2 Data Services

Page 27: Architecting a Social Enterprise Application

Securing Cloud Data

Database.com provides a rich, row-level security model– Powering our CRM application for 10+ years

– Separates the administration of security rules from application development

Query / Search natively support security model– Inaccessible records are automatically filtered out

Multi-Tenant Query Optimizer ensures security handled efficiently

Page 28: Architecting a Social Enterprise Application

Run pre-queries

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 specificis this filter?=

Multi-tenant Query Optimizer

SharedVisibility

SharedIndexes

ID Data 1 Data 2

10002 unus erat toto naturae

10003 vultus in orbe

10004 quem dixere chaeos

10005 rudis indigestaque

10006 meis perpetuum

10007 deducite temopra

10008 carmen ante

10009 mare et terras

10010 tegit et quod

10011 omnia caelum

10012 unus erat totonaturae

10013 vultus in orbe

10014 quem dixere chaeos

10015 rudis indigestaque

10016 meis perpetuum

10017 deducite temopra

10018 carmen ante

10019 mare et terras

10020 tegit et quod

10021 omnia caelum

10022 unus erat toto naturae

10023 vultus in orbe

10024 quem dixere chaeos

10025 rudis indigestaque

10026 meis perpetuum

10027 deducite temopra

10028 carmen ante

10029 mare et terras

10030 tegit et quod

10031 omnia caelum

10032 unus erat toto naturae

10033 vultus in orbe

ID Data 1 Data 2

10002 unus erat toto naturae

10003 vultus in orbe

10004 quem dixere chaeos

10005 rudis indigestaque

10006 meis perpetuum

10007 deducite temopra

10008 carmen ante

10009 mare et terras

10010 tegit et quod

10011 omnia caelum

10012 unus erat totonaturae

10013 vultus in orbe

10014 quem dixere chaeos

10015 rudis indigestaque

10016 meis perpetuum

10017 deducite temopra

10018 carmen ante

10019 mare et terras

10020 tegit et quod

10021 omnia caelum

10022 unus erat toto naturae

10023 vultus in orbe

10024 quem dixere chaeos

10025 rudis indigestaque

10026 meis perpetuum

10027 deducite temopra

10028 carmen ante

10029 mare et terras

10030 tegit et quod

10031 omnia caelum

10032 unus erat toto naturae

10033 vultus in orbe

Stop

Go

Multi-tenant Optimizer Statistics

Page 29: Architecting a Social Enterprise Application

Apex REST (Pilot)

APEX Web Services exposed via REST– Allow for custom built web services to be exposed by

customers and partners using REST architecture

– Well suited for Mobile and Cloud applications

Annotation in the APEX class:– @RestResource , @HttpGet, @HttpPost, @HttpPatch, @HttpDelete

Support XML and JSON formats

Page 30: Architecting a Social Enterprise Application

Apex Rest (Pilot)@RestResource(urlMapping='/CaseManagement/*')global with sharing class CaseManagementRESTSvc {

@HttpGetglobal static Case getCaseRecord(RestRequest req, RestResponse res) {

String caseNum = req.requestURI.substring(req.requestURI.lastIndexOf('/')+1);

Case c = [select id, CaseNumber from Case where caseNumber = :caseNum];

return c;

}

@HttpPostglobal static Case createCaseRecord(RestRequest req, RestResponse res) {

CompositeCaseRecord compositeCaseRec = new CompositeCaseRecord();

Case c = CreateCustomCaseRecord.createCase(compositeCaseRec);

return c;

}

@HttpDeleteglobal static void deleteCaseRecord(RestRequest req, RestResponse res) {

String caseNum = req.requestURI.substring(req.requestURI.lastIndexOf('/')+1);

Case c = [select id, CaseNumber from Case where caseNumber = :caseNum];

delete c;

}

}

Page 31: Architecting a Social Enterprise Application

Apex Rest (Pilot)public with sharing class CreateCustomCaseRecord {

public static Case createCase( CompositeCaseRecord caseRecord )

{

Savepoint sp = Database.setSavepoint();try

{

Case c = new Case();

c.Status = 'New';

Account a = new Account (Backend_Acct_Number__c = caseRecord.acctNumber);

c.Account = a;

insert c;

c = [select id, CaseNumber, subject, Description, Priority from Case where id=:c.Id];

Labor__c labor = new Labor__c();

labor.Case__c = c.id;

labor.Rate__c = caseRecord.labor_rate;

insert labor;

return c;

}catch (Exception e)

{

Database.rollback(sp);throw e;

}

}

}

FAQ: http://blog.sforce.com/sforce/2011/05/apex-rest-services-in-summer-11.html

Page 32: Architecting a Social Enterprise Application

Real-time Cloud Apps

Page 33: Architecting a Social Enterprise Application

Streaming API (Pilot)

Provide a stream of updates based on data changes– Admin define topics via continuous queries

– System runs queries based on a Topic

– Relevance matching kicks in and fetch updates

– Clients subscribe to Topics and listen for updates

Use Cases includes:– Near real time updates: Call Centers, Financial Apps, Calendar

– Data synchronization – immediate updates

– General purpose notifications upon saves and deletes

– Push notifications to mobile devices

Page 34: Architecting a Social Enterprise Application

Streaming API - Logical Flow

Salesforce.comAccountContacts

LeadsOpportunities

Custom Objects

App ServerManage

SubscriptionsSend

Updates

1. Relevance Checks2. Push Notification Processor3. Event Dispatch4. Query, CRUD, FLS Sharing

Data Changes Processing Updates Notifications

Page 35: Architecting a Social Enterprise Application

Optimizing Cloud Applications

Large Data Volumes

Page 36: Architecting a Social Enterprise Application

Bulk API Query

Allow for data to be retrieved via SOQL query– Up to 10 files of 1Gb each file – total of 10Gb

– Query can run for up to 10 attempts, at 10 minutes each

– Results are kept for 7 days in system

– Supports XML and CVS formats

– View results on Monitoring Page

Allow for full LDV lifecycle of data in/out of Salesforce

Page 37: Architecting a Social Enterprise Application

Scaling Apex Triggers

Basic Trigger Architecture (Bulkification)– Preprocessing

• Query needed rows

• Arrange into data structures

– “The Main For-Loop”• Use a main for loop to ensure that no records are left behind

• Avoid queries and DML operations within for loops

– Clean up and final steps• DML operations

• Emails/Notifications

Page 38: Architecting a Social Enterprise Application

Asynchronous Processing

NOW

vs.

LATERMove processing that is large or not immediately needed by the user to async

• Avoid limits• Better usability• Higher through-put

Page 39: Architecting a Social Enterprise Application

Scaling to Large Data

Asynchronous Apex– @Future methods

• Lightweight

• Easy to use (simple method annotation)

• Great for smaller transactions

– Batch Apex• Heavy duty (interface to implement)

• Can process up to 50M rows

Page 40: Architecting a Social Enterprise Application

But wait, the DevZone has more!

HackathonCheck out the Finale, Thurs, 2:30pm

Open Source LabDiscover new & interesting open projects

Lightning ForumDrop in for a quick blast of knowledge

Tech DemosSee and learn the latest from the experts

Code ConsultationsSign up for 1:1 sessions at the Welcome Desk

@forcedotcom

Page 41: Architecting a Social Enterprise Application

Watch your inbox at the end of each day for an email from our survey partner, Alliance Tech.

Click on the personalized link to be directed to the survey page for the sessions you attended.

How Could Dreamforce Be Even Better? Tell Us!

Every session survey you submit is a chance to win

an iPad 2!