David Shutt Software Architect Microsoft Corporation.

28
Case Study: One Code Base On Premises and On Line Microsoft Dynamics CRM David Shutt Software Architect Microsoft Corporation

Transcript of David Shutt Software Architect Microsoft Corporation.

Page 1: David Shutt Software Architect Microsoft Corporation.

Case Study: One Code Base On Premises and On LineMicrosoft Dynamics CRM

David ShuttSoftware ArchitectMicrosoft Corporation

Page 2: David Shutt Software Architect Microsoft Corporation.

VisionAnalyze and Plan TechnologyTeam Process and OrganizationMeasure

Case Study: One Code BaseCase Study of Bridging On Premises & Online

Page 3: David Shutt Software Architect Microsoft Corporation.

• Write once• Deploy anywhere

• Non goal: On Premises Quirks

Vision: The Power of Choice

On Premises

CRM Online(Microsoft

Hosted)

Partner Hosted

Page 4: David Shutt Software Architect Microsoft Corporation.

Analyze and Plan

Iterate Existing Code Base

New Code Base SeparateOn Premises & On Line Code

Prior Release Compatibility

Good Initial effort Initial + Ongoing Effort

Symmetry for Choice

Good Good Ongoing Effort

Engineering Maximize existing investment

Leave Legacy behind

Parallel code bases

Recommendation Preferred when architecture and quality allows

When legacy code isn’t easily adapted

Online specific infrastructure (e.g. Billing, Customer Support, Operational)

Page 5: David Shutt Software Architect Microsoft Corporation.

Analyze Security: Surface AreaPrior Release

SQL

Web UI

Web Client

Outlook Client

Excel

BizLogic

WebSvcAPI

SQL ReportingServices

Page 6: David Shutt Software Architect Microsoft Corporation.

Plan: Security: Surface AreaStrategy: wrap non hardened components

SQL

Web UI

Web Client

Outlook Client

Excel

Biz Logic

WebSvcAPI

SQLReportingServices

Page 7: David Shutt Software Architect Microsoft Corporation.

Analyze ScalePrior Release: Single Tenant

Application ServerTenant 1

Application ServerTenant 2

Application ServerTenant 4

Application ServerTenant 3

Application ServerTenant N

Page 8: David Shutt Software Architect Microsoft Corporation.

Analyze ScalePrior Release: Single Tenant with Virtualization

Application ServerTenants 1-10

Application ServerTenants 11-20

Application ServerTenants 31-40

Application ServerTenants 21-30

Application ServerTenants xx-yy

Page 9: David Shutt Software Architect Microsoft Corporation.

Plan ScaleNew Release: Multi Tenant

Application ServerTenants 1-200

Application ServerTenants 201-400

Application ServerTenants 601-800

Application ServerTenants 401-600

Application ServerTenants xxx-yyy

Page 10: David Shutt Software Architect Microsoft Corporation.

Analyze Provisioning & AvailabilityPrior Release: State in Multiple Places

Tenant Data

Tenant UI

Tenant code

Tenant Semantic Meta

Data

Tenant Registry

Application Server

Tenant UI

Tenant Code

Tenant Registry

…Application Server N

Page 11: David Shutt Software Architect Microsoft Corporation.

Plan Provisioning and AvailabilityCentralize State to enable Server Farms

Tenant Data & Meta Data (UI, code, entity def)

SQL

Application ServerCached State only

…Application Server NCached State only

Page 12: David Shutt Software Architect Microsoft Corporation.

Analyze Scale: Single Tenant MemoryPrior Release

CRM V3 Application Server

Native Semantic MetaData (1)

Managed Semantic MetaData (2) UI MetaData

CRM V3 Workflow Server

Native Semantic MetaData (3)

Page 13: David Shutt Software Architect Microsoft Corporation.

Plan Scale: Multi Tenant Memory

CRM V4 Application Server

‘Core’ MetaData Delta#1

Delta#2

DeltaN

Page 14: David Shutt Software Architect Microsoft Corporation.

Complex Test Matrix Deployment models – On Premises, Online,

Partner Hosted Authentication – AD, Basic, Windows LiveID Versions of External Dependencies

Server: OS, IIS, .NET CLR, Exchange, SQL Server Client: OS, Browser, Office/Outlook

Unify Development and Test Infrastructure Automate Deployment and Testing Centralize and Dedicate Resources

Process: Agility in TestingChallenge and Best Practices

Page 15: David Shutt Software Architect Microsoft Corporation.

Process: Extending the Delivery Team

Product Dev Support

On Premises Customer

Online Customer

Sustaining Engineerin

g

Business Operations

Data Center

Operations

Online ServicingProduct

Operations

Hosting Partner

Customer Satisfaction includes operations, sustaining engineering, & support teams

Customer support responsibilities differ across channels

On Premises

Partner

Page 16: David Shutt Software Architect Microsoft Corporation.

Measure: ScaleSingle and Multi Tenant

Description Server Spec Tenants per App server

Connections Bottleneck

V3 single Tenant 6 App: 8G, 1x1SQL: 128G, 16x2

1 6,000 SQL

V4 single Tenant 6 App: 8G, 1x1SQL: 128G, 16x2

1 24,000 SQL

Description Server Spec Tenants per App server

Connections Bottleneck

V4 single Tenant 2 App: 8G, 2x4SQL: 32G, 2x4

1 2,000 SQL

V4 multi Tenant theoretical

2 App: 16G, 2x4SQL: 32G, 2x4

400 x 5 2,000 SQL

V4 multi Tenant 2 App: 16G, 2x4SQL: 32G, 2x4

200 x5 App

Page 17: David Shutt Software Architect Microsoft Corporation.

Alpha @ scale: sudden transition from healthy to cached configuration expired

Q1: Why did configuration polling fail? A1: Polling thread CPU starved Q2: Why was CPU usage high? A2: .NET Garbage Collector Q3: Why was Garbage Collector so busy? A3: Finalization Queue very long Q4: What objects are in the queue?

Measure: Scale Cascading Failures

Page 18: David Shutt Software Architect Microsoft Corporation.

Measure: ScaleFunctional correctness does not guarantee scale public void BadScale()

{ // Get thread's windows identity. WindowsIdentity identity =

WindowsIdentity.GetCurrent(true); if(null != identity) { // Do Work with identity return; } else { // Invalid user -- throw

exception... } }

Page 19: David Shutt Software Architect Microsoft Corporation.

Measure: ScaleCoding Example for Scalability

public void GoodScale() { WindowsIdentity identity; try { identity =

WindowsIdentity.GetCurrent(true);

// Do work with the identity object.

} finally { identity.Dispose(); } }

Page 20: David Shutt Software Architect Microsoft Corporation.

Measure: ScaleEarly results with improved code

Multi tenant memory at scale, after applying fix to CRM code itself [other code still to do]

Counter Prior New Improvement

Gen0 Heap(short lived)

340MB 180MB 47%

Gen2 heap (Long Lived)

3.39GB 1.8GB 46%

Large Object Heap

3.83GB 2.76GB 28%

Total Bytes in all heaps

7.25GB 4.66GB 35%

Page 21: David Shutt Software Architect Microsoft Corporation.

Online Service provides instant feedback Noticed during Beta, fixed prior to Release

Measure: Disk SpaceLesson: Local vs Global Optimization

Observation Cause Mitigation

Many rows in queue Aggressive Scheduling Less frequent by default; Scheduled Purge jobs

Save intermediate state for debugging

Less frequent; save only when tracing enabled

Large rows in queue Save state for debugging Configurable; save only when tracing enabled

Save state past useful life

Update to shorten; purge

Format inefficient Revise format

Page 22: David Shutt Software Architect Microsoft Corporation.

Technology Build for Online, On Premises as simple case Be flexible to keep or replace components Iterate, limit initial scope Adopt existing Online-ready technology

Process Plan and Scope before you start Analyze ROI for work required Evangelize Architecture and Best Practices

within team Agility - Organizational and Process

One Code Base: Lessons

Page 23: David Shutt Software Architect Microsoft Corporation.

Azure Services Platform

Microsoft Dynamics CRM Online

Microsoft SharePoint Services

Microsoft Dynamics CRM & the Azure Services Platform

Page 24: David Shutt Software Architect Microsoft Corporation.

Microsoft Dynamics CRM Online http://crm.dynamics.com

Microsoft Dynamics CRM V4 Performance Whitepapers http://www.microsoft.com/downloads/details.

aspx?FamilyId=5852B14A-394C-4898-8374-CAF5E6479EB0&displaylang=en

PDC BB32: Rapid Business Application Development with Dynamics CRM

PDC BB08: Microsoft Dynamics CRM: Appealing Business Applications

One Code BaseLinks

Page 25: David Shutt Software Architect Microsoft Corporation.

Evals & Recordings

Please fill

out your

evaluation for

this session at:

This session will be available as a recording at:

www.microsoftpdc.com

Page 26: David Shutt Software Architect Microsoft Corporation.

Please use the microphones provided

Q&A

Page 27: David Shutt Software Architect Microsoft Corporation.

© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market

conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Page 28: David Shutt Software Architect Microsoft Corporation.