Presentation is loading. Please wait.

Presentation is loading. Please wait.

Konstantinos Pantos MVP, MSc, MCP, Software Solutions Architect

Similar presentations


Presentation on theme: "Konstantinos Pantos MVP, MSc, MCP, Software Solutions Architect"— Presentation transcript:

1 Konstantinos Pantos MVP, MSc, MCP, Software Solutions Architect kpantos@techaholics.gr

2 Azure…Where’s my stuff?  Local Storage  Unstructured  Blob Storage  Tables  Queues  (NOT relational) BUT we want RELATIONAL! SQL Azure

3 Microsoft SQL Azure Relational Database as a Service Scale on Demand Managed Service Platform capabilities delivered as a service (Database, Data Sync, Reporting…) Reduced complexity, greater flexibility Easy provisioning and deployment Auto High availability and fault tolerant Database as a utility with pay as you grow scaling Rely on Business- ready SLAs Enable multi-tenant solutions Manage multiple servers Innovate with new data application patterns Build cloud-based database solutions on a familiar relational model Build on existing developer skills and familiar Transact-SQL syntax Innovate Faster

4 A Server is not a Machine

5 How it Works ApplicationsTools ODBCADO.NET TDS SQL Azure Server Connection Routing BillingProvisioning Infrastructure DB1DB2DBn Server SQL Server SQL Azure Fabric Server SQL Server SQL Azure Fabric Server SQL Server SQL Azure Fabric

6 Application Topologies SQL Azure access from within MS Datacenter (Azure compute) SQL Azure Access from outside MS Datacenter MS Datacenter(On-premises) SQL Azure Access from within and outside MS Datacenter (On-premises & Azure Compute) Application/ Browser SOAP/RESTHTTP/S Astoria/REST - EDM HTTP/S App Code (ASP.NE T) App Code (ASP.NE T) App Code (ASP.NET) App Code (ASP.NET) T-SQL (TDS) SQL Azure WindowsAzure Code Near App code/ Tools T-SQL (TDS) SQL Azure Code Far Hybrid SQL Azure Data Sync Data Sync WindowsAzure SQL Azure SQL Serv er App code/ Tools App Code (ASP.NE T) App Code (ASP.NE T) App Code (ASP.NET) App Code (ASP.NET) T-SQL (TDS)

7 Set up a server...  Browse to http://windows.azure.com

8 Create a database  Also available at http://sqlazurelabs.com

9 SQL Azure Portal

10 Silverlight SQL Manager Basic database management facilities  Create Tables, Views, & Stored Procedures  Run Queries  Manage database objects

11 Connecting with SSMS

12 Create a database

13 More...  Application connectivity  Compatibility  Migration  Administration & Security  Price, Size and Edition  Code Near vs. Code Far vs. Hybrid  Partitioning, Sharding and Federation  Backup and Replication

14 Connecting to SQL Azure  SQL Azure connection strings follow normal SQL syntax  Applications connect directly to a database  “Initial Catalog = ” in connection string  No support for context switching (no USE )  Some commands must be in their own batch  Create/Alter/Drop Database & Create/Alter/Drop Login, & Create/Alter USER with FOR/FROM LOGIN  Encryption security  Set Encrypt = True, only SSL connections are supported  TrustServerCertificate = False, avoid Man-In-The-Middle-Attack!  Format of username for authentication:  ADO.Net: Data Source=server.database.windows.net; User ID=user@server;Password=password;...  Setup your firewall rules first!

15 SQL Azure Compatibility  Tables, indexes and views  Stored Procedures  Triggers  Constraints  Table variables, session temp tables (#t)  Spatial types, HierarchyId  Currently Supported  Not Currently Supported  Data Types  Sparse Columns, Filestream  Partitions  Full-text Search  Remote Data Access and Linked Servers  Distributed Transactions  Change Tracking  Service Broker  SQL-CLR Tables require clustered indexes List available here http://msdn.microsoft.com/en-us/library/ee336253.aspxhttp://msdn.microsoft.com/en-us/library/ee336253.aspx

16 Migration Options Generate Script Wizard Produce a SQL script compatible with SQL Azure, Schema and/or data SQL Server Migration Assistants (downloadable) MySQL, Oracle, Access, SQL Server... SQLAzureMW Useful for catching unsupported features in SQL Azure Moves data efficiently Unofficially supported Data-tier Application Component (DAC) New unit of deployment for T-SQL apps. Supports Install, Uninstall Contains developer intent as policies Schema LOGICAL Tables, Views, Constraints, SProcs, UDFs, PHYSICAL Users, Logins, Indexes Future - DAC Deployment Profile Deployment Requirements, Management Policies, Failover Policies Unit of Deployment

17 The right tool Scenario/ToolSSMAGenerat e Script Wizard DACsSSISBCP Mysql and Access to SQL Azure √ (Schema and Data) √ (Data Only) Move SQL Schema √√√ Move Data √√√ Move Large Data √√

18 Data Migration

19 Security Model  Uses regular SQL security model  Authenticate logins, map to users and roles  Authorize users and roles to SQL objects  Support for standard SQL Auth logins  Username + password Security model is compatible with on-premise SQL

20 Size Matters

21 Pricing  SQL Azure Development Accelerator Core - $74.95 EditionWebBusinessBandwidth Max 1 GB$9.99/monthn/a$.10 in / $.15 out Asia $.30 in / $.45out Max 5 GB$49.95/monthn/asame Max 10 GBn/a$99.99/monthsame Max 20 GBn/a$199.98/monthsame Max 30 GBn/a$299.97/monthsame Max 40 GBn/a$399.96/monthsame Max 50 GBn/a$499.95/monthsame

22 SQL Azure Today  Elastic Provisioning of Databases  CREATE DATABASE and go  No VMs, no servers  Pay-as-you-go business model  Don’t need it --- DROP it  Zero Physical Administration  Built-in High Availability, patching, maintenance  Database Copy, SQL Azure Data Sync

23  “How do I store more than 50gb in a single database?”  “How to I architect my application for high scale?”  “How do I scale-out my database?”

24 SQL Azure Scale Future - Federation  Provides Scale-Out Support in SQL Azure  Partition data and load across many servers  Bring computational resources of many to bear  Take advantage of elastic provisioning of databases  Pay as you go benefits  Zero physical administration  Federation includes  Robust Connection Management  Online repartition operations  Split & Merge Databases

25 Customers OrderHistory Orders Products ProductAvailabilityLineItems PurchaseOrders Companies ProductImages CustomerAudit ShoppingCart DOSO_Full_db

26 DOSO_Customers DOSO_Orders DOSO_Products Customers OrderHistory Orders Products ProductAvailability LineItems PurchaseOrders Companies ProductImages CustomerAudit ShoppingCart

27 DOSO_Customers_AK Customers OrderHistory OrdersProducts ProductAvailabilityLineItems PurchaseOrders Companies ProductImages CustomerAudit ShoppingC art DOSO_Customers_LQ DOSO_Customers_RZ Customers OrderHistory OrdersProducts ProductAvailabilityLineItems PurchaseOrders Companies ProductImages CustomerAudit ShoppingC art Customers OrderHistory OrdersProducts ProductAvailabilityLineItems PurchaseOrders Companies ProductImages CustomerAudit ShoppingC art

28 SQL Azure Federations: Concepts  Federation  Represents the data being sharded  Federation Key  The value that determines the routing of a piece of data  Atomic Unit  All rows with the same federation key value: always together!  Federation Member (aka Shard)  A physical container for a range of atomic units  Federation Root  The database that houses federation directory Federation “CustData” Member: [min, 100) AU PK=5 AU PK=25 AU PK=35 Member: [100, 488) AU PK=105 AU PK=235 AU PK=365 Member: [488, max) AU PK=555 AU PK=2545 AU PK=3565 (Federation Key: CustID)

29 Creating the schema  Federated tables  CREATE TABLE orders (…) FEDERATE ON (customerId)  Federation key must be in all unique indices  Part of the primary key  Value of federation key will determine the member  Reference tables  CREATE TABLE zipcodes (…)  Absence of FEDERATE ON indicates reference  Centralized tables  Create in root database Federation “Orders_Fed” (Federation Key: CustID) Member: [min, max) SalesDB orders Products zipcode

30 Create Database & Federation  CREATE DATABASE SalesDB (EDITION='business',MAXSIZE=50GB)  connect to SalesDB…  CREATE FEDERATION Orders_Federation(RANGE BIGINT) Create a Federation use a BIGINT as the Federation Key

31 Establish the customerid as the Federation Key Create Partitioned Table  USE FEDERATION Orders_Federation(0) WITH RESET  CREATE TABLE orders(  customerid bigint,  orderid bigint,  odate datetime,  primary key (orderid, customerid))  FEDERATE ON (customerid)  CREATE TABLE orderdetails(  customerid bigint,  orderdetailid bigint,  orderid bigint,  partid bigint,  primary key (orderdetailid, customerid))  FEDERATE ON (customerid) Data with the same customerid in these two tables should be treated as an Atomic Unit

32 Insert Some Data  INSERT INTO orders VALUES(10,1,getdate()), (10,2,getdate()), (11,3,getdate())  INSERT INTO orders VALUES(110,11,getdate()), (110,12,getdate()), (111,13,getdate())  INSERT INTO orders VALUES(210,21,getdate()), (210,22,getdate()), (211,23,getdate())  INSERT INTO orders VALUES(310,31,getdate()), (310,32,getdate()), (311,33,getdate())  INSERT INTO orderdetails VALUES(10,1,1,1), (10,2,1,2), (10,3,1,10),(10,4,2,100),(10,5,2,1000), (11,6,3,101)  INSERT INTO orderdetails VALUES(110,11,11,1), (110,12,11,2), (110,13,11,10),(110,14,12,100),(110,15,12,1000), (111,16,13,101)  INSERT INTO orderdetails VALUES(210,21,21,1), (210,22,22,2), (210,23,21,10),(210,24,22,100),(210,25,22,1000), (211,26,23,101)  INSERT INTO orderdetails VALUES(310,31,31,1), (310,32,31,2), (310,33,31,10),(310,34,32,100),(310,35,32,1000), (311,36,33,101)

33 Simple SELECT  SELECT * FROM ORDERS  RESULTS  --------  ORDER 10  ORDER 110  ORDER 210  ORDER 310

34 Split Database  USE FEDERATION ROOT WITH RESET  ALTER FEDERATION orders_federation SPLIT AT 100 Federation Root houses the Directory Split the Federation Member into two at the customerid 100 boundary

35 SELECT with Federation Key  USE FEDERATION Orders_Federation(0) WITH RESET  SELECT * FROM ORDERS  RESULTS  --------  ORDER 10  USE FEDERATION Orders_Federation(100) WITH RESET  SELECT * FROM ORDERS  RESULTS  --------  ORDER 110  ORDER 210  ORDER 310 Use Federation Member that contains customerids < 100 Use Federation Member that contains customerids > 100

36 Backups  Two dangers: Disaster Recovery, and Bob the SQL Builder  No current built in backup features  High priority for next version  Must provide own approach  Code that moves data to another SQL location  Export to file  Perhaps BCP or SSIS

37 Database Copy  Makes a transactional copy of your database to a database with a new name on the same server, or to another server  No downtime on the source database  Transactional equivalent at the END of the copy  Only works within the same datacenter  Must have matching credentials on the servers  Must have db_owner on source and dbmanager on destination CREATE DATABASE destination_database_name AS COPY OF [source_server_name.]source_database_name To see progress: SELECT * FROM sys.dm_database_copies

38 SQL Azure Data Sync – Key Features  Elastic Scale  Service scales as resources requirements grow  No-Code Sync Configuration  Easily define data to be synchronized  Schedule Sync  Choose how often data is synchronized  Conflict Handling  Handle issues where same data is changed in multiple locations  Logging and Monitoring  Administration capabilities for tracking data and monitoring potential issues

39 Sync End to End Scenarios On-Premises Applications Sync Offline Applications Sync SQL Azure Database Sync SQL Azure Data Sync http://azure.com SQL Azure Data Sync CTP2 (Coming in near future) Microsoft Sync Framework 4.0 CTP available now! Sync Retail & Remote Offices SQL Azure Data Sync CTP1 (Available now from http://azure.comhttp://azure.com)

40 Key takeaways  SQL Azure IS SQL Server…a TDS endpoint  Create DB’s and manage using what we already know  Data Migration strategies to fit specific needs  Considerations and futures paint exciting picture of what to expect looking forward

41 More Information  General Guidelines & Limitations - http://msdn.microsoft.com/en- us/library/ee336245.aspx http://msdn.microsoft.com/en- us/library/ee336245.aspx

42 Konstantinos Pantos MVP, MSc, MCP, Software Solutions Architect kpantos@techaholics.gr


Download ppt "Konstantinos Pantos MVP, MSc, MCP, Software Solutions Architect"

Similar presentations


Ads by Google