1.05k likes | 1.21k Views
Facoltà di Ingegneria,Tor Vergata,12 Dicembre 2011. Cloud e Web con Windows AZURE e ASP.NET MVC 3. Speakers: Antimo Musone e Daniele Midi antimo.musone@studentpartner.com daniele.midi@studentpartner.com. About We. Antimo Musone Cloud Development Tour Owner Daniele Midi
E N D
Facoltà di Ingegneria,Tor Vergata,12 Dicembre 2011 Cloud e Web con Windows AZURE e ASP.NET MVC 3 Speakers: Antimo Musone e Daniele Midi antimo.musone@studentpartner.com daniele.midi@studentpartner.com
About We Antimo Musone Cloud Development Tour Owner Daniele Midi Web Development Tour Owner WebTeam
START WITH :Cloud Antimo Musone Cloud Development Tour Owner
What is the cloud? An approach to computing that’s about internet scale and connecting to a variety of devices and endpoints
Why Cloud? • Customer Requirements : • Efficency, Reliability • Scalability , Agility • Reduce IT Costs • IT Consultants • Don’t must be IT warriors • Can delegate IT Problems
“Growing Fast“ “On and Off “ Inactivity Period Compute Compute Average Usage Usage Average Cloud Computing Patterns Time Time • Successful services needs to grow/scale • On & off workloads (e.g. batch job) “Unpredictable Bursting“ “Predictable Bursting“ Compute Compute Average Usage Average Usage Time Time • Unexpected/unplanned peak in demand • Services with micro seasonality trends
Cloud Services Infrastructure-as-a-Service “PaaS” “IaaS” “SaaS” Platform-as-a-Service Software-as-a-Service consume build host
Caso Cloud: Il Censimento • 500 000 connessione in un solo giorno • Carico di workload inaspettato • In tilt dopo poche ore • dal lancio • Raddoppiata l’infrastruttura IT in una sola Notte • Infrastuttura Cloud : Telecom Italia
Scalable compute and storage • Automated service management • Familiar tools, technologies, languages Windows Azure Platform • 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
Windows Azure Platform : Layers Middleware Services AppFabric Access Control AppFabric Service Bus AppFabric Caching SQL Azure Windows Azure Storage Windows Azure CDN Data Services “Red Dog” Front End (RDFE) Compute Services Windows Azure Networking Fabric Controller
North America Region Europe Region Asia Pacific Region Windows Azure Platform Data Centers N. Europe N. Central – U.S. W. Europe S. Central – U.S. E. Asia S.E. Asia • 6 datacenters across 3 continents Simply select your data center of choice when deploying an application
Components Horizontal View Windows Azure Platform Virtual Network Storage Compute
Windows Azure Windows Azure is a foundation of Microsoft’s Cloud Platform for Developers Operating System for the Cloud • Runs applications in the cloud • Provides Storage • Application Management • Developer SDK Windows Azure ideal for applications needing • Scalability • Availability • Fault Tolerance
IaaS Developer 1) Choose image, then createVM for DBMS and configure DBMS 3) Choose image, then create and configure VM(s) for application 4) Install application 5) Configure load balancer 6) Manage VMs and DBMS (e.g., deploying new OS images in VMs) 2) Provision database, then create tablesand add data Library VM Images Web Server Load Balancer Application DBMS Operating System Operating System Operating System VM VM
PaaS Developer 1) Provision database, then create tablesand add data 2) Deploy application 3) Manage Applications Web Server Load Balancer DBMS Application Operating System Operating System Operating System VM VM
PaaS - Azure Azure Developer 1) Provision database, then create tablesand add data 4) Manage VM & Applications 2) Deploy application 3) Install Other application Load Balancer Other Application Application Role Application DBMS Operating System Operating System Operating System VM VM
Windows Azure in 1 Slide Developer Portal RDP Service Management Service User Code … … StorageCluster Compute Cluster Runtime API VS Tools … MSFT Datacenters API REST WA SDK VM Setup Cloud VM Desktop
Azure Role : Scale Application Archetype
Azure Scale Applications: Layers Intelligent Network : Load Balancer Stateless Web Application : Web Role Stateless ‘Worker’ Machines : Worker Role Async Work Data /State Tier Queues Key/ValueDatastores Partitioned RDBMS Shared Filesystem
Azure Scale Applications: Roles The Internet via HTTP/TCP Tables LB LB LB Storage Queues Web Site (ASPX, ASMX, WCF) Worker Service Web Site (ASPX, ASMX, WCF) Worker Service Web Role IIS as Host Worker Role Managed Interface Call Blobs Windows Azure Data Center
AzureRole: Application Box Role is an application container, that run inside Azure VM, through it we can provide Web / Service / Standalone Applications and also offers an interface to manage it Events Methods Status Role Interface Role Lifetime Busy OnStart StatusCheck Requests Routed Fabric Calls StatusCheck Ready Run Busy OnStop StatusCheck Stopping
Services,Roles and Instances A Service is a packaged application for Azure, composed by one or more role Roles are defined in a Service Model • May define one or more Roles per Service • A role definition specifies • VM size • Communication Endpoints • Local storage resources • Etc… At runtime each Role will execute on one or more instances (up to 20 per subscription) • A role instance is a set of code, configuration, and local data, deployed in a dedicated VM
Worker Role Patterns Queue Polling Worker • Poll and Pop Messages within while(true) loop • E.g. Map/Reduce pattern, background image processing Listening Worker Role • Create TcpListener or WCF Service Host • E.g. Run a .NET SMTP server or WCF Service External Process Worker Role • OnStart or Run method executes Process.Start() • Startup Task installs or executes background/foreground process • E.g. Run a database server, web server, distributed cache
Web Role All features of a worker role + IIS 7 or 7.5 MVC 3 , ASP.NET 3.5 SP1 or 4.0 – 64bit Hosts • Webforms or MVC • FastCGI applications (e.g. PHP) • Multiple Websites Http(s) Web/Worker Hybrid • Can optionally implement RoleEntryPoint
Service Definition Describes the shape of your Windows Azure Service Defines Roles Ports, Certificates Configuration Startup Tasks IIS Configuration
Service Configuration Supplies Runtime Values, can be updated any time through Portal or API Scale Config Settings Certificates to use, VHD etc.
VM Size in Windows Azure Windows Azure • Supports Various VM Sizes • Size set on Role in Service Definition • Service can have multiple roles • Balance of Performance per node vs. High Availability from multiple nodes • Set in Service Model definition All instances of role will be of equal size
Windows Azure Platform Portal Web Access to : https://windows.azure.com Supports multiple service administrators (co-admins) Enable and connect to Windows Azure instances using Remote Desktop Built on the Windows Azure Service Management APIs
Demo Hello World by Windows Azure
Windows Azure Storage Storage in the Cloud • Scalable, durable, and available • Anywhere at anytime access • Only pay for what the service uses Exposed via RESTful Web Services • Use from anywhere on the internet • User specified globally unique account name • Can call these from any HTTP client (Flash, Silverlight ) Various storage abstractions • Tables, Blobs, Queues, Drives 100TBper account, have two independent 512 bit shared secret keys
Account Container • Blob • Pages/ • Blocks http://<account>.blob.core.windows.net/<container>/<blobname> Blob Storage Concepts • PIC01.JPG • Block/Page • images • VID1.AVI • PIC02.JPG • contoso • Block/Page • videos
Blob Details Main Web Service Operations • PutBlob,GetBlob • DeleteBlob,CopyBlob • SnapshotBlob ,LeaseBlob Associate Metadata with Blob • Standard HTTP metadata/headers (Cache-Control, Content-Encoding, Content-Type, etc) • Metadata is <name, value> pairs, up to 8KB per blob • Either as part of PutBlob or independently Blob always accessed by name • Can include ‘/‘ or other delimeter in name e.g. /<container>/myblobs/blob.jpg
Blob Containers Multiple Containers per Account • Special $root container Blob Container • A container holds a set of blobs • Set access policies at the container level • Associate Metadata with Container • List the blobs in a container • Including Blob Metadata and MD5 • NO search/query. i.e. no WHERE MetadataValue = ? Blobs Throughput • Effectively in Partition of 1 • Target of 60MB/s per Blob
http://<account>.table.core.windows.net/<tablename> Account Table Entity Table Storage Concepts Name =… Email = … customers Name =… EMailAdd= … contoso Photo ID =… Date =… photos Photo ID =… Date =…
Table Details It’s not an RDBMSsystem but it’ s a container where we can serialize a collection of objects Table Operations : • Create, Query, Delete • Tables can have metadata Entities Operations : • Insert,Delete • Update • Merge – Partial update • Replace – Update entire entity • Query • Entity Group Transactions • Multiple CUD Operations in a single atomic transaction
Entity Properties Entity can have up to 255 properties ( members of class ) • Up to 1MB per entity Mandatory Properties for every entity • PartitionKey & RowKey (only indexed properties) • Uniquely identifies an entity • Defines the sort order • Timestamp • Optimistic Concurrency. Exposed as an HTTP ETag No fixed schema for other properties • No schema stored for a table • Properties can be the standard types: • String, binary, bool, DateTime, GUID, int, int64, and double
http://<account>.table.core.windows.net/<tablename> http://antimo.table.core.windows.net/Accounts Querying ?$filter=Last eq ‘Akers’
Queue Storage Concepts http://<account>.queue.core.windows.net/<queuename> Message Queue Account customer ID order ID http://… order processing adventureworks customer ID order ID http://…
Loosely Coupled Workflow with Queue Enables workflow between roles • Load work in a queue • Producer can forget about message once it is in queue • Many workers consume the queue • For extreme throughput use multiple queues or multiple work items per message Input Queue (Work Items) Queue Worker Role Web Role Worker Role Web Role Worker Role Web Role Worker Role
Queue Details Simple asynchronous dispatch queue • No limit to queue length subject to storage limit • 8kb per message • ListQueues- List queues in account Queue operations • CreateQueue ,DeleteQueue • Get/Set Metadata • Clear Messages Message operations • PutMessage– Reads message and hides for time period • GetMessages – Reads one or more messages and hides them • PeekMessages – Reads one or more messages w/o hiding them • DeleteMessage – Permanently deletes messages from queue
SQL AZURE Database
Extending SQL Server to the Cloud SQL Azure Reporting Database Data Sync
SQL Azure Database Familiar SQL Server relational database model delivered as a service • Support for existing APIs & tools • Built for the cloud with high availability & fault tolerance • Easily provision and manage databases across multiple datacenters SQL Azure provides logical server • Gateway server that understands TDS protocol • Looks like SQL Server to TDS Client • Actual data stored on multiple backend data nodes Logical optimizations supported • Indexes, Query plans etc.. Physical optimizations not supported • File Groups, Partitions etc… Transparently manages physical storage
SQL Azure SQL Azure Use & Deployment : Web Portal (API) DB Script SQL Server Managment SQL Azure TDS Custom Tool