473,785 Members | 2,811 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

read from file or mysql

Hi guys!
I have some datas that I must check
everytime a visitor comes to my site
What is better to do:

1- Read data from a file
or
2- Read data from a mysql db

Thank you
--
Yang
Jul 17 '05 #1
10 5331

"Yang Li Ke" <ya******@sympa tico.ca> wrote in message
news:hx******** ***********@new s20.bellglobal. com...
Hi guys!
I have some datas that I must check
everytime a visitor comes to my site
What is better to do:

1- Read data from a file
or
2- Read data from a mysql db


Reading the data from a database is nearly always the best way. It will save
you a lot of problems.

Gerard van Wilgen
--
www.majstro.com (On-line translation dictionary / Enreta tradukvortaro)
www.travlang.com/Ergane (Free translation dictionary for Windows / Senpaga
tradukvortaro por Windows)

Jul 17 '05 #2
Depends on what it is and how often it changes.

Uzytkownik "Yang Li Ke" <ya******@sympa tico.ca> napisal w wiadomosci
news:hx******** ***********@new s20.bellglobal. com...
Hi guys!
I have some datas that I must check
everytime a visitor comes to my site
What is better to do:

1- Read data from a file
or
2- Read data from a mysql db

Thank you
--
Yang

Jul 17 '05 #3
a read from a db is also a read from a file.

file = file read
db = db + cool stuff + file read

if the db is on another server, then add + networking to other server

if its small and static, read from file
--
Mike Bradley
http://www.gzentools.com -- free online php tools
"Yang Li Ke" <ya******@sympa tico.ca> wrote in message
news:hx******** ***********@new s20.bellglobal. com...
Hi guys!
I have some datas that I must check
everytime a visitor comes to my site
What is better to do:

1- Read data from a file
or
2- Read data from a mysql db

Thank you
--
Yang

Jul 17 '05 #4
On 2004-01-31, CountScubula <me@scantek.hot mail.com> wrote:
a read from a db is also a read from a file.

file = file read
db = db + cool stuff + file read

if the db is on another server, then add + networking to other server


And why couldn't a file be considered as a database? :)

--
http://home.mysth.be/~timvw
Jul 17 '05 #5
I wasn't saying it cant be, in fact I am fan of flat file db's, I tend to
use a backend server with apache, and flat files, and do custom queries via
http to it, and get back contents if a form I like. sorta like local version
of remote services :)

--
Mike Bradley
http://www.gzentools.com -- free online php tools
"Tim Van Wassenhove" <eu**@pi.be> wrote in message
news:bv******** ****@ID-188825.news.uni-berlin.de...
On 2004-01-31, CountScubula <me@scantek.hot mail.com> wrote:
a read from a db is also a read from a file.

file = file read
db = db + cool stuff + file read

if the db is on another server, then add + networking to other server


And why couldn't a file be considered as a database? :)

--
http://home.mysth.be/~timvw

Jul 17 '05 #6
Tim Van Wassenhove <eu**@pi.be> wrote in message news:<bv******* *****@ID-188825.news.uni-berlin.de>...
On 2004-01-31, CountScubula <me@scantek.hot mail.com> wrote:
a read from a db is also a read from a file.

file = file read
db = db + cool stuff + file read

if the db is on another server, then add + networking to other server


And why couldn't a file be considered as a database? :)


A *file* can not be considered as a *database*, because *files* are
implemented at OS level. Whereas databases are always implemented a
layer above OS.
True database adds overhead over file read operations when we read
some data. But it adds many features like synchronization ,cache,search
etc over simple file read operation.
So, it all depends upon your requirement. If you need to read static
text every time it will be faster to save your data in a file. But if
you want to update some value every time you read the data, database
will be a better choice.

For faster performance it is always a better idea to cache your static
contents from database to files, and read from them.

And the basic thing is: databases always store data in file system
only.

--
Cheers,
Rahul Anand
Jul 17 '05 #7
On 2004-01-31, Rahul Anand <ra************ @rediffmail.com > wrote:
A *file* can not be considered as a *database*, because *files* are
implemented at OS level. Whereas databases are always implemented a
layer above OS.
Err, what is your definition of database then?
I define it as: a container that holds data.

True database adds overhead over file read operations when we read
some data. But it adds many features like synchronization ,cache,search
etc over simple file read operation.
They way i see it, it is the database management system that allows to
perform these operations on the database.

One could say that a filesystem is a dbms for files. And yes, most
filesystems allow you to perform file insert, update, search, etc
operations.
And the basic thing is: databases always store data in file system
only.


From my definition, a database doesn't store data. It is a container for
data. And the database is stored by the database management system.
--
http://home.mysth.be/~timvw
Jul 17 '05 #8
One file? I don't know. A collection of files in a directory structure,
maybe. I like to think that a database is a pool of data from which you can
easily extract a particular piece.

Uzytkownik "Tim Van Wassenhove" <eu**@pi.be> napisal w wiadomosci
news:bv******** ****@ID-188825.news.uni-berlin.de...
On 2004-01-31, CountScubula <me@scantek.hot mail.com> wrote:
a read from a db is also a read from a file.

file = file read
db = db + cool stuff + file read

if the db is on another server, then add + networking to other server


And why couldn't a file be considered as a database? :)

--
http://home.mysth.be/~timvw

Jul 17 '05 #9
Tim Van Wassenhove <eu**@pi.be> wrote in message news:<bv******* *****@ID-188825.news.uni-berlin.de>...
On 2004-01-31, Rahul Anand <ra************ @rediffmail.com > wrote:
A *file* can not be considered as a *database*, because *files* are
implemented at OS level. Whereas databases are always implemented a
layer above OS.


Err, what is your definition of database then?
I define it as: a container that holds data.

True database adds overhead over file read operations when we read
some data. But it adds many features like synchronization ,cache,search
etc over simple file read operation.


They way i see it, it is the database management system that allows to
perform these operations on the database.

One could say that a filesystem is a dbms for files. And yes, most
filesystems allow you to perform file insert, update, search, etc
operations.
And the basic thing is: databases always store data in file system
only.


From my definition, a database doesn't store data. It is a container for
data. And the database is stored by the database management system.


Thanx for pointing me about my errors.

But i was talking in context to "Storage of data: when we should use a
DBMS and when a File System".

By the context of matter i think it is clear where i am talking about
DBMS and where just database.

--
Rahul Anand
Jul 17 '05 #10

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

Similar topics

0
6528
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 /tmp/mysql.sock. Let's say, /opt/mysql_root/sock/mysql.sock. Installed DBI without any problem. In /etc/my.cnf there are lines as ----- ----- -----
0
3544
by: Taylor Lewick | last post by:
I have a large SQL file that contains a bunch of create table statements.= ... How do I get mysql to read in this file and process the sql. =20 I am not thinking load data infile because it isn't text... **************************************************************** =09 Please Note The information in this E-mail message is legally privileged and confidential information intended only for the use of the
0
2748
by: Bennett Haselton | last post by:
I'm trying to port my MySQL tables for a database called "tracerlock" from one server to another. On the old server, in the /var/lib/mysql/tracerlock directory, there was a ".MYD", ".MYI" and ".frm" file for every table in the database. So after creating a database called "tracerlock" on the new server, I copied these files over to the /var/lib/mysql/tracerlock directory on the new server. On both servers, all the table files are owned...
6
14513
by: Daniel Gwynne | last post by:
I am trying to read a mysql dump file that I was given from a mysql dump file into my mysql server, I am using the following command at the mysql command line and get the following error: mysql> items < c:\bookings\items.mtsql ERROR: Unknown command '\b'. ERROR: Unknown command '\i'. Does anyone know what this means?
0
30998
by: whitemoss | last post by:
Hi All, I had written a code to read a file and insert it's contents to the database. Since I will receive 3 files every hour, so, this program should read those files and insert the contents accordingly to the database and then after that, those files need to be removed to another folder. This program then will be executed again once it receive another 3 files on the next hour. The reason why I need to remove those files to another folder is...
6
3068
by: dylan.boudreau | last post by:
My configuration is Apache/2.0.59 (Unix) mod_ssl/2.0.59 OpenSSL/0.9.7d PHP/5.0.4 on Solaris 10. phpinfo() lists the location of php.ini as /usr/local/apache/conf and my php.ini file is there but for some reason it does not appear to be being read by php. I have defined things such as upload_tmp_dir in that file yet even with restarting apache I am not seeing this reflected in phpinfo(). I am pretty new to PHP so its entirely possible...
4
3205
by: Ross | last post by:
Hello, I am trying to Read and Write to a text file on a web server using Microsoft Visual Basic 2005 Express Edition. So far I have managed to complete my testing with a local text file using the StreamReader Class. Is it possible to use this class when trying to read and write to a text file located on a server? If so, could you please provide some examples? I have setup a free web host with www.ifastnet.com and have some connection...
4
7243
by: =?ISO-8859-1?Q?Hans_M=FCller?= | last post by:
Good morning folks, I cannot read a binary file into a mysql database. Everything I tried did not succeed. What I tried (found from various google lookups...) is this: con = MySQLdb.connect(to server) cur = con.cursor() cur.execute("insert into data values('file1', %s)", (open("test.jpg", "rb").read(), ))
10
2963
by: CDFTim | last post by:
O.K. that was a long Title... Can you help / show me how I would......... I am going to long windedly try to paint this picture. Backround: I have an html page that has a marquee function in it to display a small photo and other information to scroll in a box on the web page. The marquee's info is a table with data that I now insert manually. I would like to be able to insert the data into it from a mysql database. The marquee works by...
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10090
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9949
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7499
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5380
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.