Chief Technical Evangelist – Cloud
blog.
www.brianHprince.com
twitter.
@brianHprince
email.
• Author of “Azure in Action”
• Deep cloud and architecture background
• Experience leading agile software teams
“I love gaming, both Xbox and table top
games. I just crossed 70,000 achievement
points.”
Agenda
• Why use Cache
• Redis
• Azure Offering
Typical Caching Patterns
Web Tier
Data
Storage
SQL
Data
Typical Caching Patterns
Web Tier
Cache
Data
Data
Storage
SQL
- High Throughput
- Low Consistent Latency
50% : <3ms
99% : <10ms
Azure
Region
REDIS
“Redis has many different use cases. The simplest way to describe it
is something between a traditional database and doing
computations in memory. Redis exposes data structures that are
accessed in memory via a set of commands. ” – Salvatore
“ Redis is an open source, BSD licensed, advanced key-value store. It is often
referred to as a data structure server since keys can contain strings, hashes,
lists, sets and sorted sets. ” - redis.io
What is Redis?
Rich Redis Ecosystem
• Proven at scale
• Twitter, Github, Weibo, Pinterest, Snapchat, Craigstlist, StackOverflow, Flickr …
• Knowledgeable community
• Rich set of clients, higher level libraries
• Easy to hire for
Core Redis Features
• Low latency, high throughput key-value store
Per Key expiry, choice of eviction policies
• Atomic operations on data types
Strings, hashes, lists, sets, sorted sets
• Publisher-Subscriber pattern
• LUA scripting
• Transactions
• Pipelining
• Client libraries in multiple languages
Redis Admin Features
• Highly customizable replication support
• Supports hierarchy of ‘Slaves’ per ‘Master ’
• Persistence support *
• Point in time, Log every write, or both
• Clustering *
REDIS CACHE
- CLI
- VS
- AZURE
Demo
AZURE REDIS CACHE
PaaS Service
Azure Redis Cache
• Redis Cache hosted and managed by Microsoft
• Dedicated virtual machine per cache
• Sizes: 256 MB, 1 GB, 2.8 GB, 6 GB, 13 GB, 26 GB, 53 GB
• Available in all Azure Regions
• Except China and Government cloud
• Basic SKU : Single cache node
• Standard SKU: Cache node + one replica
• Availability SLA of 99.9%
• SSL support
Azure Redis Cache…
• Monitoring/ Diagnostics
• Alerts
• ASP.NET Session & Output Cache Providers
HIGH AVAILABILITY
Standard SKU only
High Availability
Availability Set
Master Slave
High Availability
Availability Set
Master Slave
High Availability
Availability Set
Master Slave
High Availability
Availability Set
Master Slave
SCALING AZURE REDIS CACHE
Azure Redis Cache Latency
50% : <3ms
99% : <10ms
• Pings sent via RedisBenchmark.exe
• Client and Cache in same region
• Lightly loaded Cache
Scaling Azure Redis Cache
– Increased Cache Size (Memory)
– Increased Bandwidth
– Single CPU
– Increased Cache Size, Bandwidth, CPU
– Improved Availability
– Client responsible for sharding (Static/Dynamic)
– Sharding on Server (Clustering) in future roadmap
Azure Redis Cache Performance
Cache Size
(GB)
Bandwidth
(Mbps)
GET/sec
(1KB values)
Cores
(Redis)
0.25 5 600 0.25*
1 100 12k 1*
2.8 200 24k 1
6 400 48k 1
13 500 60k 1
26 1000 110k 1
53 1000+ 150k 1
LOOKING AHEAD
• Open public endpoint
• China/Government Cloud support
• Geo Replication [One Master, Read-only geo replicas]
• Persistance
• Clustering
• Scaling
Resources
http://azure.microsoft.com/en-us/services/cache/
http://blogs.msdn.com/b/webdev/archive/2014/05/12/announcing-asp-net-session-state-
provider-for-redis-preview-release.aspx
CACHE PATTERNS
Basic Patterns – Cache over SQL
Web Tier
Data
SQL
Data
Basic Patterns – Cache over SQL
Web Tier
Cache
Data
Data
SQL
- High Throughput
- Consistent Low Latency
Azure
Region
Basic Patterns – Cache over Storage
Web Tier
Cache Dynamic
Data
Dynamic
Data
Storage
Static
Data
Basic Patterns – Multi-Region Scenario
Web Tier
Cache
Storage Azure Region 1
Web Tier
Cache
Azure Region 2
Cache
Sync
Basic Patterns – Multi-Region Scenario
Web Tier
Cache
Azure Region 1
Web Tier
Cache
Azure Region 2
SQL SQL
Secondary Index
Wilber Finely 0001:0032
0001:0032
234 1st St.:20.0:
http://aka.ms/WAD267
Session Evaluation