Question:
what is better way to store data in a website?
bab m
2009-05-01 06:59:06 UTC
is it better to put data in xml files and into directories or put data in a database?
is it safe to put common data in xml files?
any advise....
thanks for your answers....
Five answers:
J.M.F.
2009-05-01 07:12:49 UTC
It depends totally on the data you want to store :)



If you expect to do any kind of searching then a database is almost always the best bet.



However for image data for example, it's usually better just to store them as files.



If data "feels" like it should be a file then it should probably be a file - trust your instinct there.



If data feels like it belongs in a table, then a database is a better bet.



Pretty simplistic but it's the best I can do without more information :-)



Databases are good for manipulation of large amounts of data. Their power is quite awesome - once you've done a little bit of database work, i.e. covering joins of tables, you'll begin to see the power they have.



Files are normally used for static html pages in small websites. In larger sites they're used as caches, for example. Archives are stored as files. Logs are often stored as files.



A file is better for simple storage rather than searching and manipulating the data. You can't dip into any point into a file - you need to often read the whole file which is an expensive task resource wise. However appending data to the end of a file for example is very efficient which is why they're good for storing logs.



Hope that helps
P34C3
2009-05-01 09:03:12 UTC
xml should be more from an interface perspective rather than storage. So, when your system talks to another system or when you need to persist data for a short period of time, you use xml. Otherwise, for storage database is always the best choice.



The one single thing you have to remember is future growth and extensibility. What might start off as a 500KB data might grow to several gigabytes tomorrow. You do not want to be managing that in a file system. In general, even if your data is small, go for a DB.
?
2016-05-25 09:01:35 UTC
Very Cool program its fairly new never heard of it till today once in a while Adobe puts out new products. This is simple as its supposed to format meaning its a web application that works with xml to develop documents in pdf as well as run in an ajax platform to be more interactive. Microsoft Access I guess is possible by sql or mysql is better. If you are paying for a webhost most come with databases like mysql or sql depending on your server. Its quite a bit to set up but i can be done.
anonymous
2009-05-01 16:45:03 UTC
I thought xml was like html? If it is binary, I do not see why it should any safer?
anonymous
2009-05-01 07:07:36 UTC
Either way is safe if done correctly, but a database is better.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...