--- André Warnier <[EMAIL PROTECTED]> wrote: > Jonathan Vanasco wrote: > > > > look into memcached -- http://danga.com/memcached/ > > Thank you for the link, I didn't know that module, > and I'll keep it in > mind for some other projects. > But it is slightly off the mark as far as the issue > below is concerned. > Maybe it was my mentioning "data in tables" that was > confusing. My > problem is not to speed up database access, it is to > share data (stored > in memory tables, or say arrays) between Apache > children/threads. >
I haven't used Memchache yet, but it has nothing to do with databases.... It CAN be used to prevent database load, OR it could be used to prevent too much access to flocking files... Consider the Example at the top of that link sub get_foo_object { my $foo_id = int(shift); my $obj = $::MemCache->get("foo:$foo_id"); return $obj if $obj; $obj = $::db->selectrow_hashref("SELECT .... FROM foo f, bar b ". "WHERE ... AND f.fooid=$foo_id"); $::MemCache->set("foo:$foo_id", $obj); return $obj; } your subroutine would be sub get_foo_object { my $foo_id = int(shift); my $obj = $::MemCache->get("foo:$foo_id"); return $obj if $obj; ##### #get $obj from your flocked file mechanism that you are already using....... ########## $obj=get_from flockfiles($foo_id) $::MemCache->set("foo:$foo_id", $obj); return $obj; } It depends on how you've implemented the existing mechanism I guess.... The above seems expect instantiated Objects... Personally I'm curious as to why you don't want to use a database.... Regards Marty Send instant messages to your online friends http://uk.messenger.yahoo.com