From: Tom Machinski Date: 2007-10-28T08:25:51+09:00 Subject: Re: A memcached-like server in Ruby - feasible? On 10/28/07, Lionel Bouton wrote: > It looks like the job a database would do for you. Retrieving 20 large > objects with such conditions should be a piece of cake for any properly > tuned database. Did you try this with PostgreSQL or MySQL with indexes > on created_on and bar? Yes, I'm using MySQL 5, and all query columns are indexed. > How much memory did you give your database to > play with? Not sure right now, I'll ask my admin and reply. > If the size of the objects is so bad it takes too much time > to extract from the DB (or the trafic is too much for the DB to use its > own disk cache efficiently) you could only retrieve the ids in the first > pass with hand-crafted SQL and then fetch the whole objects using > memcache (and only go to the DB if memcache doesn't have the object you > are looking for). Might be a good idea. > Lionel. Long term, my goal is to minimize the amount of queries that hit the database. Some of the queries are more complex than the relatively simple example I've given here. And I don't think I could optimize them much beyond 0.01 secs per query. I was hoping to alleviate with memcached_improved some of the pains associated with database scaling, e.g. building a replicating cluster etc. Basically what memcached does for you, except as demonstrated, memcached by itself seems insufficient for our needs. Thanks, -Tom