Módulo 6 http://twitter.com/wcamb/ http://blogs.msdn.com/wcamb/ Um banco de dados relacional na nuvem Storage Compute Management Reporting Relational data Billing & Payments Management Data Sync Connectivity Access control Flexible Flexible APIs APIs Information Marketplac e Information Reporting & Marketplace BI SQL Azure acessado de dentro do Datacenter MS (Azure Compute) Application/ Browser App code/ Tools SQL Server ) Windows Azure Code Near Windows Azure Code Far Data Sync (ASP.NET) (ASP.NET SQL Azure App App Code Code T-SQL (TDS) SQL Azure acessado de dentro e de fora de um datacenter MS (on-premise & Azure Compute) App code/ Tools Astoria/REST - EDM HTTP/S T-SQL (TDS) SOAP/REST HTTP/S SQL Azure acessado de fora de um datacenter MS (on-premise) Windows Azure App App Code Code (ASP.NET) (ASP.NET ) T-SQL (TDS) Hybrid Account account server Server database Database servers databases Tables, indexes, views Stored Procedures Triggers Constraints Table variables, session temp tables (#t) Spatial (desde junho) … Distributed Transactions Distributed Query CLR Service Broker Physical server, catalog DDL Trace Flags http://msdn.microsoft.com/en-us/library/ff394115.aspx 1GB − $49.95 até 5GB 5GB 10GB 20GB − − − − $199.98/mês até 20GB $299.97/mês até 30GB $399.96/mês até 40GB $499.95/mês até 50GB 30GB 40GB 50GB http://msdn.microsoft.com/en-us/library/ff394109.aspx https://sql.azure.com/ 0.0.0.0 – 255.255.255.255 − Windows Authentication – Não Suportado − SQL Server Authentication – Suportado − O usuário deve fornecer Username + Password para toda conexão com o SQL Azure. − Autorização de usuários e papéis para objetvos SQL − ADO.NET, ODBC, PHP − Não pode chavear entre bancos (sem “USE”) − SQL Server Management Studio 2008 R2 é suportado. (SSMS) − Para versões anteriores ao SSMS R2, um workaround deve ser aplicado. − Long-running queries / Consultas de longa duração − Long-running single transactions, entre as declarações “BEGIN TRAN” e “END TRAN” − Idle connections / Conexões osciosas ! Réplica 1 DB Réplica 2 Réplica 3 Réplica 4 Modelo de Particionamento – Sharding A B Hardware Boundary A C B Hardware Boundary D C D Hardware Boundary A C D B Hardware Boundary Demo de Particionamento – Sharding − Scaling Out SQL Azure with Database Sharding − C:\WindowsAzureTrainingKit - Sep2010\Demos\ SQLAzureScalingOutWithDbShardingVS2010 SQL Azure − ODBC − ADO.NET − OLEDB − LINQ TO SQL − PHP − JAVA using System; using System.Linq; public void ConnectToSQLAzureDemo() { AdventureWorksSqlAzureDataContext context = new AdventureWorksSqlAzureDataContext(); // get all company names IQueryable<string> companyNames = from customer in context.Customers select customer.CompanyName; // display these all on the console foreach (string company in companyNames) { Console.WriteLine(company); } } <?php $host = "server.database.windows.net"; $dbname = "database"; $dbuser = "user@server"; $dbpwd = "password"; $driver = "{SQL Server Native Client 10.0}"; // Build connection string $dsn="Driver=$driver;Server=$host;Database=$dbname;Encrypt=true;Tru stServerCertificate=true"; if (!($conn = @odbc_connect($dsn, $dbuser, $dbpwd))) { die("Connection error: " . odbc_errormsg()); } // Got a connection, do what you will // Free the connection @odbc_close($conn); ?> // Build a connection string String connectionUrl= "jdbc:sqlserver://server.database.windows.net;" + "database=mydatabase;encrypt=true;user=user@server;password=*****"; // Next, make the sure the SQL Server Driver is loaded. Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); // Then attempt to get a connection. a connection. This will null or throw if we can't get Connection sqlConn = DriverManager.getConnection(connectionUrl); if (sqlConn == null) { System.out.println("Unable to obtain connection. exiting"); System.exit(1); } // Got a connection, do what you will // Free the connection sqlConn.close(); http://blogs.msdn.com/ssma/ bcp AdventureWorksLTAZ2008R2.SalesLT.Customer in C:\load\MoveDataToSQLAzure.txt -b100 -c -U username@servername -S tcp:servername.database.windows.net -P password Tipo de Engine para SQL Azure http://sqlazuremw.codeplex.com/ − Não é suportado pela Microsoft lab #05 Introdução ao SQL Azure http://twitter.com/wcamb/ http://blogs.msdn.com/wcamb/