SlideShare a Scribd company logo
Scaling Big while Sleeping WellJosh Holmes@joshholmesjosh.holmes@microsoft.comwww.joshholmes.com
AgendaTesting the WatersWhat is cloud computing?What are the advantages of cloud computing?How’s Azure fit in?Diving DeepDigging into PHP/Ruby on AzureLeveraging FastCGILeveraging Azure StorageLeveraging SQL Azure
We are all excited about the cloud
Cloud-Addressable Challenges115Maintaining security while increasing access and transparency—within and outside the organizationInfrastructure costs are fixed and ongoing, and distract from the mission of reducing business process friction26Leveraging past investments to provide future valueSecurity, access, and transparency across the value chain: suppliers, partners,  etc.3Many data centers at limit—real estate, capacity, cooling and power7Lack of a common platform4Matching capacity to demand
In House or Hosted ServersAllocated IT-capacitiesLoad Forecast“Under-supply“ of capacities“Waste“ of capacitiesFixed cost of IT-capacitiesIT CAPACITYBarrier forinnovationsActualLoadTIME
Cloud ComputingLoad ForecastAllocated IT capacitiesNo “under-supply“IT CAPACITYReduction of “over-supply“Possible reduction of IT-capacities in case of reduced loadReduction of initial investmentsActualLoadTime
Types of CloudsPlatform(as a Service)Private(On-Premise)Infrastructure(as a Service)You manageApplicationsApplicationsApplicationsYou manageRuntimesRuntimesRuntimesSecurity & IntegrationSecurity & IntegrationSecurity & IntegrationManaged by vendorDatabasesDatabasesDatabasesYou manageServersServersServersManaged by vendorVirtualizationVirtualizationVirtualizationServer HWServer HWServer HWStorageStorageStorageNetworkingNetworkingNetworking
The Microsoft Cloud~100 Globally Distributed Data CentersQuincy, WAChicago, ILSan Antonio, TXDublin, IrelandGeneration 4 DCs
Scaling Big While Sleeping Well
Categories of ServicesApplication ServicesSoftware ServicesPlatform ServicesThe Microsoft CloudInfrastructure Services
The trick is knowing what your systems need,and how the cloud can help.
Not everything has to or can live in the cloud
Only move to the cloud that which can benefit
The core strategy is ‘hybrid’
Take an À la carteapproach
We call this Software + Services
An Example…
“Packaged”ApplicationBig Pharmaceutical ExampleHosted “Packaged”“Packaged”using cloud “Software as a Service”BuyERP“Too costly to run this myself, but I’ve made too many customizations”CRMEmailBuild vs. Buy“Home Built”ApplicationHosted “Home Built”“Home Built”using cloud “Platform as a Service”HR SystemMolecule ResearchBuildClinical TrialHosterVendorOn PremiseCloud
“Packaged”ApplicationBig Pharmaceutical ExampleHosted “Packaged”“Packaged”using cloud “Software as a Service”BuyERPCRM“CRM and Email are commodity services – They have no customizations, and it’s cheaper for someone else to run these”EmailBuild vs. Buy“Home Built”ApplicationHosted “Home Built”“Home Built”using cloud “Platform as a Service”HR SystemMolecule ResearchBuildClinical TrialHosterVendorOn PremiseCloud
Big Pharmaceutical Example“Packaged”ApplicationHosted “Packaged”“Packaged”using cloud “Software as a Service”BuyERPCRMEmailBuild vs. Buy“Home Built”ApplicationHosted “Home Built”“Home Built”using cloud “Platform as a Service”“I can’t afford to maintain this old HR application written in VB4 – it’s driving me mad!”HR System“…but due to regulatory issues, I cannot store my HR data off-premise”Molecule ResearchBuildClinical TrialHosterVendorOn PremiseCloud
“Packaged”ApplicationBig Pharmaceutical ExampleHosted “Packaged”“Packaged”using cloud “Software as a Service”BuyERPCRMEmailHR SystemBuild vs. Buy“Home Built”ApplicationHosted “Home Built”“Home Built”using cloud “Platform as a Service”“I wish I had access to cheaper compute and storage when I need it”Molecule ResearchBuildClinical TrialHosterVendorOn PremiseCloud
“Packaged”ApplicationBig Pharmaceutical ExampleHosted “Packaged”“Packaged”using cloud “Software as a Service”BuyERPCRMEmailHR SystemBuild vs. Buy“Home Built”ApplicationHosted “Home Built”“Home Built”using cloud “Platform as a Service”Molecule ResearchBuild“THIS is where I want to spend my IT resources – I’m going to double down on this application!”Clinical TrialHosterVendorOn PremiseCloud
Where the Cloud is Compelling
Only 2 reasons to use the cloud
Windows Azure VMsSmallMediumLarge X Large$0.12 $0.24 $0.48 $0.96 Per service hourPer service hourPer service hourPer service hour1 x 1.6Ghz  2 x 1.6Ghz 4 x 1.6Ghz 8 x 1.6Ghz(moderate IO) (high IO)(high IO) (high IO)1.75 GB memory 3.5 GB memory 7.0 GB memory14 GB memory
Windows Azure, In One PictureBusiness PortalDeveloper PortalService Management ServiceRESTUser Code……Runtime APIStorage ClusterVS ToolsCompute Cluster…WA SDKVM SetupRESTMSFT DatacentersDesktopCloud VM
Determine an ROIConsider:Current hosting costs
Current staff costs
Cooling/power/space
Migration costs
LicensingAzureROI.CloudApp.net
Scaling Big While Sleeping Well
ZENDFRAMEWORK
Digging into Azure with PHP/Ruby
Windows Azure, In One PictureBusiness PortalDeveloper PortalService Management ServiceRESTUser Code……Runtime APIStorage ClusterVS ToolsCompute Cluster…WA SDKVM SetupRESTMSFT DatacentersDesktopCloud VM
Windows Azure RolesWorkerRoleInternal Facing
TCP/HTTP Endpoint
Long running processes
Think Service or DeamonWebRoleExternal Facing
HTTP/HTTPS Endpoint
Short lived calls
Think Web ServerRunning PHP in Windows AzureHow to Do ItHost in Web role (like .NET)Supply PHP runtimePoint to runtime via FastCGI configuration inWeb.configWeb.roleConfigPHP Web RoleInstance 1VIPLoad BalancerPHP Web RoleInstance 2
Windows Azure 4 EclipseDoes a lot of the heavy lifting for youCreates the Web.config, Web.roleConfig, PHP implementation and debugs in the dev fabrichttp://windowsazure4e.org
Running EXEs in the Worker ProcessStart with a Worker Role Process to Copy the exes to the worker role’s app directoryExecute the processMonitor the health of the processOther auxiliary tasks…
Running Ruby in the Worker Processhttp://code.msdn.microsoft.com/railsonazureDownload and extract the solution Copy the Ruby bin and lib folders to the Ruby folder in the RR project Copy your rails application to the RailsApp folder in the RR project Open the solution in Visual Studio Run in the Dev FabricNavigate to http://127.0.0.1:5100
Data Storage
Storage optionsWindows Azure DataSql Azure
Windows Azure Data StorageQueueBlobAccountTablesDrives
Azure Platform Data Storage OptionsWindows Azure Data Storage
Blobs
Unstructured data storage
Tables
Semi-structured or tabular data storage
Queues
Buffered delivery data storage
Drives
Durable NTFS volumes that Windows Azure applications can use.  See: http://microsoftpdc.com/Sessions/SVC14SQL AzureRelational data storageAdmin Windows Azure Data Storage
Windows Azure Data Storage
PHP with Windows Azure StorageWindows Azure SDK for PHP @ http://phpazure.codeplex.comPHP programming model for Windows Azure StorageFeatures PHP classes for Blobs, Tables & QueuesStore PHP sessions in Table Storage
Windows Azure Data Storage - BlobsUnstructured data storagePartitioned by containerUnlimited containers
Blobs Sample$blobStorage= new Microsoft_WindowsAzure_Storage_Blob();// Createif (!$blobStorage->containerExists($containerName)){$blobStorage->createContainer($containerName);$blobStorage->setContainerAcl($containerName, Microsoft_WindowsAzure_Storage_Blob::ACL_PUBLIC);}// Store$blob = $blobStorage->putBlob($containerName, $blobName, $localFilename, $metadata);/* @var $blob Microsoft_WindowsAzure_Storage_BlobInstance */
Blobs Sample Cont…// Copy$result = $blobStorage->copyBlob(     $containerName, $blobName, $containerName, $blob2Name);// Retrieve$tempStore= azure_getlocalresourcepath('tempstore');$tempPath= $tempStore. '\\' . $imageId;$blobStorage->getBlob($containerName, $blobName, $tempPath);// Delete$result = $blobStorage->deleteBlob($containerName, $blobName);$result = $blobStorage->deleteContainer($containerName);
Blob Stream Wrapper$blobStorage= new Microsoft_WindowsAzure_Storage_Blob();// Register:$blobStorage->registerStreamWrapper(); // registers azure://// or$blobStorage->registerStreamWrapper('blob://'); // use blob://// Use$fp= fopen('azure://mycontainer/myfile.txt', 'r');// ...fclose($fp);
Storage: XDriveNTFS drive in the cloud: X:\Fixed size between 16MB and 1TBMax 8 drives on your VMImplemented as a page blobSingle instance writeMultiple instance read
Queue Workflow ConceptsWindows Azure Queue ProvidesGuarantee delivery (two-step consumption)Worker Dequeues Message and mark it as InvisibleWorker Deletes Message when finished processing itIf Worker role crashes, message becomes visible for another Worker to processDoesn’t guarantee “only once” deliveryDoesn’t guarantee orderingBest effort FIFOWorker RoleWeb RoleInput Queue (Work Items)Worker RoleAzure QueueWeb RoleWorker RoleWeb RoleWorker Role
Azure QueuesRemoveMessageGetMessage (Timeout)Worker RolePutMessageQueueMsg 1Msg 2Msg 2Msg 1Web RoleWorker RoleWorker RoleMsg 3Msg 4Msg 2
Loosely Coupled Work with QueuesWorker-Queue ModelLoad work in a queueMany workers consume the queueInput Queue (Work Items)Azure QueueWorker RoleWeb RoleWorker RoleWeb RoleWorker RoleWeb RoleWorker Role
Queues$queueClient= new Microsoft_WindowsAzure_Storage_Queue();// Create$result = $queueClient->createQueue('imageQueue');// Delete$queueClient->deleteQueue('imageQueue');// Add message$queueClient->putMessage('imageQueue', $message, $ttl);// Retrieve Messages$messages = $queueClient->getMessages('imageQueue', 10);foreach($messages as $message) {// Do work here...$queueClient->deleteMessage('imageQueue', $message);}
Windows Azure Data Storage - TablesSemi-Structured dataTables contain entitiesEntities contain propertiesMay be partitioned across thousands of servers.Support ACID transactions over single entitiesQueries over entire table.NET and REST interfaces
Windows Azure Data Storage – Tables (Terms Part 1)TableContains a set of entities.  Entity (Row) Basic data items stored in a table.  Property (Column)Single value in an entity.   RowKeyUnique ID of the entity within a partitionTimestampTime it was created
Windows Azure Data Storage – Tables (Terms Part 2)Partition Entities in a table with the same partition keyPartitionKeySegments entities in to partitions to automatically distribute the table’s entities over many storage nodes.Sort OrderThere is a single index provided for the CTP, where all entities in a table are sorted by PartitionKey and then RowKey
Key Example – Blog PostsPartition 1Partition 2Getting all of dunnry’s blog posts is fastSingle partitionGetting all posts after 2008-03-27 is slowTraverse all partitions
Table Sample$tableStorage= new Microsoft_WindowsAzure_Storage_Table('table.core.windows.net', 'myaccount', 'myauthkey');// Create$result = $tableStorage->createTable($tableName);// List $result = $tableStorage->listTables();foreach($result as $table) {echo 'Table name is: ' . $table->Name . "\n";}// Delete$tableStorage->deleteTable($tableName);
Tables with Entities// Structured entityclass ImageEntityextends Microsoft_WindowsAzure_Storage_TableEntity{/**     * @azure filename     */public $filename;/**     * @azure size Edm.Int64     */public $size;}// Unstructured entity// Microsoft_WindowsAzure_Storage_DynamicTableEntity
Tables with Entities Cont…// Insert$image = new ImageEntity($partitionKey, $rowKey);$image->filename = $_FILES['imageUpload']['name'];$image->size = $_FILES['imageUpload']['size'];$image = $tableStorageClient->insertEntity($tableName, $image);// Retrieve$image = $tableStorage->retrieveEntityById($tableName, $partitionKey, $rowKey, 'ImageEntity');// Update$image->filename = 'newname.jpg';$result = $tableStorage->updateEntity($tableName, $image);// Delete$result = $tableStorage->deleteEntity($tableName, $image);
Table Queries// Filter condition$select = "filesizegt 1024 and PartitionKeyeq '$partitionKey'";// Or fluent interface$select = $tableStorage->select()->from($tableName)          ->where('filesizegt 1024')          ->andWhere('PartitionKeyeq ?', $partitionKey);// Run query$images = $tableStorage->storageClient->retrieveEntities('testtable', $select, 'ImageEntity');foreach($images as $image) {echo 'Name: ' . $image->filename . "\n";}
Batching Operations// Start batch$batch = $tableStorage->startBatch();// Insert multiple$images = generateEntities();foreach($images as $image) {$tableStorage->insertEntity($tableName, $image);}// Commit$batch->commit();
Table session handler$sessionHandler    = new Microsoft_WindowsAzure_SessionHandler($tableStorage);$sessionHandler->register();session_start();if (!isset($_SESSION['start'])) {$_SESSION['start'] = time();}
SQL Azure and Windows Azure Table ComparisonWindows Azure TablesSQL Azure TablesSemi-structuredLoosely typedNon-Relational (Not RDMS)Massively scalableFully structuredStrongly typedRelational (RDMS)Highly scalable
MySQL: Simple ConfigurationVIPLoad BalancerWeb RoleMySQLWorker Role
MySQL in a Windows Azure ApplicationRunning MySQL in a worker roleCopy MySQL to the worker role sub-directoryCopy to read-write local storageConfigure MySQL to listen on the right portMonitor MySQL healthConsuming MySQLDiscover IP address and portNormal access from then onHandle topology changes
Simple ConfigurationVIPLoad BalancerMySQL
ReplicationVIPLoad BalancerMSSMySQLMySQLMySQL
Windows Azure Drive with Hot SpareVIPLoad BalancerMySQLMySQL
Windows Azure Drive with Hot SpareVIPLoad BalancerMySQLMySQL
SQL Azure
SQL Azure FeaturesSupportedTables, Indexes, ViewsStored ProceduresTriggersConstraintsTable VariablesTemp Tables (#Name)Not SupportedPhysical Server Access Catalog DDLCommon Language RuntimeService BrokerReporting ServicesAnalysis ServicesDistributed Transactions and Queries
SQL AzureDeploymentWeb Portal(API)DB ScriptSQL AzureTDS

More Related Content

PPTX
Jumpstart Azure
PPTX
PHP on Windows and on Azure
PDF
Optimising Web Application Frontend
PPTX
Leverage Azure Blob Storage to build storage intensive cloud native applications
PDF
Architetture Serverless con SQL Server e Azure Functions
PPTX
Improving web site performance and scalability while saving
PPTX
2014.11.14 Data Opportunities with Azure
PDF
Using Web Standards to create Interactive Data Visualizations for the Web
Jumpstart Azure
PHP on Windows and on Azure
Optimising Web Application Frontend
Leverage Azure Blob Storage to build storage intensive cloud native applications
Architetture Serverless con SQL Server e Azure Functions
Improving web site performance and scalability while saving
2014.11.14 Data Opportunities with Azure
Using Web Standards to create Interactive Data Visualizations for the Web

What's hot (20)

PPTX
Azure Storage – Foundation for Building Secure, Scalable Cloud Applications
PPTX
Creating Real-Time Data Mashups with Node.js and Adobe CQ by Josh Miller
PPTX
[Toroman/Kranjac] Red Team vs. Blue Team in Microsoft Cloud
PPT
Building Highly Scalable Web Applications
PDF
Responsive Websites and Grid-Based Layouts by Gabriel Walt
PPTX
Azure Storage
PDF
Altitude SF 2017: Granular, Precached, & Under Budget
PDF
Firebase: Totally Not Parse All Over Again (Unless It Is)
PDF
Firebase: Totally Not Parse All Over Again (Unless It Is) (CocoaConf San Jose...
PPT
Rest services caching
PDF
Developing applications with Cloud Services #javaone 2012
PDF
Cloud Computing With Amazon Web Services, Part 3: Servers on Demand With EC2
PDF
Developing and deploying applications with Spring Boot and Docker (@oakjug)
PDF
Zero to 60 with Azure Cosmos DB
PPTX
Taking SharePoint to the Cloud
PDF
Introduction to Azure for SMB partners
PPTX
REST API Design for JAX-RS And Jersey
PPTX
Elegant Rest Design Webinar
PPTX
Web Performance, Scalability, and Testing Techniques - Boston PHP Meetup
PDF
AtlasCamp 2014: Static Connect Add-ons
Azure Storage – Foundation for Building Secure, Scalable Cloud Applications
Creating Real-Time Data Mashups with Node.js and Adobe CQ by Josh Miller
[Toroman/Kranjac] Red Team vs. Blue Team in Microsoft Cloud
Building Highly Scalable Web Applications
Responsive Websites and Grid-Based Layouts by Gabriel Walt
Azure Storage
Altitude SF 2017: Granular, Precached, & Under Budget
Firebase: Totally Not Parse All Over Again (Unless It Is)
Firebase: Totally Not Parse All Over Again (Unless It Is) (CocoaConf San Jose...
Rest services caching
Developing applications with Cloud Services #javaone 2012
Cloud Computing With Amazon Web Services, Part 3: Servers on Demand With EC2
Developing and deploying applications with Spring Boot and Docker (@oakjug)
Zero to 60 with Azure Cosmos DB
Taking SharePoint to the Cloud
Introduction to Azure for SMB partners
REST API Design for JAX-RS And Jersey
Elegant Rest Design Webinar
Web Performance, Scalability, and Testing Techniques - Boston PHP Meetup
AtlasCamp 2014: Static Connect Add-ons
Ad

Viewers also liked (7)

PPT
Architecting RIAs with Silverlight
PPTX
Touch me, I Dare You...
PPTX
Microsoft and PHP at CakeFest 2010
PPTX
Microsoft/Zend Webcast on Cloud Computing
PPTX
F as in failure slideshare
PPT
32 Ways To Keep Your Blog From Sucking
PPTX
So you want to be an architect
Architecting RIAs with Silverlight
Touch me, I Dare You...
Microsoft and PHP at CakeFest 2010
Microsoft/Zend Webcast on Cloud Computing
F as in failure slideshare
32 Ways To Keep Your Blog From Sucking
So you want to be an architect
Ad

Similar to Scaling Big While Sleeping Well (20)

PPTX
Windows Azure Platform + PHP - Jonathan Wong
PPTX
Windows Azure & How to Deploy Wordress
PPTX
Migrating Apps To Azure
PPTX
2. Windows Azure
PPTX
BizSpark Startup Night Windows Azure March 29, 2011
PPTX
Windowsazureplatform Overviewlatest
PPTX
Sky High With Azure
PPTX
Azure Overview Csco
PPTX
Windows Azure - Uma Plataforma para o Desenvolvimento de Aplicações
PPTX
How to scale up, out or down in Windows Azure - Webinar
PPTX
Just another Wordpress weblog, but more cloudy
PPTX
Running PHP In The Cloud
PPTX
Clouds clouds everywhere
PPTX
What's New for the Windows Azure Developer? Lots!!
PDF
Building Real World Application with Azure
PPTX
The Windows Azure Platform (MSDN Events Series)
PPT
Microsoft Azure, door Rob Brommer op de 4DotNet Developers Day
PPTX
Microsoft Zend webcast on Azure
PPTX
Why Windows Azure
PPTX
Microsoft Windows Azure - EBC Deck June 2010 Presentation
Windows Azure Platform + PHP - Jonathan Wong
Windows Azure & How to Deploy Wordress
Migrating Apps To Azure
2. Windows Azure
BizSpark Startup Night Windows Azure March 29, 2011
Windowsazureplatform Overviewlatest
Sky High With Azure
Azure Overview Csco
Windows Azure - Uma Plataforma para o Desenvolvimento de Aplicações
How to scale up, out or down in Windows Azure - Webinar
Just another Wordpress weblog, but more cloudy
Running PHP In The Cloud
Clouds clouds everywhere
What's New for the Windows Azure Developer? Lots!!
Building Real World Application with Azure
The Windows Azure Platform (MSDN Events Series)
Microsoft Azure, door Rob Brommer op de 4DotNet Developers Day
Microsoft Zend webcast on Azure
Why Windows Azure
Microsoft Windows Azure - EBC Deck June 2010 Presentation

More from Josh Holmes (17)

PPTX
Mentorship by Josh Holmes - a KalamazooX talk
PPTX
Tips from a grizzled speaker
PPTX
BrazilJS Perf Doctor Talk
PPTX
Cloud becomingreality
PPTX
Wordpress on Windows
PPTX
Is that a Rich Web in Your Pocket?
PPTX
Cloud by Numbers
PPTX
Rev it up with php on windows
PPTX
Scaling WordPress on Microsoft
PPTX
MODx on Windows
PPT
Wordpress On Windows
PPTX
Moving Enterprise Applications To The Cloud
PPT
Best And Worst Practices Building Ria with Adobe and Microsoft
PPTX
The Lost Art of Simplicity
PPT
Architecture of RIA from JAOO
PPT
Best And Worst Ria
PPT
Architecting For Ux
Mentorship by Josh Holmes - a KalamazooX talk
Tips from a grizzled speaker
BrazilJS Perf Doctor Talk
Cloud becomingreality
Wordpress on Windows
Is that a Rich Web in Your Pocket?
Cloud by Numbers
Rev it up with php on windows
Scaling WordPress on Microsoft
MODx on Windows
Wordpress On Windows
Moving Enterprise Applications To The Cloud
Best And Worst Practices Building Ria with Adobe and Microsoft
The Lost Art of Simplicity
Architecture of RIA from JAOO
Best And Worst Ria
Architecting For Ux

Recently uploaded (20)

PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Cloud computing and distributed systems.
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
cuic standard and advanced reporting.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Encapsulation theory and applications.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
Chapter 3 Spatial Domain Image Processing.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
“AI and Expert System Decision Support & Business Intelligence Systems”
Cloud computing and distributed systems.
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
The Rise and Fall of 3GPP – Time for a Sabbatical?
cuic standard and advanced reporting.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Review of recent advances in non-invasive hemoglobin estimation
Encapsulation theory and applications.pdf
Unlocking AI with Model Context Protocol (MCP)
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
NewMind AI Weekly Chronicles - August'25 Week I

Scaling Big While Sleeping Well

  • 1. Scaling Big while Sleeping WellJosh Holmes@joshholmesjosh.holmes@microsoft.comwww.joshholmes.com
  • 2. AgendaTesting the WatersWhat is cloud computing?What are the advantages of cloud computing?How’s Azure fit in?Diving DeepDigging into PHP/Ruby on AzureLeveraging FastCGILeveraging Azure StorageLeveraging SQL Azure
  • 3. We are all excited about the cloud
  • 4. Cloud-Addressable Challenges115Maintaining security while increasing access and transparency—within and outside the organizationInfrastructure costs are fixed and ongoing, and distract from the mission of reducing business process friction26Leveraging past investments to provide future valueSecurity, access, and transparency across the value chain: suppliers, partners, etc.3Many data centers at limit—real estate, capacity, cooling and power7Lack of a common platform4Matching capacity to demand
  • 5. In House or Hosted ServersAllocated IT-capacitiesLoad Forecast“Under-supply“ of capacities“Waste“ of capacitiesFixed cost of IT-capacitiesIT CAPACITYBarrier forinnovationsActualLoadTIME
  • 6. Cloud ComputingLoad ForecastAllocated IT capacitiesNo “under-supply“IT CAPACITYReduction of “over-supply“Possible reduction of IT-capacities in case of reduced loadReduction of initial investmentsActualLoadTime
  • 7. Types of CloudsPlatform(as a Service)Private(On-Premise)Infrastructure(as a Service)You manageApplicationsApplicationsApplicationsYou manageRuntimesRuntimesRuntimesSecurity & IntegrationSecurity & IntegrationSecurity & IntegrationManaged by vendorDatabasesDatabasesDatabasesYou manageServersServersServersManaged by vendorVirtualizationVirtualizationVirtualizationServer HWServer HWServer HWStorageStorageStorageNetworkingNetworkingNetworking
  • 8. The Microsoft Cloud~100 Globally Distributed Data CentersQuincy, WAChicago, ILSan Antonio, TXDublin, IrelandGeneration 4 DCs
  • 10. Categories of ServicesApplication ServicesSoftware ServicesPlatform ServicesThe Microsoft CloudInfrastructure Services
  • 11. The trick is knowing what your systems need,and how the cloud can help.
  • 12. Not everything has to or can live in the cloud
  • 13. Only move to the cloud that which can benefit
  • 14. The core strategy is ‘hybrid’
  • 15. Take an À la carteapproach
  • 16. We call this Software + Services
  • 18. “Packaged”ApplicationBig Pharmaceutical ExampleHosted “Packaged”“Packaged”using cloud “Software as a Service”BuyERP“Too costly to run this myself, but I’ve made too many customizations”CRMEmailBuild vs. Buy“Home Built”ApplicationHosted “Home Built”“Home Built”using cloud “Platform as a Service”HR SystemMolecule ResearchBuildClinical TrialHosterVendorOn PremiseCloud
  • 19. “Packaged”ApplicationBig Pharmaceutical ExampleHosted “Packaged”“Packaged”using cloud “Software as a Service”BuyERPCRM“CRM and Email are commodity services – They have no customizations, and it’s cheaper for someone else to run these”EmailBuild vs. Buy“Home Built”ApplicationHosted “Home Built”“Home Built”using cloud “Platform as a Service”HR SystemMolecule ResearchBuildClinical TrialHosterVendorOn PremiseCloud
  • 20. Big Pharmaceutical Example“Packaged”ApplicationHosted “Packaged”“Packaged”using cloud “Software as a Service”BuyERPCRMEmailBuild vs. Buy“Home Built”ApplicationHosted “Home Built”“Home Built”using cloud “Platform as a Service”“I can’t afford to maintain this old HR application written in VB4 – it’s driving me mad!”HR System“…but due to regulatory issues, I cannot store my HR data off-premise”Molecule ResearchBuildClinical TrialHosterVendorOn PremiseCloud
  • 21. “Packaged”ApplicationBig Pharmaceutical ExampleHosted “Packaged”“Packaged”using cloud “Software as a Service”BuyERPCRMEmailHR SystemBuild vs. Buy“Home Built”ApplicationHosted “Home Built”“Home Built”using cloud “Platform as a Service”“I wish I had access to cheaper compute and storage when I need it”Molecule ResearchBuildClinical TrialHosterVendorOn PremiseCloud
  • 22. “Packaged”ApplicationBig Pharmaceutical ExampleHosted “Packaged”“Packaged”using cloud “Software as a Service”BuyERPCRMEmailHR SystemBuild vs. Buy“Home Built”ApplicationHosted “Home Built”“Home Built”using cloud “Platform as a Service”Molecule ResearchBuild“THIS is where I want to spend my IT resources – I’m going to double down on this application!”Clinical TrialHosterVendorOn PremiseCloud
  • 23. Where the Cloud is Compelling
  • 24. Only 2 reasons to use the cloud
  • 25. Windows Azure VMsSmallMediumLarge X Large$0.12 $0.24 $0.48 $0.96 Per service hourPer service hourPer service hourPer service hour1 x 1.6Ghz 2 x 1.6Ghz 4 x 1.6Ghz 8 x 1.6Ghz(moderate IO) (high IO)(high IO) (high IO)1.75 GB memory 3.5 GB memory 7.0 GB memory14 GB memory
  • 26. Windows Azure, In One PictureBusiness PortalDeveloper PortalService Management ServiceRESTUser Code……Runtime APIStorage ClusterVS ToolsCompute Cluster…WA SDKVM SetupRESTMSFT DatacentersDesktopCloud VM
  • 34. Digging into Azure with PHP/Ruby
  • 35. Windows Azure, In One PictureBusiness PortalDeveloper PortalService Management ServiceRESTUser Code……Runtime APIStorage ClusterVS ToolsCompute Cluster…WA SDKVM SetupRESTMSFT DatacentersDesktopCloud VM
  • 39. Think Service or DeamonWebRoleExternal Facing
  • 42. Think Web ServerRunning PHP in Windows AzureHow to Do ItHost in Web role (like .NET)Supply PHP runtimePoint to runtime via FastCGI configuration inWeb.configWeb.roleConfigPHP Web RoleInstance 1VIPLoad BalancerPHP Web RoleInstance 2
  • 43. Windows Azure 4 EclipseDoes a lot of the heavy lifting for youCreates the Web.config, Web.roleConfig, PHP implementation and debugs in the dev fabrichttp://windowsazure4e.org
  • 44. Running EXEs in the Worker ProcessStart with a Worker Role Process to Copy the exes to the worker role’s app directoryExecute the processMonitor the health of the processOther auxiliary tasks…
  • 45. Running Ruby in the Worker Processhttp://code.msdn.microsoft.com/railsonazureDownload and extract the solution Copy the Ruby bin and lib folders to the Ruby folder in the RR project Copy your rails application to the RailsApp folder in the RR project Open the solution in Visual Studio Run in the Dev FabricNavigate to http://127.0.0.1:5100
  • 48. Windows Azure Data StorageQueueBlobAccountTablesDrives
  • 49. Azure Platform Data Storage OptionsWindows Azure Data Storage
  • 50. Blobs
  • 57. Durable NTFS volumes that Windows Azure applications can use. See: http://microsoftpdc.com/Sessions/SVC14SQL AzureRelational data storageAdmin Windows Azure Data Storage
  • 59. PHP with Windows Azure StorageWindows Azure SDK for PHP @ http://phpazure.codeplex.comPHP programming model for Windows Azure StorageFeatures PHP classes for Blobs, Tables & QueuesStore PHP sessions in Table Storage
  • 60. Windows Azure Data Storage - BlobsUnstructured data storagePartitioned by containerUnlimited containers
  • 61. Blobs Sample$blobStorage= new Microsoft_WindowsAzure_Storage_Blob();// Createif (!$blobStorage->containerExists($containerName)){$blobStorage->createContainer($containerName);$blobStorage->setContainerAcl($containerName, Microsoft_WindowsAzure_Storage_Blob::ACL_PUBLIC);}// Store$blob = $blobStorage->putBlob($containerName, $blobName, $localFilename, $metadata);/* @var $blob Microsoft_WindowsAzure_Storage_BlobInstance */
  • 62. Blobs Sample Cont…// Copy$result = $blobStorage->copyBlob( $containerName, $blobName, $containerName, $blob2Name);// Retrieve$tempStore= azure_getlocalresourcepath('tempstore');$tempPath= $tempStore. '\\' . $imageId;$blobStorage->getBlob($containerName, $blobName, $tempPath);// Delete$result = $blobStorage->deleteBlob($containerName, $blobName);$result = $blobStorage->deleteContainer($containerName);
  • 63. Blob Stream Wrapper$blobStorage= new Microsoft_WindowsAzure_Storage_Blob();// Register:$blobStorage->registerStreamWrapper(); // registers azure://// or$blobStorage->registerStreamWrapper('blob://'); // use blob://// Use$fp= fopen('azure://mycontainer/myfile.txt', 'r');// ...fclose($fp);
  • 64. Storage: XDriveNTFS drive in the cloud: X:\Fixed size between 16MB and 1TBMax 8 drives on your VMImplemented as a page blobSingle instance writeMultiple instance read
  • 65. Queue Workflow ConceptsWindows Azure Queue ProvidesGuarantee delivery (two-step consumption)Worker Dequeues Message and mark it as InvisibleWorker Deletes Message when finished processing itIf Worker role crashes, message becomes visible for another Worker to processDoesn’t guarantee “only once” deliveryDoesn’t guarantee orderingBest effort FIFOWorker RoleWeb RoleInput Queue (Work Items)Worker RoleAzure QueueWeb RoleWorker RoleWeb RoleWorker Role
  • 66. Azure QueuesRemoveMessageGetMessage (Timeout)Worker RolePutMessageQueueMsg 1Msg 2Msg 2Msg 1Web RoleWorker RoleWorker RoleMsg 3Msg 4Msg 2
  • 67. Loosely Coupled Work with QueuesWorker-Queue ModelLoad work in a queueMany workers consume the queueInput Queue (Work Items)Azure QueueWorker RoleWeb RoleWorker RoleWeb RoleWorker RoleWeb RoleWorker Role
  • 68. Queues$queueClient= new Microsoft_WindowsAzure_Storage_Queue();// Create$result = $queueClient->createQueue('imageQueue');// Delete$queueClient->deleteQueue('imageQueue');// Add message$queueClient->putMessage('imageQueue', $message, $ttl);// Retrieve Messages$messages = $queueClient->getMessages('imageQueue', 10);foreach($messages as $message) {// Do work here...$queueClient->deleteMessage('imageQueue', $message);}
  • 69. Windows Azure Data Storage - TablesSemi-Structured dataTables contain entitiesEntities contain propertiesMay be partitioned across thousands of servers.Support ACID transactions over single entitiesQueries over entire table.NET and REST interfaces
  • 70. Windows Azure Data Storage – Tables (Terms Part 1)TableContains a set of entities. Entity (Row) Basic data items stored in a table. Property (Column)Single value in an entity. RowKeyUnique ID of the entity within a partitionTimestampTime it was created
  • 71. Windows Azure Data Storage – Tables (Terms Part 2)Partition Entities in a table with the same partition keyPartitionKeySegments entities in to partitions to automatically distribute the table’s entities over many storage nodes.Sort OrderThere is a single index provided for the CTP, where all entities in a table are sorted by PartitionKey and then RowKey
  • 72. Key Example – Blog PostsPartition 1Partition 2Getting all of dunnry’s blog posts is fastSingle partitionGetting all posts after 2008-03-27 is slowTraverse all partitions
  • 73. Table Sample$tableStorage= new Microsoft_WindowsAzure_Storage_Table('table.core.windows.net', 'myaccount', 'myauthkey');// Create$result = $tableStorage->createTable($tableName);// List $result = $tableStorage->listTables();foreach($result as $table) {echo 'Table name is: ' . $table->Name . "\n";}// Delete$tableStorage->deleteTable($tableName);
  • 74. Tables with Entities// Structured entityclass ImageEntityextends Microsoft_WindowsAzure_Storage_TableEntity{/** * @azure filename */public $filename;/** * @azure size Edm.Int64 */public $size;}// Unstructured entity// Microsoft_WindowsAzure_Storage_DynamicTableEntity
  • 75. Tables with Entities Cont…// Insert$image = new ImageEntity($partitionKey, $rowKey);$image->filename = $_FILES['imageUpload']['name'];$image->size = $_FILES['imageUpload']['size'];$image = $tableStorageClient->insertEntity($tableName, $image);// Retrieve$image = $tableStorage->retrieveEntityById($tableName, $partitionKey, $rowKey, 'ImageEntity');// Update$image->filename = 'newname.jpg';$result = $tableStorage->updateEntity($tableName, $image);// Delete$result = $tableStorage->deleteEntity($tableName, $image);
  • 76. Table Queries// Filter condition$select = "filesizegt 1024 and PartitionKeyeq '$partitionKey'";// Or fluent interface$select = $tableStorage->select()->from($tableName) ->where('filesizegt 1024') ->andWhere('PartitionKeyeq ?', $partitionKey);// Run query$images = $tableStorage->storageClient->retrieveEntities('testtable', $select, 'ImageEntity');foreach($images as $image) {echo 'Name: ' . $image->filename . "\n";}
  • 77. Batching Operations// Start batch$batch = $tableStorage->startBatch();// Insert multiple$images = generateEntities();foreach($images as $image) {$tableStorage->insertEntity($tableName, $image);}// Commit$batch->commit();
  • 78. Table session handler$sessionHandler = new Microsoft_WindowsAzure_SessionHandler($tableStorage);$sessionHandler->register();session_start();if (!isset($_SESSION['start'])) {$_SESSION['start'] = time();}
  • 79. SQL Azure and Windows Azure Table ComparisonWindows Azure TablesSQL Azure TablesSemi-structuredLoosely typedNon-Relational (Not RDMS)Massively scalableFully structuredStrongly typedRelational (RDMS)Highly scalable
  • 80. MySQL: Simple ConfigurationVIPLoad BalancerWeb RoleMySQLWorker Role
  • 81. MySQL in a Windows Azure ApplicationRunning MySQL in a worker roleCopy MySQL to the worker role sub-directoryCopy to read-write local storageConfigure MySQL to listen on the right portMonitor MySQL healthConsuming MySQLDiscover IP address and portNormal access from then onHandle topology changes
  • 84. Windows Azure Drive with Hot SpareVIPLoad BalancerMySQLMySQL
  • 85. Windows Azure Drive with Hot SpareVIPLoad BalancerMySQLMySQL
  • 87. SQL Azure FeaturesSupportedTables, Indexes, ViewsStored ProceduresTriggersConstraintsTable VariablesTemp Tables (#Name)Not SupportedPhysical Server Access Catalog DDLCommon Language RuntimeService BrokerReporting ServicesAnalysis ServicesDistributed Transactions and Queries
  • 89. SQL AzureAccessing databasesWeb Portal(API)Your AppSQL AzureTDSChange Connection String
  • 90. Database ReplicasSingle DatabaseMultiple ReplicasReplica 1Single PrimaryReplica 2DBReplica 3
  • 91. SQL AzureDatabase Monitoring & RecoveryWeb Portal(API)!Your AppSQL AzureTDS
  • 92. SQL Azure Server Creation
  • 93. SQL Azure Firewall MaintenanceSimple rules
  • 94. Easy one-screen portal maintenanceSQL Azure Database Connection StringAn administrative user is created with the serverUser has system administrator permissions likesa”Server=tcp:itte80vcfq.database.windows.net; Database=FabrikamAzureDB;User ID=SaPaulM;Password=myPassword;Trusted_Connection=False;Encrypt=True;
  • 95. Database MigrationsScriptsTransfer SchemaBCPTransfer DataSSIS (SQL Server Integration Service)Transfer Schema and Data
  • 96. Database Migrations (Cont.)The SQL Azure Migration Wizard helps you migrate your local SQL Server 2005 / 2008 databases into SQL Azure. The wizard walks you through the selection of your SQL objects, creates SQL scripts suitable for SQL Azure, and allows you to migrate your data.”http://sqlazuremw.codeplex.com/
  • 97. Database Management using SQL Management Studio
  • 98. PHP with SQL AzureSQL Server Driver for PHP @ http://sqlsrvphp.codeplex.com/Supports PHP access to SQL AzureFeaturesChoose between SQL Server and SQL Azure by changing connection stringUse from on-premises or in Windows Azure
  • 100. More resourcesMicrosoft Windows Azure Interophttp://www.microsoft.com/windowsazure/interop/Interop Bridgeshttp://www.interoperabilitybridges.com/
  • 101. More resourcesPHPhttp://www.windowsazure4e.orghttp://phpazure.codeplex.com/MySQLWindows Azure MySQL PHP Solution Acceleratorhttp://code.msdn.microsoft.com/winazuremysqlphp
  • 102. More resourcesPythonSriram Krishnanhttp://www.sriramkrishnan.com/blog/2008/11/python-wrapper-for-windows-azure.htmlRubySimon Davieshttp://blogs.msdn.com/simondavieshttp://code.msdn.microsoft.com/railsonazureJohnny Halifehttp://github.com/johnnyhalife/waz-storagehttp://waz-storage.heroku.com/rdoc/index.html
  • 103. And of courseJosh Holmeshttp://www.joshholmes.com
  • 104. Scaling Big while Sleeping WellJosh Holmes@joshholmesjosh.holmes@microsoft.comwww.joshholmes.com

Editor's Notes

  • #5: Many of the challenges with building applications today have very little to do with development tools, programming languages, or frameworks. Rather, many of the challenges that organizations face are related to the infrastructure required to deploy, run, and manage applications. Quickly summarize only 1 of the following:Startups - For example, imagine you were a startup building the next social networking site or online game You have to worry about numerous issues that are unrelated to the functionality of the application.[Capacity]You have to think about the capacity requirements for the application.Will it be used by a few thousand users or hundreds of thousands or millions?How do users translate to bandwidth, storage, and server requirements?Will the usage be consistent during all times of the year? Will it be consistent over the lifetime of the application?Can you handle spikes in demand if there were sudden demands for the app? (Digg Effect)Ultimately, most organizations end up paying for more capacity then they need.[Deployment, operations, and versioning]Then you have to worry about deploying and operating your applicationHow do you deploy your application over multiple servers?How do you role out updates to the app without taking it offline?How do you manage patches? Enterprise - For established organizations, some of these decisions and problems may have already been addressed through a shared data center or an established staff and processes. However, in enterprise organizations we often find that apps are silos of their own servers. Established organizations also still have to spend a significant amount of capital and operations funding. IT resources are applied to maintaining applications rather than delivering new value and functionality. ISV - Finally, if you’re an ISV who builds applications for use by other businesses you have to worry about a number of additional problems. You have to think about your customer’s capacity, which gets factored into the cost of ownership. Often, your sales opportunities are limited by your customer’s ability to deploy new applications.Your customers often have existing assets such as order fulfillment systems, ERP systems, multi-terabyte databases, etc. that are running on-premise. You must be able to easily integrate with these assets.
  • #18: http://www.flickr.com/photos/cesarastudillo/158254288/sizes/o/
  • #24: This reference chart may help us to recognize opportunities for using cloud computing within our own organizations or our vendors or customers.A new social networking sight may need a massive amount of scalability…A 911 call center may require that last “9” of reliability…A tax preparation package may require varying amounts of computational power, storage, and bandwidth…A hurricane relief site may need to launch on a moment’s notice and be available for a duration that is hard to predict at the onset of the disaster.A genome sequencing project or perhaps a search for extraterrestrial planets to live on in our future might require massive amounts of parallel processing power.A new online startup may need to begin business with little or no capital investment and fail fast with little or no financial lossSo with the terrific list of “great fits” … are there any “bad fits”? Well… yes… there are a few… at the present time…Frequently updated applications are not very good candidates. Primarily I say this because as a developer … the time that it takes to deploy is longer than if you had your own local on premise or hosted servers; however, you must take this with a grain of salt as you’ll have to compare it against the level of effort the you presently invest to make deployments in order to gauge the applicability of this advice.Applications needing external data storage are also not very good candidates at the present time.Of course, this is a moving target… and as cloud computing evolves further… even these bullets (and others like them) may move from the not-so-good list to the good-list. We are entering a new era of software development where we will once again be inspired and excited about our profession as software developers!
  • #31: http://www.flickr.com/photos/28481088@N00/2530180465/sizes/m/
  • #41: We’ll start with SQL Azure... This will give most of developers a common frame of reference as most developers are comfortable with relational databases.In a short while, I will introduce Blobs, Tables, Queues, and DrivesSQL Azure can be thought of as your SQL Server in the cloud. It is based on a subset of SQL Server 2008.Blobs are a means of storing unstructured data, such as pictures, movies, PDF’s, Word documents, and the like.Tables are a means of storing semi-structured or tabular data. Tables are similar to an Excel spreadsheet in the sense that data is tabular and there is no strict type cohesion as there would be in a SQL Server table column. Data stored in tables is partitioned and keyed for retrievalQueues are a means of buffered message delivery. There are very useful for communicating data between our Windows Azure service instances. As our service instances do not have to wait around for the I/O of delivering the message or the result of the message processing, they can dramatically improve the scalability of our software system.Drives are a recently added feature announced at the Los Angeles PDC in November 2009. Drives provide durable storage that appears to our application as an NTFS volume. The drive itself is an abstraction over the same Windows Azure Data Storage used for Blobs. You can get more information on Drives by visiting the PDC site on my slide.Applications may use multiple types of data storage at the same time. In fact, this is quite common. When we do our first Windows Azure Data Storage demo together, I will be showing you an application that uses Blobs, Tables, and Queues in concert.
  • #42: Okay… That’s all about SQL Azure for now… we’ll come back to this topic in Session 3…Keep in mind that SQL Azure is a separate product from Windows Azure…. And that Windows Azure includes Windows Azure Data Storage, which we are going to talk about now. We will be using the Windows Azure Data Storage directly in demos, so these slides will provide more of a brief and high level overview.To get Windows Azure Data Storage setup, we simply create a new Storage Account from the Windows Azure Portal.
  • #43: Our Windows Azure Data Storage will be accessible via RESTful queries at the endpoints you see on this slide, or via the API in the Windows Azure SDK library.We’ll be using the Windows Azure library in our demo.
  • #45: It’s time now to introduce Windows Azure Data Storage Blobs.Blobs are for storage of unstructured data.We partition our data by creating Blob containers which we give names to.We can create an unlimited number of Blob Containers.We then simply place our blob data into the blob containers, supplying a unique identifier.When we want to retrieve our data, we simply provide the container and the unique identifier.
  • #51: Use queues as a way of communicating w/ the backend worker rolesWRs call getmessage and pass timeoutTimeout value is importantExpiration time is important; message is marked in the queue as invisible; for duration of timeout it’s invisibleWhen we’re done processing, we call a message to remove the message through a deleteTh reason we do this is imagine we have a second worker role; if something goes wrong, once the timeout expires, the message becomes visible, and the next person to do a get message will get the message
  • #54: http://www.flickr.com/photos/cav666/3562455727/http://go.microsoft.com/fwlink/?LinkId=153401Windows Azure Data Storage Tables are how we get massively scalable and highly available databases.Although there are some similarities, these tables are very different from relational database tables.Data in Windows Azure Data Storage Tables is semi-structured; The concept of a Windows Azure Data Storage Table is similar to how a spreadsheet is used to provide tabularized organization to data without strongly enforcing data cohesion.… Data is indexed in Tables for high performance retrieval, but there are no relationships between Tables.The tables support ACID transactions over single entities and rich queries over the entire table.
  • #56: The PartitionKey combined with the RowKey uniquely identifies an entity in a table.
  • #57: 11:53Getting the all of dunnry’s post it fast because we’re selecting the entities by a partition keyGetting all of the posts after a certain is slow because we may have to traverse across multiple servers because we’re selecting entities that span partition keysA query without the partition key is really a scan
  • #64: We have included this feature comparison table in anticipation of your likely questions about differences between using a relational database table as you may be currently doing with your SQL Server databases and the new Windows Azure Tables included in Windows Azure.
  • #71: http://www.flickr.com/photos/timothymorgan/75593157/sizes/o/
  • #72: As I stated earlier, SQL Azure is based on SQL Server 2008. At this time it is only a subset of the features of the server product.My intention here is to convey the high level features that are supported and the ones that are not.SQL Azure will support most of the things we need… Tables, Index, Views, Stored Procedures, Triggers, and Constraints… in my book… that’s all the functionality that I need for most of my applications.There are some other adjunct technologies that ship as part of SQL Server 2008 such as SQL Reporting Services and Analysis Services which are not supported. The Service Broker is also not supported.
  • #73: So let’s assume that we have designed our relational database with local developer and data modeling tools.We can begin our story then by assuming that we want to get our database deployed to the cloud.There are some tools that will expedite this process which I will show you later, but for now lets assume that we have scripted our database schema. We apply this script to SQL Azure which speaks native TDS.If you created your database through the SQL Azure Portal, then SQL Azure will have created one master database and three replicas of that database. If you create your database with the script the same will be true.These replicas are stored in different database centers from the master to provide redundancy and protection against geographical catastrophe.
  • #74: Configuring our application to use SQL Azure storage instead of SQL Server is simply a matter of modifying the connection string in our application’s configuration file.When our application requests data, ADO.NET speaks to the TDS which directs our queries to the master database server. The master database server performs our query and returns the results to our application.
  • #75: From our application’s point of view, there is only one SQL Azure database.As we make updates to our database, those updates are replicated to other copies stored in other data centers so that in the event that our database fails for any reason, the other databases will be standing by ready to take its place.
  • #76: But what if that master database server fails for some reason?TDS is receives notification of the database failure and automatically redirects the call to the replica!The Azure Cloud Fabric is self-healing… and the details are outside the scope of this presentation; however, the fabric will get busy repairing itself like drones on a Borg mother ship… essentially with the objective of keeping three replicas online at a time.
  • #77: I will demonstrate creating a SQL Azure account in session 3 where I will walk you through the entire process.For now I simply want to give you some background information to prepare you for our first demonstration.When we create our SQL Azure database server, we’ll be prompted for an Administrator’s name and a password.This username and password will be the granted a system administrator role that is similar to the “sa” account on a local SQL Server 2008 box. The account has permission to create and drop databases and database ownership authority in any databases that you create with this account.
  • #78: After creating your SQL Azure database server, you will want to grant appropriate access through the SQL Azure firewall.SQL Azure provides a very simple and easy to maintain firewall. The firewall is so easy to use that it’s only going to get one slide in my deck!The firewall allows us to expose our database to Windows Azure services via a checkbox and to add ranges of IP addresses such as your home office and your business… or possibly the address of a 3rd party server hosting some application that needs data access.I’ll do a thorough demo of this feature in session 3…
  • #79: When you created your SQL Azure database server, you supplied an administrator’s user name and password. I have named my user accordingly… to remind me of its power.The SQL Portal will offer you the ability to copy these credentials in connection string format to your clip board… tempting you into believing that you should just paste this into your configuration file.This is terrific for demos like mine… BUT you should NEVER, EVER do this…A database server system administrator password placed in a configuration file in clear text format… there has got to be something naive in the extreme going on here… and worse… no way to create non-sa-like users through the UI… you must script your database users and then apply the script to the database. And to anticipate your question… no… you can’t use SQL Server Management Studio to do this either.I will demo this as well in session 3… so hang tight…
  • #80: There are a number of techniques for getting data migrated from an existing database into a SQL Azure database.One very effective technique is to script the database schema and any stored procedures or views and then apply these scripts to the SQL Azure database. Once the schema has been deployed to the cloud, BCP can be used to copy the data in.Another effective technique is to utilize SQL Server Integration Service which will transfer the Schema and the Data.
  • #81: I think that I saved the best for last here… The SQL Server Migration Wizard is available for download from the CodePlex website at the URL on this slide.To quote the website, “The SQL Azure Migration Wizard helps you migrate your local SQL Server 2005 / 2008 databases into SQL Azure. The wizard walks you through the selection of your SQL objects, creates SQL scripts suitable for SQL Azure, and allows you to migrate your data.”I will demonstrate this tool in session 3 when I use it to migrate an application and associated database from the local desktop to the cloud.
  • #82: Although some things can be done with SQL Server 2008 Management Studio, I highly recommend that you use the 2008 R2 Nov CTP as it is SQL Azure aware.After you have created your system administrator account for SQL Azure, you can use SQL Server Management Studio R2 CTP to make connections to the database and execute scripts such as the one that I am showing in this slide.