Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Re: Question about properly laying out a database

by sligi (Sexton)
on Dec 12, 2001 at 04:09 UTC ( [id://131121]=note: print w/replies, xml ) Need Help??


in reply to Re: Question about properly laying out a database
in thread Question about properly laying out a database

I suggest you use a real database like PostgresQL or at least MySQL. They're not that hard to set up, DBI is wonderful, and you can query on any field with great simplicity.

This would be my suggestion, too. It also gives you the benefit of scalability - if your database is so designed.

To help you on your way, jeffa has written an article (Migrating a 1NF table to multiple 2NF tables) that gives very good pointers on db design. There are also good links at the end of that article and it's replies so you might want to check them out.

--
sligi

  • Comment on Re: Re: Question about properly laying out a database

Replies are listed 'Best First'.
Stick w/the DBMs
by djantzen (Priest) on Dec 12, 2001 at 08:57 UTC

    My initial reaction as well was to suggest a DB like MySQL, but on further consideration... I've worked on a website with over 8000 entries where each entry had about 15 pieces of metadata, all of which was stored in DBMs. It's worked reliably for over five years.

    Question to the questioner: is this the first brush at this sort of system that your employer has attempted? If so, don't try to get it perfect, just get something out there that works, even if you end up rewriting the whole thing again in 6 months. It's unavoidable that the requirements will change, and it's futile to spend time now implementing a heavyweight architecture where the problem domain isn't clear.

      OOooo... *very* nice phraseology in your use of "problem domain."

      That's going in my non-technie I-need-to-speak-with-managers folder. :)

      very nice.

      fongsaiyuk

      My employer is the type that says, "Show me a working prototype and then we'll refine it." It's quite aggravating when the functionality isn't fully nailed down, so I am definately going to stick with DB_File.

      The suggestion for normalizing the database was EXACTLY what I needed. (thanks joealba!). I've done that and it has drastically improved the database. I have some books on MySQL coming soon, and I intend to tackle learning it quite soon. Who knows... perhaps I'll be rewriting the script 6 months later. Question though: how stable is MySQL in comparison to say, a DBM or a flat file for small (under 5000 entries) databases? Is it realistic to think that I could set up a system that allows them to add, edit, and remove records with a web interface and not have to be there to maintain it? I have yet to work with it very much, so it will be a challenge :-)

        MySQL and PostgreSQL are very stable and reliable. They're also a lot heavier than DB_File et al, because they have their own permissions systems.

            -- Chip Salzenberg, Free-Floating Agent of Chaos

        Question though: how stable is MySQL in comparison to say, a DBM or a flat file for small (under 5000 entries) databases?

        Well, that depends - mostly on the load, I'd think. With such a small db it's hard to generate enough load to really stress the system. You probably would not feel the difference at all as everything will fit in memory just nicely.

        With a RDBMS you have the flexibility of the relational data model and the power of SQL. It may not be necessary in this project, but maybe in the next one. I found PostgreSQL Tutorial to be a fairly good introduction to SQL.

        Is it realistic to think that I could set up a system that allows them to add, edit, and remove records with a web interface and not have to be there to maintain it?

        If you set up any system - especially a database - it is bound to require maintenance. Something can always go wrong, and eventually will.

        Here's one (a bit old) article which I found enlightning: MySQL and PostgreSQL Compared by Tim Perdue; and here's another: Why Not MySQL? by Ben Adida.

        --
        sligi

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://131121]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2024-04-19 18:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found