If that's the case then you might try some of the techniques in Dominus's lightweight database tutorials. You can find the link to them in this node:
http://www.perlmonks.com/?node_id=629253
I started looking through the materials and I think it may work real well for your situation. However, I do not have much experience in it, so you're on your own from there.