mashta gidi
mashta gidi

Reputation: 867

asp.net site needd memcached

I have a site which uses a lot of queries and therefor the need for cahce. since I am recompiling from the time to time (bug fixex and new versions) using the httpruntime built in cache, causes my cached data to be erased. I looked at Memcahced and it says: "Memcached is an in-memory key-value store for small chunks of arbitrary data (strings, objects)". My app needs to store a few milion keys, but the size of each key is not so big (the largest object can contain a list of a few thousands records, but usually it is one object with a 20-30 properties). Does memcached suit my needs?

Upvotes: 0

Views: 182

Answers (1)

mfanto
mfanto

Reputation: 14438

I think there's a couple questions here. How big is the data you're trying to cache? Prior to 1.4.2, memcache had a limit of 1mb per item. While you can now store larger records, it's not recommended. How big is your "few thousand records"? As long as you have reasonable sizes, then yes, memcached could be useful and suit your needs. It works well, it's scalable, and you can share cache data between workers.

Is the entire reason for not using the HttpRuntime cache because sometimes it gets cleared? Because that's also possible with memcached. Neither are persistent stores, and while you can set infinite expiration times here and here, any new versions of memcached, reboots, among other reasons, could cause the cache to clear.

Upvotes: 1

Related Questions