Predictable Performance: Scale-up or scale-down (Vertical) • Elastic Scale: Scale-out or scale-in (Horizontal) Scale up/down • Premium Standard Basic Premium Standard Basic Basic Basic Scale out/in Basic Basic Basic.

Download Report

Transcript Predictable Performance: Scale-up or scale-down (Vertical) • Elastic Scale: Scale-out or scale-in (Horizontal) Scale up/down • Premium Standard Basic Premium Standard Basic Basic Basic Scale out/in Basic Basic Basic.

Predictable Performance: Scale-up or scale-down (Vertical)
•
Elastic Scale: Scale-out or scale-in (Horizontal)
Scale up/down
•
Premium
Standard
Basic
Premium
Standard
Basic
Basic
Basic
Scale out/in
Basic
Basic
Basic
Based on customer feedback we are moving to a model based on
Predictable Performance
Web & Business
Basic, Standard & Premium
•
•
•
•
•
•
•
•
•
Web / Business
Basic / Standard / Premium
Machine
Machine
Compute
DB 2
DB 2
DB 4
DB 7
DB 7
DB 55
DB
DB 8
DB 8
Memory
DB 6 DB
6
DB 9
DB 9
DB 1
Bounding boxes
eliminates noisy
neighbors
DB 4
DB 7
DB 2
DB 5
DB 8
Memory
DB 3
DB 6
DB 9
Reads
DB
4
DB 3
Noisy
neighbor!
Reads
Writes
DB 1
DB 3
Writes
DB 1
Compute
Azure SQL Database
Customers
•
•
•
•
•
•
Monitoring
% of current Performance Level
Bounding Box
Compute




60%
Memory
50%
Read
50%
75%
DB workload
Reads
Writes
Utilization
Write
CPU
Memory
Basic
Standard
Premium
Performance Levels
(DTU)
5
S0: 10
S1: 20
S2: 50
P1: 100
P2: 200
P3: 800
ASDB results
16,600 tx/hour
S1: ,520 tx/minute
S1: ,940 tx/minute
S2: 2,570 tx/minute
P1: 105 tx/second
P2: 228 tx/second
P3: 735 tx/second
Maximum DB size
2GB
250GB
500GB
Price* per hour (month)
$0.0069 (~$5)
S0: $0.0208 (~$15)
S1: $0.0417 (~$30)
S2: $0.1042 (~$75)
P1: $0.6458 (~$465)
P2: $1.292 (~$930)
P3: $5.167 (~$3,720)
*Starting November 1st
CPU
CPU
CPU
Writes
Writes
Writes
SELECT * FROM a
JOIN b ON …
RESULT
Reads
Reads
Reads
2
160
200
1600
1600
10000
• Application exceeds the limits of a single
database:
• Application Types
•
•
•
•
•
(2) Sharding Key
(3) Shard Map
Manager
(6) Sharded Table
(8) Shardlet
Customer Table
Customer ID
Name
1
Alice
2
Bob
...
Data Center Table
Data Center ID
DC Name
1
Boston
2
Miami
(1) Database
(4) Shard
(7) Reference Table
(5) Shard Set
(4) Shard
Shard Map Management (SMM)
• Define groups of shards for your application
• Manage mapping of routing keys to shards
Data Dependent Routing (DDR)
Application
Developer
.NET
Application
• Route incoming requests to the correct shard,
e.g., given a customer ID
• Ensure correct routing as tenants move
• Cache routing information for efficiency
Multi-Shard Query (MSQ)
• Interactive processing across several shards
• Same statement executed on all shards with
UNION all semantics
Admin/
DevOps
Management
Service
Split Merge Service (SMS)
• Grow or shrink capacity by adding or removing
scale units
• Dynamically adjust scale factor of scale unit
• Trigger adjustment dynamically through policies
Application
Developer
.NET
Application
Federations Migration Utility
• Migrate from Federations to Elastic Scale
Shard Elasticity (SE)
• Policy-based horizontal and vertical sharding
using Azure Automation
Admin/
DevOps
Management
Service
[shardmaps_global]
smid
name
1
RangeShardMap
[shards_global]
•
Shard Map
Manager
•
•
•
sid
smid
server
database
1
1
Server1
DB1
2
1
Server1
DB2
[shard_mappings_global]
•
DB1
DB2
[0-100)
[100-200)
DB3
DB4
[200-300)
[300-400)
Shard Set
DB5
[400-500)
mid
smid
min
max
Sid
1
1
0
100
1
2
1
100
200
2
DB6
[500-600)
...
DBn
[n – n+100)
Application
Developer
Shard Map
Manager
Client App
DDR APIs
SELECT *
FROM customers
WHERE customer ID = 104
DB1
DB2
[0-100)
[100-200)
DB3
DB4
[200-300)
[300-400)
DB5
[400-500)
DB6
[500-600)
...
DBn
[n – n+100)
// Get a routed connection for a given shardingKey
using (SqlConnection conn = ShardMap.OpenConnectionForKey(
shardingKey,
connectionString /* Credentials Only */,
ConnectionOptions.Validate
/* Validate */ ));
{
using (SqlCommand cmd = new SqlCommand()
{
cmd.Connection = conn;
cmd.CommandText = "SELECT * FROM customers WHERE customer ID = 104";
SqlDataReader sdr = cmd.ExecuteReader();
// Now consume results from the data reader…
}
}
•
•
•
Application
Developer
Client App
DDR APIs
Cache
Shard Map
Manager
GSM
DB
LSM
Shard Map
Manager
Client App
MSQ APIs
Application
Developer
SELECT count(*)
FROM customers
DB1
DB2
[0-100)
[100-200)
UNION ALL result set
DB3
DB4
[200-300)
[300-400)
DB5
[400-500)
DB6
[500-600)
...
DBn
[n – n+100)
using (MultiShardConnection conn = new MultiShardConnection(m_shardMap.GetAllShards(null),
MultiShardTestUtils.GetTestSqlCredential()))
{
using (MultiShardCommand cmd = conn.CreateCommand())
{
cmd.CommandText = "SELECT count(*) FROM customers";
cmd.CommandType = CommandType.Text;
cmd.Policy = MultiShardPolicy.PartialResults;
using (MultiShardDataReader sdr = cmd.ExecuteReader(includeShardNameColumn: true))
{
while (sdr.Read())
{
// Now consume results from the data reader…
}
}
}
}
•
•
•
Admin/
DevOps
Merge
Management
Service
Split
DB1
DB2
[0-100)
[100-200)
DB3
DB4
[200-300)
[300-400)
DB5
[400-500)
DB6
[500-600)
DB2.1
DB5.1
DB5.2
[0-200)
[400-450)
[450-500)
...
DBn
[n – n+100)
ALL
•
•
•
regular
DB1
[0-100)
DB2
[100-200)
DB3
[200-300)
DB4
[300-400)
DB5
[400-500)
DB6
[500-600)
...
DBn
[n – n+100)
http://azure.microsoft.com/en-us/documentation/services/sql-database/
http://azure.microsoft.com/en-us/documentation/articles/sql-database-elastic-scale-documentation-map/
https://code.msdn.microsoft.com/vstudio/Elastic-Scale-with-Azure-a80d8dc6
http://azure.microsoft.com/blog/2014/09/11/azure-sql-database-introducesnew-near-real-time-performance-metrics/
microsoft.com/sqlserver and Amazon Kindle Store
microsoftvirtualacademy.com
Azure Machine Learning, DocumentDB, and Stream Analytics
http://channel9.msdn.com/Events/TechEd
www.microsoft.com/learning
http://microsoft.com/technet
http://developer.microsoft.com