7 Key Things for Building a
Highly-Scalable SharePoint App
Edin Kapić – SharePoint Architect, Spenta
Edin Kapić
www.sharepointsummit.org

SharePoint Architect
Works for Spenta / Beezy in
Barcelona

SharePoint Server MVP
President of Catalonian
SharePoint User Group
(SUG.CAT)
@ekapic
www.edinkapic.com

sug.cat
2
www.sharepointsummit.org

Scalability

3
Scalability
www.sharepointsummit.org

Hey boss, we have 1M
new users for our web
app!!
...and they all sign up
tomorrow!
Scalability
www.sharepointsummit.org

Not scalable

Scalable
5
Scalability
www.sharepointsummit.org

6
Scalability
www.sharepointsummit.org

7
www.sharepointsummit.org

SharePoint 2013
Apps Architecture
SharePoint 2013 Application Architecture
www.sharepointsummit.org

SharePoint 2013 Apps are cloud-based
SharePoint 2013 Application Architecture
www.sharepointsummit.org

SharePoint is now just
another external
system
Mechanisms to
minimize round trips

10
SharePoint 2013 Application Architecture
www.sharepointsummit.org

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)

11
SharePoint 2013 Application Architecture
www.sharepointsummit.org

12
Session Overview
www.sharepointsummit.org

Avoiding Roundtrips
Effective Caching Mechanisms
Content-Delivery Networks

Avoiding Bottlenecks
Avoiding Storage Locks
Waiting in a Queue is Not Bad
Acting Asynchronously

Avoiding Single Point of Failure
Redundant Design
13
SharePoint 2013 Application Architecture
www.sharepointsummit.org

14
www.sharepointsummit.org

Effective Caching
Mechanisms
Effective Caching Mechanisms
www.sharepointsummit.org

Caching is the cheapest way to avoid
unnecessary roundtrips
Local Cache
Small, static data, very frequently accessed

Distributed Cache
Everything that you reasonably can

Stale Data
www.sharepointsummit.org

Content Delivery
Networks (CDN)
BLOB Storage
www.sharepointsummit.org

Big binary storage in the cloud

Bypass the Processing
Public BLOBs can be accessed by URL

Shared Signatures
Private BLOBs can be accessed by special URL
Content Delivery Networks (CDN)
www.sharepointsummit.org

Big binary storage close to the user
No need to serve from the cloud
First user pays the “toll”, others get it free

Offload all that you can
Images
Scripts
Media Files

Versioned URLs
www.sharepointsummit.org

Avoiding Storage
Locks
Avoiding Storage Locks
www.sharepointsummit.org

NoSQL vs RDBMS
Table Storage vs
SQL Azure

Eventual vs
Immediate
Consistency
Avoiding Storage Locks
www.sharepointsummit.org
Partition Keys

Sharding
Partition your data
across multiple
databases or storages

A-F

G-O

JOINs across shards
Data Access

SQL Azure Federations

P-Z
Shards
Avoiding Storage Locks
www.sharepointsummit.org

Command-Query Responsibility Segregation

Source: Udi Dahan

23
www.sharepointsummit.org

Waiting in a
Queue is Not Bad
Waiting in a Queue is Not Bad
www.sharepointsummit.org

Request/Response doesn’t scale well
Web

Back-End
Message Queue

By queuing the requests we have control
To decouple the request and the response
To do retries and accomodate node loss
To throttle the rate of service
To scale up and down depending on the workload
Waiting in a Queue is Not Bad
www.sharepointsummit.org

Azure Queues
Low-Level
Pass messages between roles and sites
Fully decoupled R/W operations
Automatic Load Balancing

Azure Service Bus Queues
High-Level
Messaging framework with queues
Publisher-Subscriber
Transactions

26
Waiting in a Queue is Not Bad
www.sharepointsummit.org

Azure Queues
Storage
Account

Queue
Submitqueue

my-account

Calc-queue

Message
Joe’s Job
Mary’s Job

Andy’s Job
27
www.sharepointsummit.org

Acting
Asynchronously
Acting Asynchronously
www.sharepointsummit.org

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

Web Tier

Request 1

Response 1
Request 2

Request 1

Thread
#1

Data
Tier

Response 1

Thread
#1

Request 2

Just got easier in NET 4.5 with async/await

Data
Tier
www.sharepointsummit.org

Redundant
Design

30
Redundant Design
www.sharepointsummit.org

If any single node
goes down, your app
must continue
unhindered
Although some delay is
OK

Idempotent operations
Load-balancing
31
Redundant Design
www.sharepointsummit.org

Azure Traffic Manager

32
Redundant Design
www.sharepointsummit.org

33
www.sharepointsummit.org

Summary
7 Key Things for Building a HighlyScalable SharePoint App
www.sharepointsummit.org

1.

Caching

2.

Content Delivery Network / BLOB Storage

3.

NoSQL

4.

Sharding

5.

Queuing

6.

Asynchronous Processing

7.

Redundant Design
Additional Resources
www.sharepointsummit.org

High Scalability
http://highscalability.com/

Advanced Patterns in Cloud-Hosted Apps for
Microsoft SharePoint
http://channel9.msdn.com/Events/TechEd/NorthAme
rica/2013/SES-B301

36
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

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

Editor's Notes

  • #22 CAP Theorem: Consistency, Availiability, PartitionTolerance
  • #23 ParallelizedqueryacrossShards
  • #32 Bridge in Ohio after a locomotiveloosefreefrom a flatbedimpacted on thepillars. Thepillarshad redundant designs