Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between memcache and python dictionary

In my current project, I am using Memcache to store key-value pairs, but since the communication happens over the socket between my process and the Memcache causing the huge latencies. We went with memcache because we had a requirement of storing large amount of key-value pairs. But now I want to store the dictionary as a global datastructure in my process. Is it a good thing? Because the dictionary will be stored in processes address space. Suggestions please....

like image 494
hue Avatar asked Aug 22 '11 06:08

hue


1 Answers

The usual reason to use memcached is that you would like to distribute the cache among multiple machines, with the goal of both having data available on all the machines, while also utilizing the storage of all the machines. If those requirements don't apply to you, and you only need the cached data on a single machine, then memcached doesn't offer you all that much. In that case, moving the dictionary into your local process might be a good idea.

like image 166
dlev Avatar answered Nov 09 '22 20:11

dlev