I have several fastcgi processes that are supposed to share data. The data is bound to a session (a unique session id string) and should be able to survive a server reboot. Depending on the number of sessions, the shared data might be too big to fit into main memory. Ideally, in the case when the shared data exceeds a certain treshold, the data bound to sessions that have been the least active should exist on disk only, whereas the most active session data should be available from main memory. After a session has been inactive for some time, the sessions data is to be destroyed.
My question is (being a newbie to C/++):
Are there any approaches or libraries that can help me tackle this quite hairy problem ?
Is it possible to use mmap() with shared memory considering the requirement that inactive session data should be destroyed ?