in reply to Re^3: Selecting one of two implementations
in thread Selecting one of two implementations
Forgive my improper terminology - I didn't take computer science, so I may be using terms incorrectly. I would definitely like to extend the module into a cache (which would include a callback to generate missing information), but I suppose that we're looking more at a database. My confused terminology actually comes from my investigation of Cache::Cache. The documentation uses the example:
So, if our calling code is implemented similarly, then the database becomes a cache. (Generating 200MB tar.gz files off the network isn't free, but using already-built tarballs from the local drive is about as free as it's going to get.)use Cache::FileCache; my $cache = new Cache::FileCache( ); my $customer = $cache->get( $name ); if ( not defined $customer ) { $customer = get_customer_from_db( $name ); $cache->set( $name, $customer, "10 minutes" ); } return $customer;
The way our code works now is that we start with a preparation phase, where the cache/database is populated with things that are going to be needed 1-15 times. Then we enter the execution phase where we pull items from the cache/database as needed to build what we need to build.
Note that we've also given thought to actually using an RDBMS rather than the filesystem to allow us different flexibilities - e.g., having multiple machines pull from the common cache via DBI. Or using FTP or HTTP as protocols to do similarly. The RDBMS idea is more of a coolness thing - FTP or HTTP are probably better (i.e., more practical) protocols for this.
|
|---|