Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Escalabilidad horizontal y arquitecturas elásticas en Microsoft azure

En esta sesión veremos problemas y soluciones a la hora de escalar arquitecturas muy exigentes. Veremos opciones para segmentar lecturas-escrituras con Replicación y AlwaysON, utilizar sistemas de cacheo con AppFabric Cache y/o Azure Cache, entornos híbridos para liberar carga con Azure. Orientaremos la sesión para que el asistente entienda las alternativas que hay y sus pros y contras de cara a su evaluación.

  • Login to see the comments

  • Be the first to like this

Escalabilidad horizontal y arquitecturas elásticas en Microsoft azure

  1. 1. #SQSummit @enriquecatala Escalabilidad horizontal y arquitecturas elásticas en Microsoft Azure Mentor ecatala@solidq.com MVP – MCT – MCSE Enrique Catalá Bañuls
  2. 2. Agenda 3 1. ¿Qué podemos usar? 2. AlwaysON 3. Arquitecturas elásticas 4. Caching 5. Autoescalado VMs 6. Rendimiento CPU
  3. 3. La informática en la nube definida Posiciónamiento 4 Cloud computing as four deloyment models, three service models and five main features features Public Cloud Hybrid Cloud Private Cloud CommunityCloud IaaS Infrastructure as a Service PaaS Platform as a Service SaaS Platform as a Service On-demand Self Service BroadNetwork Access Resource Pooling Rapid Elasticity Measured Service
  4. 4. Modelos de Servicio 5
  5. 5. Soluciones híbridas 6
  6. 6. Tecnologias soportadas 7 Tecnología SQL Server Cero pérdida de datos Ámbito Nº secundarios Failover automático Leer de secundarios Availability Groups 2012+ Si* DB(s) 4 -> 2012 8 -> 2014 Yes (w/ additional cluster member)** Si Database Mirroring 2008 R2 2012 Si* DB 1 Yes (w/ Witness)** Limited (database snapshots) Log Shipping 2005+ No DB Ilimitadas No Limited (standby state) Replicacion 2008+ No Articulos ***Ilimitadas No Si
  7. 7. Tamaños de VM 8 Cores Memoria Temp Ancho de banda Discos de datos IOPs total SQL Standard Coste/ hora ExtraSmall 1 - Shared 768 MB 20 GB 5 1 500 €0,015/h Small 1 1.75 GB 70 GB 100 2 1000 €0,068/h Medium 2 3.5 GB 135 GB 200 4 2000 €0,135/h Large 4 7 GB 285 GB 400 8 4000 €0,269/h ExtraLarge 8 14 GB 605 GB 800 16 8000 €0,537/h A5 2 14GB 605 GB 200 4 2000 €0,298/h A6 4 28 GB 285 GB 1,000 8 4000 €0,596/h A7 8 56 GB 605 GB 2,000 16 8000 €1,192/h A8 8 2.6 Ghz 56 Gb 1600 Mhz 382 Gb 1,000 40,000** 16 8000 €1,183/h A9 16 2.6 Ghz 112 Gb 1600 Mhz 382 Gb 1,000 40,000** 16 8000 €3,65/h
  8. 8. Bajada de precio en SQL VMs SQL Standard (a fecha de 12-05-2014) 9 2013 2014 (basic) 2014 (standard) ExtraSmall €0.425/hr €0,014/hr €0,015/hr Small €0.477/hr €0,056/hr €0,068/hr Medium €0.544/hr €0,111/hr €0,135/hr Large €0.678/hr €0,221/hr €0,269/hr ExtraLarge €1.356/hr €0,441/hr €0,537/hr A6 €1.17/hr €0,596/hr €0,596/hr A7 €2.339/hr €1,192/hr €1,192/hr
  9. 9. Agenda 10 1. ¿Qué podemos usar? 2. AlwaysON 3. Arquitecturas elásticas 4. Caching 5. Autoescalado VMs 6. Rendimiento CPU
  10. 10. Diagrama arquitectura AlwaysOn SQL Server 2012+ 11 Windows Cluster Availability Group On-Premises SecondaryPrimary
  11. 11. Diagrama arquitectura 12 Windows Cluster Availability Group On-Premises Secondary Cloud SecondaryPrimary
  12. 12. Diagrama arquitectura 13 Windows Cluster Windows Cluster Availability GroupAvailability Group Primary Secondary On-Premises (NY) On-Premises (NJ) Secondary Cloud
  13. 13. Diagrama arquitectura 14 Windows Cluster Availability Group Cloud On-Premises SecondarySecondaryPrimary
  14. 14. AlwaysOn 15
  15. 15. DEMO 16 Elasticidad con AlwaysOn híbrido
  16. 16. Agenda 41 1. ¿Qué podemos usar? 2. AlwaysON 3. Arquitecturas elásticas 4. Caching 5. Autoescalado VMs 6. Rendimiento CPU
  17. 17. Diagrama arquitectura Elasticidad 42 DBreplica1 Replica1 Replica2 Replica n DBreplica2 DBreplica3 Azure Republicador (opcional) Transactional replication SYNC WAN SQL1 (onpremise) ON PREMISE Azure  Nodos secundarios replicación  Capa de base de datos, suscriptores (5s-15s delay)  SQL Standard Edition  Nodo publicador  Instancia OnPremise que contiene los datos maestros a replicar mediante replicación transaccional
  18. 18. DEMO 43 Configurar entorno
  19. 19. Grupo de afinidad 44
  20. 20. Network Service 45
  21. 21. Infraestructura 46
  22. 22. Dominio Active Directory 47
  23. 23. Añadir el rol de Active Directory 48
  24. 24. Añadir DNS 49
  25. 25. Añadir republicador 50
  26. 26. DEMO 51 Elasticidad flexible
  27. 27. • Las VM no pueden ser basic* • Usa VPN o encripta tu conexión • Automatiza los despliegues con sysprep y scripts Conceptos clave 52
  28. 28. Agenda 53 1. ¿Qué podemos usar? 2. AlwaysON 3. Arquitecturas elásticas 4. Caching 5. Autoescalado VMs 6. Rendimiento CPU
  29. 29. IaaS y VMs 54
  30. 30. Windows Azure Caching concepts Microsoft Azure Cache is a family of distributed, in-memory, scalable solutions that enable you to build highly scalable and responsive applications by providing super- fast access to your data. Microsoft Azure Cache is available in the following flavors. – Azure Redis Cache (Preview) – Managed Cache Service – In-Role Cache
  31. 31. Managed Cache Service Azure Managed Cache Service is based on the AppFabric Cache engine. It also gives you access to a secure, dedicated cache that is managed by Microsoft. A cache created using the Managed Cache Service is also accessible from applications within Azure running on Azure Web Sites, Web & Worker Roles and Virtual Machines. For more information
  32. 32. Using Managed Cache // Cache client configured by settings in application // configuration file. DataCacheFactoryConfiguration config = new DataCacheFactoryConfiguration("default"); DataCacheFactory cacheFactory = new DataCacheFactory(config); DataCache defaultCache = cacheFactory.GetDefaultCache(); // Put and retrieve a test object from the default cache. defaultCache.Put("testkey", "testobject"); string strObject = (string)defaultCache.Get("testkey");
  33. 33. In-Role Caching Based on the AppFabric Cache engine. Allows you to perform caching by using a dedicated web or worker role instance in an application deployed to Microsoft Azure Cloud Services. This provides flexibility in terms of deployment options and size but you manage the cache yourself. //add string object to cache with key "Key0" myCache.Add("Key0", "object added with Key0"); //add or replace string object in cache using key "Key0" myCache.Put("Key0", "object replaced or added using Key0"); //remove object in cache using key "Key0" myCache.Remove("Key0");
  34. 34. Use Cloud Caching: the Right Reasons Speed of access to data Azure SQL database Azure storage Remote storage and services Avoiding hitting rate limits Up to 5,000 entities/messages/blobs per second per account Up to 500 messages per second from a single queue Up to 500 entities per second from a single table partition
  35. 35. Using Caching in your applications Stores session state in shared memory Required for Web Farms Faster than SQL Simple configuration change to your web app Enables session state to be cached across a cluster Uses cache-aside, not RT+WB (session is Activity Data) TIP: Use HA to reduce the chances of sessions state loss Example: ASP.NET App Session state provider 60 <sessionState mode="Custom" customProvider="SessionStoreProvider"> <providers> <add name="SessionStoreProvider“ type="Microsoft.ApplicationServer.Caching.DataCacheSessionStoreProvider, Microsoft.ApplicationServer.Caching.Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35“ cacheName=“MyCache"/> </providers> </sessionState>
  36. 36. Azure Redis Cache (PREVIEW) Microsoft Azure Redis Cache (Preview) is based on the popular open source Redis Cache. It gives you access to a secure, dedicated Redis cache, managed by Microsoft. A cache created using Azure Redis Cache is accessible from any application within Microsoft Azure. Azure Redis Cache (Preview) is available in the following two tiers. – Basic – single node, multiple sizes. – Standard – Two node Master/Slave, multiple sizes. Once the preview period is over, the standard tier offering will have a 99.9% SLA.
  37. 37. Azure Redis Cache
  38. 38. Azure Redis Cache (use) using StackExchange.Redis; ConnectionMultiplexer connection = ConnectionMultiplexer.Connect("contoso5.redis.cache. windows.net,ssl=true,password=..."); // connection referes to a previously configured //ConnectionMultiplexer IDatabase cache = connection.GetDatabase(); ConnectionMultiplexer connection = ConnectionMultiplexer.Connect( "contoso5.redis.cache.windows.net..."); IDatabase cache = connection.GetDatabase(); // Perform cache operations using the cache object... // Simple put of integral data types into the cache cache.StringSet("key1", "value"); cache.StringSet("key2", 25); // Simple get of data types from the cache string key1 = cache.StringGet("key1"); int key2 = (int)cache.StringGet("key2");
  39. 39. DEMO 64 Caching
  40. 40. Agenda 65 1. ¿Qué podemos usar? 2. AlwaysON 3. Arquitecturas elásticas 4. Caching 5. Autoescalado VMs 6. Rendimiento CPU
  41. 41. DEMO 66 Autoscale VM
  42. 42. Autoscale VM Dos nodos, 1 parado 67
  43. 43. Autoscale VM Máquina1 68
  44. 44. Autoscale VM Log de operaciones 69
  45. 45. Autoscale VM Detectado evento…aprovisionando 70
  46. 46. Autoscale VM Aprovisionando 71
  47. 47. Autoscale VM Aparece en el log 72
  48. 48. Autoscale VM Log del evento 73
  49. 49. Agenda 74 1. ¿Qué podemos usar? 2. AlwaysON 3. Arquitecturas elásticas 4. Caching 5. Autoescalado VMs 6. Rendimiento CPU
  50. 50. Rendimiento CPU Benchmark simple 75 Máquina Puntuación single- thread Puntuación multi- thread Descripción Portatil Enrique Catalá 1911 4826 Intel i7 1.73Ghz Entorno Web Role (A3) 1068 3729 AMD Opteron 4171 2.1Ghz Entorno VM A3 (4cores) 1066 3635 AMD Opteron 4171 2.1Ghz Entorno VM A4 (8cores) 1072 6617 AMD Opteron 4171 2.1Ghz Entorno VM A7 (AMD) 1077 5622 AMD Opteron 4171 2.1Ghz Entorno VM A7 (Intel) 1115 6680 Intel Xeon E5-2660 2.2Ghz Entorno A9 2460 10580 Intel Xeon E5-2670 2.6Ghz
  51. 51. Rendimiento CPU 76 Azure OnPremise Azure OnPremise Azure OnPremise
  52. 52. Rendimiento CPU También a nivel SQL 77
  53. 53. Solución IaaS real (eLearning) 78 AS_DCAD AS_Cluster_SQL_AO AS_FE_MOOD AS_FE_LAMS AG 80 80
  54. 54. Arquitecturas elásticas en SQL • De serie con AlwaysOn • “sin límite” con replicación Elasticidad flexible • Web y worker roles • VMS Caché Conclusión Azure mola…pero úsalo para lo que necesitas  79
  55. 55. ¿Preguntas? 80
  56. 56. ¡Gracias! Siéntate a comer con nosotros o tómate un café y aclara tus dudas  @enriquecatala Mentor – MVP SQL Server Enrique Catala Bañuls 81

×