• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Real World Azure - Dev
 

Real World Azure - Dev

on

  • 3,731 views

MSDN Events Presents – for the Developer & Architect from ...

MSDN Events Presents – for the Developer & Architect from

In this session, we will discuss:

Cloud computing architectures in general and the Azure architecture in particular
Several aspects of Azure from the developer’s and architect’s perspective
Azure roles (web, web service and worker)
Azure storage options
Azure security and identity options
How Azure-based applications can be integrated with on-premise applications
Configuration, deployment and scaling Azure-based applications
How development teams can optimize their applications for better management and monitoring

Statistics

Views

Total Views
3,731
Views on SlideShare
3,702
Embed Views
29

Actions

Likes
3
Downloads
121
Comments
0

2 Embeds 29

http://www.notsotrivial.net 25
http://www.slideshare.net 4

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • Here’s the datacenter in the cloudA collection of commodity hardwareA collection of storage servers; triple replicationLoad BalancersFabric Controller: the “Brains” behind it all. Web Portal: where to deploy and manage applicationsService – any app you want to run is the service.It’s about running your service in the Microsoft datacenter. Windows Azure is not a SKU that you would install onsite.
  • = Service Deployment (So easy, even a CEO can do it) =Service, the application you want to runModel, service configuration; tells what the service looks like, how many you want to run, etc.Today, you must deploy your service through the portal. In the future, there will be an API available that will you to deploy your service through command-line, TFS build procedures, and other types of automation In this scenario, we are deploying our service through the portal. We upload the two files (the service package and model configuration). The Fabric Controller reads the model configuration which describes how to deploy our service. In this case, we are deploying our service to 3 machines. The Fabric Controller determines which 3 machines to deploy to, copies the service package to the 3 machines, and fires up the services. [Transition] The Fabric Controller then configures the DNS so you have an endpoint exposed for your services for the outside world to communicate with your services. From there, it configures the load balancers and routers. That’s it. It’s completed automated.
  • Managed partner pipeline review -opps in Seibel, partner, PAM; get together and collaborate on opps - more social collaboration, ability to comment, ability to bring people inDidn’t do much in SQL Azure as it wasn’t available at the timeAccomplished goals in 5 mos.
  • Web role - support for multi-tennancy (host multiple customers or segments on set of infrastructure) - web service for updating the opportunity information.NET Service Bus was used to integrate on the backend with SeibelMoved worker role inside firewall as it made more sense (on premise)Heavy use of Tables and BlobsMost Queue work is done with the .NET Service Bus under-the-covers; not a whole lot of work writing directly to QueuesDuring development, SDS did a reset and became SQL Azure; use Azure storage until SQL Azure becomes available (one of the best decisions they made)
  • Community wants to control Personalization, Content, Membership
  • TODO: Convert to Whiteboard template
  • TODO: Convert to Whiteboard template
  • We will bend over backwards to help you out.
  • BlobsBlobs are stored in containers. There are 0 or more blobs per container and 0 or more containers per account. (since you can have 0 containers, but then you would not have any blobs either)Typically url in the cloud is http://accountname.blob.core.windows.net/container/blobpathBlob paths can contain the / character, so you can give the illusion of multiple folders, but there is only 1 level of containers.Blob capacity at CTP is 50gb.There is an 8k dictionary that can be associated with blobs for metadata.Blobs can be private or public:Private requires a key to read and writePublic requires a key to write, but NO KEY to read.Use blobs where you would use the file system in the past.
  • Tables are simply collections of Entities.Entites must have a PartitionKey and RowKey – can also contain up to 256 other properties.Entities within a table need not be the same shape! E.g.:Entity 1: PartitionKey, RowKey, firstnameEntity 2: PartitionKey, RowKey, firstname, lastnameEntity 3: PartitionKey, Rowkey, orderId, orderData, zipCodePartitions are used to spread data across multiple servers. This happens automatically based on the partition key you provide. Table “heat” is also monitored and data may be moved to different storage endpoints based upon usage.Queries should be targeted at a partition, since there are no indexes to speed up performance. Indexes may be added at a later date.Its important to convey that whilst you could copy tables in from a local data source (e.g. sql) it would not perform well in the cloud, data access needs to be re-thought at this level. Those wanting a more traditional SQL like experience should investigate SDS.
  • Hosted in Microsoft data centersFor massive scalable applicationsWe’re talking millions of rows, terabytes of dataStorage is one of the pieces of the Azure PlatformIt is NOT relationalWe can take hot data, the data that’s being requested more often, and scale those out to more serversDesigned for online, high-scale, high-throughput applicationsFamiliar if you’re used to .NET, LINQ and ADO.NET Data ServicesShared-key authentication between client and server
  • 05:17Flexible schema, tables don’t have to have the same columns (properties) defined up front; this is not an ‘Add Column’ or ‘Update Schema’Optimistic concurrency, protects you from someone else from modifying your data while you’re working on it
  • 07:17It’s an “Entity Store”, you can store entities, can retrieve entities, do simple querying on these entitiesPartitioned SQL Server: - A-M on this server - N-Z on this serverTop 5 customers that ordered the most, you have to poll 26 servers and aggregate the dataThat’s sort of what we have with Azure Table storage. We went with a highly partitioned approach upfront to gain scale and gain availability. We’ve had to sacrifice some of the complex queries such as joins to support this. It’s just a different way of having to deal with your data.
  • 09:18Entities (Rows)Properties (Columns)An Entity has 2 “Key” properties: -PartitionKey: How to partition data (ie. First-letter of last name, zip code) - every entity will be on the SAME physical server, this sets us up for scale - a good strategy is to keep your partitions small - RowKey: a unique identifier within a partition
  • 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
  • 14:58Keep partitions small, this increases scalability; this allows us to replicate data when its hot and spread data across multiple servers
  • 16:34Whitepaper: Windows Azure Table - Programming Azure Tables, http://go.microsoft.com/fwlink/?LinkId=153401Locality, in working with your entities, you want them to be on the same server or close together; you gain locality by having large partitionsBut… for scalability, we said that you want smaller partitions so we can help manage the distribute the data and therefore the loadScalability is defined on who well you can manage your partition sizesConsiderations: - the only transaction we have our within the same table with the same partition key; take your transactional requirements into consideration when defining you want to partition your data - query efficiency; think through the top queries you want to execute - scalability: managing the size of your partitions - flexible partitioning : A-M, N-Z; change to A-M, N-R, S-Z - partitioning scheme by months (holiday sales, by month but in december by day)
  • 21:51A simple formula for choosing keys (more info in the whitepaper)Potential keys… what are you going to query onOrder by importanceMay need additional information to make it unique (add a GUID)
  • 23:35If you do a query on a non-key property, that’s a scan (very inefficient)Improve performance by scoping - by partition key, and range of row keys - scope by tables (came up in some customer discussions); users have arbitrary queries, no good set of keys (only querying from top 1000 items), make a table of just those 1000 items - data will be replicated but you can determine which partition to query from based on query typeIs it OK to duplicate data? Efficiency over consistency and slowing down updates - Certain types of applications
  • 30:29One of the more important things to understand*NOT* a relational databaseBad – indexes, foreign keys, referential integrity don’t existGood – it scales!Have to write lower level code for Azure table access vs. SQL ServerStorage in triplicateOur experience is Azure storage has been remarkably stable during the CTP; amazing as it’s a CTP and its brand new codeIt is CASE SENSITIVELot of learning in the community
  • 46:44During development, Azure Storage Client library was a sample; they couldn’t use a sample; since then its shipping as part of the SDK (production quality)Leverage client library where you canAzure storage is available via RESTThe hardest part is getting the signature right; its very picky (tutorial available on bartr’s blog)Client library uses ADO.NET Data ServicesSometimes its faster to just pull back a simple string then spin up a bunch of ADO.NET Data Services objectsREST is easier for dealing with versioning
  • 49:23REST requires a lot of parsingLINQ and XML make it easy, but sometimes parsing is easier (and maybe the only thing needed)CLOSE your HTTP connections; wrap in ‘using’ block or physically close themStorage names are picky
  • 50:32Drop table/Create table has about 30-40 sec lag timeOften better to get more data then you need (goes against T-SQL best practices)
  • 52:34List<> is your friend; works well, serializes well, binds wellThe team used this to work with the azure table data
  • 53:20(watch Dave Campbell session on SQL Azure)
  • 54:32SQL Server is very familiar, Azure tables are new and unknownSQL Server will not scale as well for V1; make the right choice for your needs
  • 56:09SQL Azure costs more, but delivers moreDBA’s don’t have the tools available yet to monitor SQL Azure… system catalog is different in the cloud then on premise… this is forthcoming
  • Queues are simple:Messages are placed in queues. Max size is 8k (and it’s a string)Message can be read from the queue, at which point it is hidden.Once whatever read the message from the queue is finished processing the message, it should then remove the message from the queue. If not the message is returned to the queue after a specific user defined time limit. This can be used to handle code failures etc.
  • 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
  • C:Program Files (x86)Microsoft .NET Services SDK (July 2009 CTP)SamplesServiceBusGettingStartedEcho
  • If you are or know someone starting a software business, get started building applications for Windows Azure * by joining BizSpark!*inclusion of Windows Azure in the BizSpark program is still being finalized and there is no public information on this topic we can share

Real World Azure - Dev Real World Azure - Dev Presentation Transcript

  • MSDN Events Presents:Real World Azure
    clint edmonson | architect evangelist | www.notsotrivial.net
    mike benkovich | developer evangelist | www.benkotips.com
  • This is Jim
    Patterns for Cloud Computing
  • Jim has many questions about cloud computing
    Patterns for Cloud Computing
  • The more he reads, the more confused he gets
    Patterns for Cloud Computing
  • “What is Cloud Computing?”
    Patterns for Cloud Computing
  • “What can I use the Cloud for?”
    Patterns for Cloud Computing
  • “What is Microsoft’s roadmap in this space?”
    Patterns for Cloud Computing
  • Define Cloud Computing
    Break down the parts
    Highlight the implementation of a Real World Azure scenario
  • Jim has heard all the buzzwords
  • Service Oriented Architecture
  • Rich Internet Applications
  • Software as a Service
  • Software + Services
  • Are any of these cloud computing?
  • Styles of application architecture
  • These styles can work in the cloud, but they are not cloud computing
  • Where do your applications “live”?
  • On Premises
    Hosted
    Cloud
    Vendor’s Problem
  • “What is Microsoft doing in Cloud Computing?”
  • 3 x Critical Concepts
  • Roles
    Web Role
    Worker Role
  • Storage
    Table, Blob, Relational
  • Messaging
    Queues
  • Patterns for Cloud Computing
    Using the Cloud for Scale
  • “Isn’t the cloud good for applications that need to scale dynamically?”
    Patterns for Cloud Computing
  • For example, tax applications
    Patterns for Cloud Computing
  • “How does this work?”
    Patterns for Cloud Computing
  • Let’s do some white boarding for Jim…
    Patterns for Cloud Computing
  • Using the Cloud for Scale
    “Wow! What a great site!”
    Database
    Request
    Web Tier
    B/L Tier
    Browser
    Response
  • Using the Cloud for Scale
    Browser
    Browser
    Database
    Web Tier
    B/L Tier
    Browser
    “Server Busy”
    Browser
    Browser
  • Using the Cloud for Scale
    Browser
    Browser
    Database
    Web Tier
    B/L Tier
    Browser
    “Timeout”
    Browser
    Browser
  • How would Jim do this today on premises?
  • Using the Cloud for Scale
    How would Jim do this today on premises?
    Browser
    Web Tier
    N L B
    Browser
    Database
    Web Tier
    B/L Tier
    Browser
    Browser
    Web Tier
    Browser
  • Using the Cloud for Scale
    How would Jim do this today on premises?
    Browser
    B/L Tier
    N L B
    Browser
    Database
    Web Tier
    Browser
    B/L Tier
    Browser
    B/L Tier
    Browser
  • Using the Cloud for Scale
    How would Jim do this today on premises?
    Browser
    Web Tier
    N L B
    B/L Tier
    N L B
    Browser
    Database
    Web Tier
    Browser
    B/L Tier
    Browser
    Web Tier
    B/L Tier
    Browser
  • Using the Cloud for Scale
    How would Jim do this today on premises?
    Browser
    p1 p2 p3
    Web Tier
    N L B
    B/L Tier
    N L B
    Browser
    Database
    Web Tier
    Browser
    B/L Tier
    Browser
    Web Tier
    B/L Tier
    Browser
  • Not without consequences...
  • Using the Cloud for Scale
    How would Jim do this today on premises?
    Browser
    p1 p2 p3
    Web Tier
    N L B
    B/L Tier
    N L B
    Browser
    Database
    Web Tier
    Browser
    B/L Tier
    Browser
    Web Tier
    B/L Tier
    Browser
    “That took a lot of work - and money!”
  • Using the Cloud for Scale
    How would Jim do this today on premises?
    p1 p2 p3
    “Not so great now…”
    Web Tier
    N L B
    B/L Tier
    N L B
    Database
    Web Tier
    Browser
    B/L Tier
    Web Tier
    B/L Tier
    “That took a lot of work - and money!”
    “Hmmm... Most of this stuff is sitting idle...”
  • Using the Cloud for Scale
    Datacenter peak load
    Idle time
    Usage
    Jan
    Apr
    Jul
    Oct
  • How can Windows Azure help?
  • Using the Cloud for Scale
    “Wow! What a great site!”
    Azure Storage
    Request
    Web Role
    Worker Role
    Browser
    Response
  • Using the Cloud for Scale
    Browser
    Browser
    Azure
    Storage
    Web Role
    Worker Role
    Browser
    “Server Busy”
    Browser
    Browser
  • Using the Cloud for Scale
    Browser
    Web Role
    N L B
    Browser
    AzureStorage
    Web Role
    Worker Role
    Browser
    Browser
    Web Role
    Browser
    You don’t see this bit
  • Using the Cloud for Scale
    Browser
    Web Role
    N L B
    Worker Role
    N L B
    Browser
    AzureStorage
    Web Role
    Browser
    Worker Role
    Browser
    Web Role
    Worker Role
    Browser
  • Using the Cloud for Scale
    Browser
    p1 p2 p3
    Web Role
    N L B
    Worker Role
    N L B
    Browser
    AzureStorage
    Web Role
    Browser
    Worker Role
    Browser
    Web Role
    Worker Role
    Browser
  • What’s going on behind the scenes?
  • Windows Azure
    Your
    Service
    DNS
    LB
    Web Portal
    (API)
    LB
    Fabric
    Controller
  • Service
    Service
    Service
    Model
    Your
    Service
    DNS
    LB
    Web Portal
    (API)
    DNS
    config
    LB
    Service Deployment
    Fabric
    Controller
  • Your
    Service
    Service
    Service
    DNS
    Service
    Service
    Service
    Service
    Service
    LB
    Service
    Web Portal
    (API)
    LB
    Model
    Service Scaling
    Fabric
    Controller
  • Your
    Service
    Service
    DNS
    Service
    Service
    Service
    LB
    Web Portal
    (API)
    !
    LB
    Model
    Service Monitoring & Recovery
    Fabric
    Controller
  • On to the Case Study…
  • RXD Incubation Project
    Project Vision
    Project Austin delivers a next-generation, micro-community based opportunity management and collaboration experience to our managed partners …
    Project Goals
    Gain first-hand experience on Azure
    Cloud Storage – Security – Integration – Web – SQL Azure
    Explore a business scenario that leverages the promises of the cloud
    Provide enterprise feedback to the Azure team
    Deliver a working prototype in FY09
    Project Austin Overview
  • Project Austin delivers a next-generation, micro-community based opportunity management and collaboration experience that brings a managed feel to the unmanaged space, allowing Microsoft to observe and participate in the sales process at scale through dynamic, customer-driven collaboration.
    Project Austin leverages Windows Azure, CRM Services, and SharePoint Services to provide a rich set of customer and partner capabilities in the cloud while integrating with existing on-premise solutions.
    Project Austin significantly enhances our understanding of our customers and partners by facilitating relationships with and between customers, partners, and Microsoft, while providing data that allows Microsoft to identify and promote world-class selling techniques and content.
    Project Austin Vision
  • Web Role
    Multi-Tenant; Web App; Web Service
    Integration
    Worker Role; .NET Service Bus; Siebel
    Data Storage
    Tables; Blobs; Queues; SQL Azure
    Live ID Integration
    Web Auth; Access Control Service; WIF; RPS
    Technical Overview
  • Community
    Community
    Micro Community
    Factory
    Community
    Community
    Community
    Groups
    Community Group A
    Community Group B
    Personalization
    Membership
    Content
    Personalization
    Membership
    Content
    High Level Services
    Personalization
    Customization
    Content
    Security
    Integration

    Navigation
    Search
    Membership
    Identity
    Groups

    Foundation Services
    Identity
    Security
    Storage
    Eventing
    Config
    Content

    Micro Community
    Compute
    59
  • (TODO: Insert Austin Screenshots or walkthrough application)
  • (Transition to Developer Evangelist…)
    This slide is Hidden
  • Warning – this session contains information about Microsoft Technologies that are in the CTP (pre-Beta) stages. Specifics of the technology may change before final release.
  • Feedback.
  • We are here to help. Send us your questions, doubts, concerns, challenges, adoration, regrets, denials, and alibis.
    We will start a discussion and help you out.
    something@microsoft.com
  • The Development Experience…
  • Visual Studio
    Templates
    Debugging
    .NET platform
    .NET, IIS7, WCF
    “The cloud on your desktop”
    Complete offline cloud simulation
    Like Cassini (web development server)
    Consistent, Familiar Development
  • Write code on your development machine
    Test locally
    Build package w/VS Tools
    Upload your package to the web portal
    Push “deploy”
    Monitor, upgrade, scale…
    Publishing Your Service To The Cloud
  • Demo: Developer Experience
  • Roles
    Web Role
    Worker Role
    Windows Server 2008 x64
    .NET Start
    Native Code
    User Mode
    • Windows Server 2008 x64
    • IIS 7
    • FastCGI - PHP
    • Native Code
    • Full Trust
    • User Mode
  • Demo: Guest Book
  • Service Models & Roles
    Bid Now Service
    Worker X
    Web A
    (port 80)
    Main Web
    100 instances
    Image Resize
    2 instances
    Worker Y
    Auction Processing
    25 instances
    Web B
    (port 8081)
    Admin
    2 instances
    Worker Z
    Notifications
    10 instances
  • Debugging the cloud really means logging
    Simple logging API today
    More functionality over time
    Debugging in the Cloud
  • Demo: Guest Book Logging
  • Storage in the Cloud…
  • Blobs, Tables, Relational
  • Blobs, Tables, Relational
  • Blobs stored in Containers
    1 or more Containers per account
    Scoping is at container level
    …/Container/blobpath
    Blobs
    Capacity 50GB in CTP
    Metadata, accessed independently
    name/value pairs (8kb total)
    Private or Public container access
    Use Blobs for file system
    Blobs
  • Using the Cloud for Storage
    Blob Container
    PutBlob
    PUT http://account.blob.core.windows./net/containername/blobname
    Azure
    Blob Storage
    REST API
    Client
    http://account.blob.core.windows.net/containername/blobname
    PutBlob = 64Mb MAX
    MetaData = 8Kb per Blob
  • Using the Cloud for Storage
    Blob Container
    Azure
    Blob Storage
    REST API
    Client
    GetBlob
    GET http://account.blob.core.windows./net/containername/blobname
    http://account.blob.core.windows.net/containername/blobname
  • Using the Cloud for Storage
    Blob Container
    Azure
    Blob Storage
    REST API
    Client
    GetBlob
    GET http://account.blob.core.windows./net/containername/blobname
    Range: bytes=329300 - 730000
    http://account.blob.core.windows.net/containername/blobname
  • Using the Cloud for Storage
    Blob Container
    PutBlock(blobname, blockid, data)
    PutBlockList(blobname, blockid1, …, blockidN)
    Azure
    Blob Storage
    REST API
    Client
    http://account.blob.core.windows.net/containername/blobname
    PutBlock = 4Mb MAX to a maximum of 50Gb
    BlockId = 64 bytes
  • Blobs, Tables, Relational
  • Using the Cloud for Storage
    REST:
    GET http://account.table.core.windows.net/Customer?$filter=%20PartitionKey%20eq%20value
    LINQ:
    var customers = from o in context.CreateQuery<customer>(“Customer”) where o.PartitionKey == value select o;
    Azure
    Table Storage
    Worker Role
    http://account.table.core.windows.net
    Each Table:
    PartitionKey (e.g. DocumentName) to ensure scalability
    RowKey (e.g. version number)
    [fields] for data
  • Entities and properties (rows & columns)
    Tables scoped by account
    Designed for billions+
    Scale-out using partitions
    Partition key & row key
    Operations performed on partitions
    Efficient queries
    No limit on number of partitions
    Use ADO.NET Data Services
    Tables
  • Provides structured storage
    Massively scalable tables (TBs of data)
    Highly available
    Durable
    Familiar and easy-to-use API
    ADO.NET Data Services – .NET 3.5 SP1
    .NET classes and LINQ
    REST – with any platform or language
    Introduction to Tables
  • For scalable applications:
    Billions of rows, TBs of data
    Automatic load management (hot data)
    For online applications:
    High availability
    Built-in replication
    Flexible schema (no big “schema migration”)
    Optimistic concurrency
    Advantages
  • No join
    No group by
    No order by
    Think: relational DB partitioned to the max
    Not a Relational Database
  • Table
    A Table is a set of Entities (rows)
    An Entity is a set of Properties (columns)
    Entity
    Two “key” properties form unique ID
    PartitionKey – enables scale
    RowKey – uniquely ID within a partition
    Data Model
  • Key Example – Blog Posts
    Partition 1
    Partition 2
    Getting all of dunnry’s blog posts is fast
    Single partition
    Getting all posts after 2008-03-27 is slow
    Traverse all partitions
  • Partition Key – how data is partitioned
    Row Key – unique in partition, defines sort
    Goals
    Keep partitions small (increased scalability)
    Specify partition key in common queries
    Query/sort on row key
    Keys
  • Tradeoff between locality and scalability
    Considerations
    Entity group transactions
    Query efficiency
    Scalability
    Flexible Partitioning
    Choosing a Partition Key
  • Pick potential keys (common query filters)
    Order keys by importance
    If needed, include an additional unique key
    Use two most important keys as PK, RK
    Consider concatenating to form keys
    A Method of Choosing Keys
  • A Method for Choosing Keys…
    • Pick potential keys (common query filters)
    • Order keys by importance
    • If needed, include an additional unique key
    • Use two most important keys as PK, RK
    • Consider concatenating to form keys
  • Non-key queries are scans
    Improve performance by scoping
    Usually by partition key
    But what about by table?
    3 tables
    Top 1,000 popular items
    Top 10,000 popular items
    Everything
    Now arbitrary “top 1,000” queries are fast
    Better locality than clever partition keys
    Multiple Tables, Same Keys
  • Demo: Guest Book Table Storage
  • Lessons LearnedAzure Storage
    Azure tables are *not* a relational database
    Requires a mind shift
    Azure tables scale
    3 - 9s availability
    Azure tables support exactly one key
    PartitionKey + RowKey
    Case Matters
    No foreign keys
    No referential integrity
    No stored procedures
    Leverage the community
  • Lessons LearnedAzure Storage
    Azure storage Client Library
    No longer just a “sample”
    Azure storage is available via REST
    Not limited to Azure hosted apps
    Not limited to Microsoft platform or tools
    Getting the signature correct is the hard part
    Console tools are easy to write
    Ultimate flexibility
    Use the REST interface early as you’re versioning your tables
  • Lessons LearnedAzure Storage - RESTful
    REST is *not* TDS
    Be prepared to parse
    LINQ and XML classes help
    Sometimes, string parsing is the best choice
    Don’t forget to close your HTTP connections
    Azure storage names are picky
    So are Azure key values
    It’s possible to create an entity in a table and not be able to update or delete it
  • Lessons LearnedAzure Storage – Roundtrips are expensive
    Often better to pull back more than you need vs. multiple roundtrips
    LINQ on results in memory is fast & flexible
    foreach works well too
    don’t forget the break;
    Sort and cache tables on the web tier
    Use XML Serialization to write the results to local storage
    It’s generally faster to hydrate from local storage
    Not as fast as caching in memory
  • Lessons LearnedAzure Storage – List<>
    Using List<> with entity types
    List<> binds well
    LINQ works well with List<>
    So does foreach
    List<> serializes well
    Add intelligence to your entities
    Compare, Equals, ToString, etc.
  • Blobs, Tables, Relational
  • SQL Server Data Services (MIX08)
  • Using the Cloud for Storage
    This is what I’m doing on premises...
    Data
    TDS
    RDBMS
    Client
    DB Server
  • Using the Cloud for Storage
    So, this is what I would like to do in the cloud...
    Data
    TDS
    RDBMS
    Client
    DB Server
  • SQL Data Services (MIX09)
  • SQL Azure (July 2009)
  • Using the Cloud for Storage
    So, this is what I would like to do…
    Data
    TDS
    RDBMS
    Client
    SQL Azure
  • Using the Cloud for Storage
    HTTP
    TDS
    RDBMS
    Browser
    Web Role
    SQL Azure
  • Using the Cloud for Storage
    Queue
    TDS
    HTTP
    RDBMS
    Browser
    Web Role
    Worker Role
    SQL Azure
  • Migration!
  • Using the Cloud for Storage
    “The Data Center”
    TDS
    HTTP
    RDBMS
    Browser
    Web Tier
    Bus. Logic
    SQL Server
  • Using the Cloud for Storage
    “The Cloud”
    Queue
    TDS
    HTTP
    RDBMS
    Browser
    Web Role
    Worker Role
    SQL Azure
  • Demo: SQL Azure CTP
  • CTP Limitations TodaySET ANSI_NULLS ONSET ANSI_NULLS OFFPAD_INDEX  = OFFSET ANSI_PADDING OFFALLOW_ROW_LOCKS  = ONALLOW_PAGE_LOCKS  = ONON [PRIMARY]FILLFACTOR = 90Three-part naming (e.g. dbo.TableName.ColumnName)Cannot use “WITH IGNORE_DUP_KEY” w/o the quotesNo @@servernameNo CREATE SCHEMA(Not an exhaustive list)
  • Lessons LearnedSQL Azure
    From the database “down” it’s just SQL Server
    Well, almost …
    Most tools don’t work today
    System catalog is different
    No CLR
    Above the database is taken care of for you
    You can’t really change anything
  • Lessons LearnedSQL Azure
    SQL Server is very familiar
    SQL Azure *is* SQL Server in the cloud
    Security of Azure tables is unknown
    SQL Server has a very good pedigree
    A lot of our customers LOVE SQL Server
    Understand Azure storage
    Understand SQL Azure
    Make the right recommendation
  • Lessons LearnedSQL Azure
    Azure tables are *not* SQL Azure
    SQL Azure is not the only storage option
    SQL Azure is not always the best storage option
    SQL Azure costs more
    Delivers a *lot* more functionality
    SQL Azure is more limited on scale [today]
  • Queues
  • Simple asynchronous dispatch queue
    Create and delete queues
    Message:
    Retrieved at least once
    Max size 8kb
    Operations:
    Enqueue
    Dequeue
    RemoveMessage
    Queues
  • Azure Queues
    RemoveMessage
    GetMessage (Timeout)
    Worker Role
    PutMessage
    Queue
    Msg 1
    Msg 2
    Msg 2
    Msg 1
    Web Role
    Worker Role
    Worker Role
    Msg 3
    Msg 4
    Msg 2
  • Patterns in the Cloud
    Using the Cloud for Multi Tenancy
  • “I like the idea of scaling Web roles…”
    Patterns for Cloud Computing
  • “…but need to serve multiple customers”
    Patterns for Cloud Computing
  • “Without creating separate codebases!”
    Patterns for Cloud Computing
  • Using the Cloud for Multi Tenancy
    Database
    Web Tier
    B/L Tier
    Browser
    Customer #1
  • How would Jim do this today on premises?
  • #2 - Using the Cloud for Multi Tenancy
    How would Jim do this today on premises?
    Database
    Web Tier
    B/L Tier
    Browser
    Customer #1
    Database
    Web Tier
    B/L Tier
    Browser
    Customer #2
    Database
    Web Tier
    B/L Tier
    Browser
    Customer #3
  • Gets expensive pretty quickly
  • Using the Cloud for Multi Tenancy
    Browser
    Customer #1
    Database
    Web Tier
    B/L Tier
    Browser
    Customer #2
    Browser
    Customer #3
  • Schema CustomizationsUI Customizations
  • Schema CustomizationsUI Customizations
  • 3 options for data in multi tenant environment
  • Using the Cloud for Multi Tenancy
    Browser
    Fixed Schema
    Customer #1
    Database
    Web Tier
    B/L Tier
    Browser
    Customer #2
    Browser
    Option 1: Everyone Uses the Same Database/Schema
    Customer #3
    Pros: Simplest approach, easy to maintain/upgrade.
    Cons: No customizations. Restoring of tenant data.
  • Using the Cloud for Multi Tenancy
    Database
    Browser
    Customer #1
    Customer #1
    Database
    Web Tier
    B/L Tier
    Browser
    Customer #2
    Customer #2
    Database
    Browser
    Customer #3
    Customer #3
    Option 2: Give Each Customer Their Own Database/Schema
    Pros: Flexible. Tenant restore is easier. High Isolation.
    Cons: Can be costly. Difficult to upgrade db schemas.
  • Using the Cloud for Multi Tenancy
    Fixed Schema
    with Customizations
    Browser
    Customer #1
    Database
    Web Tier
    B/L Tier
    Browser
    Customer #2
    Browser
    Option 3: Fixed Database/Schema, with customizations
    Customer #3
    Pros: Customers can add their own custom fields
    Cons: Non standard way of customizing the schema. Tenant restore is difficult.
  • Using the Cloud for Multi Tenancy
    Tenant
    1
    *
    int
    TenantID
    nvarchar
    TenantName
    *
    *
    Type
    Employee
    int
    TypeID
    int
    EmployeeId
    nvarchar
    Name
    nvarchar
    FirstName
    nvarchar
    nvarchar
    CLRType
    LastName
    1
    1
    Customization
    int
    CustomizationID
    *
    *
    nvarchar
    Value
  • Using the Cloud for Multi Tenancy
    Tenant
    1
    *
    1
    TenantID
    UK Branch
    TenantName
    *
    *
    Type
    Employee
    1
    TypeID
    1
    EmployeeId
    PostalCode
    Name
    Gordon
    FirstName
    string
    Brown
    CLRType
    LastName
    1
    1
    Customization
    1
    CustomizationID
    *
    *
    SW1A 2AA
    Value
  • Using the Cloud for Multi Tenancy
    Tenant
    1
    *
    2
    TenantID
    US Branch
    TenantName
    *
    *
    Type
    Employee
    2
    TypeID
    2
    EmployeeId
    ZipCode
    Name
    Barack
    FirstName
    string
    Obama
    CLRType
    LastName
    1
    1
    Customization
    2
    CustomizationID
    *
    *
    20500
    Value
  • Using the Cloud for Multi Tenancy
    Tenant
    1
    *
    2
    TenantID
    Fixed Schema
    Applies to All Tenants
    Could be both
    US Branch
    TenantName
    *
    *
    Type
    Employee
    2
    TypeID
    2
    EmployeeId
    Customizable
    Tenant by Tenant Basis
    ZipCode
    Name
    Barack
    FirstName
    string
    Obama
    CLRType
    LastName
    1
    1
    Customization
    2
    CustomizationID
    *
    *
    20500
    Value
  • Schema CustomizationsUI Customizations
  • #2 - Using the Cloud for Multi Tenancy
    Browser
    Customer #1
    Database
    Web Tier
    B/L Tier
    Browser
    Customer #2
    Browser
    Customer #3
  • URL Handing
  • Can ASP.NET MVC Help?
  • Single Controller per Tenant http://employeedata.cloudapp.net/contoso (ContosoController)http://employeedata.cloudapp.net/fabrikam(FabrikamController)
  • Shared Controller per Tenant http://employeedata.cloudapp.net/contoso (EmployeeController)http://employeedata.cloudapp.net/fabrikam(EmployeeController)
  • Shared Controller per Tenant (with URL mask)http://hr.contoso.co.uk(http://employeedata.cloudapp.net/employees)http://hr.fabrikam.com(http://employeedata.cloudapp.net/employees)
  • Using the Cloud for Multi Tenancy
    http://hr.chase.co.uk
    Browser
    Customer #1
    http://employeedata.cloudapp.net
    Database
    Web Tier
    B/L Tier
    Browser
    Customer #2
    Browser
    Customer #3
    http://hr.citigroup.com
  • Using the Cloud for Multi Tenancy
    http://hr.chase.co.uk -> CNAME (employeedata.cloudapp.net)
    Browser
    Customer #1
    http://employeedata.cloudapp.net
    Database
    Web Tier
    B/L Tier
    Browser
    Customer #2
    Browser
    Customer #3
    http://hr.citigroup.com -> CNAME (employeedata.cloudapp.net)
  • Using the Cloud for Multi Tenancy
    http://hr.chase.co.uk -> CNAME (employeedata.cloudapp.net)
    Browser
    Customer #1
    http://employeedata.cloudapp.net
    Database
    Web Tier
    B/L Tier
    Browser
    Customer #2
    Use custom routing in ASP.NET MVC
    Browser
    Customer #3
    http://hr.citigroup.com -> CNAME (employeedata.cloudapp.net)
  • Demo: Multi-Tenant Routing with ASP.NET MVC
    Tentative
  • Patterns for Moving to the Cloud
    Using the Cloud for Communications
  • Jim’s organization needs to communicate with other organizations
    Patterns for Cloud Computing
  • “This has always been a very tricky and expensive process to get working”
    Patterns for Cloud Computing
  • “Does the cloud offer anything to help?”
    Patterns for Cloud Computing
  • How would Jim have done this before?
  • Using the Cloud for Communications
    Telco provided WAN
    Company 2
    Company 1
    Server
    Client
    FTP
    Server
    FTP
    Client
  • Using the Cloud for Communications
    Internet
    Telco provided WAN
    Company 2
    Company 1
    Server
    Client
    FTP
    Server
    FTP
    Client
  • Using the Cloud for Communications
    Internet
    Telco provided WAN
    Company 2
    Company 1
    DMZ
    Server
    Client
    Extranet
    Site
    Browser
  • What does the cloud provide?
  • Using the Cloud for Communications
    http://app.queue.core.windows.net/
    Azure Queue
    REST
    Client
  • Using the Cloud for Communications
    Company 1
    http://app.queue.core.windows.net/
    Client
    Azure Queue
    REST
    Company 2
    Client
  • Using the Cloud for Communications
    x
    Company 1
    http://app.queue.core.windows.net/
    Client
    Azure Queue
    REST
    Company 2
    Client
  • Using the Cloud for Communications
    Company 1
    http://app.queue.core.windows.net/
    Client
    Master Key
    Azure Queue
    REST
    Company 2
    Client
    Master Key
  • Using the Cloud for Communications
    Company 1
    http://app.queue.core.windows.net/
    Client
    Azure Queue
    REST
    Web Role
    Company 2
    Client
  • Using the Cloud for Communications
    Proxy?
    Company 1
    Firewall
    http://app.queue.core.windows.net/
    Client
    Azure Queue
    REST
    Web Role
    Company 2
    Client
    Firewall
  • Using the Cloud for Communications
    Company 1
    Firewall
    http://app.queue.core.windows.net/
    Client
    Azure Queue
    REST
    Web Role
    65.55.33.204
    Company 2
    Client
    Firewall
    192.168.14.100
    NAT?
  • Using the Cloud for Communications
    Company 1
    Firewall
    http://app.queue.core.windows.net/
    Client
    Azure Queue
    REST
    Web Role
    65.55.33.204
    Company 2
    Client
    Firewall
    192.168.14.100
    OK, so I’ll do a HTTP poll every minute
  • Using the Cloud for Communications
    Company 1
    Firewall
    http://app.queue.core.windows.net/
    Client
    Azure Queue
    REST
    Web Role
    65.55.33.204
    Company 2
    Client
    Firewall
    192.168.14.100
    …and how about other protocols other than HTTP?
  • How does the .NET Service Bus help?
  • Using the Cloud for Communications
    Company 1
    sb://.../myqueue
    Client
    .NET
    Service Bus
    Company 2
    Client
    Firewall
    Outbound bi-directional socket
    Kept alive in background
  • Using the Cloud for Communications
    Company 1
    Firewall
    sb://.../myqueue
    Client
    Outbound one-way socket
    .NET
    Service Bus
    Company 2
    Message routed
    accordingly
    Client
    Firewall
    Outbound bi-directional socket
    Kept alive in background
  • Austin Integration with Siebel (on-premise)
    Austin
    Blob
    Table
    Queue
    sb://.../myqueue
    On-Premise DataCenter
    .NET
    Service Bus
    Synchronization Message
    Firewall
    bi-directional socket
    Kept alive in background
    Siebel
    Opp. Exchange
    Service
  • Demo: Integration through the .NET Service Bus
  • High Level of Abstraction
    Hardware
    Server OS
    Network Infrastructure
    Web Server
    Availability
    Automated Service Management
    Scalability
    Instance & Partitions
    Developer Experience
    Familiar Developer Tools
    Windows Azure Benefits
  • Resources
    Azure Services Training Kit
    Downloadable hands-on labs, demos, and presentations
    http://www.azure.com
    Blogs
    http://blog.smarx.com – Steve Marx
    http://blogs.msdn.com/clemensv - Clemens Vasters (.NET Services)
    Azure Services Platform Forums
    http://www.microsoft.com/azure/blog.mspx
  • (Transition to Architect Evangelist for wrap-up…)
    • Highlight customer wins or Partner experiences
    • Q&A
    • Collect surveys and Hand out tokens
    • Giveaways
    TODO
  • From start to finish in two weeks
    • West Monroe Partners asked to develop an interactive, printable map for the 2009 Taste of Chicago’s two million visitors
    • Had two weeks to design and build externally facing Web functionality, ensure scalability for up to 50,000 hits per day, with no defined hosting solution in place
    Taste of Chicago
    “With Windows Azure and Live Services, we built a solution that uses the equivalent of 25 servers, and yet it required no up-front capital costs and minimal ongoing operational costs.”
    Cory Chaplin, Technology Solutions Practice Lead, West Monroe Partners
    [case study]
  • “Be This Close”
    Country Music Festival 2009
    • Compelling Silverlight/DeepZoom experience leveraging Windows Azure as the storage mechanism
    • Less than 1 hour to get up and running on Azure
    • 850 high resolution photos broken into x,000 tiles
    • Week a half to build Azure support
    [play it online]
    “Windows Azure was a breeze to use and didn't let us down.”
    Ben Henderson, Firefly Logic
  • Customer Costs Reduced 60 Percent
    Delivers enterprise line of business data to mobile workers anytime, anywhere, at minimal cost to the enterprise.
    Aggregated LOB data, LOB access rules, and, optionally, even LOBs themselves are stored in the cloud in Microsoft SQL Data Services.
    Cumulux
    [case study]
    “With software-plus-services, we can get our customers up and running on mPortal in two weeks versus two months—a 75 percent time-to-market improvement over on-premises deployment.”
    RanjithRamakrishnan, Chief Technology Officer for Cumulux
  • What do I get?
    MSDN Premium
    Phone and Online Technical Support
    Profiled on Microsoft and other web properties
    How do I qualify?
    • Building software or software services
    • Privately held
    • In business for less than 3 years
    • Less than US $1 million in annual revenue
    contact briangorbett
    bgorbett@microsoft.com
    425-538-0050
  • dave.bost@microsoft.com
    http://davebost.com/blog
    © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.
    The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.