From: Antti <ant...@he...> - 2004-05-05 16:24:06
|
Hi all! I'm new here so a minimal introducton could be in place: I'm a CompSci student and sometimes working on the Mimerdesk/Dicole project mendtioned earlier on this list mainly as a volunteer. We are building the new Dicole upon OI (and will soon port it to OI2) and I'm currently trying to wrap my brains around OI2 with some prior OI1 knowledge. My question concerns OI(2) caching on a distributed environment. Our system will sometimes be distributed among two or more request serving servers running apache and mod_perl (and a single database backend) and I'm wondering what might be the best solution to implement various caching strategies for such an environment. Our application will be quite dynamic with very few static elements and thus it might be not so important to cache already generated pages in a shared filesystem. We anyway do have some quite static sets of data in the database which are used as base to generate the user specific data and it would be nice to be able to cache these data collections - preferably in their parsed state. An example of this kind of data would be the navigation system. We have many spops objects (of one type) which in the end form a tree of navigation items. After the navigation tree has been generated it is run through for the specific user and the parts the user is not allowed to see are deleted and user/group specific information and links are generated. The first point of caching would be after the generation of the initial navigation items tree. The second could be after the user specific navigation tree generation. The first data collection will be the same for every user and thus it will be loaded from the database and formed into the tree each time a request is received. I peronally think that the best solution for caching this kind of data would be to keep it in the process' memory. This rises some questions about the validity of the data which I have thought of resolving by creating a database table listing the last modification times for each dataset which will be checked in the beginning of each request (could also be any other shared datasource). The more global datasets like this we have, the more we get benefit out of having a single small dataset specifying the validity of all other datasets which hold their generation time that will be checked against the last data modifying time when the data is used. My question is could there be support in OI2 for this kind of data caching? I know it would be quite easy to extend the OI2::Cache to use also Cache::MemoryCache to hold the data cache in each process but there should also be a globally accessible place (LDAP, database others?) to store the last modification times. If OI2 would use this kind of caching for example language data or theme data we get even more benefist out of this kind of approach since the single checking of the validity table would validate even more data caches in memory. Also I'd like to hear Chris's ideas about language data storing and caching if I could learn something to improve or refactor my ideas on the global data caching area. Then to the second caching area.. We have in our system a heavily used groups system and lots of user specific data - so both for groups and for users there will be loads of datasets like the navigation tree described earlier. This data we can not cache in the process' memory since there simply is no space for the data of many users and groups multiplied by the amount of processes running simultaneously. So if we want to cache this kind of data an obivous place would be the filesystem. Now I don't like the idea that caching would be handled in a shared filesystem and thus suggest that it is being held in the local filesystem and its validity would be checked just like the global data - just tied to the user/group/whatever key. For this purpose we could either use the previous global data table or form new tables which could be queried just for the relevant data (current user and users groups). This again would be nice to somehow integrate to OI2 to get the full benefits out of a single modifications table. So any thoughts or suggestions on the caching area bot in OI or in our system? - Antti Ps. Thanks if you read the whole post ;) |