Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

MySQL,, OR normal DB!

by ACJavascript (Acolyte)
on Apr 07, 2003 at 23:48 UTC ( [id://248764]=perlquestion: print w/replies, xml ) Need Help??

ACJavascript has asked for the wisdom of the Perl Monks concerning the following question:

Hello again from the wannabe monk...
I was thinking,, and I couldn't find an answer in any of the books I own.. So I wonder if any of you could shine a light on this.

Is using a MySQL database SAFFER then usering a normal filename.db (database) ??

Thanks for any help!!!

Replies are listed 'Best First'.
Re: MySQL,, OR normal DB!
by tachyon (Chancellor) on Apr 08, 2003 at 00:02 UTC

    RDBMS - Relational Data Base Management Systems (of which MySql is one of many) we developed starting in the 1960s to solve many of the problems associated with flat file databases. They are widely used because they do. SQL or Structured Query Language is one of the ways in which you can interact with the data in a RDBMS. It is quite simple to learn the basics of SQL. With a RDBMS you have far more flexibility in what you can do with the data than with flat files where you essentially have to roll your own sql.

    For anything more than trivial applications using a DB is the way to go. Trivial applications often develop featuritis so starting with a DB is often not a bad idea. Once you have tasted the power of SQL and a RDBMS there it is really hard to go back to flatfiles.




Re: MySQL,, OR normal DB!
by arturo (Vicar) on Apr 08, 2003 at 00:10 UTC

    It's kinda hard to answer this question. In my experience, neither system has ever messed me up, but then I've never pushed a .dbm file very hard. Safer how? How would you measure such a thing? When is failure due to a bug, or to programmer stupidity / lack of foresight / lapses in judgment ?

    MySQL is an RDBMS with network capability. If you're running it as such, well, then, since it's not gonna be bug-free, then you have the possibility of a bad access configuration or (less likely) a remote security hole, which ain't there with a dbm file on a local disk.

    OTOH, Large sites run MySQL and, while at least one of those sites uses multiple DBs and has failover schemes, to the best of my knowledge neither has had a major database corruption issue that could be traced to a MySQL failure (I'm prepared to be corrected on that).

    It's hard to compare two different things like this: one gives you an SQL interface and networkability, while the other doesn't (not by itself). MySQL also handles concurrency issues for you (what if more than one reader or writer accesses the data at the same time), which can be a bit of a headache with dbm files.

    But no matter which you would use, if keeping your data safe is *that* important, then back it up regularly. If the hard drive fries, neither system will help you.

    If not P, what? Q maybe?
    "Sidney Morgenbesser"

Re: MySQL,, OR normal DB!
by Ovid (Cardinal) on Apr 08, 2003 at 03:31 UTC

    Whether or not MySQL is a good choice for you simply depends upon what you need. For example, if you just need a configuration file, no, MySQL is not a choice, but you'll need to define your requirements before anyone can respond adequately.

    merlyn has an interesting use.perl post on this topic.


    New address of my CGI Course.
    Silence is Evil (feel free to copy and distribute widely - note copyright text)

Re: MySQL,, OR normal DB!
by glwtta (Hermit) on Apr 08, 2003 at 03:30 UTC
    As others have mentioned that really depends on what you mean by "safer".

    Neither is really liable to start losing data for no reason, if you are worried about logical errors on your (the developer's) part and data integrity using an RDBMS might be a good idea. Though for this purpose I would recommend using something along the lines of PostgreSQL rather than MySQL as it generally has more developer-friendly features, many of them important for maintaining data integrity.

SQL vs file-db
by Improv (Pilgrim) on Apr 08, 2003 at 12:16 UTC
    db provides a very different interface and structure than SQL-based databases, and that involves thinking about things differently. Depending on what you need, either might be a good design decision. Generally, SQL databases tend to be more engineered, with all sorts of nice features like scalability, security, and easy running of complex queries. If your data isn't quite flat, then SQL databases are an excellent match. However, they are more complex than the db, and if all you're trying to get is some form of persistant data, then they're probably the wrong solution. In sum, you can think of SQL as being like a nice car, and file db as being like a bike. Their purposes arn't entirely the same, cars are more powerful and essential for some purposes, but require entering a certain frame of mind, and their features are overkill if all you want to do is ride around the neighborhood. I hope this helps..
Re: MySQL,, OR normal DB!
by nite_man (Deacon) on Apr 08, 2003 at 12:42 UTC
    I'm agree with brothers.
    Your choise should be up to an your objective. It doesn't need to complicate a solution but serious projects need an use serious tools.
    --------> SV* sv_bless(SV* sv, HV* stash);
      Yes I see what you all are saying and I agree,, it really all depends on the function of that database.. But what i was trying to say - Im sorry if I wasn't clear :)

      Which is safer,, meaning,, To a hacker,, Is it simpler to hack a db or a MySQL database,, For I want to hold some info in a db,, but dont want it to be out there for anyone.

      These database would be in a secure directory with passwords and such,, So would that be good?

      Thanks all of you for your posting! :)

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://248764]
Approved by dga
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-07-24 09:34 GMT
Find Nodes?
    Voting Booth?

    No recent polls found

    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.