Am So, 2003-11-23 um 18.48 schrieb Tod Harter: > On Saturday 22 November 2003 10:48 am, Tom Schindl wrote: > > It does not always have to be SHM using Cache::Cache you could also > > share data using the e.g. the filesystem. > > > > Another possibility would be to use BerkeleyDB which works perfectly see > > also http://www.perl.com/pub/a/2001/10/17/etoys.html > > Yeah, but what would be the point? Then your taking data from one object store > (the main one) and putting it into a cache which is probably no faster than > where you normally store it. (IE, if Berkeley DB is such a great cache then > why not always keep your objects there....). Berkeley DB or SHM or whatnot > MIGHT beat out a fast RDBMS like MySQL in some cases, but in my experience > its most likely the speed gain will be slight to nothing and the increase in > application complexity will be fairly significant.
Well it depends. I completely agree with you when the object created only holds a dataset e.g. table-row of the database (which is the situation discussed in this thread). In case you are calculating things upon this data it will of course make sense to cache this data. It also makes sense if your SQL-Statement is very complex and its costs on the RDBMS-side are very high. For my last project I had to shade an old and not well design Informix-database behind a ***hopefully*** better designed OO-API, which needs nearly realtime support for television-inserts, online-sports-tickers, ... . In such a situation it made sense to cache data using Cache::Cache and sharing those data between mulitple processes. > > Also remember that ANY cache will have to serialize all accesses to each > object, which if your application hits a lot of objects fairly often will > most likely bottleneck you at the cache with possibly serious total system This is true if you have mulitple concurrent write accesses, when you have one writer/creator and multiple readers that's not much a problem. > throughput limitations. OTOH if MySQL were to be your bottleneck you could > always move your database off to faster hardware, build a cluster, etc. > > > > > Tom > > > > Am Fr, 2003-11-21 um 01.15 schrieb Matthew Smith: > > > > From: "Ken Burcham" <[EMAIL PROTECTED]> > > > > > > > > can I do that lookup just once > > > > and stuff it somewhere like an application server variable? > > > > > > I use Apache::AxKit::Plugin::Session, there is a 'Global' taglib that > > > let's you share data between all instances of apache. It's a bit > > > involved though, if you're not doing access and authentication it might > > > be easier to directly use Apache::Session, there is a shared memory > > > module which would do the job. Maybe others have recomendations on the > > > best way to access shared memory for mod_perl. > > > > > > > where does this cache > > > > > > > > live? Or does it? > > > > > > My understanding is that it is stored in the memory of the perl instance > > > that is running. I also understand that there is a perl instance for > > > each apache server instance running - so things can get out of sync if > > > your browser comes in on a different server - hence the need for a > > > shared memory storage. > > > > > > matt > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
