in reply to Wisdom sought on migrating from text files to Berkeley DB or SQL
I use BerkelyDB for a LOT of stuff, especially configuration info. It's fast and easy and certainly less of a pain in the ass to set up, but just keep in mind that there are some drawbacks as well. For a time I found myself creating pseudo-logic structions by accessing data by $db{"$key.$val"}. Using such a structure is cute but becomes hard to manage rather quick. The other issue is fixing incorrect data. Because there is no direct access to the database file itself, you might need to keep this in mind. I made a program myself that allows me to fix/add/delete stuff from the database, but as far as I know there isn't any defacto program that anyone has made.
The other big drawback is that BerkelyDB databases aren't very portable. I'd generally assume that once you make a db file on one server, that it's only going to work on that server. Making a raw export into text might be something to consider for a backup plan.
Now for what you want to do, storing simple things that you want to access via a key (like configuration info and simple mail dump) BerkelyDB works REALLY well. Where it sucks is when you need to get meaningful information out of stuff that is locked up in your database - which means you end up doing stuff like rather messy loops and such. So for what you do now it would be great, for what you want to do in the future, maybe not. I guess that depends on how many db files you plan on breaking this up into, and how you structure your keys.
As an aside an alternative thing to think about is using XML , although slower, it's a lot more fault tollerant.
The other big drawback is that BerkelyDB databases aren't very portable. I'd generally assume that once you make a db file on one server, that it's only going to work on that server. Making a raw export into text might be something to consider for a backup plan.
Now for what you want to do, storing simple things that you want to access via a key (like configuration info and simple mail dump) BerkelyDB works REALLY well. Where it sucks is when you need to get meaningful information out of stuff that is locked up in your database - which means you end up doing stuff like rather messy loops and such. So for what you do now it would be great, for what you want to do in the future, maybe not. I guess that depends on how many db files you plan on breaking this up into, and how you structure your keys.
As an aside an alternative thing to think about is using XML , although slower, it's a lot more fault tollerant.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Wisdom sought on migrating from text files to Berkeley DB or SQL
by Anonymous Monk on Nov 06, 2012 at 08:45 UTC | |
by Anonymous Monk on Nov 08, 2012 at 10:20 UTC | |
by Anonymous Monk on Jan 16, 2013 at 09:01 UTC | |
by Anonymous Monk on Nov 06, 2012 at 09:44 UTC |
In Section
Seekers of Perl Wisdom