A long time I ago I asked for the wisdom of using BDB instead of a SQL db for creating a web-type app.

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.

--

when small people start casting long shadows, it is time to go to bed

In reply to Wisdom of data in hashes vs. SQL by punkish

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.