Namespaces

Eamon Daly edaly at nextwavemedia.com
Thu Jun 23 09:14:12 PDT 2005


I didn't really provide information about my particular
application, so let me outline that and perhaps someone will
have a workaround: I have 100 tables, each containing 20,000
rows, with zipcode as the PK. When a zipcode comes in, our
application checks each table and reports which tables
contain that zipcode.

With namespaces, the table name is the namespace name, each
zipcode requested is a key, and the response is the value.
Cache maintenance is simple: I delete the namespace when the
underlying table is changed.

Your suggestion is a good one, but unless I store a complex
object in the value:

94110 -> { 'table_1' => 'Y', 'table_2' => 'N' ... }

it breaks down in my particular case. Also, I'd still have
to ask the database for the table version on every request,
or maintain a separate cache of table updates and query
against that. That's certainly cheaper than going to the
database, but still a lot of activity.

I appreciate the response! Any other ideas?

____________________________________________________________
Eamon Daly



----- Original Message ----- 
From: "Brad Fitzpatrick" <brad at danga.com>
To: "Eamon Daly" <edaly at nextwavemedia.com>
Cc: <memcached at lists.danga.com>
Sent: Thursday, June 23, 2005 10:50 AM
Subject: Re: Namespaces


> You can just cache a table version number in each row's day.  So
>
> 94110 -> "1/San Francisco, CA"
>
> And then you fetch 94110, split the version/city apart, see if the version
> matches your table version.
>
>
> On Thu, 23 Jun 2005, Eamon Daly wrote:
>
>> Any feel for when namespaces and clearing by namespace might
>> be implemented? We want to cache some really large tables of
>> zipcodes, but it doesn't make sense to cache entire tables
>> when only 5-10% of the rows are ever hit. We'd like to cache
>> rows as they're requested, but then there's no way to delete
>> all of them when the underlying table is updated.
>>
>> ____________________________________________________________
>> Eamon Daly



More information about the memcached mailing list