Thanks for your reply.
I have tested Redis and it seems to fit my needs perfectly.
I just wanna use REDIS in an easy way:
I will use a Hash value with the HTML content and 1 counter incremented on each display
On each request I request Redis to get the HTML and to increment the counter, If there is no entry I build the HTML using some POSTGRESQL queries and I store the HTML in REDIS with a counter=1.
Every 5 minutes I run through all the Redis record and for each record if the counter is not null I increment the counter on POSTGRESQL side.
So it's not a difficult process.
Currently I'm using gwan webserver and an internal key-value store provided by gwan but I I face some problems, gwan is crashing every night and gwan is using an internal cache mechanism automatically which prevent me from incrementing the counters correctly.
So I decided to migrate to OPENRESTY.
Le vendredi 25 octobre 2013 11:28:25 UTC+2, jerome lafon a écrit :
Hello,
Which Key Value dictionary do you think is the most adapted in term of performance and memory consumption for caching HTML content and a counter that will be incremented each time the HTML is retrieved from the cache?
The size of the HTML data is around 20 KB.
REDIS seems easier to use with the possibility to store a Hash as the value and to use the INCRM command which is atomic, but I don't know if memcached does the job pretty well.
Jérôme