4. Scaling the DB layer
Scaling UP Table Partitioning
Master/Slave Scaling OUT (Sharding)
Cluster Computing
App Server #1 DB1
App Server #2 DB1
App Server #3 DB1
App Server #3 DB1
5. What is a SQL Azure Federation?
F Federation
e Member #1
d
e
r Federation
User Database a Member #2
t
i Federation
o Member #3
n
6. Terminology
1. Federation
2. Federation Key (UNIQUEIDENTIFIER, INT, BIGINT, VARBINARY)
CREATE FEDERATION Tenant_Fed (id INT RANGE)
3. Federation Member Federation Members
4. Atomic Unit Federation Root
5. Table Data
• Federation Root Central Federated
• Federation Tables Tables Tables
• Reference Tables Reference
• Central Tables Tables
7. Create Federation Table
CREATE TABLE [dbo].[TenantDocuments](
[ID] [int] NOT NULL,
[TenantID] [int] NOT NULL,
[Title] [varchar](50) NOT NULL,
CONSTRAINT [PK_Account] PRIMARY KEY CLUSTERED
(
[ID] ASC,
[TenantID] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
FEDERATED ON (TID = TenantID)
GO
9. Management of Azure Federations
ALTER FEDERATION Tenant_Fed SPLIT AT (TenantId=10)
My DB
Accounts_Fed
ALTER FEDERATION federation_name
{ SPLIT AT (distribution_name = boundary_value)
| DROP AT ([LOW|HIGH] distribution_name =
boundary_value)
}[;]
13. Billing Model
Principles:
• DB Charges are prorated to a day.
Example: Cost of 1Gb Web edition is $0.33/day
• All DB that exist in the day are charged
• Only DB that are in ready state are charged
Operations which affect Billing:
• Federation Creation
• Federation Repartitioning Operations
• Modification of Federation Billing properties
ALTER DATABASE database_name {
MODIFY (<edition_options> [, ..n])
}
<edition_options> ::= {
(MAXSIZE = {1|5|10|20|30|40|50|100|150} GB)
| (EDITION = {'web' | 'business'})
} [;]