Cloud Application Architecture with SQL Azure and Windows AzureDr. Eduardo Castro MartínezMicrosoft MVPecastro@mswindowscr.orghttp://comunidadwindows.orghttp://ecastrom.blogspot.com
Session ObjectivesProvide a big-picture view of the SQL Server in the CloudProvide a big-picture view of the Windows Azure platformDescribe typical scenarios for using the Windows Azure platform
AgendaCloud Computing PlatformUnderstanding Cloud ComputingCloud Computing Security Cloud Computing and StandardsCreating Cloud Aware ApplicationsWindows Azure Platform
Computing Evolution40’s70’s80’sNowMobility explosion
Collaboration
High level of interconexion between users
Web platform growing
Pressure over companies data centre.4
Issues Facing Developers70% of Web Development Effort is “Muck”: Data Centers Bandwidth / Power / Cooling Operations StaffingScaling is Difficult and Expensive: Large Up-Front Investment Invest Ahead of Demand Load is Unpredictable
Solution: Web-Scale ComputingScale capacity on demandTurn fixed costs into variable costsAlways availableRock-solid reliabilitySimple APIs and conceptual modelsCost-effectiveReduced time to marketFocus on product & core competencies
The Cloud General concepts
Typical Application Grow?UsersUnusedcapacityBuy more of everythingServersRearchitect Database to scale outBuy bigger SQL BoxAdd some Web Servers
Workload Patterns Optimal For Cloud     “On and Off “  “Growing Fast“  InactivityPeriod Compute Compute Average UsageUsageAverageTime Time On & off workloads (e.g. batch job)Over provisioned capacity is wasted Time to market can be cumbersome Successful services needs to grow/scale   Keeping up w/ growth is big IT challenge Complex lead time for deployment“Unpredictable Bursting“  “Predictable Bursting“  Compute Compute Average Usage Average Usage Time Time Unexpected/unplanned peak in demand  Sudden spike impacts performance Can’t over provision for extreme cases Services with micro seasonality trends   Peaks due to periodic increased demandIT complexity and wasted capacity
What is the ‘Cloud’?The Cloud – metaphor for the internet‘Cloud Computing’Exploiting resources ‘out there’Scalable computational powerData management and storageEnabling servicesApplications
What is the ‘Cloud’?The Cloud“Packaged”ApplicationAn application that I buy “off the shelf” and run myselfHosted “Packaged”An application that I buy “off the shelf” and run at a host site“Packaged”Using cloud servicesAn application that I buy “off the shelf” and host using cloud platform“Software as a Service”A hosted application that I buy as a service from a vendorBuyBuild vs. Buy“Custom Built”ApplicationAn application that I develop and run myselfHosted “Custom Built”An application that I develop myself and run at a host site“Custom Built”using cloud services An application that I develop myself and host using cloud platform“Platform as a Service”A vendor hosted development and runtime environmentBuild
3 Cloud Service ModelsCloud Software as a Service (SaaS)Use provider’s applications over a network Cloud Platform as a Service (PaaS)Deploy customer-created applications to a cloud Cloud Infrastructure as a Service (IaaS)Rent processing, storage, network capacity, and other fundamental computing resourcesTo be considered “cloud” they must be deployed on top of cloud infrastructure that has the key characteristics12
Service Model Architectures13
Cloud App Architecture
High Scale Application ArchetypeIntelligent Network Load BalancerNetwork ActivationM Tiers of N stateless machines w/ Forward CachingStateless ‘Worker’ MachinesQueue ActivationShared FilesystemPartitioned Relational DBAsync DispatchQueue‘Monolithic’State Tier
Cloud aware ArchitectureWindows Azure RolesClient ApplicationsSilverlight Application Common Educational ExperiencesService Bus WCFDistributed Cache Workerhttp:// gagame .*Dynamic Worker(tasks uploaded as blobs and sharding)PartitionerWorkerOn PremisesSQL ServerWindows Azure Storage-- - --- - --- - --- - -Queues for communication between clients and rolesTables to record server & partition informationBlobs to store web and worker role resourcesConfigurationStatisticsC# Application on PremisesSQL AzureCastellan Venue DBCastellan Venue DBCastellan Venue DBCastellan Venue DB’sCastellan Venue DB’sCastellan Venue DB’sCommon DB TablesShardingPartitionShardingPartitionShardingPartition...
Sample Cloud Application ArchitectureSource: eleniamapi@yahoo.com
Sample Cloud ArchitectureSource: eleniamapi@yahoo.com
The ‘Why’ and ‘How’ of Cloud MigrationThere are many benefits that explain why to migrate to cloudsCost savings, power savings, green savings, increased agility in software deploymentCloud security issues may drive and define how we adopt and deploy cloud computing solutions19
Balancing Threat Exposure and Cost Effectiveness20Private clouds may have less threat exposure than community clouds which have less threat exposure than public clouds. Massive public clouds may be more cost effective than large community clouds which may be more cost effective than small private clouds. Doesn’t strong security controls mean that I can adopt the most cost effective approach?
21Cloud Migration and Cloud Security ArchitecturesClouds typically have a single security architecture but have many customers with different demandsClouds should attempt to provide configurable security mechanismsOrganizations have more control over the security architecture of private clouds followed by community and then publicThis doesn’t say anything about actual securityHigher sensitivity data is likely to be processed on clouds where organizations have control over the security model
22Putting it TogetherMost clouds will require very strong security controlsAll models of cloud may be used for differing tradeoffs between threat exposure and efficiencyThere is no one “cloud”. There are many models and architectures.How does one choose?
Migration Paths for Cloud AdoptionUse public cloudsDevelop private cloudsBuild a private cloudProcure an outsourced private cloudMigrate data centers to be private clouds (fully virtualized)Build or procure community cloudsOrganization wide SaaSPaaS and IaaSDisaster recovery for private cloudsUse hybrid-cloud technologyWorkload portability between clouds23
Possible Effects ofCloud ComputingSmall enterprises use public SaaS and public clouds and minimize growth of data centersLarge enterprise data centers may evolve to act as private cloudsLarge enterprises may use hybrid cloud infrastructure software to leverage both internal and public cloudsPublic clouds may adopt standards in order to run workloads from competing hybrid cloud infrastructures24
An Overview of the Windows Azure Platform
The Windows Azure PlatformWindows AzureSQL AzureWindows Azure platform AppFabricDeveloper tools
Windows Azure BasicsWindows Azure can potentially provide various kinds of Windows-based environmentsThe current release supports both .NET and unmanaged applicationsWindows Azure provides Operating System like conceptsProcess ManagementComputationStorage
Azure™ Services Platform
A set of connected serversOn which developers can:Install and run servicesStore and retrieve dataWhat Is The Cloud in Windows Azure?
It is an operating system for the cloudIt is designed for utility computingIt has four primary features:Service managementComputeStorageDeveloper experienceWhat Is Windows Azure?
The Windows Azure PlatformSQL AzureCloudApplicationsWindows Azure AppFabricWindows AzureOn-PremisesApplicationsOthersWindows
Windows AzureAn illustrationApplication ComputeStorageConfigFabric…SQL AzureApplicationsWindows Azure AppFabricWindows AzureApplicationsOthersWindows
Windows Azure DatacenterYour ServiceWindows Azure Building BlocksWeb Site(ASPX, ASMX, WCF)Web Site(ASPX, ASMX, WCF)Web Role(ASPX, WCF)LBTablesWorker ServiceWorker RoleInternetStorageQueueLBBlobs
Windows Azure Applications, Storage, and RolesnmWeb RoleWorker RoleLBCloud Storage (blob, table, queue)
Windows Azure, In One PictureBusiness PortalDeveloper PortalService Management ServiceRESTUser Code……Runtime APIStorage ClusterVS ToolsCompute Cluster…WA SDKVM SetupRESTMSFT DatacentersDesktopCloud VM
AzurePartial Trust“Dev Fabric”Dev Environment
Windows Azure Compute Service A closer lookVMsVMsHTTP/ HTTPSWorkerRole InstanceWebRole InstanceLoad BalancerIISApplicationStorage ComputeFabric…
StorageWeb RoleInstanceWorker RoleInstanceFabric  AgentFabric  AgentFabric ControllerWindows Azure Fabric
Cloud Simple ApplicationWorker RoleWeb RoleQueueBlob
Windows Azure for Application DevelopersHostedServicePortalSDKStorageDevelopRunDeploy
RolesRoleCodeConfiguration
Load Balanced InstancesRoleInstance 1http://yourapp.cloudapp.netInstance 2
Web vs Worker RoleWorker RoleWeb RoleSystem HostIIS HostYour CodeYour Code
Compute
Windows Azure Compute ServiceThe VMs are provided by a cloud-optimized hypervisorNot your average VMThey run 64-bit Windows Server 2008Each VM has a one-to-one relationship with a processor coreFor developers:It’s mostly standard Windows and .NETA few things require accessing the Windows Azure Agent, e.g., loggingA desktop facsimile of Windows Azure in the cloud is provided for development via the SDK
Windows Azure Compute Service A closer lookVMsVMsWorkerRole InstanceWebRole InstanceHTTPIISLoad BalancerRoleEntryPoint.Start()AgentAgentWindows Azure FabricApplicationStorage ComputeFabric…
Storage
Windows Azure StorageStorage types:Blobs: a simple hierarchy of binary dataTables: entity storage (not relational tables)Queues: high performance quasi-transactional queue structuresAccess:Data is exposed via a RESTful interfaceData can be accessed by:Windows Azure applicationsAny other internet connected applicationon-premises or other cloud applications
Windows Azure Storage ServiceA closer lookHTTP/ HTTPSRESTServicesBlobsTablesQueuesApplicationStorage ComputeFabric…
Business AnalyticsReportingData SyncDatabase
SQL AzureA relational DB in the cloudSQL Azure DatabaseData HubOthers (Future)Relational database as a serviceHighly available, automatically maintainedExtension of the SQL Server Data Platform.NET ServicesSQL ServicesApplicationsLive ServicesWindows AzureApplicationsWindowsMobileWindowsVista/XPWindowsServerOthers
DatabaseRelational database, provided as a serviceHighly symmetrical development and tooling experience (use TDS protocol and T-SQL)Highly scaled out, on commodity hardwareBuilt on the SQL Server technology foundationBeyond “hosted database”High availability, DB provisioning, and DB management are provided by the servicePay for what you use
SQL Azure DatabaseHighly scaled out relational database as a serviceRelational database serviceSQL Server technology foundation
Highly symmetrical
Highly scaled
Highly secureDatabase “as a Service” – beyond hostingBrowserDatabaseSOAP/RESTHTTP/SADO.NET/REST - EDMHTTP/SMSDatacenterWindows Azure ComputeApp Code(ASP.NET)SQL Server Report Server(on-premises)Customer Value PropsSelf-provisioning and capacity on demand
Symmetry w/ on-premises database platform
Automatic high-availability and fault-tolerance
Automated DB maintenance (infrastructure)
Simple, flexible pricing – “pay as you grow”T-SQL (TDS)T-SQL (TDS)SQL AzureDatabase- AD Federation (LiveId /AppFabric AC)
Application Primary FocusDesigning for the CloudFundamentalsAutomatedServiceManagementHighAvailabilityScale outServicesMulti-tenancyResource Optimization
Transitioning Cloud Driven Process
Transitioning to the cloudMove Entire Applications to the CloudExtend Application Components to the CloudStore Data inthe CloudCreate hybrid applications by Combining Cloud ServicesStart new applications based onCloud Services
Migration Paths for Cloud AdoptionUse public cloudsDevelop private cloudsBuild a private cloudProcure an outsourced private cloudMigrate data centers to be private clouds (fully virtualized)Build or procure community cloudsOrganization wide SaaSPaaS and IaaSDisaster recovery for private cloudsUse hybrid-cloud technologyWorkload portability between clouds57
Infrastructure Transition
Cloud Reference ArchitectureCloud Computing for Financial Institutions. VivekKejriwal
Transitioning Cloud Driven Architectures
Transitioning Cloud Driven Architectures
Transitioning Cloud Driven Architectures
Transitioning Cloud Driven Architectures
Application Architecture for the Cloud
Application Basic Building BlocksnmPresentation RoleService RoleLBCloud Storage (blob, table, queue)65
N-Tier Application TransitionPresentationBusinessMove to the cloudOn PremisesData AccessDataData
N-Tier Application TransitionPresentationBusinessMove to the cloudOn PremisesData AccessDataData
N-Tier Application TransitionPresentationMove to the cloudBusinessMove to the cloudDataData AccessDataOn Premises DataSync
Simple Cloud ApplicationServicesPresentationQueueBlob
Sample Cloud Application ArquitectureCloud Based RolesClient ApplicationsMultimedia Application Common Educational ExperiencesCommunication ServicesCommunication ServicesDistributed Cache Workerhttp:// sophia.*Dynamic Worker(blobs and sharding management)PartitionerWorkerOn PremisesData StorageCloud Storage-- - --- - --- - --- - -Queues for communication between clients and rolesTables to record server & partition informationBlobs to store web and worker role resourcesConfigurationStatisticsApplication on PremisesCloud Relational StorageCastellan Venue DBCastellan Venue DBCastellan Venue DBCastellan Venue DB’sCastellan Venue DB’sCastellan Venue DB’sCommon DB TablesShardingPartitionShardingPartitionShardingPartition...
Service Bus2) Discover endpointsRegistry4) Upgrade to direct connection1) Register endpoints3) Access applicationEndpointsApplicationApplicationOrganization XOrganization YAccess ControlService BusCloud Communication Pattern
Transitioning to the CloudDesign Requirements
Basic cloud development principles
Basic cloud development principles
Cloud Transitioning ArchitectureIdentify PatternsConsider:Basic componentsMessagingInteroperable Message Format and ProtocolsCommunication or Integration BusResource DeploymentStorageInfrastructure (Processing, Creation, …)
Scaling Out using a Queue Based PatternProcess MessageProcess RoleSubmit MessageQueueMsg 1Msg 2Msg 2Msg 1ApplicationWorker RoleProcess RoleMsg 3Msg 4Msg 2
TableIncidentTableQueue AAlarmProcessorPos RptTableNewMsgParse & RouteEventTableTimerTableImplement Queues for Reliability and ContinuityProcessor ATableQueue BProcessor BTable
Building Blocks Key takeawaysUse the cloud provider service configuration to scaleDesign how to communicate your application componentsBuilt your application to scale up/down roles in production
Windows Azure Storage Service
Windows Azure Storage ServiceA closer lookHTTP/ HTTPSBlobsTablesQueuesApplicationStorage ComputeFabric…
Fundamental Storage AbstractionsTables– Provide structured storage.  A Table is a set of entities, which contain a set of propertiesQueues– Provide reliable storage and delivery of messages for an applicationBlobs – Provide a simple interface for storing named files along with metadata for the fileDrives – Provides durable NTFS volumes for Windows Azure applications to use (new)81
Windows Azure StorageTables: StrengthsMassive scalabilityBy effectively allowing scale-out dataPerspective:Applied to the right problem, Windows Azure Tables are a beautiful thingBut they’re not the optimal solution for a majority of data storage scenariosAmazon, Google, and others provide similar cloud storage mechanismsAll of these can be seen as part of the NOSQL movement
Windows Azure StoragePoints of interestStorage types:Blobs: store binary dataTables: provide scale-out, entity-based storageNot relational tablesQueues: allow message-based communicationAccess:Data is grouped into storage accountsData can be accessed by:Windows Azure apps Other on-premises or cloud apps
Windows Azure StorageA closer look at blobsOptions for accessing blobs:From Windows Azure applications or other applications: via RESTful requestsFrom Windows Azure applications: via Windows Azure DrivesDrives make a blob look like an NTFS file system to the applicationBlobs can also be used with the Windows Azure Content Delivery Network (CDN)For faster access from distributed locations to frequently accessed content
Windows Azure StorageA closer look at tables. . .TableTableTableEntity. . .EntityEntityStorage AccountsPropertyPropertyPropertyNameTypeValue
Windows Azure TablesProvides Structured StorageMassively Scalable TablesBillions of entities (rows) and TBs of dataCan use thousands of servers as traffic growsHighly Available & DurableData is replicated several timesFamiliar and Easy to use APIADO.NET Data Services – .NET 3.5 SP1.NET classes and LINQREST – with any platform or language86
Windows Azure StorageTables: ChallengesNo SQLA new approach for developers to learnNo aggregatesAccess via RESTYou can’t use ordinary ADO.NETAn unfamiliar structure for dataYou can’t easily move relational data in or outSupporting services are scarce, e.g., reportingNo schemaAnd no views
Windows Azure StorageA closer look at queuesmain(){  …  }  Web RoleWorker Role1) Receive work4) Do workASP.NET, WCF, etc.2) Put message in queue3) Get message from queue5) Delete message from queueQueue
Windows Azure Tables
Windows Azure TablesProvides Structured StorageMassively Scalable TablesBillions of entities (rows) and TBs of dataCan use thousands of servers as traffic growsHighly Available & DurableData is replicated several timesFamiliar and Easy to use APIADO.NET Data Services – .NET 3.5 SP1.NET classes and LINQREST – with any platform or language90
Table Storage ConceptsEntitiesTablesAccountsEmail  =…Name = …UsersEmail  =…Name = …moviesonlineGenre =…Title    = …MoviesGenre =…Title    = …91
Table Data ModelTableA storage account can create many tablesTable name is scoped by accountSet of entities (i.e. rows)EntitySet of properties (columns)Required propertiesPartitionKey, RowKey and Timestamp92
Required Entity PropertiesPartitionKey & RowKeyUniquely identifies an entityDefines the sort orderUse them to scale your applicationTimestamp Read onlyOptimistic Concurrency93
PartitionKey And PartitionsPartitionKeyUsed to group entities in the table into partitionsA table partition All entities with same partition key valueUnit of scaleControl entity localityRow key provides uniqueness within a partition94
Partitions and Partition RangesServer ATable = Movies[Action - Comedy)Server ATable = MoviesServer BTable = Movies[Comedy-  Western)95
Table OperationsTableCreateQueryDeleteEntitiesInsertUpdate Merge – Partial UpdateReplace – Update entire entityDeleteQueryEntity Group Transaction (new)
Table SchemaDefine the schema as a .NET class[DataServiceKey("PartitionKey", "RowKey")]publicclassMovie    {///<summary>/// Category is the partition key///</summary>publicstringPartitionKey { get; set; }///<summary>/// Title is the row key///</summary>publicstringRowKey { get; set; }publicDateTime Timestamp { get; set; }        publicintReleaseYear { get; set; }publicstring Language { get; set; }publicstring Cast { get; set; }    }97
Table SDK Sample CodeStorageCredentialsAccountAndKeycredentials = newStorageCredentialsAccountAndKey(“myaccount",  “myKey");stringbaseUri = "http://myaccount.table.core.windows.net";CloudTableClienttableClient = newCloudTableClient(baseUri, credentials);tableClient.CreateTable(“Movies");TableServiceContextcontext = tableClient.GetDataServiceContext();CloudTableQuery<Movie> q = (from movie incontext.CreateQuery<Movie>(“Movies") 	wheremovie.PartitionKey == “Action" && movie.RowKey == "The Bourne Ultimatum"	select movie).AsTableServiceQuery<Movie>();MoviemovieToUpdate = q.FirstOrDefault();// Update moviecontext.UpdateObject(movieToUpdate);context.SaveChangesWithRetries();// Add moviecontext.AddObject(new Movie(“Action" , movieToAdd));context.SaveChangesWithRetries();98
Key Selection: Things to ConsiderScalabilityDistribute load as much as possibleHot partitions can be load balancedPartitionKeyis critical for scalabilityQuery Efficiency & SpeedAvoid frequent large scansParallelize queriesEntity group transactions (new)Transactions across a single partitionTransaction semantics & Reduce round trips99
Key Selection: Case Study 1Table for listing all moviesHome page lists movies based on chosen category100
Movie Listing – Solution 1Why do I need multiple PartitionKeys?Account name as Partition Key  Movie title  as RowKey since movie names need to be sortedCategory as a separate propertyDoes this scale?101
Movie Listing – Solution 1Single partition - Entire table served by one serverAll requests served by that single serverDoes not scaleClientClientRequestRequestRequestRequestServer A102
Movie Listing – Solution 2All movies partitioned by categoryAllows system to load balance hot partitionsLoad distributedBetter than single partitionServer AClientClientRequestRequestRequestRequestRequestRequestRequestRequestServer B103
Key Selection: Case Study 2Log every transaction into a table for diagnosticsScale Write Intensive ScenarioLogs can be retrieved for a given time range104
Logging - Solution 1Timestamp as Partition Key Looks like an obvious choiceIt is not a single partition as time moves forward Append onlyRequests to single partition rangeLoad balancingdoesnot helpServer may throttleServer AApplicationsClientServer BRequestRequestRequestRequest105
Logging Solution 2 - Distribute "Append Only”Prefix timestamp such that load is distributedId of the node loggingHash into N bucketsWrite load is now distributed Better throughputTo query logs in time rangeParallelize it across prefix valuesServer AApplicationsClientServer BRequestRequestRequestRequest106
Key Selection: Query Efficiency & SpeedSelect keys that allow fast retrievalReduce scan rangeReduce scan frequency107
Single Entity QueryWhere PartitionKey=‘SciFi’ and  RowKey = ‘Star Trek’Efficient processingNo continuation tokensServer AClientRequestServer BResult108
Table Scan QuerySelect * from Movies where Rating > 4Returns Continuation token1000 movies in result setPartition range boundarySerial Processing: Wait for     continuation  token before     proceedingReturns 1000  moviesPartition range boundary hitServer ACont.Cont.Return continuationClientRequestRequest Cont.Request Cont.Server BCont.109
Make Scans FasterSplit “Select * from Movies where Rating > 4” intoWhere PartitionKey >= “A” and PartitionKey < “D” and Rating > 4Where PartitionKey >= “D” and PartitionKey < “I” and Rating > 4Etc.Execute in parallelEach query handles continuationServer ACont.Cont.RequestClientRequestRequestServer BCont.110
Query SpeedFastSingle PartitionKey and RowKey with equalityMediumSingle partition but a small range for RowKeyEntire partition or table that is smallSlowLarge single scanLarge table scan“OR” predicates on keys => no query optimization => results in scanExpect continuation token for all except in 1111
Make Queries FasterLarge ScansSplit the range and parallelize queriesCreate and maintain own views that help queries“Or” PredicatesExecute individual query in parallel instead of using “OR”User InteractiveCache the result to reduce scan frequency112
Expect Continuation Tokens – Seriously!Maximum of 1000 rows in a responseAt the end of partition range boundaryMaximum of 5 seconds to execute the query113
Entity Group Transactions (EGT) (new)Atomically perform multiple insert/update/deleteover entities in same partition in a single transactionMaximum of 100 commands in a single transaction and payload < 4 MBADO.Net Data ServiceUse SaveChangesOptions.Batch114
Key Selection: Entity Group TransactionCase StudyMaintain user account informationAccount ID, User Name, Address, Number of rentalsMaintain information of checked out rentalsAccount ID, Movie Title, Check out date, Due dateSolution 1 – Maintain two tables – Users & Rentals Handle Cross table consistencyInsert into Rentals table succeedsUpdate to Users table failsQueue to maintain consistency115
Solution 2Store Account Information and Rental details in same tableMaintain same PartitionKey to enforce transactionsAccount ID as  PartitionKeyUpdate total count and Insert new rentals using Entity Group TransactionPrefix RowKey with “Kind” code: A = Account, R = RentalRow key for account info: [Kind Code]_[AccountId]Row Key for rental info: [Kind Code]_[Title]Rental Properties not set for Account row and vice versa116
Best PracticesSelect PartitionKey and RowKey that help scaleEfficient for frequently used queriesSupports batch transactionsDistributes loadDistribute “Append only” patterns using prefix to PartitionKeyAlways Handle continuation tokensClient can maintain their own cache/views instead of frequent scansFuture Feature - Secondary IndexExecute parallel queries instead of “OR” predicatesImplement back-off strategy for retries117
Windows Azure QueuesQueue are performance efficient, highly available and provide reliable message deliverySimple, asynchronous work dispatchProgramming semantics ensure that a message can be processed at least onceAccess is provided via REST118
Queue Storage ConceptsMessagesQueuesAccounts128 x 128 http://...thumbnailjobs256 x 256 http://...sallyhttp://...traverselinkshttp://...119
Account, Queues and MessagesAn account can create many queuesQueue Name is scoped by the accountA Queue contains messagesNo limit on number of messages stored in a queueSet a limit for message expirationMessagesMessage size  <= 8 KBTo store larger data, store data in blob/entity storage, and the blob/entity name in the messageMessage now has dequeue count120
Queue OperationsQueueCreate QueueDelete QueueList QueuesGet/Set Queue MetadataMessagesAdd Message (i.e. Enqueue Message)Get Message(s) (i.e. Dequeue Message)Peek Message(s)Delete Message121
Queue Programming ApiCloudQueueClientqueueClient = newCloudQueueClient(baseUri, credentials);CloudQueue queue = queueClient.GetQueueReference("test1");queue.CreateIfNotExist();//MessageCount is populated via FetchAttributesqueue.FetchAttributes();CloudQueueMessage message = newCloudQueueMessage("Some content");queue.AddMessage(message);message = queue.GetMessage(TimeSpan.FromMinutes(10) /*visibility timeout*/);//Process the message here …queue.DeleteMessage(message);122
Removing Poison MessagesProducersConsumersC1P21. GetMessage(Q, 30 s)  msg 1211111213403011211020C2P12. GetMessage(Q, 30 s)  msg 2123
Removing Poison MessagesProducersConsumers11C1P21. GetMessage(Q, 30 s)  msg 15. C1 crashed4011213012111236. msg1 visible 30 s after Dequeue21C2P12. GetMessage(Q, 30 s)  msg 23. C2 consumed msg 24. DeleteMessage(Q, msg 2)7. GetMessage(Q, 30 s)  msg 1124
Removing Poison MessagesProducersConsumers1. Dequeue(Q, 30 sec)  msg 15. C1 crashed10.  C1 restarted11.  Dequeue(Q, 30 sec)  msg 112.  DequeueCount > 213.  Delete (Q, msg1)C1P2401230131213312C2P16. msg1 visible 30s after Dequeue9. msg1 visible 30s after Dequeue2. Dequeue(Q, 30 sec)  msg 23. C2 consumed msg 24. Delete(Q, msg 2)7. Dequeue(Q, 30 sec)  msg 18. C2 crashed125
Best Practices & SummaryMake message processing idempotentNo need to deal with failuresDo not rely on orderInvisible messages result in out of orderUse Dequeue count to remove poison messagesEnforce threshold on message’s dequeue countUse message count to dynamically increase/reduce workersUse blob to store message data with reference in messageMessages > 8KBBatch messagesGarbage collect orphaned blobs126
Storage SummaryTableScalable & Reliable Structured Storage SystemPartitioning is critical to scalabilityEntity Group Transactions (new)QueueScalable & Reliable Messaging System Dequeue count returned with message (new)Use back-off strategy on retriesOfficial Storage Client Library (new)127
What is “SQL Azure”?
Review – Conceptual modelSubscription Used to map service usage to the billing instrumentUsers may have many subscriptionsLogical ServerAkin to SQL Server InstanceUnit of Geo-Location & Billing1:1 Subscription & serverUser DatabaseRestricted T-SQL surface areaAdditional catalog views provided e.g. sys.billing, sys.firewall_rules, etc
SQL AzureA relational DB in the cloudSQL Azure DatabaseData HubOthers (Future)Relational database as a serviceHighly available, automatically maintainedExtension of the SQL Server Data Platform.NET ServicesSQL ServicesApplicationsLive ServicesWindows AzureApplicationsWindowsMobileWindowsVista/XPWindowsServerOthers
SQL Azure DatabaseSingle LogicalDatabaseMultiple PhysicalReplicasReplica 1Single PrimaryReplica 2DB-     Based on SQL Server 2008 R2 engineUse same tools and data access frameworksSix global datacentersHigh Availability & RedundancyReads are completed at the primaryWrites are replicated to a quorum of secondariesReplica 3MultipleSecondaries
Extending SQL Server Data Platform to the CloudData SyncReference DataDatabaseSymmetric Programming ModelData Hub AggregationInitial services – core RDBMS capabilities with SQL Azure Database, Data Sync
Future Offerings
Additional data platform capabilities: Reporting, BI
New services: Reference DataThe New SQL Data ServicesClear Feedback: “I want a database in the Cloud”Familiar SQL Server relational modelUses existing APIs & toolsBuilt for the Cloud with availability and scaleAccessible to all from PHP, Ruby, and JavaFocus on combining the best features of SQL Server running at scale with low friction
The Evolution of SDSEvolvesBrowserApplicationApplicationApplicationBrowserApplicationApplicationODBC, OLEDB, ADO.Net PHP, Ruby, …REST ClientSQL Client*REST ClientCloudCloudWindows AzureREST (Astoria)Web AppADO.Net + EFREST ClientHTTP+RESTHTTP+RESTHTTPTDSHTTPWindows AzureWeb AppSQL Client*Data CenterData CenterTDS + TSQL ModelREST/SOAP + ACE ModelSDS NextSDS Current* Client access enabled using TDS for ODBC,    ADO.Net, OLEDB, PHP-SQL, Ruby, …
SQL AzureSQL Azure DatabaseOthers (Future)SQL AzureApplicationsWindows Azure AppFabricWindows AzureApplicationsOthersWindows
SQL Azure DatabaseAn IllustrationSQL Azure DatabaseDatabaseTDSApplicationDatabaseDatabaseSQL Azure DatabaseOthers (Future)
SQL Azure DatabaseUsing one or multiple databasesSQL Azure DatabaseDatabaseApplicationMax database size is 50 GBDatabaseDatabaseApplicationDatabase
SQL Azure Network TopologyApplications use standard SQL client libraries: ODBC, ADO.Net, PHP, …ApplicationInternetAzure CloudTDS (tcp)Security BoundaryLoad balancer forwards ‘sticky’ sessions to TDS protocol tierLBTDS (tcp)GatewayGatewayGatewayGatewayGatewayGatewayGateway: TDS protocol gateway, enforces AUTHN/AUTHZ policy; proxy to CloudDBTDS (tcp)SQLSQLSQLSQLSQLSQLScalability and Availability: Fabric, Failover, Replication, and  Load balancing
TDS GatewayTDS ListenerCapability negotiationTDS Packet inspectionSecurityLogical->Physical mapping via metadata catalogEnabler for multi-tenet capabilitiesIsolation layer
TDS Gateway LayeringGateway ProcessTDS EndpointAdminSvc EndpointProvisioning EndpointProtocol ParserBusiness Logic ServicesConnection MgmtSQLSQLSQLSQLSQLSQLScalability and Availability: Fabric, Failover, Replication, and  Load balancing
Provisioning SubscriptionCoordinated across all Azure servicesExecuted in parallel w/retriesServerMay occur between data centersPoint where Geo-location is establishedDatabaseAlways occurs within a single data centerCross node operations executed during this process e.g. add new db to sys.databases on the master
Server ProvisioningDriven by administrator PortalProvision request is sent to GatewayMetadata catalog entry createdDNS record (CNAME) created within LiveDNS serviceMaster DB createdOn completion metadata catalog updated
SQL Azure Server ProvisioningLive DNS ClusterCustomer BrowserLive DNS SvcDatacenter (Sub-Region)15Portal LBGateway LB2436Front-end NodeFront-end NodeFront-end NodeFront-end NodeGateway Gateway Admin Portal Admin Portal 7Backend NodeBackend NodeBackend NodeSQL ServerSQL ServerSQL ServerMgmt. ServicesMgmt. ServicesMgmt. ServicesFabricFabricFabric
Database ProvisioningGateway performs stateful TDS packet inspectionPicks out subset of messagesParses out args for create databaseMakes entry into Gateway metadata catalogUnused replica set located and reservedReplica set (UserDB) is prepped for use Metadata catalog is updated
SQL Azure Database provisioningTDS Gateway1Front-end NodeProtocol ParserTDS Session23Gateway LogicMaster NodeMaster ClusterMaster Node Components47568Backend Node 1Backend Node 2Backend Node 3SQL InstanceSQL InstanceSQL InstanceSQL DBSQL DBSQL DBScalability and Availability: Fabric, Failover, Replication, and  Load balancingScalability and Availability: Fabric, Failover, Replication, and  Load balancing
SQL Azure Login ProcessLogin request arrives at the GatewayGateway locates MasterDb & UserDb replica setsCredentials are validated against MasterDbTDS session is opened to UserDB and requests are forwarded
SQL Azure Login ProcessTDS Gateway71Front-end NodeProtocol ParserTDS Session26Gateway LogicMaster NodeGlobal Partition MapMaster Node Components3845Backend Node 1Backend Node 2Backend Node 3SQL InstanceSQL InstanceSQL InstanceSQL DBSQL DBSQL DBScalability and Availability: Fabric, Failover, Replication, and  Load balancingScalability and Availability: Fabric, Failover, Replication, and  Load balancing
Service ResilienceProvisioningState machines used to coordinate activities across node (and datacenter) boundariesFailed provisioning attempts cleaned automatically after 10 minutesLoginFailovers during the login will be transparent (<30 seconds)Metadata catalog refresh occurs automaticallyActive SessionSurface as connection drops (due to state)
Monitoring Service HealthMetricsCluster wide performance counters gather key metrics on the serviceUsed to alert Operations to issues before they become a problemEarly warning systemCode issuesCapacity warningsHealthExercises the service routinely looking for problemsWhen issues are encountered runs deep diagnosticsNetwork connectivity at the node levelValidate all dependent services (Live DNS, Live ID, etc)Monitoring from other MSFT DC’sValidates accessibility from multiple geographic locationsAlerts fired automatically when test jobs fail
Security/Attack ConsiderationsService Secure channel required (SSL)Denial Of Service trend trackingPacket InspectionServer IP allow list (Firewall) Idle connection cullingGenerated server names DatabaseDisallow the most commonly attacked user id’s (SA, Admin, root, guest, etc) Standard SQL Authn/Authz mode
What’s New In SQL Azure CTPEnhancementsSQL Azure DatabaseWindows Azure Platform – Developer PortalEnhanced user experience and reportingDatabase manager for SQL AzureSQL Azure Reporting CTPReporting and BI on SQL Azure databasesBased on SQL Server Reporting ServicesSQL Azure Data Sync CTP2Synchronize SQL Azure databasesSynchronize SQL Azure with on-premises SQL Server
What’s New In SQL Azure CTPEnhancementsSQL Azure DatabaseWindows Azure Platform – Developer PortalEnhanced user experience and reportingDatabase manager for SQL AzureSQL Azure Reporting CTPReporting and BI on SQL Azure databasesBased on SQL Server Reporting ServicesSQL Azure Data Sync CTP2Synchronize SQL Azure databasesSynchronize SQL Azure with on-premises SQL Server
What’s New In SQL Azure CTPEnhancementsSQL Azure DatabaseWindows Azure Platform – Developer PortalEnhanced user experience and reportingDatabase managementSQL Azure Reporting CTPReporting and BI on SQL Azure databasesBased on SQL Server Reporting ServicesSQL Azure Data Sync CTP2Synchronize SQL Azure databasesSynchronize SQL Azure with on-premises SQL Server
SQL Azure Reporting CTPFeatures:Based on SQL Server Reporting ServicesInteractive and tabular reportingData visualizations: charts, graphs, mapping, gaugesSQL Azure Database data sourcesUtilizes BI Developer Studio (free) to author reportsExport to Excel, PDF, CSV formatsCore scenarios:Operational reporting on SQL Azure dataEmbed reports into Windows Azure or on-premises applications Web RoleReporting“Introduction to SQL Azure Reporting”
What’s New In SQL AzureEnhancementsSQL Azure DatabaseWindows Azure Platform – Developer PortalEnhanced user experience and reportingDatabase managementSQL Azure Reporting CTPReporting and BI on SQL Azure databasesBased on SQL Server Reporting ServicesSQL Azure Data Sync CTP2Synchronize SQL Azure databasesSynchronize SQL Azure with on-premises SQL Server
SQL Azure Data Sync CTP2Elastic ScaleService scales as resources requirements growNo-Code Sync ConfigurationEasily define data to be synchronizedSchedule SyncChoose how often data is synchronizedConflict HandlingHandle issues where same data is changed in multiple locationsLogging and MonitoringAdministration capabilities for tracking data and monitoring potential issuesCTP 1CTP 2“Introduction to SQL Azure Data Sync”
SQL Azure Data Sync – A Closer LookCTP 2On PremisesWindows AzureData Sync ServiceLocal AgentSync OrchestratorSync OrchestratorHTTPSSQL Server Sync ProviderSQL Server Proxy ProviderSQL ServerProviderTDSSQL ServerSQL Azure
SQL Azure Data Sync – Example Use CasesMove workloads in stages preserving existing infrastructureMove part of the application and sync its dataMeet compliance and regulationsControl data synchronized off-premisesEnable scale-out read or read/writeMultiple synchronized databases for scalabilityPreserve data – geo replication of dataEnable new scenariosSpanning enterprise, cloud and remote offices/retail stores
SQL Azure Data Sync – RoadmapSQL Azure DatabaseNowSyncSyncData Sync Service For SQL AzureRemote OfficesRetail StoresSyncSyncSyncSyncSyncCTP2 – End of CY10On-Premises (Headquarters)
New SQL Azure Usage ScenariosFully featured Windows Azure PlatformApplicationData SyncWeb RoleReporting
New SQL Azure Usage ScenariosFully featured Windows Azure PlatformApplicationGlobally available,cloud & on-premisesdata synchronizationData SyncData SyncGeo-replication of data across Windows Azure Platform datacentersWeb RoleReportingCorporate OfficeBranch Office or RetailDatacenterSynchronize multiple on-premises SQL Server databases in different locations
RoadmapNowVisit www.microsoft.com/sqlazure to register for upcoming CTP access2010New Windows Azure Developer Portal; Database ManagerLimited CTPs of Data Sync CTP2, Reporting CTPWatch for PDC Announcements; visit the SQL Azure blog and website2011Backup & RestoreSQL Azure ReportingSQL Azure Data Sync
Windows Azure AppFabricInfrastructure in the cloudService BusAccess ControlSQL AzureApplications?Windows Azure AppFabricWindows AzureApplicationsOthersWindows
Service Bus3) Discover Service Bus endpoint1) Register service  endpoint Registry2) Expose Service Bus endpoint5) Invoke operation on service endpoint4) Invoke operation on Service Bus endpointClient (On-premises or cloud)WCF Service(On-premises)Service BusAccess ControlIllustrating Service Bus
Windows Azure Platform PricingA summary (in US dollars)Compute: $0.12 to $0.96/hour for each role instance depending on instance size                      Storage:	Windows Azure blobs and tables:Data: $0.15/GB per monthAccess: $0.01/10,000 operationsSQL Azure relational:$9.99/month per GBBandwidth: Americas/Europe: $0.10/GB in, $0.15/GB outAsia/Pacific: $0.30/GB in, $0.45/GB out
Service Level AgreementsKey points: Windows Azure computeWhen you deploy two or more role instances in different fault and upgrade domains, your Internet-facing roles will have external connectivity at least 99.95% of the timeMicrosoft will detect within two minutes when a role instance’s process is not running and initiate corrective action
Service Level AgreementsKey points: Windows Azure storageAt least 99.9% of the time, Microsoft will successfully process correctly formatted requests to add, update, read and delete dataAt least 99.9% of the time, your storage accounts will have connectivity to Microsoft’s Internet gateway
Service Level AgreementsKey points: SQL Azure databaseSQL Azure will maintain a Monthly Availability of 99.9% during a calendar month. Monthly Availability percentage for a specific customer database is the ratio of the time the database was available to customer to the total time in a month. An interval is marked as unavailable if the customer’s attempts to connect to a database are rejected by the SQL Azure gateway.
Using the Windows Azure Platform: Scenarios

Cloud application architecture with sql azure and windows azure

  • 1.
    Cloud Application Architecturewith SQL Azure and Windows AzureDr. Eduardo Castro MartínezMicrosoft MVPecastro@mswindowscr.orghttp://comunidadwindows.orghttp://ecastrom.blogspot.com
  • 2.
    Session ObjectivesProvide abig-picture view of the SQL Server in the CloudProvide a big-picture view of the Windows Azure platformDescribe typical scenarios for using the Windows Azure platform
  • 3.
    AgendaCloud Computing PlatformUnderstandingCloud ComputingCloud Computing Security Cloud Computing and StandardsCreating Cloud Aware ApplicationsWindows Azure Platform
  • 4.
  • 5.
  • 6.
    High level ofinterconexion between users
  • 7.
  • 8.
  • 9.
    Issues Facing Developers70%of Web Development Effort is “Muck”: Data Centers Bandwidth / Power / Cooling Operations StaffingScaling is Difficult and Expensive: Large Up-Front Investment Invest Ahead of Demand Load is Unpredictable
  • 10.
    Solution: Web-Scale ComputingScalecapacity on demandTurn fixed costs into variable costsAlways availableRock-solid reliabilitySimple APIs and conceptual modelsCost-effectiveReduced time to marketFocus on product & core competencies
  • 11.
  • 12.
    Typical Application Grow?UsersUnusedcapacityBuymore of everythingServersRearchitect Database to scale outBuy bigger SQL BoxAdd some Web Servers
  • 13.
    Workload Patterns OptimalFor Cloud “On and Off “ “Growing Fast“ InactivityPeriod Compute Compute Average UsageUsageAverageTime Time On & off workloads (e.g. batch job)Over provisioned capacity is wasted Time to market can be cumbersome Successful services needs to grow/scale Keeping up w/ growth is big IT challenge Complex lead time for deployment“Unpredictable Bursting“ “Predictable Bursting“ Compute Compute Average Usage Average Usage Time Time Unexpected/unplanned peak in demand Sudden spike impacts performance Can’t over provision for extreme cases Services with micro seasonality trends Peaks due to periodic increased demandIT complexity and wasted capacity
  • 14.
    What is the‘Cloud’?The Cloud – metaphor for the internet‘Cloud Computing’Exploiting resources ‘out there’Scalable computational powerData management and storageEnabling servicesApplications
  • 15.
    What is the‘Cloud’?The Cloud“Packaged”ApplicationAn application that I buy “off the shelf” and run myselfHosted “Packaged”An application that I buy “off the shelf” and run at a host site“Packaged”Using cloud servicesAn application that I buy “off the shelf” and host using cloud platform“Software as a Service”A hosted application that I buy as a service from a vendorBuyBuild vs. Buy“Custom Built”ApplicationAn application that I develop and run myselfHosted “Custom Built”An application that I develop myself and run at a host site“Custom Built”using cloud services An application that I develop myself and host using cloud platform“Platform as a Service”A vendor hosted development and runtime environmentBuild
  • 16.
    3 Cloud ServiceModelsCloud Software as a Service (SaaS)Use provider’s applications over a network Cloud Platform as a Service (PaaS)Deploy customer-created applications to a cloud Cloud Infrastructure as a Service (IaaS)Rent processing, storage, network capacity, and other fundamental computing resourcesTo be considered “cloud” they must be deployed on top of cloud infrastructure that has the key characteristics12
  • 17.
  • 18.
  • 19.
    High Scale ApplicationArchetypeIntelligent Network Load BalancerNetwork ActivationM Tiers of N stateless machines w/ Forward CachingStateless ‘Worker’ MachinesQueue ActivationShared FilesystemPartitioned Relational DBAsync DispatchQueue‘Monolithic’State Tier
  • 20.
    Cloud aware ArchitectureWindowsAzure RolesClient ApplicationsSilverlight Application Common Educational ExperiencesService Bus WCFDistributed Cache Workerhttp:// gagame .*Dynamic Worker(tasks uploaded as blobs and sharding)PartitionerWorkerOn PremisesSQL ServerWindows Azure Storage-- - --- - --- - --- - -Queues for communication between clients and rolesTables to record server & partition informationBlobs to store web and worker role resourcesConfigurationStatisticsC# Application on PremisesSQL AzureCastellan Venue DBCastellan Venue DBCastellan Venue DBCastellan Venue DB’sCastellan Venue DB’sCastellan Venue DB’sCommon DB TablesShardingPartitionShardingPartitionShardingPartition...
  • 21.
    Sample Cloud ApplicationArchitectureSource: eleniamapi@yahoo.com
  • 22.
  • 23.
    The ‘Why’ and‘How’ of Cloud MigrationThere are many benefits that explain why to migrate to cloudsCost savings, power savings, green savings, increased agility in software deploymentCloud security issues may drive and define how we adopt and deploy cloud computing solutions19
  • 24.
    Balancing Threat Exposureand Cost Effectiveness20Private clouds may have less threat exposure than community clouds which have less threat exposure than public clouds. Massive public clouds may be more cost effective than large community clouds which may be more cost effective than small private clouds. Doesn’t strong security controls mean that I can adopt the most cost effective approach?
  • 25.
    21Cloud Migration andCloud Security ArchitecturesClouds typically have a single security architecture but have many customers with different demandsClouds should attempt to provide configurable security mechanismsOrganizations have more control over the security architecture of private clouds followed by community and then publicThis doesn’t say anything about actual securityHigher sensitivity data is likely to be processed on clouds where organizations have control over the security model
  • 26.
    22Putting it TogetherMostclouds will require very strong security controlsAll models of cloud may be used for differing tradeoffs between threat exposure and efficiencyThere is no one “cloud”. There are many models and architectures.How does one choose?
  • 27.
    Migration Paths forCloud AdoptionUse public cloudsDevelop private cloudsBuild a private cloudProcure an outsourced private cloudMigrate data centers to be private clouds (fully virtualized)Build or procure community cloudsOrganization wide SaaSPaaS and IaaSDisaster recovery for private cloudsUse hybrid-cloud technologyWorkload portability between clouds23
  • 28.
    Possible Effects ofCloudComputingSmall enterprises use public SaaS and public clouds and minimize growth of data centersLarge enterprise data centers may evolve to act as private cloudsLarge enterprises may use hybrid cloud infrastructure software to leverage both internal and public cloudsPublic clouds may adopt standards in order to run workloads from competing hybrid cloud infrastructures24
  • 29.
    An Overview ofthe Windows Azure Platform
  • 30.
    The Windows AzurePlatformWindows AzureSQL AzureWindows Azure platform AppFabricDeveloper tools
  • 31.
    Windows Azure BasicsWindowsAzure can potentially provide various kinds of Windows-based environmentsThe current release supports both .NET and unmanaged applicationsWindows Azure provides Operating System like conceptsProcess ManagementComputationStorage
  • 32.
  • 33.
    A set ofconnected serversOn which developers can:Install and run servicesStore and retrieve dataWhat Is The Cloud in Windows Azure?
  • 34.
    It is anoperating system for the cloudIt is designed for utility computingIt has four primary features:Service managementComputeStorageDeveloper experienceWhat Is Windows Azure?
  • 35.
    The Windows AzurePlatformSQL AzureCloudApplicationsWindows Azure AppFabricWindows AzureOn-PremisesApplicationsOthersWindows
  • 36.
    Windows AzureAn illustrationApplicationComputeStorageConfigFabric…SQL AzureApplicationsWindows Azure AppFabricWindows AzureApplicationsOthersWindows
  • 37.
    Windows Azure DatacenterYourServiceWindows Azure Building BlocksWeb Site(ASPX, ASMX, WCF)Web Site(ASPX, ASMX, WCF)Web Role(ASPX, WCF)LBTablesWorker ServiceWorker RoleInternetStorageQueueLBBlobs
  • 38.
    Windows Azure Applications,Storage, and RolesnmWeb RoleWorker RoleLBCloud Storage (blob, table, queue)
  • 39.
    Windows Azure, InOne PictureBusiness PortalDeveloper PortalService Management ServiceRESTUser Code……Runtime APIStorage ClusterVS ToolsCompute Cluster…WA SDKVM SetupRESTMSFT DatacentersDesktopCloud VM
  • 40.
  • 41.
    Windows Azure ComputeService A closer lookVMsVMsHTTP/ HTTPSWorkerRole InstanceWebRole InstanceLoad BalancerIISApplicationStorage ComputeFabric…
  • 42.
    StorageWeb RoleInstanceWorker RoleInstanceFabric AgentFabric AgentFabric ControllerWindows Azure Fabric
  • 43.
    Cloud Simple ApplicationWorkerRoleWeb RoleQueueBlob
  • 44.
    Windows Azure forApplication DevelopersHostedServicePortalSDKStorageDevelopRunDeploy
  • 45.
  • 46.
    Load Balanced InstancesRoleInstance1http://yourapp.cloudapp.netInstance 2
  • 47.
    Web vs WorkerRoleWorker RoleWeb RoleSystem HostIIS HostYour CodeYour Code
  • 48.
  • 49.
    Windows Azure ComputeServiceThe VMs are provided by a cloud-optimized hypervisorNot your average VMThey run 64-bit Windows Server 2008Each VM has a one-to-one relationship with a processor coreFor developers:It’s mostly standard Windows and .NETA few things require accessing the Windows Azure Agent, e.g., loggingA desktop facsimile of Windows Azure in the cloud is provided for development via the SDK
  • 50.
    Windows Azure ComputeService A closer lookVMsVMsWorkerRole InstanceWebRole InstanceHTTPIISLoad BalancerRoleEntryPoint.Start()AgentAgentWindows Azure FabricApplicationStorage ComputeFabric…
  • 51.
  • 52.
    Windows Azure StorageStoragetypes:Blobs: a simple hierarchy of binary dataTables: entity storage (not relational tables)Queues: high performance quasi-transactional queue structuresAccess:Data is exposed via a RESTful interfaceData can be accessed by:Windows Azure applicationsAny other internet connected applicationon-premises or other cloud applications
  • 53.
    Windows Azure StorageServiceA closer lookHTTP/ HTTPSRESTServicesBlobsTablesQueuesApplicationStorage ComputeFabric…
  • 54.
  • 55.
    SQL AzureA relationalDB in the cloudSQL Azure DatabaseData HubOthers (Future)Relational database as a serviceHighly available, automatically maintainedExtension of the SQL Server Data Platform.NET ServicesSQL ServicesApplicationsLive ServicesWindows AzureApplicationsWindowsMobileWindowsVista/XPWindowsServerOthers
  • 56.
    DatabaseRelational database, providedas a serviceHighly symmetrical development and tooling experience (use TDS protocol and T-SQL)Highly scaled out, on commodity hardwareBuilt on the SQL Server technology foundationBeyond “hosted database”High availability, DB provisioning, and DB management are provided by the servicePay for what you use
  • 57.
    SQL Azure DatabaseHighlyscaled out relational database as a serviceRelational database serviceSQL Server technology foundation
  • 58.
  • 59.
  • 60.
    Highly secureDatabase “asa Service” – beyond hostingBrowserDatabaseSOAP/RESTHTTP/SADO.NET/REST - EDMHTTP/SMSDatacenterWindows Azure ComputeApp Code(ASP.NET)SQL Server Report Server(on-premises)Customer Value PropsSelf-provisioning and capacity on demand
  • 61.
    Symmetry w/ on-premisesdatabase platform
  • 62.
  • 63.
    Automated DB maintenance(infrastructure)
  • 64.
    Simple, flexible pricing– “pay as you grow”T-SQL (TDS)T-SQL (TDS)SQL AzureDatabase- AD Federation (LiveId /AppFabric AC)
  • 65.
    Application Primary FocusDesigningfor the CloudFundamentalsAutomatedServiceManagementHighAvailabilityScale outServicesMulti-tenancyResource Optimization
  • 66.
  • 67.
    Transitioning to thecloudMove Entire Applications to the CloudExtend Application Components to the CloudStore Data inthe CloudCreate hybrid applications by Combining Cloud ServicesStart new applications based onCloud Services
  • 68.
    Migration Paths forCloud AdoptionUse public cloudsDevelop private cloudsBuild a private cloudProcure an outsourced private cloudMigrate data centers to be private clouds (fully virtualized)Build or procure community cloudsOrganization wide SaaSPaaS and IaaSDisaster recovery for private cloudsUse hybrid-cloud technologyWorkload portability between clouds57
  • 69.
  • 70.
    Cloud Reference ArchitectureCloudComputing for Financial Institutions. VivekKejriwal
  • 71.
  • 72.
  • 73.
  • 74.
  • 75.
  • 76.
    Application Basic BuildingBlocksnmPresentation RoleService RoleLBCloud Storage (blob, table, queue)65
  • 77.
    N-Tier Application TransitionPresentationBusinessMoveto the cloudOn PremisesData AccessDataData
  • 78.
    N-Tier Application TransitionPresentationBusinessMoveto the cloudOn PremisesData AccessDataData
  • 79.
    N-Tier Application TransitionPresentationMoveto the cloudBusinessMove to the cloudDataData AccessDataOn Premises DataSync
  • 80.
  • 81.
    Sample Cloud ApplicationArquitectureCloud Based RolesClient ApplicationsMultimedia Application Common Educational ExperiencesCommunication ServicesCommunication ServicesDistributed Cache Workerhttp:// sophia.*Dynamic Worker(blobs and sharding management)PartitionerWorkerOn PremisesData StorageCloud Storage-- - --- - --- - --- - -Queues for communication between clients and rolesTables to record server & partition informationBlobs to store web and worker role resourcesConfigurationStatisticsApplication on PremisesCloud Relational StorageCastellan Venue DBCastellan Venue DBCastellan Venue DBCastellan Venue DB’sCastellan Venue DB’sCastellan Venue DB’sCommon DB TablesShardingPartitionShardingPartitionShardingPartition...
  • 82.
    Service Bus2) DiscoverendpointsRegistry4) Upgrade to direct connection1) Register endpoints3) Access applicationEndpointsApplicationApplicationOrganization XOrganization YAccess ControlService BusCloud Communication Pattern
  • 83.
    Transitioning to theCloudDesign Requirements
  • 84.
  • 85.
  • 86.
    Cloud Transitioning ArchitectureIdentifyPatternsConsider:Basic componentsMessagingInteroperable Message Format and ProtocolsCommunication or Integration BusResource DeploymentStorageInfrastructure (Processing, Creation, …)
  • 87.
    Scaling Out usinga Queue Based PatternProcess MessageProcess RoleSubmit MessageQueueMsg 1Msg 2Msg 2Msg 1ApplicationWorker RoleProcess RoleMsg 3Msg 4Msg 2
  • 88.
    TableIncidentTableQueue AAlarmProcessorPos RptTableNewMsgParse& RouteEventTableTimerTableImplement Queues for Reliability and ContinuityProcessor ATableQueue BProcessor BTable
  • 89.
    Building Blocks KeytakeawaysUse the cloud provider service configuration to scaleDesign how to communicate your application componentsBuilt your application to scale up/down roles in production
  • 90.
  • 91.
    Windows Azure StorageServiceA closer lookHTTP/ HTTPSBlobsTablesQueuesApplicationStorage ComputeFabric…
  • 92.
    Fundamental Storage AbstractionsTables–Provide structured storage. A Table is a set of entities, which contain a set of propertiesQueues– Provide reliable storage and delivery of messages for an applicationBlobs – Provide a simple interface for storing named files along with metadata for the fileDrives – Provides durable NTFS volumes for Windows Azure applications to use (new)81
  • 93.
    Windows Azure StorageTables:StrengthsMassive scalabilityBy effectively allowing scale-out dataPerspective:Applied to the right problem, Windows Azure Tables are a beautiful thingBut they’re not the optimal solution for a majority of data storage scenariosAmazon, Google, and others provide similar cloud storage mechanismsAll of these can be seen as part of the NOSQL movement
  • 94.
    Windows Azure StoragePointsof interestStorage types:Blobs: store binary dataTables: provide scale-out, entity-based storageNot relational tablesQueues: allow message-based communicationAccess:Data is grouped into storage accountsData can be accessed by:Windows Azure apps Other on-premises or cloud apps
  • 95.
    Windows Azure StorageAcloser look at blobsOptions for accessing blobs:From Windows Azure applications or other applications: via RESTful requestsFrom Windows Azure applications: via Windows Azure DrivesDrives make a blob look like an NTFS file system to the applicationBlobs can also be used with the Windows Azure Content Delivery Network (CDN)For faster access from distributed locations to frequently accessed content
  • 96.
    Windows Azure StorageAcloser look at tables. . .TableTableTableEntity. . .EntityEntityStorage AccountsPropertyPropertyPropertyNameTypeValue
  • 97.
    Windows Azure TablesProvidesStructured StorageMassively Scalable TablesBillions of entities (rows) and TBs of dataCan use thousands of servers as traffic growsHighly Available & DurableData is replicated several timesFamiliar and Easy to use APIADO.NET Data Services – .NET 3.5 SP1.NET classes and LINQREST – with any platform or language86
  • 98.
    Windows Azure StorageTables:ChallengesNo SQLA new approach for developers to learnNo aggregatesAccess via RESTYou can’t use ordinary ADO.NETAn unfamiliar structure for dataYou can’t easily move relational data in or outSupporting services are scarce, e.g., reportingNo schemaAnd no views
  • 99.
    Windows Azure StorageAcloser look at queuesmain(){ … } Web RoleWorker Role1) Receive work4) Do workASP.NET, WCF, etc.2) Put message in queue3) Get message from queue5) Delete message from queueQueue
  • 100.
  • 101.
    Windows Azure TablesProvidesStructured StorageMassively Scalable TablesBillions of entities (rows) and TBs of dataCan use thousands of servers as traffic growsHighly Available & DurableData is replicated several timesFamiliar and Easy to use APIADO.NET Data Services – .NET 3.5 SP1.NET classes and LINQREST – with any platform or language90
  • 102.
    Table Storage ConceptsEntitiesTablesAccountsEmail =…Name = …UsersEmail =…Name = …moviesonlineGenre =…Title = …MoviesGenre =…Title = …91
  • 103.
    Table Data ModelTableAstorage account can create many tablesTable name is scoped by accountSet of entities (i.e. rows)EntitySet of properties (columns)Required propertiesPartitionKey, RowKey and Timestamp92
  • 104.
    Required Entity PropertiesPartitionKey& RowKeyUniquely identifies an entityDefines the sort orderUse them to scale your applicationTimestamp Read onlyOptimistic Concurrency93
  • 105.
    PartitionKey And PartitionsPartitionKeyUsedto group entities in the table into partitionsA table partition All entities with same partition key valueUnit of scaleControl entity localityRow key provides uniqueness within a partition94
  • 106.
    Partitions and PartitionRangesServer ATable = Movies[Action - Comedy)Server ATable = MoviesServer BTable = Movies[Comedy- Western)95
  • 107.
    Table OperationsTableCreateQueryDeleteEntitiesInsertUpdate Merge– Partial UpdateReplace – Update entire entityDeleteQueryEntity Group Transaction (new)
  • 108.
    Table SchemaDefine theschema as a .NET class[DataServiceKey("PartitionKey", "RowKey")]publicclassMovie {///<summary>/// Category is the partition key///</summary>publicstringPartitionKey { get; set; }///<summary>/// Title is the row key///</summary>publicstringRowKey { get; set; }publicDateTime Timestamp { get; set; } publicintReleaseYear { get; set; }publicstring Language { get; set; }publicstring Cast { get; set; } }97
  • 109.
    Table SDK SampleCodeStorageCredentialsAccountAndKeycredentials = newStorageCredentialsAccountAndKey(“myaccount", “myKey");stringbaseUri = "http://myaccount.table.core.windows.net";CloudTableClienttableClient = newCloudTableClient(baseUri, credentials);tableClient.CreateTable(“Movies");TableServiceContextcontext = tableClient.GetDataServiceContext();CloudTableQuery<Movie> q = (from movie incontext.CreateQuery<Movie>(“Movies") wheremovie.PartitionKey == “Action" && movie.RowKey == "The Bourne Ultimatum" select movie).AsTableServiceQuery<Movie>();MoviemovieToUpdate = q.FirstOrDefault();// Update moviecontext.UpdateObject(movieToUpdate);context.SaveChangesWithRetries();// Add moviecontext.AddObject(new Movie(“Action" , movieToAdd));context.SaveChangesWithRetries();98
  • 110.
    Key Selection: Thingsto ConsiderScalabilityDistribute load as much as possibleHot partitions can be load balancedPartitionKeyis critical for scalabilityQuery Efficiency & SpeedAvoid frequent large scansParallelize queriesEntity group transactions (new)Transactions across a single partitionTransaction semantics & Reduce round trips99
  • 111.
    Key Selection: CaseStudy 1Table for listing all moviesHome page lists movies based on chosen category100
  • 112.
    Movie Listing –Solution 1Why do I need multiple PartitionKeys?Account name as Partition Key Movie title as RowKey since movie names need to be sortedCategory as a separate propertyDoes this scale?101
  • 113.
    Movie Listing –Solution 1Single partition - Entire table served by one serverAll requests served by that single serverDoes not scaleClientClientRequestRequestRequestRequestServer A102
  • 114.
    Movie Listing –Solution 2All movies partitioned by categoryAllows system to load balance hot partitionsLoad distributedBetter than single partitionServer AClientClientRequestRequestRequestRequestRequestRequestRequestRequestServer B103
  • 115.
    Key Selection: CaseStudy 2Log every transaction into a table for diagnosticsScale Write Intensive ScenarioLogs can be retrieved for a given time range104
  • 116.
    Logging - Solution1Timestamp as Partition Key Looks like an obvious choiceIt is not a single partition as time moves forward Append onlyRequests to single partition rangeLoad balancingdoesnot helpServer may throttleServer AApplicationsClientServer BRequestRequestRequestRequest105
  • 117.
    Logging Solution 2- Distribute "Append Only”Prefix timestamp such that load is distributedId of the node loggingHash into N bucketsWrite load is now distributed Better throughputTo query logs in time rangeParallelize it across prefix valuesServer AApplicationsClientServer BRequestRequestRequestRequest106
  • 118.
    Key Selection: QueryEfficiency & SpeedSelect keys that allow fast retrievalReduce scan rangeReduce scan frequency107
  • 119.
    Single Entity QueryWherePartitionKey=‘SciFi’ and RowKey = ‘Star Trek’Efficient processingNo continuation tokensServer AClientRequestServer BResult108
  • 120.
    Table Scan QuerySelect* from Movies where Rating > 4Returns Continuation token1000 movies in result setPartition range boundarySerial Processing: Wait for continuation token before proceedingReturns 1000 moviesPartition range boundary hitServer ACont.Cont.Return continuationClientRequestRequest Cont.Request Cont.Server BCont.109
  • 121.
    Make Scans FasterSplit“Select * from Movies where Rating > 4” intoWhere PartitionKey >= “A” and PartitionKey < “D” and Rating > 4Where PartitionKey >= “D” and PartitionKey < “I” and Rating > 4Etc.Execute in parallelEach query handles continuationServer ACont.Cont.RequestClientRequestRequestServer BCont.110
  • 122.
    Query SpeedFastSingle PartitionKeyand RowKey with equalityMediumSingle partition but a small range for RowKeyEntire partition or table that is smallSlowLarge single scanLarge table scan“OR” predicates on keys => no query optimization => results in scanExpect continuation token for all except in 1111
  • 123.
    Make Queries FasterLargeScansSplit the range and parallelize queriesCreate and maintain own views that help queries“Or” PredicatesExecute individual query in parallel instead of using “OR”User InteractiveCache the result to reduce scan frequency112
  • 124.
    Expect Continuation Tokens– Seriously!Maximum of 1000 rows in a responseAt the end of partition range boundaryMaximum of 5 seconds to execute the query113
  • 125.
    Entity Group Transactions(EGT) (new)Atomically perform multiple insert/update/deleteover entities in same partition in a single transactionMaximum of 100 commands in a single transaction and payload < 4 MBADO.Net Data ServiceUse SaveChangesOptions.Batch114
  • 126.
    Key Selection: EntityGroup TransactionCase StudyMaintain user account informationAccount ID, User Name, Address, Number of rentalsMaintain information of checked out rentalsAccount ID, Movie Title, Check out date, Due dateSolution 1 – Maintain two tables – Users & Rentals Handle Cross table consistencyInsert into Rentals table succeedsUpdate to Users table failsQueue to maintain consistency115
  • 127.
    Solution 2Store AccountInformation and Rental details in same tableMaintain same PartitionKey to enforce transactionsAccount ID as PartitionKeyUpdate total count and Insert new rentals using Entity Group TransactionPrefix RowKey with “Kind” code: A = Account, R = RentalRow key for account info: [Kind Code]_[AccountId]Row Key for rental info: [Kind Code]_[Title]Rental Properties not set for Account row and vice versa116
  • 128.
    Best PracticesSelect PartitionKeyand RowKey that help scaleEfficient for frequently used queriesSupports batch transactionsDistributes loadDistribute “Append only” patterns using prefix to PartitionKeyAlways Handle continuation tokensClient can maintain their own cache/views instead of frequent scansFuture Feature - Secondary IndexExecute parallel queries instead of “OR” predicatesImplement back-off strategy for retries117
  • 129.
    Windows Azure QueuesQueueare performance efficient, highly available and provide reliable message deliverySimple, asynchronous work dispatchProgramming semantics ensure that a message can be processed at least onceAccess is provided via REST118
  • 130.
    Queue Storage ConceptsMessagesQueuesAccounts128x 128 http://...thumbnailjobs256 x 256 http://...sallyhttp://...traverselinkshttp://...119
  • 131.
    Account, Queues andMessagesAn account can create many queuesQueue Name is scoped by the accountA Queue contains messagesNo limit on number of messages stored in a queueSet a limit for message expirationMessagesMessage size <= 8 KBTo store larger data, store data in blob/entity storage, and the blob/entity name in the messageMessage now has dequeue count120
  • 132.
    Queue OperationsQueueCreate QueueDeleteQueueList QueuesGet/Set Queue MetadataMessagesAdd Message (i.e. Enqueue Message)Get Message(s) (i.e. Dequeue Message)Peek Message(s)Delete Message121
  • 133.
    Queue Programming ApiCloudQueueClientqueueClient= newCloudQueueClient(baseUri, credentials);CloudQueue queue = queueClient.GetQueueReference("test1");queue.CreateIfNotExist();//MessageCount is populated via FetchAttributesqueue.FetchAttributes();CloudQueueMessage message = newCloudQueueMessage("Some content");queue.AddMessage(message);message = queue.GetMessage(TimeSpan.FromMinutes(10) /*visibility timeout*/);//Process the message here …queue.DeleteMessage(message);122
  • 134.
    Removing Poison MessagesProducersConsumersC1P21.GetMessage(Q, 30 s)  msg 1211111213403011211020C2P12. GetMessage(Q, 30 s)  msg 2123
  • 135.
    Removing Poison MessagesProducersConsumers11C1P21.GetMessage(Q, 30 s)  msg 15. C1 crashed4011213012111236. msg1 visible 30 s after Dequeue21C2P12. GetMessage(Q, 30 s)  msg 23. C2 consumed msg 24. DeleteMessage(Q, msg 2)7. GetMessage(Q, 30 s)  msg 1124
  • 136.
    Removing Poison MessagesProducersConsumers1.Dequeue(Q, 30 sec)  msg 15. C1 crashed10. C1 restarted11. Dequeue(Q, 30 sec)  msg 112. DequeueCount > 213. Delete (Q, msg1)C1P2401230131213312C2P16. msg1 visible 30s after Dequeue9. msg1 visible 30s after Dequeue2. Dequeue(Q, 30 sec)  msg 23. C2 consumed msg 24. Delete(Q, msg 2)7. Dequeue(Q, 30 sec)  msg 18. C2 crashed125
  • 137.
    Best Practices &SummaryMake message processing idempotentNo need to deal with failuresDo not rely on orderInvisible messages result in out of orderUse Dequeue count to remove poison messagesEnforce threshold on message’s dequeue countUse message count to dynamically increase/reduce workersUse blob to store message data with reference in messageMessages > 8KBBatch messagesGarbage collect orphaned blobs126
  • 138.
    Storage SummaryTableScalable &Reliable Structured Storage SystemPartitioning is critical to scalabilityEntity Group Transactions (new)QueueScalable & Reliable Messaging System Dequeue count returned with message (new)Use back-off strategy on retriesOfficial Storage Client Library (new)127
  • 139.
  • 140.
    Review – ConceptualmodelSubscription Used to map service usage to the billing instrumentUsers may have many subscriptionsLogical ServerAkin to SQL Server InstanceUnit of Geo-Location & Billing1:1 Subscription & serverUser DatabaseRestricted T-SQL surface areaAdditional catalog views provided e.g. sys.billing, sys.firewall_rules, etc
  • 141.
    SQL AzureA relationalDB in the cloudSQL Azure DatabaseData HubOthers (Future)Relational database as a serviceHighly available, automatically maintainedExtension of the SQL Server Data Platform.NET ServicesSQL ServicesApplicationsLive ServicesWindows AzureApplicationsWindowsMobileWindowsVista/XPWindowsServerOthers
  • 142.
    SQL Azure DatabaseSingleLogicalDatabaseMultiple PhysicalReplicasReplica 1Single PrimaryReplica 2DB- Based on SQL Server 2008 R2 engineUse same tools and data access frameworksSix global datacentersHigh Availability & RedundancyReads are completed at the primaryWrites are replicated to a quorum of secondariesReplica 3MultipleSecondaries
  • 143.
    Extending SQL ServerData Platform to the CloudData SyncReference DataDatabaseSymmetric Programming ModelData Hub AggregationInitial services – core RDBMS capabilities with SQL Azure Database, Data Sync
  • 144.
  • 145.
    Additional data platformcapabilities: Reporting, BI
  • 146.
    New services: ReferenceDataThe New SQL Data ServicesClear Feedback: “I want a database in the Cloud”Familiar SQL Server relational modelUses existing APIs & toolsBuilt for the Cloud with availability and scaleAccessible to all from PHP, Ruby, and JavaFocus on combining the best features of SQL Server running at scale with low friction
  • 147.
    The Evolution ofSDSEvolvesBrowserApplicationApplicationApplicationBrowserApplicationApplicationODBC, OLEDB, ADO.Net PHP, Ruby, …REST ClientSQL Client*REST ClientCloudCloudWindows AzureREST (Astoria)Web AppADO.Net + EFREST ClientHTTP+RESTHTTP+RESTHTTPTDSHTTPWindows AzureWeb AppSQL Client*Data CenterData CenterTDS + TSQL ModelREST/SOAP + ACE ModelSDS NextSDS Current* Client access enabled using TDS for ODBC, ADO.Net, OLEDB, PHP-SQL, Ruby, …
  • 148.
    SQL AzureSQL AzureDatabaseOthers (Future)SQL AzureApplicationsWindows Azure AppFabricWindows AzureApplicationsOthersWindows
  • 149.
    SQL Azure DatabaseAnIllustrationSQL Azure DatabaseDatabaseTDSApplicationDatabaseDatabaseSQL Azure DatabaseOthers (Future)
  • 150.
    SQL Azure DatabaseUsingone or multiple databasesSQL Azure DatabaseDatabaseApplicationMax database size is 50 GBDatabaseDatabaseApplicationDatabase
  • 151.
    SQL Azure NetworkTopologyApplications use standard SQL client libraries: ODBC, ADO.Net, PHP, …ApplicationInternetAzure CloudTDS (tcp)Security BoundaryLoad balancer forwards ‘sticky’ sessions to TDS protocol tierLBTDS (tcp)GatewayGatewayGatewayGatewayGatewayGatewayGateway: TDS protocol gateway, enforces AUTHN/AUTHZ policy; proxy to CloudDBTDS (tcp)SQLSQLSQLSQLSQLSQLScalability and Availability: Fabric, Failover, Replication, and Load balancing
  • 152.
    TDS GatewayTDS ListenerCapabilitynegotiationTDS Packet inspectionSecurityLogical->Physical mapping via metadata catalogEnabler for multi-tenet capabilitiesIsolation layer
  • 153.
    TDS Gateway LayeringGatewayProcessTDS EndpointAdminSvc EndpointProvisioning EndpointProtocol ParserBusiness Logic ServicesConnection MgmtSQLSQLSQLSQLSQLSQLScalability and Availability: Fabric, Failover, Replication, and Load balancing
  • 154.
    Provisioning SubscriptionCoordinated acrossall Azure servicesExecuted in parallel w/retriesServerMay occur between data centersPoint where Geo-location is establishedDatabaseAlways occurs within a single data centerCross node operations executed during this process e.g. add new db to sys.databases on the master
  • 155.
    Server ProvisioningDriven byadministrator PortalProvision request is sent to GatewayMetadata catalog entry createdDNS record (CNAME) created within LiveDNS serviceMaster DB createdOn completion metadata catalog updated
  • 156.
    SQL Azure ServerProvisioningLive DNS ClusterCustomer BrowserLive DNS SvcDatacenter (Sub-Region)15Portal LBGateway LB2436Front-end NodeFront-end NodeFront-end NodeFront-end NodeGateway Gateway Admin Portal Admin Portal 7Backend NodeBackend NodeBackend NodeSQL ServerSQL ServerSQL ServerMgmt. ServicesMgmt. ServicesMgmt. ServicesFabricFabricFabric
  • 157.
    Database ProvisioningGateway performsstateful TDS packet inspectionPicks out subset of messagesParses out args for create databaseMakes entry into Gateway metadata catalogUnused replica set located and reservedReplica set (UserDB) is prepped for use Metadata catalog is updated
  • 158.
    SQL Azure DatabaseprovisioningTDS Gateway1Front-end NodeProtocol ParserTDS Session23Gateway LogicMaster NodeMaster ClusterMaster Node Components47568Backend Node 1Backend Node 2Backend Node 3SQL InstanceSQL InstanceSQL InstanceSQL DBSQL DBSQL DBScalability and Availability: Fabric, Failover, Replication, and Load balancingScalability and Availability: Fabric, Failover, Replication, and Load balancing
  • 159.
    SQL Azure LoginProcessLogin request arrives at the GatewayGateway locates MasterDb & UserDb replica setsCredentials are validated against MasterDbTDS session is opened to UserDB and requests are forwarded
  • 160.
    SQL Azure LoginProcessTDS Gateway71Front-end NodeProtocol ParserTDS Session26Gateway LogicMaster NodeGlobal Partition MapMaster Node Components3845Backend Node 1Backend Node 2Backend Node 3SQL InstanceSQL InstanceSQL InstanceSQL DBSQL DBSQL DBScalability and Availability: Fabric, Failover, Replication, and Load balancingScalability and Availability: Fabric, Failover, Replication, and Load balancing
  • 161.
    Service ResilienceProvisioningState machinesused to coordinate activities across node (and datacenter) boundariesFailed provisioning attempts cleaned automatically after 10 minutesLoginFailovers during the login will be transparent (<30 seconds)Metadata catalog refresh occurs automaticallyActive SessionSurface as connection drops (due to state)
  • 162.
    Monitoring Service HealthMetricsClusterwide performance counters gather key metrics on the serviceUsed to alert Operations to issues before they become a problemEarly warning systemCode issuesCapacity warningsHealthExercises the service routinely looking for problemsWhen issues are encountered runs deep diagnosticsNetwork connectivity at the node levelValidate all dependent services (Live DNS, Live ID, etc)Monitoring from other MSFT DC’sValidates accessibility from multiple geographic locationsAlerts fired automatically when test jobs fail
  • 163.
    Security/Attack ConsiderationsService Securechannel required (SSL)Denial Of Service trend trackingPacket InspectionServer IP allow list (Firewall) Idle connection cullingGenerated server names DatabaseDisallow the most commonly attacked user id’s (SA, Admin, root, guest, etc) Standard SQL Authn/Authz mode
  • 164.
    What’s New InSQL Azure CTPEnhancementsSQL Azure DatabaseWindows Azure Platform – Developer PortalEnhanced user experience and reportingDatabase manager for SQL AzureSQL Azure Reporting CTPReporting and BI on SQL Azure databasesBased on SQL Server Reporting ServicesSQL Azure Data Sync CTP2Synchronize SQL Azure databasesSynchronize SQL Azure with on-premises SQL Server
  • 165.
    What’s New InSQL Azure CTPEnhancementsSQL Azure DatabaseWindows Azure Platform – Developer PortalEnhanced user experience and reportingDatabase manager for SQL AzureSQL Azure Reporting CTPReporting and BI on SQL Azure databasesBased on SQL Server Reporting ServicesSQL Azure Data Sync CTP2Synchronize SQL Azure databasesSynchronize SQL Azure with on-premises SQL Server
  • 166.
    What’s New InSQL Azure CTPEnhancementsSQL Azure DatabaseWindows Azure Platform – Developer PortalEnhanced user experience and reportingDatabase managementSQL Azure Reporting CTPReporting and BI on SQL Azure databasesBased on SQL Server Reporting ServicesSQL Azure Data Sync CTP2Synchronize SQL Azure databasesSynchronize SQL Azure with on-premises SQL Server
  • 167.
    SQL Azure ReportingCTPFeatures:Based on SQL Server Reporting ServicesInteractive and tabular reportingData visualizations: charts, graphs, mapping, gaugesSQL Azure Database data sourcesUtilizes BI Developer Studio (free) to author reportsExport to Excel, PDF, CSV formatsCore scenarios:Operational reporting on SQL Azure dataEmbed reports into Windows Azure or on-premises applications Web RoleReporting“Introduction to SQL Azure Reporting”
  • 168.
    What’s New InSQL AzureEnhancementsSQL Azure DatabaseWindows Azure Platform – Developer PortalEnhanced user experience and reportingDatabase managementSQL Azure Reporting CTPReporting and BI on SQL Azure databasesBased on SQL Server Reporting ServicesSQL Azure Data Sync CTP2Synchronize SQL Azure databasesSynchronize SQL Azure with on-premises SQL Server
  • 169.
    SQL Azure DataSync CTP2Elastic ScaleService scales as resources requirements growNo-Code Sync ConfigurationEasily define data to be synchronizedSchedule SyncChoose how often data is synchronizedConflict HandlingHandle issues where same data is changed in multiple locationsLogging and MonitoringAdministration capabilities for tracking data and monitoring potential issuesCTP 1CTP 2“Introduction to SQL Azure Data Sync”
  • 170.
    SQL Azure DataSync – A Closer LookCTP 2On PremisesWindows AzureData Sync ServiceLocal AgentSync OrchestratorSync OrchestratorHTTPSSQL Server Sync ProviderSQL Server Proxy ProviderSQL ServerProviderTDSSQL ServerSQL Azure
  • 171.
    SQL Azure DataSync – Example Use CasesMove workloads in stages preserving existing infrastructureMove part of the application and sync its dataMeet compliance and regulationsControl data synchronized off-premisesEnable scale-out read or read/writeMultiple synchronized databases for scalabilityPreserve data – geo replication of dataEnable new scenariosSpanning enterprise, cloud and remote offices/retail stores
  • 172.
    SQL Azure DataSync – RoadmapSQL Azure DatabaseNowSyncSyncData Sync Service For SQL AzureRemote OfficesRetail StoresSyncSyncSyncSyncSyncCTP2 – End of CY10On-Premises (Headquarters)
  • 173.
    New SQL AzureUsage ScenariosFully featured Windows Azure PlatformApplicationData SyncWeb RoleReporting
  • 174.
    New SQL AzureUsage ScenariosFully featured Windows Azure PlatformApplicationGlobally available,cloud & on-premisesdata synchronizationData SyncData SyncGeo-replication of data across Windows Azure Platform datacentersWeb RoleReportingCorporate OfficeBranch Office or RetailDatacenterSynchronize multiple on-premises SQL Server databases in different locations
  • 175.
    RoadmapNowVisit www.microsoft.com/sqlazure toregister for upcoming CTP access2010New Windows Azure Developer Portal; Database ManagerLimited CTPs of Data Sync CTP2, Reporting CTPWatch for PDC Announcements; visit the SQL Azure blog and website2011Backup & RestoreSQL Azure ReportingSQL Azure Data Sync
  • 176.
    Windows Azure AppFabricInfrastructurein the cloudService BusAccess ControlSQL AzureApplications?Windows Azure AppFabricWindows AzureApplicationsOthersWindows
  • 177.
    Service Bus3) DiscoverService Bus endpoint1) Register service endpoint Registry2) Expose Service Bus endpoint5) Invoke operation on service endpoint4) Invoke operation on Service Bus endpointClient (On-premises or cloud)WCF Service(On-premises)Service BusAccess ControlIllustrating Service Bus
  • 178.
    Windows Azure PlatformPricingA summary (in US dollars)Compute: $0.12 to $0.96/hour for each role instance depending on instance size Storage: Windows Azure blobs and tables:Data: $0.15/GB per monthAccess: $0.01/10,000 operationsSQL Azure relational:$9.99/month per GBBandwidth: Americas/Europe: $0.10/GB in, $0.15/GB outAsia/Pacific: $0.30/GB in, $0.45/GB out
  • 179.
    Service Level AgreementsKeypoints: Windows Azure computeWhen you deploy two or more role instances in different fault and upgrade domains, your Internet-facing roles will have external connectivity at least 99.95% of the timeMicrosoft will detect within two minutes when a role instance’s process is not running and initiate corrective action
  • 180.
    Service Level AgreementsKeypoints: Windows Azure storageAt least 99.9% of the time, Microsoft will successfully process correctly formatted requests to add, update, read and delete dataAt least 99.9% of the time, your storage accounts will have connectivity to Microsoft’s Internet gateway
  • 181.
    Service Level AgreementsKeypoints: SQL Azure databaseSQL Azure will maintain a Monthly Availability of 99.9% during a calendar month. Monthly Availability percentage for a specific customer database is the ratio of the time the database was available to customer to the total time in a month. An interval is marked as unavailable if the customer’s attempts to connect to a database are rejected by the SQL Azure gateway.
  • 182.
    Using the WindowsAzure Platform: Scenarios