Sie sind auf Seite 1von 34

Designing Modern Apps

using New Capabilities in


Microsoft Azure SQL
Database, Deep Dive
Tobias Ternstrm
Alexander (Sasha) Nosov
Program Managers, Data Platform Group

Agenda
Performance
Business Continuity

Performance

Performance
Case for change
Concepts
New Service Tiers
Usage Models

Case for Change


Based on customer feedback we are moving to a model
based on Predictable Performance
Web & Business
Price/storage
Throttling
Performance varies based on
neighboring tenants
Deprecated (April 2015)

Basic, Standard &


Premium
Price/performance &
features
Resource Governance
Predictable Performance
Preview since April 2014
Backwards Compatible

Concepts
Database Throughput Unit DTU
Azure SQL Database Benchmark ASDB

Database Throughput Unit


Bounding Box
Monitoring
DTU
% of current Performance Level
Compute

Read

Write

60
%

50
%

Memory

75%

DB
workloa
d

Reads

Writes

Utilization

CPU Memory
(coming)

Represents the relative power (resources) assigned to the


database
Blended measure of CPU, memory, and read and write rates
Compare the power across performance levels
Simplifies talking about performance, think IOPS vs. %

Azure SQL Database Benchmark


An example representing meaningful
ASDB
OLTP-type workload
Uses six tables of varying sizes some of
which are always larger than available
memory and scale with the throughput
Uses nine transaction types
A transaction is a combination of multiple
SELECT, DELETE, INSERT, UPDATE
statements

New Service Tiers


Basic

Standard

Premium

Performance Levels
(DTU)

S1: 5
S2: 25

P1: 100
P2: 200
P3: 800

ASDB results

3,467 tx/hour

S1: 283 tx/minute


S2: 1,470 tx/minute

P1: 98 tx/second
P2: 192 tx/second
P3: 730 tx/second

Maximum DB size

2GB

250GB

500GB

Price per day/month


(-50% during Preview)

$0.16 / $4.995

S1: $1.30 / $40


S2: $6.45 / $200

P1: $30 / $930


P2: $60 / $1,860
P3: $240 / $7,440

Changing Performance Level


PowerShell
Set-AzureSqlDatabase

REST
Update Database /
ServiceLevelObjectiveId

.NET
Microsoft.WindowsAzure.Mana
gement.Sql.SqlManagementCl
ient
client.Databases.Update()

T-SQL

Performance Monitoring
Should you scale up or down?
Azure Portal
master.sys.resource_stats
Based 5 minute averages
Improvements coming (at least) throughout Preview

Query tuning
sys.dm_exec_query_stats
sys.dm_exec_query_sql_text()
sys.dm_exec_query_plan
sys.dm_exec_requests
sys.dm_exec_sessions

Demo

Usage Models

Common Patterns we see


Single database
Vertically partitioned
Single tenant/DB (CSVs)
Other partitioning
scheme

P3
Fabrikam
Fabrikam

S1
Invoice
Invoice

S2
Order
Order

S1
Inventory
Inventory

P1
Root
Root

S2
Cust. #1
Cust. #1

Basic
Cust. #2
Cust. #2

Cust. #n

S2
Root
Root

Basic
Shard #1
Shard #1

P2
Shard #2
Shard #2

Shard #n

Software as a Service vendors


SaaS vendors frequently run their code as a layer
Code is usually shared across many customers
Sometimes databases are shared too
When they have more customers, they often have more databases

SaaS

Customer
DB1

Customer
DB2

Customer
DB3

Customer
DB N

Central Metadata Databases


If you have a whole bunch of
databases, you need a directory to
keep track of which Customers are in
1
each database
A Directory database stores this Director
y
data
General Login Path
1.

Connect to Root Database, find tenant

Cache!

2.
3.

Connect to Right Client Database for this Customer


Shard
Perform Work on per-customer data
1

Shard
2
3

Example Sharded Model


Sharded Models split the data across multiple databases that each have the
same schema
All data about one customer is located within a single database OLTP
operations work fine
Cross-database operations do not work without manual work @ client-app

Business Continuity
Scenarios
Solutions
Design patterns

Business
Continuity
Problem

Enabling the application to continuously


operate during unplanned and planned
disruptive events

High
availability
platform

Up to 4 synchronous replicas
Transparent automatic failov
Uptime SLA of 99.95%

Single Logical
Database

DB
Ack Read
Value Write
P

Ack

Write

Ack
Write

Reads are completed at the primary


Writes are replicated to secondaries

Point In Time
Restore

sabcp01bl21
sabcp02bl21
sabcp03bl21

Automatic Backup

Copy backups to Azure Storage

Full backups once a week, diff backup once a


day,
log backups every 5 min

LS XYZ

Daily backup files uploaded to geo-redundant


Azure Storage

DB

Self-service restore
REST API, PowerShell or Portal
Creates a side-by-side database copy

Tiered Retention Policy


Basic edition: last daily backup
Standard edition: 7 days
Premium edition: 30 days

Restore
as a
new
databas
e

DB1

Active
Georeplication
(Premium
tier)

US West

Ge o replic
a

t io n

LS ABC

LS XYZ

Failover to
secondary
database

X
US East

RTO<1h, RPO<5m
Automatic data replication and synchronization
REST and PowerShell API to opt-in and failover
DMV to guide failover decisions
User controlled placement of up to 4 secondaries
Creates secondary database with matching
performance level

Demo
Geo-replication activation and
failover

Design
pattern #1

Active-passive compute with coupled failover

Optimized for co-located


app and data tier
Secondary is not used
for app access
Failover involves DNS
change

Design
pattern #2

Active-active compute with decoupled failover

Optimized isolated load


balancing of the end user
traffic
Secondary is used for readonly
access
Failover does not involve DNS
change

Design
pattern #3

Active-passive compute with decoupled failover

Optimized for partial


failures of the application
stack
Secondary is not used for
application access
Failover involve DNS
change

BCDR Summary
Basic tier

Standard tier

Uptime SLA

Premium tier

99.95%

Database size limit

2GB

250GB

500GB

Point In Time Restore


(oops recovery)

Last restore point


within 24 hrs

Any point within 7


days

Any point within 35


days

Restore to another
RTO<24h*, RPO<24h RTO<24h*, RPO<24h
region (no pre-allocated
capacity)**

RTO<24h*, RPO<24h

Geo-replication (one
passive secondary,
fixed DR pairing)**

Not available

RTO<2h RPO<30m

RTO<2h RPO<30m

Active geo-replication
(up to 4 read only
secondaries,
configurable regions)

Not available

Not available

RTO<1h, RPO<5m

* Target only, depends on the data size and scale of restores


** Not all disaster recovery features are available today

BCDR Scenarios in Service tiers


Scenario

Basic Tier

Standard Tier

Premium Tier

Local failures

Azure DB upgrades and


maintenance

Accidental data corruption

Regional disaster

DR Drill

Online application upgrade


Application failure

Online application relocation

Load balancing

Call To Action
Basic, Standard & Premium are in Preview
We are listening closely to and evaluating feedback

Reminders
Performance levels can be changed up & down online to support
peak load
DTUs assigned are constant, not averages over time
Transaction numbers are examples, not hard DB transaction limits

Stay
tuned
Additional business continuity features for Basic and
Standard
Increased performance
Basic: 1 5 DTU

S1: 5 15 DTU
S2: 25 50 DTU

P1: 100 DTU


(unchanged)
P2: 200 DTU
(unchanged)

Related content
Performance
PowerShell: http://msdn.microsoft.com/en-us/library/jj585422.aspx
REST: http://msdn.microsoft.com/en-us/library/azure/dn505719.aspx
Benchmark: http://msdn.microsoft.com/en-us/library/azure/dn741327.aspx

Business continuity
Overview: http://msdn.microsoft.com/library/azure/dn741339.aspx , http://
msdn.microsoft.com/en-us/library/azure/jj650016.aspx
PowerShell: http://msdn.microsoft.com/en-us/library/dn720220.aspx , http://
msdn.microsoft.com/en-us/library/dn720218.aspx
REST: http://msdn.microsoft.com/en-us/library/azure/dn509565.aspx,

Resources
Learning
Sessions on Demand

http://channel9.msdn.com/Events/Tec
hEd

TechNet
Resources for IT Professionals

http://microsoft.com/technet

Microsoft Certification & Training Resources

www.microsoft.com/learning

msdn
Resources for Developers

http://microsoft.com/msdn

Complete an evaluation and enter


to win!

Evaluate this session


Scan this
QR code
to evaluate
this session.

2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.

Das könnte Ihnen auch gefallen