Download presentation
Published byStuart McKenzie Modified over 9 years ago
2
How to Build High Performance Apps Using Microsoft Azure Redis Cache
Pranav Rastogi M350
3
Introduction
4
Professional ASP.NET 4.5 in C# and VB Azure Redis Cache ASP.NET
5
Agenda Why Cache Redis Azure Redis Cache FAQs
6
Typical Caching Pattern
Storage Web Tier Data Data SQL
7
Storage Web Tier Cache Azure Region SQL - High Throughput
- Low Consistent Latency 50% : <3ms 99% : <10ms Web Tier Cache Azure Region Data Data SQL
8
Caching
9
Redis
10
What is Redis? “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 “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
11
Rich 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
12
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, bitmaps and hyperloglogs. Transactions Publisher-Subscriber pattern LUA scripting Pipelining Client libraries in multiple languages
13
Redis features… Databases Highly customizable replication support
Supports hierarchy of ‘Slaves’ per ‘Master’ Persistence support Point in time, Log every write, or both Clustering
14
Redis
15
Azure Redis Cache Service
16
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 China and Government cloud coming SSL Basic SKU : Single cache node Standard SKU: Cache node + one replica Availability SLA of 99.9%
17
Azure Redis Cache… RBAC Provisioning Redis Cache
Monitoring/ Diagnostics Alerts ASP.NET Session & Output Cache Providers Memcache protocol shim
18
Azure Redis Cache
19
FAQs
20
Which Azure Cache offering is right for me?
We recommend all new developments use Azure Redis Cache.
21
How to pick the Cache SKU
Cache size High Availability - Standard Network bandwidth Cache and client should be in the same region
22
Azure Redis Cache Latency
50% : <3ms 99% : <10ms Pings sent via redis-benchmark.exe Client and Cache in same region Lightly loaded Cache
23
(Simple GET calls of 1 KB values) Bandwidth (Mbits/sec)
Azure Redis Cache Performance Cache Name Cache Size GET/sec (Simple GET calls of 1 KB values) Bandwidth (Mbits/sec) Cores (Redis) C0 250 MB 610 5 0.25* C1 1 GB 12,200 100 1* C2 2.5 GB 24,300 200 1 C3 6 GB 48,875 400 C4 13 GB 61,350 500 C5 26 GB 112,275 1000 C6 53 GB 153,219 1000+
24
High Latency Cache and client in the same region.
Network bandwidth limits on client or server. Redis commands usage. Measure and iterate.
25
Scaling Azure Redis Cache
Build 2013 4/25/2017 Scaling Azure Redis Cache Scale Up– aka Vertical Scaling Increased Cache Size (Memory) Increased Bandwidth Single CPU Scale Out– aka Horizontal Scaling Increased Cache Size, Bandwidth, CPU Improved Availability Client responsible for sharding (Static/Dynamic) Sharding on Server (Clustering) in future roadmap © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
26
Monitoring Azure Redis Cache
Monitor in the portal. Set eviction policies. Set Alerts. Monitor using Redis tools eg. redis-cli.exe High Fragmentation Benchmarking using redis-benchmark.exe
27
Client configuration – StackExchange.Redis
Use latest version Single instance of ConnectionMultiplexer AbortOnConnectFail=false ConnectRetry ConnectionTimeout Large values/ Long running commands Use multiple Connection Multiplexers for different connection settings.
28
Cache patterns Cache Aside pattern Retry logic Local cache
29
Multi-Region Scenario
Azure Region 1 Azure Region 2 Storage Web Tier Web Tier Cache Cache Cache Sync
30
Multi-Region Scenario
Azure Region 1 Azure Region 2 Web Tier SQL Web Tier SQL Cache Cache
31
High Availability Availability Set Slave Azure Redis Endpoint Master
TechEd 2013 4/25/2017 6:34 PM High Availability Azure Redis Endpoint [Shim] Master Slave Master Slave Availability Set © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
32
High Availability Availability Set Slave Azure Redis Endpoint Master
TechEd 2013 4/25/2017 6:34 PM High Availability Azure Redis Endpoint [Shim] Master Slave Slave Master Availability Set © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
33
High Availability Availability Set Slave Azure Redis Endpoint Master
TechEd 2013 4/25/2017 6:34 PM High Availability Azure Redis Endpoint [Shim] Master Slave Slave Master Availability Set © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
34
Roadmap
35
Roadmap Scale Up/ Down Configuring Redis – key space notification
Persistence Azure Regions China/ Government Cloud support Clustering Virtual Network Geo Replication
36
Resources Pricing Documentation Cache User Voice
Microsoft patterns & practices on Cache Retry logic Investigating Timeout Exceptions in StackExchange.Redis Memcache protocol shim
37
Resources Microsoft Virtual Academy TechNet & MSDN Flash
4/25/2017 Microsoft Virtual Academy Resources TechNet & MSDN Flash Free Online Learning Subscribe to our fortnightly newsletter Sessions on Demand © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
38
Complete your session evaluation now and be in to win!
4/25/2017 6:34 PM Complete your session evaluation now and be in to win! © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
39
4/25/2017 6:34 PM © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.