This document discusses scalability and elastic architectures in Microsoft Azure. It includes:
1. An agenda covering what can be used, AlwaysOn availability groups, elastic architectures, caching, auto-scaling VMs, and CPU performance.
2. Descriptions and diagrams of AlwaysOn availability group architectures within Azure and in hybrid configurations.
3. Details on transactional replication for flexible elasticity across web/worker roles and VMs.
4. Explanations of managed cache service, in-role caching, and Azure Redis Cache, along with code examples for using caching.
5. A demo of auto-scaling VMs in response to detected events.
6. A benchmark showing varying
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
12. Diagrama arquitectura
13
Windows Cluster Windows Cluster
Availability GroupAvailability Group
Primary Secondary
On-Premises (NY) On-Premises (NJ)
Secondary
Cloud
41. 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
54. 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
55. 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
56. 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");
57. 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");
58. 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
59. 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>
60. 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.
62. 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");
77. Solución IaaS real (eLearning)
78
AS_DCAD
AS_Cluster_SQL_AO
AS_FE_MOOD
AS_FE_LAMS
AG
80
80
78. 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