Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MemCache vs Azure Caching

I am torn between using Memcache and using Windows Azure Caching. I have no experience in either of them so I would love for someone to come up with some deciding factors:

  • price
  • performance
  • ease of use
  • anything
like image 906
MaxWillmott Avatar asked Sep 13 '12 11:09

MaxWillmott


People also ask

Why is memcache better than Redis?

Redis uses a single core and shows better performance than Memcached in storing small datasets when measured in terms of cores. Memcached implements a multi-threaded architecture by utilizing multiple cores. Therefore, for storing larger datasets, Memcached can perform better than Redis.

Does Azure support Memcached?

Memcached Cloud provides various data persistence options as well as remote backups for disaster recovery purposes. After selecting Memcached Cloud in the Azure Store, it takes seconds to create your Memcached bucket and all operations are fully-automated from that moment on.

Why do we use memcache?

Unlike databases that store data on disk or SSDs, Memcached keeps its data in memory. By eliminating the need to access disks, in-memory key-value stores such as Memcached avoid seek time delays and can access data in microseconds. Memcached is also distributed, meaning that it is easy to scale out by adding new nodes.

What is an azure Redis cache?

Azure Cache for Redis is a fully managed, in-memory cache that enables high-performance and scalable architectures. Use it to create cloud or hybrid deployments that handle millions of requests per second at sub-millisecond latency—all with the configuration, security, and availability benefits of a managed service.


2 Answers

You actually need to evaluate 3 possible options:

  • Windows Azure Shared Caching (previously Windows Azure AppFabric Caching)
    • Managed, multi-tenant shared cache
    • Not free (pretty expensive actually)
    • Quotas apply in terms of cache size, transactions per hour, bandwidth per hour, concurrent connections
    • Slower than Windows Azure Caching (preview)
    • Throttling can occur
    • FAQ: http://msdn.microsoft.com/en-us/library/windowsazure/hh697522
  • Windows Azure Caching (Preview)
    • Uses the free memory of your roles (so you don't need to pay anything extra to use this)
    • No quotas (except for the memory available on your instances), no throttling, ...
    • Dedicated to your cloud service
    • Improved performance over Shared Caching (see end of this page)
    • Support for large caches over 100 GB
    • Support for memcache binary and text protocols (so existing applications that are based on memcached can leverage the caching preview)
    • Visual Studio support
  • Memcached
    • Can be used in Windows Azure
    • Uses memory of your roles, just like the caching preview
    • Free, just like the caching preview
    • No Visual Studio support
    • Dedicated, no quotas, support for large caches, ...

I don't have any benchmarks, but since both Windows Azure Caching (Preview) and Memcached are dedicated solutions using the memory on your roles and support the memcached protocol, you might simply go for the Windows Azure Caching (Preview) for the Visual Studio and .NET support. And once it leaves preview you'll be able to get support for it as well.

like image 52
Sandrino Di Mattia Avatar answered Nov 26 '22 16:11

Sandrino Di Mattia


From what I can tell, Azure cache isn't compatible with memcache:

root@**:~# memccapable -h **.cache.windows.net -p 22233 -t 1 -b
binary noop                             Errno: 110 Connection timed out [FAIL]
binary quit                             Errno: 110 Connection timed out [FAIL]
binary quitq                            [FAIL]
binary set                              Errno: 104 Connection reset by peer [FAIL]
binary setq                             Errno: 104 Connection reset by peer [FAIL]
binary flush                            Errno: 104 Connection reset by peer [FAIL]
binary flushq                           Errno: 104 Connection reset by peer [FAIL]

I gave up on trying to make it work. Installing memcached on an Linux Azure VM works great < 1ms latency.

like image 22
Jon Avatar answered Nov 26 '22 17:11

Jon