Presentation is loading. Please wait.

Presentation is loading. Please wait.

(re)-Architecting cloud applications on the windows Azure platform CLAEYS Kurt Technology Solution Professional Microsoft EMEA.

Similar presentations


Presentation on theme: "(re)-Architecting cloud applications on the windows Azure platform CLAEYS Kurt Technology Solution Professional Microsoft EMEA."— Presentation transcript:

1 (re)-Architecting cloud applications on the windows Azure platform CLAEYS Kurt Technology Solution Professional Microsoft EMEA

2

3 If you want to use the benefits of Azure... Benefis are : Elastic Scalability High Availablity (SLA) Reduced costs Mass storage Assync architecture Yes ! Even if the benefits are not really important... You are just looking for a hosting platform... Yes ! For Azure... applications should be stateless. To avoid failures. Do you need to re-Architect ?

4 Azure apps are loadbalanced No sticky sessions. No server affinity. Azure is a public PAAS It’s public, some of the resources are shared. It’s a Platform, delivers generic building blocks to implement a solution. Azure compute is a scale out environment Adding more instances of the same power instead of adding more power to a single instance. Azure is a OPEX environment The code (you architect) decides how much you pay. Azure Basics

5 Azure Compute SLA Windows Azure has separate SLA’s for compute and storage. For compute, we guarantee that when you deploy two or more role instances in different fault and upgrade domains your Internet facing roles will have external connectivity at least 99.95% of the time. Additionally, we will monitor all of your individual role instances and guarantee that 99.9% of the time we will detect when a role instance’s process is not running and initiate corrective action. http://www.microsoft.com/windowsazure/sla

6 Azure Solution Architecture Internet Windows Azure Service Your Service Web Site (ASPX, ASMX, WCF) Web Site (ASPX, ASMX, WCF) Web Role (ASPX, WCF) Worker Service Worker Role Your Storage Tables Blobs Queues NLBNLB SQL Data SQL

7 Azure Network Load Balancer webrole Instance 1 Instance 2 Instance 3 NLB

8 Azure Network Load Balancer webrole Instance 1 Instance 2 Instance 3 NLB

9 Azure Network Load Balancer webrole Instance 1 Instance 2 Instance 3 NLB “round robin” no sticky sessions !

10 No sticky sessions Avoid use session variables Store state in ASP.NET viewstate More bandwidth needed Not compatible with MVC pattern Store state in SQL Azure You could redirect sessions state to SQL Azure, Azure Storage or AppFabric Caching No server affinity Do not write data to the local filesystem Write data to Azure storage You could use Azure Blob drives (in single instance setup) Developing for a load balancer

11 Scaling engine App running on 2 instances performance metrics Local DB Scaling engine defines on metrics and polling intervals interprete metrics changes the configuration App 3

12 Scaling should done in units. A unit-of-scale is a combination of components in multiple layers. Example: application instances and the database together should be considered as the unit-of-scale. If you add application instances you should also add databases. Not necessary 1-to-1, but you should know how many instances a database can handle and add them if needed. Consider all mechanisms that have different scaling behavior like queues, storage, blob drive IO, bandwidth... Unit of Scale pattern

13 Azure Storage support huge volume tables Tableschema is part of your application Huge capacity 100TB of storage per storage account 1 subscription can have 5 storage accounts Need to partition your tables to have a good response time Azure will move hot partitions to separate nodes to achieve SLA’s Scaling storage

14 Azure Storage Tables Tables are partitioned to support load balancing across storage nodes unique

15 Table Partioning Partition keyRow keyData Partition “A” Storage node 1 Partition “B” Storage node 2

16 All cities in world (7.500.000)

17

18 Sharing a SQL Server node means throttling to protect the other customers. Throttling means : a connection to SQL Azure could be dropped unexpectedly. Solution : Before issuing a command against a connection check if is still open, re-open it if SQL Azure has closed it. SQL Azure throttling/retry logic using (ReliableSqlConnection conn = new ReliableSqlConnection(connString)) { // Attempt to open a connection using the specified retry policy. conn.Open(sqlAzureRetryPolicy); //... execute SQL queries against this connection... } using (ReliableSqlConnection conn = new ReliableSqlConnection(connString)) { // Attempt to open a connection using the specified retry policy. conn.Open(sqlAzureRetryPolicy); //... execute SQL queries against this connection... }

19 Service Azure Queues webrole Instance 1 Instance 2 Instance 3 workerrole Instance 1 Instance 2 Instance 3 busy free busy Putmessage

20 Azure Queues webrole Instance 1 Instance 2 Instance 3 workerrole Instance 1 Instance 2 Instance 3 busy free busy Getmessage one (and only one) free instance of the workerrole gets the message Service

21 Working with Queues CloudQueueMessage cloudQueueMessage; cloudQueueMessage = cloudQueue.GetMessage(); //process single message CloudQueueMessage cloudQueueMessage; cloudQueueMessage = cloudQueue.GetMessage(); //process single message List cloudQueueMessages; cloudQueueMessages = cloudQueue.GetMessages(32).ToList(); //process all messages on multiple threads List cloudQueueMessages; cloudQueueMessages = cloudQueue.GetMessages(32).ToList(); //process all messages on multiple threads Workerroles read messages from queue to start a job assync. GetMessage = 1 REST call, GetMessages(32) = 1 REST call

22 Working with Queues while (true) { System.Threading.Thread.Sleep(timeToSleep); CloudQueueMessage cloudQueueMessage; cloudQueueMessage = cloudQueue.GetMessage(); if(cloudQueueMessage!=null) { //process single message } while (true) { System.Threading.Thread.Sleep(timeToSleep); CloudQueueMessage cloudQueueMessage; cloudQueueMessage = cloudQueue.GetMessage(); if(cloudQueueMessage!=null) { //process single message } } Watch out for trying to read messages to often.

23 1 year, 24 h/day every second 10 GetMessage calls = $315,36 1 year, 24 h/day, every minute 1 GetMessageCall = $0,52 Operational costs Costs multiplied by 600 !!

24 Re-architecting is needed. Just moving app to cloud is easy but does not give you all benefits. Need some design patterns to reach the benefits : Scalibilty – Unit of Scale Stateless applications Data partitioning Retry Logic vs Throttling Assync architectures using queues Cost effective coding Summary


Download ppt "(re)-Architecting cloud applications on the windows Azure platform CLAEYS Kurt Technology Solution Professional Microsoft EMEA."

Similar presentations


Ads by Google