7 Key Things for Building a Highly-Scalable SharePoint 2013 App

Post on 17-Aug-2014

1.837 views 9 download

Tags:

description

My slides from SharePoint Summit Vancouver 2013 talk. Learn best practices and patterns to build your next superscalable SharePoint 2013 App. You will see how to pair the power of the browser and the cloud to build a SharePoint app that runs like a cheetah. We will go in depth on how the modern SharePoint 2013 app is build on Windows Azure, demo and learn how to manage the different mechanisms for scaling that are available to us, such as non-relational databases, cache, asynchronous API calls and queuing. You will take away code samples and guidance that will enable you to scale you next SharePoint 2013 app.

Transcript of 7 Key Things for Building a Highly-Scalable SharePoint 2013 App

7 Key Things for Building a Highly-Scalable SharePoint App

Edin Kapić – SharePoint Architect, Spenta

www.sharepointsummit.org

2

Edin Kapić

SharePoint ArchitectWorks for Spenta / Beezy in Barcelona

SharePoint Server MVP

President of Catalonian SharePoint User Group (SUG.CAT)

sug.cat@ekapicwww.edinkapic.com

www.sharepointsummit.org

Scalability

3

www.sharepointsummit.org

Scalability

Hey boss, we have 1M new users for our web app!!

...and they all sign up tomorrow!

www.sharepointsummit.org

5

Scalability

Not scalable Scalable

www.sharepointsummit.org

6

Scalability

www.sharepointsummit.org

7

Scalability

www.sharepointsummit.org

SharePoint 2013 Apps Architecture

www.sharepointsummit.org

SharePoint 2013 Application Architecture

SharePoint 2013 Apps are cloud-based

www.sharepointsummit.org

10

SharePoint 2013 Application Architecture

SharePoint is now just another external system

Mechanisms to minimize round trips

www.sharepointsummit.org

11

SharePoint 2013 Application Architecture

With the cloud, we have potential for scalability and high availability

But the architecture must enable it

(It doesn’t come out of the box)

www.sharepointsummit.org

12

SharePoint 2013 Application Architecture

www.sharepointsummit.org

13

Session Overview

Avoiding RoundtripsEffective Caching MechanismsContent-Delivery Networks

Avoiding BottlenecksAvoiding Storage LocksWaiting in a Queue is Not BadActing Asynchronously

Avoiding Single Point of FailureRedundant Design

www.sharepointsummit.org

14

SharePoint 2013 Application Architecture

www.sharepointsummit.org

Effective Caching Mechanisms

www.sharepointsummit.org

Effective Caching Mechanisms

Caching is the cheapest way to avoid unnecessary roundtrips

Local CacheSmall, static data, very frequently accessed

Distributed CacheEverything that you reasonably can

Stale Data

www.sharepointsummit.org

Content Delivery Networks (CDN)

www.sharepointsummit.org

BLOB Storage

Big binary storage in the cloud

Bypass the ProcessingPublic BLOBs can be accessed by URL

Shared SignaturesPrivate BLOBs can be accessed by special URL

www.sharepointsummit.org

Content Delivery Networks (CDN)

Big binary storage close to the userNo need to serve from the cloudFirst user pays the “toll”, others get it free

Offload all that you canImagesScriptsMedia Files

Versioned URLs

www.sharepointsummit.org

Avoiding Storage Locks

www.sharepointsummit.org

Avoiding Storage Locks

NoSQL vs RDBMSTable Storage vs SQL Azure

Eventual vs Immediate Consistency

www.sharepointsummit.org

Avoiding Storage Locks

ShardingPartition your data across multiple databases or storages

JOINs across shards

SQL Azure Federations

Shards

A-F

G-O

P-ZData Access

Partition Keys

www.sharepointsummit.org

23

Avoiding Storage Locks

Command-Query Responsibility Segregation

Source: Udi Dahan

www.sharepointsummit.org

Waiting in a Queue is Not Bad

www.sharepointsummit.org

Waiting in a Queue is Not Bad

Request/Response doesn’t scale well

By queuing the requests we have controlTo decouple the request and the responseTo do retries and accomodate node lossTo throttle the rate of serviceTo scale up and down depending on the workload

Web Back-End

Message Queue

www.sharepointsummit.org

26

Waiting in a Queue is Not Bad

Azure QueuesLow-LevelPass messages between roles and sitesFully decoupled R/W operationsAutomatic Load Balancing

Azure Service Bus QueuesHigh-LevelMessaging framework with queuesPublisher-SubscriberTransactions

www.sharepointsummit.org

27

Waiting in a Queue is Not Bad

my-account

Submit-queue

Joe’s Job

Mary’s Job

Calc-queue

Andy’s Job

Storage Account

Queue

Message

Azure Queues

www.sharepointsummit.org

Acting Asynchronously

www.sharepointsummit.org

Web Tier

DataTier

We can optimize the server throughput with async calls to the next tier

Just got easier in NET 4.5 with async/await

Acting Asynchronously

Web Tier

Thread#1

DataTier

Request 1

Response 1

Request 2

Thread#1

Request 1

Response 1

Request 2

www.sharepointsummit.org

Redundant Design

30

www.sharepointsummit.org

31

Redundant Design

If any single node goes down, your app must continue unhindered

Although some delay is OK

Idempotent operationsLoad-balancing

www.sharepointsummit.org

32

Redundant Design

Azure Traffic Manager

www.sharepointsummit.org

33

Redundant Design

www.sharepointsummit.org

Summary

www.sharepointsummit.org

7 Key Things for Building a Highly-Scalable SharePoint App

1. Caching2. Content Delivery Network / BLOB Storage3. NoSQL4. Sharding5. Queuing6. Asynchronous Processing7. Redundant Design

www.sharepointsummit.org

36

Additional Resources

High Scalabilityhttp://highscalability.com/

Advanced Patterns in Cloud-Hosted Apps for Microsoft SharePoint

http://channel9.msdn.com/Events/TechEd/NorthAmerica/2013/SES-B301

Thank you for your attention!This presentation will be available on the Vancouver

SharePoint Summit web site a few days after the event.

Please rate this session!Fill out the survey and get a chance to win a Surface