473,238 Members | 1,791 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,238 software developers and data experts.

File I/O vs. MySQL

I'm thinking of building a custom website template system. I haven't
decided whether to use files or MySQL to store page html data. Is there
a performance difference between reading a flat file vs. reading a
database?

Aug 24 '05 #1
9 6145
Well, yes. Use your filesystem for what it's for: storing files. There
is no reason to use a database for what you're doing.

Aug 24 '05 #2
Yes, a MySQL query will always be slower than reading flat files. If speed
is the primary concern, go with files. Of course, you must weigh this
against the convenience of having your page data in a MySQL database.

"Nerdlance.com" <du**********@gmail.com> wrote in message
news:11*********************@g44g2000cwa.googlegro ups.com...
I'm thinking of building a custom website template system. I haven't
decided whether to use files or MySQL to store page html data. Is there
a performance difference between reading a flat file vs. reading a
database?

Aug 25 '05 #3
Padding your resume is a very good reason. "Built a database-driven
content management system (CRM)" sounds more impressive than "Created a
bunch of HTML files."

Aug 25 '05 #4
Actually, if you'll notice, phpBB and other forums use template files,
in which are contained the template code and various forms of (X)HTML
markup. As far as a CMS goes, the DB is used, but not specifically for
holding your markup. Rather, it would contain values that would be
inserted into the template (like user's settings).

peace

Aug 25 '05 #5
Nerdlance.com wrote:
I'm thinking of building a custom website template system. I haven't
decided whether to use files or MySQL to store page html data. Is there
a performance difference between reading a flat file vs. reading a
database?


All applications want to be database applications when they grow up.

Learn to manage data. Learn it soon. Learn it well.
--
Kenneth Downs
Secure Data Software, Inc.
(Ken)nneth@(Sec)ure(Dat)a(.com)
Aug 25 '05 #6
Chung Leong wrote:
Padding your resume is a very good reason. "Built a database-driven
content management system (CRM)" sounds more impressive than "Created
a bunch of HTML files."


Actually you can use the filesystem and still say exactly the same thing
as you quoted above. Some people consider the file system a
database-driven system. Hell some people consider /etc/passwd a
database! Buzzwords are buzzwords and people use them to describe all
sorts of things. Now if you said "Build a MySQL database-driven content
management system..." then it does show off that you know MySQL. But it
also points out that you didn't mention say MS SQL. Depending on the
position you're applying for this could be detrimental...

--
If at first you don't succeed, skydiving is not for you.

Aug 25 '05 #7
Kevin wrote:
Yes, a MySQL query will always be slower than reading flat files. If
speed is the primary concern, go with files. Of course, you must weigh
this against the convenience of having your page data in a MySQL database.


Convenience?!? There's no convenience of having your page data in a
MySQL database! Hell to get to it you have to fire up mysql, log in,
connect to the database, remember/figure out the database
structure/tables evolved, etc. With a flat file all you gotta do is find
the file and then type more(1)!

You use a database if you need the extra functionality that a database
brings to the table, like indexing and keying off of certain fields,
etc. Otherwise (like in this case where you are mainly just gonna be
reading files sequentially) a flat file system is a better choice!
--
What happened to the first 6 ups?

Aug 25 '05 #8
"a MySQL query will always be slower than reading flat files. "

I think it really depends on lots of factors: which kind of query it
is, how big those flat files are, etc. If the target source is big,
running from DB should be a lot faster, because of index.

Aug 26 '05 #9

What if you page data grows more and more .. you have hard time saving to
the server from your http request, as your connection may timeout regularly.

--
Geeks Home
www.fahimzahid.com


"Nerdlance.com" <du**********@gmail.com> wrote in message
news:11*********************@g44g2000cwa.googlegro ups.com...
I'm thinking of building a custom website template system. I haven't
decided whether to use files or MySQL to store page html data. Is there
a performance difference between reading a flat file vs. reading a
database?

Dec 3 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: francescomoi | last post by:
Hi. I'm trying to build 'MySQL-python-1.2.0' on my Linux FC2: ---------------------------------- # export PATH=$PATH:/usr/local/mysql/bin/ # export mysqlclient=mysqlclient_r # python setup.py...
0
by: JL | last post by:
Platform: Linux Red Hat RHEL 3 (and red hat 9) Installed MySQL from source. As a matter of fact, installed all LAMPS from source, and the mysql socket file was arranged in a place other than...
0
by: Jean Hagen | last post by:
I'm trying to write a script to weekly remove MySQL logs, the general, error and binary log files. Following the MySQL documentation, I've written a script that moves all current log files, then...
12
by: jacob nikom | last post by:
Hi, I would like to store XML files in MySQL. What is the best solution: 1. Convert it to string and store it as CLOB/text 2. Serialize it and store as byte array 3. Flatten it out and create...
0
by: Jason Reljac | last post by:
Howdy, I'm looking for a little help. I had a W2K server with Apache/PHP/mySQL installed and working. I had a specific page that ran a mySQL SELECT INTO OUTFILE and dumped the outfile into a...
4
by: news | last post by:
Our production database in an exported textfil runs about 60 MB. Compressed that's about 9 MB. I'm trying to import the export into another machine running FC3 and mySQL 11.18, and it appears as...
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
0
by: jaejinkorean | last post by:
I don't know if this is the right place to ask this question... My php.ini file look like following.. There are some empty spot to fill.. I do not know what values should I assign,, To us mySQL...
3
by: doctorhardik | last post by:
hai all i am try configure php4.3.9 on my FC-3 machine. and my mysql database version 5.0.1, in phpinfo file it show mysql but when i run php -v command it show error like
1
ddtpmyra
by: ddtpmyra | last post by:
When Im downloading a file from mysql database the file is already corrupted below are the code I used on downloading to mysql and uploading from mysql. PDF file are doing okay as long as it is a...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.