Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure: Redis vs Table Storage for web cache

We currently use Redis as our persistent cache for our web application but with it's limited memory and cost I'm starting to consider whether Table storage is a viable option.

The data we store is fairly basic json data with a clear 2 part key which we'd use for the partition and row key in table storage so I'm hoping that would mean fast querying.

I appreciate one is in memory and one is out so table storage will be a bit slower but as we scale I believe there is only one CPU serving data from a Redis cache whereas with Table storage we wouldn't have that issue as it would be down to the number of web servers we have running.

Does anyone have any experience of using Table storage in this way or comparisons between the 2.

I should add we use Redis in a very minimalist way get/set and nothing more, we evict our own data and failing that leave the eviction to Redis when it runs out of space.

like image 694
Simon Avatar asked Oct 18 '16 08:10

Simon


People also ask

Which type of data can most benefit from being stored in a caching system like Azure Redis cache?

While most databases store data on slower, disk-based storage, Azure Cache for Redis stores data in memory. Since memory is significantly faster than disk storage, data can be written and retrieved much faster.

What is it that makes a caching system like Redis cache faster than a traditional data store like Azure SQL database?

Using an in-memory cache, like Azure Cache for Redis, to associate information with a user is much faster than interacting with a full relational database. Applications often add tasks to a queue when the operations associated with the request take time to execute.

What is the difference between Redis and Azure cache for Redis?

1 Answer. Show activity on this post. Azure Redis Cache is a Managed Azure service, which creates and manages the Redis instance(s) (updates, automatic failover etc.) on behalf of the customer and provides the customer with TCP endpoint(s) to communicate with.

Is Azure table storage fast?

The arrangement of data across partitions affects query performance. Retrieving a records by their primary key is always very fast but Azure Tables resorts to table scans to find any data that is not in the same partition. Each scanned row counts towards that 20,000 operations per second limit.


1 Answers

This is a fairly broad/opinion-soliciting question. But from an objective perspective, these are the attributes you'll want to consider when deciding which to use:

  • Table Storage is a durable, key/value store. As such, content doesn't expire. You'll be responsible for clearing out data.
  • Table Storage scales to 500TB.
  • Redis is scalable horizontally across multiple nodes (or, scalable via Redis Service). In contrast, Table Storage will provide up to 2,000 transactions / sec on a partition, 20,000 transactions / sec across the storage account, and to scale beyond, you'd need to utilize multiple storage accounts.
  • Table Storage will have a significantly lower cost footprint than a VM or Redis service.
  • Redis provides features beyond Azure Storage tables (such as pub/sub, content eviction, etc).
  • Both Table Storage and Redis Cache are accessible via an endpoint, with many language-specific SDK wrappers around the API's.
like image 112
David Makogon Avatar answered Sep 28 '22 22:09

David Makogon