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

of 38 /38
7 Key Things for Building a Highly- Scalable SharePoint App Edin Kapić – SharePoint Architect, Spenta

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

Page 1: 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

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

www.sharepointsummit.org

2

Edin Kapić

SharePoint ArchitectWorks for Spenta / Beezy in Barcelona

SharePoint Server MVP

President of Catalonian SharePoint User Group (SUG.CAT)

[email protected]

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

www.sharepointsummit.org

Scalability

3

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

www.sharepointsummit.org

Scalability

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

...and they all sign up tomorrow!

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

www.sharepointsummit.org

5

Scalability

Not scalable Scalable

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

www.sharepointsummit.org

6

Scalability

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

www.sharepointsummit.org

7

Scalability

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

www.sharepointsummit.org

SharePoint 2013 Apps Architecture

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

www.sharepointsummit.org

SharePoint 2013 Application Architecture

SharePoint 2013 Apps are cloud-based

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

www.sharepointsummit.org

10

SharePoint 2013 Application Architecture

SharePoint is now just another external system

Mechanisms to minimize round trips

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

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)

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

www.sharepointsummit.org

12

SharePoint 2013 Application Architecture

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

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

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

www.sharepointsummit.org

14

SharePoint 2013 Application Architecture

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

www.sharepointsummit.org

Effective Caching Mechanisms

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

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

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

www.sharepointsummit.org

Content Delivery Networks (CDN)

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

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

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

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

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

www.sharepointsummit.org

Avoiding Storage Locks

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

www.sharepointsummit.org

Avoiding Storage Locks

NoSQL vs RDBMSTable Storage vs SQL Azure

Eventual vs Immediate Consistency

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

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

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

www.sharepointsummit.org

23

Avoiding Storage Locks

Command-Query Responsibility Segregation

Source: Udi Dahan

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

www.sharepointsummit.org

Waiting in a Queue is Not Bad

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

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

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

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

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

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

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

www.sharepointsummit.org

Acting Asynchronously

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

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

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

www.sharepointsummit.org

Redundant Design

30

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

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

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

www.sharepointsummit.org

32

Redundant Design

Azure Traffic Manager

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

www.sharepointsummit.org

33

Redundant Design

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

www.sharepointsummit.org

Summary

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

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

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

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

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

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

SharePoint Summit web site a few days after the event.

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

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