Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-09-2009, 07:12 AM   #1
Registered: Mar 2009
Distribution: Slackware 13.0
Posts: 60

Rep: Reputation: 16
Unhappy Why do we need a database program such as MySQL or MS SQL or Oracle?

What is wrong if php or Ruby on Rails store the information and then access/modify/store more in one or more gigantic text files in the server?

thank you.
Old 09-09-2009, 07:46 AM   #2
Registered: Feb 2005
Distribution: Ubuntu, CentOS
Posts: 585

Rep: Reputation: 35
What is it you want?

Nothing says you have to use an RDMS to store your data. Nothing says you can't "roll your own", and store information in binary or even text files.

However, here are some things you might want to consider:

How will you search for data?

How will you delineate data fields in a file?

And, most importantly, will you write some performance tests to see which is faster?
Old 09-09-2009, 07:54 AM   #3
Senior Member
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060
A data base management system (DBMS), such as MySQL, PostgreSQL, Oracle, and others, gives you a convenient and efficient way to store, search, modify and retrieve information from one or more tables in one or more data bases. The DBMS' are relational which means that you can store related information in multiple tables (rather than one big file) and retrieve it quickly (an example may be a customer table storing information about a customer and an orders table storing information about items a customer has ordered and a products table storing information about the products. Say the customer - orders table is joined (related) by, say, customer number and the orders - products table is joined (related) by product number. For example, can then find out how many customers ordered a given product quickly (handy for inventory control purposes, say) rather than searching through massive text files looking for information. Without a DBMS it would be virtually impossible for, say, to exist.

So, is there anything wrong with searching giant text file? Nope, but it sure makes sense to do so in the most efficient way available. A DBMS keeps duplication down (say you sold 1,000 of a given product and had 1,000 identical lines of text describing the product in a file rather than just one description that is found by a number and displayed, printed or whatever needs to be done.

Hope this helps some.
Old 09-09-2009, 08:12 AM   #4
LQ Veteran
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 416Reputation: 416Reputation: 416Reputation: 416Reputation: 416
Believe me, when you have many multiples of terabytes of data to store in a useful way, you don't want to do it in gigantic text files.
Old 09-09-2009, 08:31 PM   #5
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,417

Rep: Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397
All of the above, plus any new guys probably already know SQL ... as opposed to having to learn your file layout and how to manipulate it.
Also, flat text files bottleneck multiple users/processes; how are you going to handle record/file locking?


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
My SQL statement to delete an entry in MYSQL database fails in PHP ratchie Linux - Software 1 12-29-2008 03:48 AM
LXer: Protecting your MySQL database from SQL injection attacks with GreenSQL LXer Syndicated Linux News 0 08-25-2008 08:00 PM
Wrote java program and can't connect to sql database mokoena Programming 1 07-12-2008 11:01 AM
how to import mysql database to oracle LinuxLover Linux - Software 1 07-22-2006 08:30 AM
COnnect Oracle Database in Linux by C++ program!! nelnel Linux - Software 4 05-24-2005 11:13 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:54 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration