Arquitetura de Soluções

por Waldemir Cambiucci

Windows Azure: algumas novidades com a v1.0

Olá pessoal, tudo certo?


Depois de alguns dias criando projetos e bases de dados no portal do Azure, notei algumas novidades interessantes. Veja só:


1) Agora, temos algumas mensagens sobre o tempo estimado de resposta de alguns serviços e atividades, como o processo de deployment de um pacote ou subida de um projeto para a produção.


image


2) Quando vamos criar nosso serviço no Windows Azure, podemos também criar um Marketplace para nossa oferta de serviço para o mercado, veja:


image


Através da opção “Create Marketplace Listing”, podemos criar nossa entrada para o Pinpoint, conforme anunciado durante o pdc09. Infelizmente, ainda não temos esse serviço disponível para o Brasil, mas vamos aguardar!


3) Para a construção de projetos Code Far, ou seja, aplicações
on-premise que acessam dados no SQL Azure, podemos configurar a faixa de endereços IP de estações cliente que podem acessar nosso serviço, um recurso muito perguntado pelo mercado em CTPs anteriores:


image


4) Para a administração do SQL Azure Database, podemos usar o SQL Server Management Studio 2008 R2, que agora tem suporte para o serviço Azure.


O CTP de novembro do SSMS já está disponível para download no link abaixo:


SQL Server 2008 R2 November CTP
Ref.: http://www.microsoft.com/sqlserver/2008/en/us/r2.aspx


5) Finalmente, a migração de bases de dados locais para o SQL Azure está bem mais fácil com a ferramenta SQL Azure Migration Wizard. Fiz vários testes com a versão 1.9 e o processo rodou sem problemas em todos eles.


Primeiro, você conecta ao servidor SQL local, selecionando a base para migração desejada. O passo seguinte da ferramenta é uma análise de compatibilidade sobre a base e os objetos presentes, gerando um relatório de conferência:


image


Podemos configurar o Migration Wizard com as informações para conexão ao SQL Azure, através do arquivo “SQLAzureMW.exe.config” que se encontra na pasta do executável principal da ferramenta. Algo como:



   1: <?xml version=“1.0” encoding=“utf-8”?>
   2: <configuration>
   3:     <appSettings>
   4:         <add key=“SQLAzureServerName” value=“tcp:v8gzm8u90h.database.windows.net”/>
   5:         <add key=“SQLAzureUserName” value=“wcamb@v8gzm8u90h”/>
   6:         <add key=“SQLAzurePassword” value=“****************”/>
   7:  
   8:         <add key=“NotSupportedByAzureFileName” value=“NotSupportedByAzureFile.Config” />
   9:  
  10:         <add key=“TimeBetweenChunks” value=“15000”/> <!– Number of miliseconds to sleep between BCP chuncks –>
  11:         <add key=“ChunkSize” value=“250000”/>        <!– Number of records to process per BCP itteration –>
  12:         <add key=“BCPArgsIn” value=“{0} in {1} -E -q -n -b 5000”/>
  13:         <add key=“BCPArgsOut” value=“{0} out {1} -E -q -n”/>
  14:  
  15:         <!– General Options –>
  16:         <add key=“ScriptDefaults” value=“true”/>
  17:         <add key=“ScriptHeaders” value=“false”/>
  18:         <add key=“IncludeIfNotExists” value=“true”/>
  19:  
  20:         <!– Table / View Options –>
  21:         <add key=“ScriptCheckConstraints” value=“true”/>
  22:         <add key=“ScriptForeignKeys” value=“true”/>
  23:         <add key=“ScriptPrimaryKeys” value=“true”/>
  24:         <add key=“ScriptUniqueKeys” value=“true”/>
  25:         <add key=“ScriptIndexes” value=“true”/>
  26:         <add key=“ScriptData” value=“true”/>
  27:  
  28:         <!– Check For Options–>
  29:         <add key=“ActiveDirectorySP” value=“false”/>
  30:         <add key=“BackupandRestoreTable” value=“false”/>
  31:         <add key=“ChangeDataCapture” value=“false”/>
  32:         <add key=“CheckAll” value=“true”/>
  33:         <add key=“CursorSPs” value=“false”/>
  34:         <add key=“DatabaseEngineSP” value=“false”/>
  35:         <add key=“DatabaseMailSP” value=“false”/>
  36:         <add key=“DatabaseMaintenancePlan” value=“false”/>
  37:         <add key=“DataControl” value=“false”/>
  38:         <add key=“DistributedQueriesSP” value=“false”/>
  39:         <add key=“FullTextSearchSP” value=“false”/>
  40:         <add key=“GeneralExtendedSPs” value=“false”/>
  41:         <add key=“GeneralTSQL” value=“true”/>
  42:         <add key=“IntegrationServicesTable” value=“false”/>
  43:         <add key=“LogShipping” value=“false”/>
  44:         <add key=“MetadataFunction” value=“false”/>
  45:         <add key=“OLEAutomationSP” value=“false”/>
  46:         <add key=“OLEDBTable” value=“false”/>
  47:         <add key=“ProfilerSP” value=“false”/>
  48:         <add key=“ReplicationSP” value=“false”/>
  49:         <add key=“ReplicationTable” value=“false”/>
  50:         <add key=“RowsetFunction” value=“false”/>
  51:         <add key=“SecurityFunction” value=“false”/>
  52:         <add key=“SecuritySP” value=“false”/>
  53:         <add key=“SQLMailSP” value=“false”/>
  54:         <add key=“SQLServerAgentSP” value=“false”/>
  55:         <add key=“SQLServerAgentTable” value=“false”/>
  56:         <add key=“SystemCatalogView” value=“false”/>
  57:         <add key=“SystemFunction” value=“false”/>
  58:         <add key=“SystemStatisticalFunction” value=“false”/>
  59:         <add key=“Unclassified” value=“false”/>
  60:     </appSettings>
  61: </configuration>

A partir dessa configuração e da análise de compatibilidade, a ferramenta faz o processo de upload da base de dados e seus objetos, direto para o SQL Azure Database.


Ao final, um novo relatório é gerado para nossa conferência:


image


Veja abaixo um relatório gerado para o upload da base Northwind para o SQL Azure Database:



   1: Process starting …
   2:  — Success: CREATE NONCLUSTERED INDEX [CategoryName] ON [dbo].[Categories]  …
   3:  
   4: Uploading data to “Northwind.dbo.Categories
   5: ****
   6: Copied 8 of 8 (100%)
   7: Clock Time (ms.) Total     : 1357   Average : (5.90 rows per sec.)
   8:  
   9:  — Success: CREATE TABLE [dbo].[CustomerDemographics]( …
  10:  — Success: CREATE NONCLUSTERED INDEX [Region] ON [dbo].[Customers]  …
  11:  
  12: Uploading data to “Northwind.dbo.Customers
  13: ***
  14: Copied 91 of 91 (100%)
  15: Clock Time (ms.) Total     : 780    Average : (116.67 rows per sec.)
  16:  
  17:  — Success: CREATE TABLE [dbo].[CustomerCustomerDemo]( …
  18:  — Success: ALTER TABLE [dbo].[CustomerCustomerDemo]  WITH CHECK ADD  CONSTRAINT [ …
  19:  — Success: ALTER TABLE [dbo].[CustomerCustomerDemo] CHECK CONSTRAINT [FK_Customer …
  20:  — Success: ALTER TABLE [dbo].[CustomerCustomerDemo]  WITH CHECK ADD  CONSTRAINT [ …
  21:  — Success: ALTER TABLE [dbo].[CustomerCustomerDemo] CHECK CONSTRAINT [FK_Customer …
  22:  — Success: CREATE NONCLUSTERED INDEX [PostalCode] ON [dbo].[Employees]  …
  23:  
  24: Uploading data to “Northwind.dbo.Employees
  25: ****
  26: Copied 9 of 9 (100%)
  27: Clock Time (ms.) Total     : 1607   Average : (5.60 rows per sec.)
  28:  
  29:  — Success: ALTER TABLE [dbo].[Employees]  WITH NOCHECK ADD  CONSTRAINT [FK_Employ …
  30:  — Success: ALTER TABLE [dbo].[Employees]  WITH NOCHECK ADD  CONSTRAINT [FK_Employ …
  31:  — Success: ALTER TABLE [dbo].[Employees] CHECK CONSTRAINT [FK_Employees_Employees …
  32:  — Success: ALTER TABLE [dbo].[Employees]  WITH NOCHECK ADD  CONSTRAINT [CK_Birthd …
  33:  — Success: ALTER TABLE [dbo].[Employees] CHECK CONSTRAINT [CK_Birthdate] …
  34:  — Success: CREATE TABLE [dbo].[Region]( …
  35:  
  36: Uploading data to “Northwind.dbo.Region
  37: **
  38: Copied 4 of 4 (100%)
  39: Clock Time (ms.) Total     : 343    Average : (11.66 rows per sec.)
  40:  
  41:  — Success: CREATE TABLE [dbo].[Territories]( …
  42:  
  43: Uploading data to “Northwind.dbo.Territories
  44: ***
  45: Copied 53 of 53 (100%)
  46: Clock Time (ms.) Total     : 639    Average : (82.94 rows per sec.)
  47:  
  48:  — Success: ALTER TABLE [dbo].[Territories]  WITH CHECK ADD  CONSTRAINT [FK_Territ …
  49:  — Success: ALTER TABLE [dbo].[Territories] CHECK CONSTRAINT [FK_Territories_Regio …
  50:  — Success: CREATE TABLE [dbo].[EmployeeTerritories]( …
  51:  
  52: Uploading data to “Northwind.dbo.EmployeeTerritories
  53: **
  54: Copied 49 of 49 (100%)
  55: Clock Time (ms.) Total     : 359    Average : (136.49 rows per sec.)
  56:  
  57:  — Success: ALTER TABLE [dbo].[EmployeeTerritories]  WITH CHECK ADD  CONSTRAINT [F …
  58:  — Success: ALTER TABLE [dbo].[EmployeeTerritories] CHECK CONSTRAINT [FK_EmployeeT …
  59:  — Success: ALTER TABLE [dbo].[EmployeeTerritories] CHECK CONSTRAINT [FK_EmployeeT …
  60:  — Success: ALTER TABLE [dbo].[EmployeeTerritories]  WITH CHECK ADD  CONSTRAINT [F …
  61:  — Success: ALTER TABLE [dbo].[EmployeeTerritories] CHECK CONSTRAINT [FK_EmployeeT …
  62:  — Success: CREATE NONCLUSTERED INDEX [PostalCode] ON [dbo].[Suppliers]  …
  63:  
  64: Uploading data to “Northwind.dbo.Suppliers
  65: ***
  66: Copied 29 of 29 (100%)
  67: Clock Time (ms.) Total     : 608    Average : (47.70 rows per sec.)
  68:  
  69:  — Success: CREATE NONCLUSTERED INDEX [SuppliersProducts] ON [dbo].[Products]  …
  70:  
  71: Uploading data to “Northwind.dbo.Products
  72: ***
  73: Copied 77 of 77 (100%)
  74: Clock Time (ms.) Total     : 562    Average : (137.01 rows per sec.)
  75:  
  76:  — Success: ALTER TABLE [dbo].[Products]  WITH NOCHECK ADD  CONSTRAINT [FK_Product …
  77:  — Success: ALTER TABLE [dbo].[Products] CHECK CONSTRAINT [FK_Products_Categories] …
  78:  — Success: ALTER TABLE [dbo].[Products]  WITH NOCHECK ADD  CONSTRAINT [FK_Product …
  79:  — Success: ALTER TABLE [dbo].[Products] CHECK CONSTRAINT [FK_Products_Suppliers] …
  80:  — Success: ALTER TABLE [dbo].[Products]  WITH NOCHECK ADD  CONSTRAINT [CK_Product …
  81:  — Success: ALTER TABLE [dbo].[Products] CHECK CONSTRAINT [CK_Products_UnitPrice] …
  82:  — Success: ALTER TABLE [dbo].[Products] CHECK CONSTRAINT [CK_Products_UnitPrice] …
  83:  — Success: ALTER TABLE [dbo].[Products]  WITH NOCHECK ADD  CONSTRAINT [CK_Reorder …
  84:  — Success: ALTER TABLE [dbo].[Products] CHECK CONSTRAINT [CK_ReorderLevel] …
  85:  — Success: ALTER TABLE [dbo].[Products]  WITH NOCHECK ADD  CONSTRAINT [CK_UnitsIn …
  86:  — Success: ALTER TABLE [dbo].[Products] CHECK CONSTRAINT [CK_UnitsInStock] …
  87:  — Success: ALTER TABLE [dbo].[Products]  WITH NOCHECK ADD  CONSTRAINT [CK_UnitsOn …
  88:  — Success: ALTER TABLE [dbo].[Products] CHECK CONSTRAINT [CK_UnitsOnOrder] …
  89:  — Success: ALTER TABLE [dbo].[Products] ADD  CONSTRAINT [DF_Products_UnitPrice]   …
  90:  — Success: ALTER TABLE [dbo].[Products] ADD  CONSTRAINT [DF_Products_UnitsInStock …
  91:  — Success: ALTER TABLE [dbo].[Products] ADD  CONSTRAINT [DF_Products_UnitsOnOrder …
  92:  — Success: ALTER TABLE [dbo].[Products] ADD  CONSTRAINT [DF_Products_ReorderLevel …
  93:  — Success: ALTER TABLE [dbo].[Products] ADD  CONSTRAINT [DF_Products_ReorderLevel …
  94:  — Success: ALTER TABLE [dbo].[Products] ADD  CONSTRAINT [DF_Products_Discontinued …
  95:  — Success: CREATE TABLE [dbo].[Shippers]( …
  96:  
  97: Uploading data to “Northwind.dbo.Shippers
  98: **
  99: Copied 3 of 3 (100%)
 100: Clock Time (ms.) Total     : 359    Average : (8.36 rows per sec.)
 101:  
 102:  — Success: CREATE NONCLUSTERED INDEX [ShipPostalCode] ON [dbo].[Orders]  …
 103:  
 104: Uploading data to “Northwind.dbo.Orders
 105: ****
 106: Copied 830 of 830 (100%)
 107: Clock Time (ms.) Total     : 1763   Average : (470.79 rows per sec.)
 108:  
 109:  — Success: ALTER TABLE [dbo].[Orders]  WITH NOCHECK ADD  CONSTRAINT [FK_Orders_Cu …
 110:  — Success: ALTER TABLE [dbo].[Orders] CHECK CONSTRAINT [FK_Orders_Customers] …
 111:  — Success: ALTER TABLE [dbo].[Orders]  WITH NOCHECK ADD  CONSTRAINT [FK_Orders_Em …
 112:  — Success: ALTER TABLE [dbo].[Orders] CHECK CONSTRAINT [FK_Orders_Employees] …
 113:  — Success: ALTER TABLE [dbo].[Orders]  WITH NOCHECK ADD  CONSTRAINT [FK_Orders_Sh …
 114:  — Success: ALTER TABLE [dbo].[Orders] CHECK CONSTRAINT [FK_Orders_Shippers] …
 115:  — Success: ALTER TABLE [dbo].[Orders] ADD  CONSTRAINT [DF_Orders_Freight]  DEFAUL …
 116:  — Success: ALTER TABLE [dbo].[Orders] ADD  CONSTRAINT [DF_Orders_Freight]  DEFAUL …
 117:  — Success: CREATE NONCLUSTERED INDEX [ProductsOrder_Details] ON [dbo].[Order Deta …
 118:  
 119: Uploading data to “Northwind.dbo.Order Details
 120: ****
 121: Copied 2155 of 2155 (100%)
 122: Clock Time (ms.) Total     : 1794   Average : (1201.23 rows per sec.)
 123:  
 124:  — Success: ALTER TABLE [dbo].[Order Details]  WITH NOCHECK ADD  CONSTRAINT [FK_Or …
 125:  — Success: ALTER TABLE [dbo].[Order Details] CHECK CONSTRAINT [FK_Order_Details_O …
 126:  — Success: ALTER TABLE [dbo].[Order Details]  WITH NOCHECK ADD  CONSTRAINT [FK_Or …
 127:  — Success: ALTER TABLE [dbo].[Order Details] CHECK CONSTRAINT [FK_Order_Details_P …
 128:  — Success: ALTER TABLE [dbo].[Order Details]  WITH NOCHECK ADD  CONSTRAINT [CK_Di …
 129:  — Success: ALTER TABLE [dbo].[Order Details] CHECK CONSTRAINT [CK_Discount] …
 130:  — Success: ALTER TABLE [dbo].[Order Details]  WITH NOCHECK ADD  CONSTRAINT [CK_Qu …
 131:  — Success: ALTER TABLE [dbo].[Order Details] CHECK CONSTRAINT [CK_Quantity] …
 132:  — Success: ALTER TABLE [dbo].[Order Details]  WITH NOCHECK ADD  CONSTRAINT [CK_Un …
 133:  — Success: ALTER TABLE [dbo].[Order Details]  WITH NOCHECK ADD  CONSTRAINT [CK_Un …
 134:  — Success: ALTER TABLE [dbo].[Order Details] CHECK CONSTRAINT [CK_UnitPrice] …
 135:  — Success: ALTER TABLE [dbo].[Order Details] ADD  CONSTRAINT [DF_Order_Details_Un …
 136:  — Success: ALTER TABLE [dbo].[Order Details] ADD  CONSTRAINT [DF_Order_Details_Qu …
 137:  — Success: ALTER TABLE [dbo].[Order Details] ADD  CONSTRAINT [DF_Order_Details_Di …
 138:  — Success: create view “Alphabetical list of products” AS …
 139:  — Success: create view “Product Sales for 1997” AS …
 140:  — Success: create view “Category Sales for 1997” AS …
 141:  — Success: create view “Current Product List” AS …
 142:  — Success: create view “Customer and Suppliers by City” AS …
 143:  — Success: create view Invoices AS …
 144:  — Success: create view Invoices AS …
 145:  — Success: create view “Order Details Extended” AS …
 146:  — Success: create view “Order Subtotals” AS …
 147:  — Success: create view “Orders Qry” AS …
 148:  — Success: create view “Products Above Average Price” AS …
 149:  — Success: create view “Products by Category” AS …
 150:  — Success: create view “Quarterly Orders” AS …
 151:  — Success: create view “Sales by Category” AS …
 152:  — Success: create view “Sales Totals by Amount” AS …
 153:  — Success: create view “Summary of Sales by Quarter” AS …
 154:  — Success: create view “Summary of Sales by Year” AS …
 155:  — Success: create view “Summary of Sales by Year” AS …
 156:  — Success: EXEC dbo.sp_executesql @statement = N’CREATE PROCEDURE CustOrderHist @ …
 157:  — Success: CREATE PROCEDURE CustOrdersDetail @OrderID int …
 158:  — Success: CREATE PROCEDURE CustOrdersOrders @CustomerID nchar(5) …
 159:  — Success: create procedure “Employee Sales by Country”  …
 160:  — Success: create procedure “Sales by Year”  …
 161:  — Success: EXEC dbo.sp_executesql @statement = N’CREATE PROCEDURE SalesByCategory …
 162:  — Success: create procedure “Ten Most Expensive Products” AS …
 163: Processing finished
 164:  

Recomendo conferir essa ferramenta, através do link abaixo:


SQL Azure Migration Wizard v1.9
Ref.: http://sqlazuremw.codeplex.com/


Por último, ainda essa semana, recebi algumas perguntas sobre cenários e casos de utilização/migração de aplicações para a nuvem. De fato, existem vários cenários e patterns que são mais ou menos aplicáveis para nuvem. Muitas empresas e profissionais estão se perguntando quando ir para o Azure e como reconhecer as aplicações mais indicadas.


Um post que ajuda muito nesse estudo foi publicado pelo Otávio semanas atrás e continua sendo uma leitura obrigatória:


Quando usar o Azure?
Ref.: http://blogs.msdn.com/otavio/archive/2009/10/21/quando-usar-o-azure.aspx


Assim, estou preparando alguns novos post para tratar especificamente estes cenários. Em breve teremos novidades aqui no blog, aguardem!


Por enquanto é só! Até o próximo post 🙂


Waldemir