Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Developing With SQL Azure

Similar presentations


Presentation on theme: "Introduction to Developing With SQL Azure"— Presentation transcript:

1 Introduction to Developing With SQL Azure
Jeff Mlakar Database Architect Ernst & Young

2 About me Computer Science and Mechanical Engineering degrees from the Engineering College at the University of Michigan Started in SQL Server 2000, C++, Started in .NET 1.1, BizTalk 2002 Currently work as a Database Architect at the accounting firm of Ernst & Young. (Title has been referred to as Database Architect, SQL Lead Designer/Data Modeler, Senior Application Engineer, … so you tell me) Work on applications to Steward/Manage/ReportOn data across the global firm. Blog: ,

3 PURPOSE To introduce you to working with Cloud databases in SQL Azure by working to accomplish a specific goal. I’ve found it’s easier to learn about something when you have a goal in mind.

4 The Goal Create a Tool in Management Studio that can upload/retrieve common TSQL scripts to/from an online repository.

5 Agenda About your speaker What is the Cloud?
Windows Azure Platform Overview SQL Azure overview DEMO: Creating an Azure database DEMO: Creating your own SSMS AddIn DEMO: Developing in the Cloud DEMO: Connecting to and using your Cloud DB Show end product / Chance to win prizes! SQL Azure Pricing SQL Azure News SQL Azure Coming-Soons You’re actually getting 2 for the price of 1 in this talk.

6 What is Cloud Computing?
A Service approach to computing that’s about scaling, abstraction by the vendor, and consumption-based pricing.

7 Think “Electricity” Powering your building is like running your website / database

8 Why use the Cloud? 2 reasons:
Scale to and pay for what you use. Only worry about the stuff you know well.

9 Allocated IT-capacities
Load Forecast Not Enough Power Too Much Power IT CAPACITY Slide Objectives: Understand the challenges of irregular load in applications Understand the challenges of both too much capacity and not enough capacity and the sort of groups they impact within a customer Understand that traditionally IT capacity is purchased in a stepwise fashion involving capital expenditure at each point Speaking Points: To understand the value and opportunity for cloud computing, I believe it’s important to think about how IT capacity is typically used by applications today in most environments. Today most organizations significantly over estimate or underestimate the amount of resources they need to run their applications. This leads to a higher cost for the infrastructure and the delivery of the overall applications. Build Steps: Forecast load is to grow steadily Planned capacity grows in a stepwise fashion. Need to plan in advance due to hardware lead times Actual load is highly variable over time Periods where we have excess capacity. Capital laying idle, opex wasted powering and cooling servers Periods where we have insufficient capacity and our customers get a bad experience Actual Load TIME

10 IT CAPACITY TIME Load Forecast Actual Load Capacity on Demand
Slide Objectives: Understand that Windows Azure allows capacity to be turned on and off easily Capacity can be brought on stream very quickly (no need to order servers in advance) Speaking Points: Lowers capex through not having to pay for hardware Reduces waste of ovefr capacity Ensures we can always provision enough capacity for peak periods Can reduce capacity if demand subsides Actual Load TIME

11 Cloud Services “IaaS” “PaaS” “SaaS” Host Build Consume Amazon
Software-as-a-Service Consume GMail “SaaS” Platform-as-a-Service Build Microsoft “PaaS” Infrastructure-as-a-Service Host Amazon “IaaS” Slide Objectives: Explain the three established terms in the industry for cloud services Speaking Points: With this in mind, it’s important to understand how to talk about our Cloud Services offerings. There is a lot of confusion in the industry when it comes to the cloud. It’s important that you understand both what is happening in the industry and how we think about the cloud. This is the most commonly used taxonomy for differentiating between types of cloud services. The industry has defined three categories of services: IaaS – a set of infrastructure level capabilities such as an operating system, network connectivity, etc. that are delivered as pay for use services and can be used to host applications. PaaS – higher level sets of functionality that are delivered as consumable services for developers who are building applications. PaaS is about abstracting developers from the underlying infrastructure to enable applications to quickly be composed. SaaS – applications that are delivered using a service delivery model where organizations can simply consume and use the application. Typically an organization would pay for the use of the application or the application could be monetized through ad revenue. It is important to note that these 3 types of services may exist independently of one another or combined with one another. SaaS offerings needn’t be developed upon PaaS offerings although solutions built on PaaS offerings are often delivered as SaaS. PaaS offerings also needn’t expose IaaS and there’s more to PaaS than just running platforms on IaaS.

12 Cloud Services In-House Software Infrastructure Platform Software
Storage Servers Networking O/S Middleware Virtualization Data Applications Runtime You manage Infrastructure (as a Service) Storage Servers Networking O/S Middleware Virtualization Data Applications Runtime Managed by vendor You manage Platform (as a Service) Managed by vendor You manage Storage Servers Networking O/S Middleware Virtualization Applications Runtime Data Software (as a Service) Managed by vendor Storage Servers Networking O/S Middleware Virtualization Applications Runtime Data Slide Objectives: Explain the differences and relationship between IaaS, PaaS, and SaaS in more detail. Speaking Points: Here’s another way to look at the cloud services taxonomy and how this taxonomy maps to the components in an IT infrastructure. Packaged Software With packaged software a customer would be responsible for managing the entire stack – ranging from the network connectivity to the applications. IaaS With Infrastructure as a Service, the lower levels of the stack are managed by a vendor. Some of these components can be provided by traditional hosters – in fact most of them have moved to having a virtualized offering. Very few actually provide an OS The customer is still responsible for managing the OS through the Applications. For the developer, an obvious benefit with IaaS is that it frees the developer from many concerns when provisioning physical or virtual machines. This was one of the earliest and primary use cases for Amazon Web Services Elastic Cloud Compute (EC2). Developers were able to readily provision virtual machines (AMIs) on EC2, develop and test solutions and, often, run the results ‘in production’. The only requirement was a credit card to pay for the services. PaaS With Platform as a Service, everything from the network connectivity through the runtime is provided and managed by the platform vendor. The Windows Azure Platform best fits in this category today. In fact because we don’t provide access to the underlying virtualization or operating system today, we’re often referred to as not providing IaaS. PaaS offerings further reduce the developer burden by additionally supporting the platform runtime and related application services. With PaaS, the developer can, almost immediately, begin creating the business logic for an application. Potentially, the increases in productivity are considerable and, because the hardware and operational aspects of the cloud platform are also managed by the cloud platform provider, applications can quickly be taken from an idea to reality very quickly. SaaS Finally, with SaaS, a vendor provides the application and abstracts you from all of the underlying components.

13 Windows Azure Platform PaaS

14 Windows Azure Platform
Scalable compute and storage Automated service management Familiar tools, technologies, languages Relational storage for the cloud Consistent development model Automated database management Connect existing apps to the cloud Connect through network boundaries Easily control authorization to apps

15 Storage Options in Windows Azure Platform:
Windows Azure Storage Instance: non-relational storage by means of services that use BLOBS Tables Queues (cheap, but have to programmatically handle Referential Integrity, Transactions, Performance, etc…) SQL Azure (more expensive that #1, but gives us relational storage with powerful and robust database engine we all know and love)

16 SQL Azure Database as a Service

17 History First introduced in Community Technology Preview (CTP) as SQL Server Data Services (SSDS) SSDS was non-relational (similar to current Windows Azure Storage instances) and was an altogether new approach to persisting data. Customers complained. They wanted: Relational engine Easy way to Migrate existing apps To use the skill set they already have. Exit SSDS. Enter SQL Azure. (Yay! A Database!)

18 SQL Azure Database The first and only true database as a service
Subtitle color Managed Service Scale On Demand Innovate Faster Easy provisioning and deployment Auto high-availability and fault tolerance No need for server or VM administration Database utility; pay as you grow Business-ready SLAs Enable multi-tenant solutions World-wide presence Build cloud-based database solutions on consistent relational model Leverage existing skills through existing ecosystem of developer and management tools

19 SQL Azure Physical Architecture
Apps Tools ODBC ADO.NET TDS SQL Azure Services Connection Routing Billing Provisioning Server Server Server SQL Server SQL Server SQL Server SQL Azure Fabric SQL Azure Fabric SQL Azure Fabric Infrastructure Database 1 Database 2 Database 3

20 Database Replicas (Hooray for HA!)
Single Database Multiple Replicas Replica 1 Single Primary Replica 2 DB Replica 3 Replica 4

21 Logical vs. Physical Administration
Service handles physical management Automatically provides HA “out of box” Transparent failover in case of failure Load balancing of data to ensure SLA SQL Azure focus on logical administration Schema creation and management Query optimization Security management (Logins, Users, Roles)

22 Azure Code/Data Architecture Options:
Near Far

23 Azure Code/Data Architecture Options: (cont.)
From Windows Azure From Outside Microsoft Datacenter From Windows Azure & Outside Microsoft Datacenter SQL Server App Code / Tools Application / Browser App Code / Tools SQL Azure Data Sync Microsoft Datacenter Microsoft Datacenter Microsoft Datacenter Windows Azure Windows Azure SQL Azure SQL Azure SQL Azure Code Near Code Far Hybrid

24 DEMO TIME! Create a SQL Azure Server and Database

25 Steps to Create a SQL Azure Database
Get a free subscription through: Use Promo Code: DPWE01 OR Introductory special at: Go your portal at Select Database -> Your Subscription -> Create Server. Create firewall rules. DONE!

26 Steps to Create a SQL Azure Database
Select Create Database

27 Create an SSMS AddIn Step-by-Step
demo Create an SSMS AddIn Step-by-Step

28 Steps to Create an SSMS AddIn
Open Visual Studio. File->New Project->Other Project types->Extensibility-> Visual Studio AddIn Go through Wizard and select “Yes” for creating a Command Bar UI Change Debugging from VS to SSMS by going to the Project Properties, under “Debug”. Remove Working Directory and Command Line Change Start External Program to C:\Program Files\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Ssms.exe

29 Steps to Create an SSMS AddIn (cont.)
While you’re in Properties, go to Build and Select “Register for COM interop” Delete “.Addin” files Add a Setup Project. File->Add->New Project->Other Project Types->Setup Proj Right-click Setup Proj and Add Project Output. Select the primary output of your AddIn project Select primary output, go to Properties->Register. Change from vsdrpDoNotRegister to vsdrpCOM

30 Steps to Create an SSMS AddIn (cont.)
Add Registry Keys to Setup Proj by right-clicking and going to View-Registry. Add: [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\100\Tools\Shell\AddIns\AddInName.Connect] "LoadBehavior"=dword: Add dlls (What make it possible)

31 Steps to Create an SSMS AddIn (cont.)
Add DLLs:- SqlWorkbench.Interfaces.dll - Microsoft.SqlServer.SqlTools.VSIntegration.dll From: C:\Program Files\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE Open Connect.cs and add “using Microsoft.SqlServer.Management.UI.VSIntegration” Comment out DTE2 _applicationObject and declaration; that interface is not supported in SSMS AddIn Replace _applicationObject with ServiceCache.ExtensibilityModel

32 Steps to Create an SSMS AddIn (cont.)
15) Locate OnConnection and make connectMode Startup Before: After:

33 Steps to Create an SSMS AddIn (cont.)
In Setup Proj, right click Detected Dependencies and hit Refresh In the resulting list, right-click ieframe.dll and Click “Exclude”. It’s not supported.

34 Now we’re ready to say Hello World

35 Steps to Create an SSMS AddIn (cont.)

36 Steps to Create an SSMS AddIn (cont.)
Build your AddIn project and Setup Project. Run the msi you built and Start Management Studio (After you’re installed once, you can just hit F5 to run changes)

37 Make a more complex App

38 Add a User Control Create a Windows User Control “MainWindow”
and launch it like so:

39 If you need to create an update:
In Setup Project Properties, make sure “RemovePreviousVersions” is set to true Increment Version Select “Yes” when prompted to update ProductCode Correct update installer to function correctly for COM reg Download “Orca.exe”, a database table editor for creating and editing Windows Installer packages. Open the resulting msi in Orca and open table “InstallExecutionSequence” Find Entry “RemoveExistingProducts” and give it a value that falls between InstallValidate and InstallInitialize (ie 1450 if InstallValidate is 1400 and InstallInitialize is 1500)

40 Developing in the Cloud
demo Developing in the Cloud

41 Database Manager

42 Connecting to and using your Cloud DB
demo Connecting to and using your Cloud DB

43 Use fully-qualified server name and SQL Server Authentication to connect in Connection String

44 Bail! Drop DB and Server. No more charges!
demo Bail! Drop DB and Server. No more charges!

45 New(er) Stuff Integrated Silverlight Management Tool that you saw
SQL Server Reporting Services Data-tier Application (DAC) framework v2.0 (CTP)

46 Rumors of Coming-Soons
SSIS Database Federations Backups (what?? They’re not there yet?)

47 Not supported Change Data Capture Data Auditing Data Compression
Extended Events External Key Management / Extensible Key Management FILESTREAM Data Integrated Full-Text Search Large User-Defined Aggregates (UDAs) Large User-Defined Types (UDTs) Performance Data Collection (Data Collector) Policy-Based Management Resource Governor Sparse columns

48 Not supported (cont.) SQL Server Replication
Transparent Data Encryption Common Language Runtime (CLR) and CLR User-Defined Types Database Mirroring Service Broker Table Partitioning Typed XML and XML indexing is not supported. The XML data type is supported by SQL Azure. Backup and Restore (that’s right. I’m complaining about it twice) Extended Stored Procedures Extended Properties See General Guidelines & Limitations:

49 Useful Tools SQL Azure Data Sync SQL Azure Migration Wizard
Based on Microsoft Sync Framework Easy way if you want to sync data across data centers or from Cloud to On-Prem SQL Azure Migration Wizard Analyze a DB or a script for Azure compliance

50 So what does this COST? Edition Web Business Bandwidth Max 1 GB
$9.99/month n/a $.10 in / $.15 out / GB /month Asia: $.10 in / $.20 out / GB /month Max 5 GB $49.95/month same Max 10 GB $99.99/month Max 20 GB $199.98/month Max 30 GB $299.97/month Max 40 GB $399.96/month Max 50 GB $499.95/month

51 Summary SQL Azure provides a highly available cloud database service.
Infrastructure in managed for you Scale On Demand Use your existing skill set to innovate faster

52 Resources Books: Azure in Action Downloads:
Search: “Windows Azure Platform Training Kit” Links: Events: Azure Bootcamp: Detroit is April 13,14 You’re actually getting 2 for the price of 1 in this talk.

53 Resources (cont.) My SSMS AddIn for Storing Scripts to Cloud:
Download, install, will appear in Tools->ScriptStore for SSMS 2008/2008R2 Upload the most scripts by April 9th, & Win a $100 Amazon Gift Card! Upload the best script by April 9th, My Blog: Follow me on twitter: @JeffMlakar You’re actually getting 2 for the price of 1 in this talk. Thanks to Microsoft and Brian Prince for many graphics in this presentation

54 Resources (cont.) Stick around for Bill Wilder's talk: Storing Data in the Cloud: Beyond SQL Azure at 2:30 You’re actually getting 2 for the price of 1 in this talk.

55 Questions?


Download ppt "Introduction to Developing With SQL Azure"

Similar presentations


Ads by Google