Application Internet Azure Cloud Internet Azure Cloud LB TDS (tcp) Applications use standard SQL client libraries: ODBC, ADO.Net, PHP, … Load balancer forwards ‘sticky’ sessions to TDS protocol tier Security Boundary SQL Gateway Scalability and Availability: Fabric, Failover, Replication, and Load balancing Gateway: TDS protocol gateway, enforces AUTHN/AUTHZ policy; proxy to backend SQL
IDNameStart IPEnd IPCreateModify 1Office … 2Home … …
TimeDatabaseDirectionClassPeriodQuantity :00TPCHEgressInternalPeak :00TPCHIngressInternalPeak76026 ……………… TimeSKUQuantity :00Web :00Business10 ………
Recommendations
Increases efficiency by removing re-login
while (true) { using (SqlConnection connection = new SqlConnection(connStr)) { try { connection.Open(); using (SqlCommand cmd = connection.CreateCommand()) { cmd.CommandText cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new BCPJobId)); cmd.ExecuteNonQuery(); } catch (Exception exc) { // deal with error } // more stuff // ….. }
// Length inferred: leads to cache bloat cmd.CommandText = "SELECT c1 FROM dbo.tbl WHERE c2 SqlDbType.NVarChar).Value = "1"; … SqlDbType.NVarChar).Value = "22"; // Length supplied: no cache bloat cmd.CommandText = "SELECT c1 FROM dbo.tbl WHERE c2 SqlDbType.NVarChar, 128).Value = "1"; nvarchar(1)) SELECT c1 FROM dbo.tbl WHERE c2 nvarchar(2)) SELECT c1 FROM dbo.tbl WHERE c2 nvarchar( 128 )) SELECT c1 FROM dbo.tbl WHERE c2
SQL Azure Cluster Node 55 DB3 DB1 DB2 DB3 DB4 DB5 DB6
SQL Azure Cluster DBC1 DBC2 DBC3 DBC4 DBC5 DBC6
Skip This Ad Go See Mark Scurrell’s Session: Using the Microsoft Sync Framework to Connect Apps to the Cloud (SVC23)
// Bulk data import using (SqlBulkCopy bulk = new SqlBulkCopy(new SqlConnection(conn)) { DestinationTableName = "dbo.data", BatchSize = 2000, // Transaction size (length) BulkCopyTimeout = 10000, // Transaction timeout NotifyAfter = 1000, // Progress callback }) { bulk.SqlRowsCopied += new SqlRowsCopiedEventHandler( myProgressCallback); bulk.WriteToServer(sourceDataReader); }
demo
// BCP example SET SRV=somesrv.database.windows.net SET SET PW=something SET S_DR=C:\flats bcp TPCH2.dbo.supplier in %S_DR%\supplier.tbl -c -U %LOGIN% -P %PW% -S %SRV% -t "|" bcp TPCH2.dbo.nation in %S_DR%\nation.tbl -c -U %LOGIN% -P %PW% -S %SRV% -t "|" bcp TPCH2.dbo.region in %S_DR%\region.tbl -c -U %LOGIN% -P %PW% -S %SRV% -t "|" bcp TPCH2.dbo.customer in %S_DR%\customer.tbl -c -U %LOGIN% -P %PW% -S %SRV% -t "|" bcp TPCH2.dbo.part in %S_DR%\part.tbl -c -U %LOGIN% -P %PW% -S %SRV% -t "|“ bcp TPCH2.dbo.supplier out %S_DR%\supplier.tbl -c -U %LOGIN% -P %PW% -S %SRV% -t "|" bcp TPCH2.dbo.nation out %S_DR%\nation.tbl -c -U %LOGIN% -P %PW% -S %SRV% -t "|" bcp TPCH2.dbo.region out %S_DR%\region.tbl -c -U %LOGIN% -P %PW% -S %SRV% -t "|" bcp TPCH2.dbo.customer out %S_DR%\customer.tbl -c -U %LOGIN% -P %PW% -S %SRV% -t "|" bcp TPCH2.dbo.part out %S_DR%\part.tbl -c -U %LOGIN% -P %PW% -S %SRV% -t "|"
Browser WorkerRole Blobs Target DB Jobs BCP PutBlob() NewJob() GetJob() GetBlob() WebRole
Built by Developers for Developers….
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista 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.