Windows Azure SQL Database Federations
Upcoming SlideShare
Loading in...5
×
 

Windows Azure SQL Database Federations

on

  • 2,036 views

Introduction to the Federations horizontal scale-out feature of Windows Azure SQL Database.

Introduction to the Federations horizontal scale-out feature of Windows Azure SQL Database.

Statistics

Views

Total Views
2,036
Views on SlideShare
2,031
Embed Views
5

Actions

Likes
1
Downloads
23
Comments
0

3 Embeds 5

http://us-w1.rockmelt.com 3
http://paper.li 1
https://twitter.com 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

CC Attribution License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • Performance / database sizeNew pricing model complicates things since price is not linear in DB sizeFlavorous example
  • Data Distribution:Range partitioningRound robinHash bucketRouting:Database discoveryConnection managementFlavorusTo support the spike in first-day ticket sales, Flavorus used the Windows Azure platform to host 750 web role instances of the Jetstream application and 550 SQL Azure databases. The application wrote chunks of customer data to multiple sharded SQL Azure databases in parallel. Jetstream was live for two days, after which the company returned the event data to its on-premises servers and continued selling tickets.http://www.microsoft.com/casestudies/Case_Study_Detail.aspx?CaseStudyID=4000011072
  • A range distribution can be affected by:Data skew – data concentrated in one federation memberOperational skew – data operations concentrated in one federation member
  • FederatedReferenceCommonIndividual members contain distinct schema
  • DB_NAME() provides the name of the current federation member.FEDERATION_FILTERING_VALUE(DistributionName) provided the current FILTERING=ON valuehttp://msdn.microsoft.com/en-us/library/windowsazure/hh597465.aspxFederation atomic unit is explicitly not a security boundaryError to insert/update data in wrong member
  • Only valid when connected to root databaseOrdering of uniqueidentity:00000000-0000-0000-0000-080000000000http://sqlblog.com/blogs/alberto_ferrari/archive/2007/08/31/how-are-guids-sorted-by-sql-server.aspx
  • Metadatasys.federationssys.federation_memberssys.federation_distributionssys.federation_member_distributionssys.federation_historysys.federation_member_historysys.federation_distribution_historysys.federation_member_distribution_historysys.dm_federation_operationssys.dm_federation_operation_memberssys.dm_federation_operation_errorssys.dm_federation_operation_error_members
  • LOW is in memberHIGH is NOT in memberIterate over LOW value for member distributions
  • SQL Azure Federation Data Migration Wizardhttp://sqlazurefedmw.codeplex.com/

Windows Azure SQL Database Federations Windows Azure SQL Database Federations Presentation Transcript

  • SQL Database Federations Scaling out relational data in Windows Azure NEIL MACKENZIE
  • Who Am I? Neil Mackenzie Azure Architect @ Satory Global Windows Azure MVP Blog: http://convective.wordpress.com/ Twitter: @mknz Book: Microsoft Windows Azure Development Cookbook
  • Content Windows Azure Platform Motivation for SQL Database Federations Overview of SQL Database Federations Transact-SQL Statements DMVs Fan-out queries
  • Windows Azure Cloud Services:  Platform-as-a-Service  Web roles, worker roles  Infrastructure-as-a-Service  Virtual Machines, SQL Server 2012 Connectivity  Endpoints, Virtual Network, Service Bus Storage  Windows Azure Storage Service  Windows Azure SQL Database
  • SQL Database Database-as-a-Service  Multi-tenanted  Priced in GB/month Database  One primary and two secondary databases  Quorum commit  Maximum size: 150GB Programmability  TDS protocol  SQL Server authentication  Change connection string and go
  • Scalability Scale up  Use more powerful hardware  Price/performance problem  Fails at internet scale Scale out  Use commodity hardware  Cost-effective way to increase performance  Resilient towards failure
  • Scale-Out Data Use multiple databases (shards) Sharding provides:  Larger data sizes  Higher performance Issues:  Data distribution  Connection routing
  • SQL Database Federations Sharding-as-a-Service Federated database comprises:  Root database  Federation member databases (shards) Federation specified by:  Federation name  Distribution key Routing  Connection pooling
  • Federation Members Federation member  Federated data distributed by distribution key range  Error to insert or update distribution key outside range  Member databases can have:  different sizes  different schemas Distribution key in:  Clustered index  Each unique index
  • Table Types Federated tables  In federation members CREATE TABLE ( … ) FEDERATED ON (CustomerId = custId) Reference tables  In federation members CREATE TABLE ( … ) Common tables  In root database
  • Federation Operations Transact SQL support for federations:  CREATE FEDERATION  USE FEDERATION  ALTER FEDERATION  DROP FEDERATION
  • CREATE FEDERATION CREATE FEDERATION federation_name (distribution_name <data_type> RANGE) Data types:  INT  BIGINT  UNIQUEIDENTIFIER  VARBINARY(n) - n<=900 Root database can support several federations  e.g. – customer federation, product federation
  • USE FEDERATION USE FEDERATION ROOT WITH RESET  Routes connection to root database USE FEDERATION federation_name (distribution_name = value) WITH RESET, FILTERING={ON|OFF}  Routes connection to appropriate federation member  FILTERING= OFF allows connection to be used for any data in the federation member  FILTERING=ON restricts connection to a specified distribution key
  • ALTER FEDERATION: SPLIT Range: 100 400 500ALTER FEDERATION CustomerFederationSPLIT AT (CustomerId = 200) Range: 100 200 400 500
  • ALTER FEDERATION: DROP 100 200 400 500ALTER FEDERATION CustomerFederationDROP AT (LOW CustomerId = 200) 100 200 400 500ALTER FEDERATION CustomerFederationDROP AT (HIGH CustomerId = 200) 100 200 400 500
  • Dynamic Management Views Definition  e.g. sys.federation_member_distributions History  e.g. sys.federation_member_distribution_history Operations  e.g. sys.dm_federation_operations Operation errors  e.g. sys.dm_federation_operation_errors
  • sys.federation_member_distributions Columns  federation_id int  member_id int (database id)  Distribution_name sysname  Range_low sqlvariant  Range_high sqlvariant Range:  includes Range_low  excludes Range_high
  • Security Principal Root database  CREATE USER user_name FROM LOGIN login_name Federation member  CREATE USER user_name Security is otherwise like SQL Database
  • Fan-Out Queries Loop over:  sys.federation_member_distributions.Range_low Perform queries in parallel Two-step process  Member query  Summary query (if necessary)
  • Summary SQL Database Federations  Sharding-as-a-Service  Elastic scalability for SQL Database databases  Management support  Developer support
  • More Information MSDN Wiki http://bit.ly/A7sUdo Cihan Biyikoglu blog: http://blogs.msdn.com/b/cbiyikoglu/ Post based on this presentation: http://bit.ly/wqD4Xo