punkish has asked for the wisdom of the Perl Monks concerning the following question:
I quote myself --
On a related note -- I find the whole concept of Bdb very fascinating. Perhaps because it is a novelty to me after years of getting bored by rdbms and SQL. However, I find little or no discussion of using Bdb as the backend of websites. The reasons seem obvious -- Bdb is not relational, and while some relational stuff can be emulated, well, heck, it was just not designed to answer the kind of questions a rdbms can. Still, there is something elegant about everything being contained in a hash that can be loaded in memory, all self-contained, clean... like a single, shiny object. Any insights?
The wisdom I came back with was the SQL provided flexibility that a hash db would not be able to.
In a recent thread, dragonchild, who always has wise insights to offer, suggested I ditch DBD::SQLite in favor of DBM::Deep. For that specific application it might be too late (a lot of SQL coding already done), but for future projects I might seriously consider DBM::Deep. The attraction is in it being pure-perl, so moving apps from one 'puter to another, from Mac to Win to Linux, from home to ISP, etc., would be a piece of cassata.
The question, however, still remains -- how do I do SQL-type queries with a hash-based db?
$db->{my_complex} = [ 'hello', { perl => 'rules' }, 42, 99 ]; print $db->{my_complex}->[1]->{perl}, "\n"; # easy # however .. print all records that 'rule' # difficult
Any examples that I could follow up on where DBM::Deep type db has been used to create a web-app? And, I am not talking of a SQL/hash hybrid where SQL data are taken out and more static (less dynamic) hash db created to improve performance. Instead, I am looking for examples of moderately complex, relational db structures implemented with a hash db.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Wisdom of data in hashes vs. SQL
by cmeyer (Pilgrim) on Jun 13, 2005 at 19:11 UTC | |
by biosysadmin (Deacon) on Jun 13, 2005 at 22:27 UTC | |
by monarch (Priest) on Jun 14, 2005 at 02:13 UTC | |
|
Re: Wisdom of data in hashes vs. SQL
by dragonchild (Archbishop) on Sep 24, 2007 at 15:17 UTC |