sql vs xml?

Alex

Diamond Member
Oct 26, 1999
6,995
0
0
it's a simple site and there will only be 2 kinds of dynamic data:

- simple news section where staff can log in to admin site section and post news items that appear on the main news page

- on-going progress reports where staff will log in to admin section and add textual information regarding each order and where clients will be able to search by their license plate and see what's been done to their car so far

its for a large mechanic's office and he really liked the idea of enabling customers to track the progress online. it's pretty new i think only food delivery companies have that kind of stuff.

since i'm more comfortable with sql my gut feeling is to do it like that but i'm wondering whether xml will be more efficient?

any thoughts and opinions welcome! thanks!!
 

clamum

Lifer
Feb 13, 2003
26,252
403
126
I'm not sure what you'd use XML for in this situation. Using a database and server-side scripting language (MySQL and PHP, both free) seems to me like it would work pretty well for what you need done.
 

Atheus

Diamond Member
Jun 7, 2005
7,313
2
0
Not sure I understand...

php vs xml?
since i'm more comfortable with sql my gut feeling is to do it like that but i'm wondering whether xml will be more efficient?

PHP, XML, and SQL are such different languages that I can't imagine comparing them - you would never really use them in similar ways.

You'll want to use PHP (or another server-side language) to recieve posted data and to interact with the database using SQL. You can put things in database in XML format, or not... it depends on what you're storing...


 

Alex

Diamond Member
Oct 26, 1999
6,995
0
0
Originally posted by: Atheus
Not sure I understand...

php vs xml?
since i'm more comfortable with sql my gut feeling is to do it like that but i'm wondering whether xml will be more efficient?

PHP, XML, and SQL are such different languages that I can't imagine comparing them - you would never really use them in similar ways.

You'll want to use PHP (or another server-side language) to recieve posted data and to interact with the database using SQL. You can put things in database in XML format, or not... it depends on what you're storing...


my comparison of the two was in terms of a means of storing and retrieving dynamic content for a webpage.
but really, php + mysql makes a lot more sense and i'm a lot more comfortable working with those two anyway. i thought maybe using xml would be faster than querying the database but since they are few operations per session and the xml file size could grow rapidly mysql seems like the better alternative!
 

jjones

Lifer
Oct 9, 2001
15,424
2
0
Yeah, from what I've researched, xml is either just slightly faster, or slightly slower than the typical db query. Can't remember which but it was really insignificant, all things being equal.

I use xml on my site like that but it's for infrequently updated data (a couple of times a day at most) and the reason I use it is to lessen the load on the db, not that it's really necessary right now but I did it in anticipation of a future need. All of the principal directory pages on my site read an xml file rather than pull from the database. As new deals get listed, the corresponding xml file is updated, but on average, any single xml file isn't updated very often.
 

Alex

Diamond Member
Oct 26, 1999
6,995
0
0
Originally posted by: jjones
Yeah, from what I've researched, xml is either just slightly faster, or slightly slower than the typical db query. Can't remember which but it was really insignificant, all things being equal.

I use xml on my site like that but it's for infrequently updated data (a couple of times a day at most) and the reason I use it is to lessen the load on the db, not that it's really necessary right now but I did it in anticipation of a future need. All of the principal directory pages on my site read an xml file rather than pull from the database. As new deals get listed, the corresponding xml file is updated, but on average, any single xml file isn't updated very often.

good answer i like that!
so yeah i'll stick with sql!
 

Atheus

Diamond Member
Jun 7, 2005
7,313
2
0
Originally posted by: franguinho
Originally posted by: Atheus
Not sure I understand...

php vs xml?
since i'm more comfortable with sql my gut feeling is to do it like that but i'm wondering whether xml will be more efficient?

PHP, XML, and SQL are such different languages that I can't imagine comparing them - you would never really use them in similar ways.

You'll want to use PHP (or another server-side language) to recieve posted data and to interact with the database using SQL. You can put things in database in XML format, or not... it depends on what you're storing...


my comparison of the two was in terms of a means of storing and retrieving dynamic content for a webpage.
but really, php + mysql makes a lot more sense and i'm a lot more comfortable working with those two anyway. i thought maybe using xml would be faster than querying the database but since they are few operations per session and the xml file size could grow rapidly mysql seems like the better alternative!

Oh I seeeeeee, you mean using flat xml files to replace the database, sorry. I've never done it that way, although I can see the advantages for a small site - you could use a really lightweight XML parser and avoid the overhead of mysql.

 

troytime

Golden Member
Jan 3, 2006
1,996
1
0
i think the mysql query, or even multiples, will still be faster than parsing an xml file
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
Originally posted by: jjones
Yeah, from what I've researched, xml is either just slightly faster, or slightly slower than the typical db query. Can't remember which but it was really insignificant, all things being equal.
That statement doesn't mean much without a huge amount of qualification. Like what the 'typical db query' is and what exactly you're doing with the xml.

I think the best reason to go with xml directly on disk is that it would vastly simplify the deployment process. You don't have to administer a database and you can migrate servers by copying a couple of files. Possibly nicer from a security standpoint if you don't like to let your webserver talk to anything outside a chroot.

If you did xml you'd have to worry about a few things like concurrency (multiple people changing the files at the same time) and privacy (if the xml files are within your document root and they contain sensitive data you have to make sure people can't retrieve them with their browsers). Mysql will likely scale far better if you ever make this bigger.
 

troytime

Golden Member
Jan 3, 2006
1,996
1
0
the more i think about it, the more i think that parsing an xml file is simply not a good idea for this type of content

by the time the file is parsed and processed, the query will be done and displayed
and that doesn't even factor in any slowdowns for the file locking

databases are made for this, xml isn't
 

jjones

Lifer
Oct 9, 2001
15,424
2
0
Well, I'll explain a little bit about my application. I use it in a worldwide directory application. Each city within the directory has its own xml file of listings, as does each country and region have its own xml file of cities within that country, or countries within that region.

What I'm looking at is that each and every page that is navigated means a hit on the db. I use xml because the content, while dynamic, is actually modified very little. New listings go in daily, but for each individual city, the changes are infrequent. On top of that, the cities and countries will change very rarely. Seems a waste to hit the db every time, yet I needed to be able to approach it dynamically because I certainly don't want to be manually changing mostly static pages, no matter how infrequent.

Everything is contained on the db and I use that populate the xml files. Concurrency is no problem, nor is privacy. As for parsing, the only xml data you're parsing is these relatively small xml files which include only exactly what is needed for each individual page, so it's not like you have to parse a huge xml file.

This works very well for me, and I probably never would have thought to use this method if I hadn't been faced with this type of application. For the OP, I don't see any benefit to doing something like this.
 

troytime

Golden Member
Jan 3, 2006
1,996
1
0
Originally posted by: jjones
Well, I'll explain a little bit about my application. I use it in a worldwide directory application. Each city within the directory has its own xml file of listings, as does each country and region have its own xml file of cities within that country, or countries within that region.

What I'm looking at is that each and every page that is navigated means a hit on the db. I use xml because the content, while dynamic, is actually modified very little. New listings go in daily, but for each individual city, the changes are infrequent. On top of that, the cities and countries will change very rarely. Seems a waste to hit the db every time, yet I needed to be able to approach it dynamically because I certainly don't want to be manually changing mostly static pages, no matter how infrequent.

Everything is contained on the db and I use that populate the xml files. Concurrency is no problem, nor is privacy. As for parsing, the only xml data you're parsing is these relatively small xml files which include only exactly what is needed for each individual page, so it's not like you have to parse a huge xml file.

This works very well for me, and I probably never would have thought to use this method if I hadn't been faced with this type of application. For the OP, I don't see any benefit to doing something like this.

ok...but 'hitting the db' isn't taxing, especially with just small data queries
if it IS taxing in your environment, it means either a) your schema sucks or b) your server sucks

it doesn't seem right to have the data in a database and have a script that creates xml files in order to save server resources.
if you're going to all the trouble of writing the data to file, you might as well write it to include files instead of xml files (which need to be parsed)

are you using simplexml, or did you write your own parser?
 

jjones

Lifer
Oct 9, 2001
15,424
2
0
Well, number one, they aren't simple queries. The schema is fine, and the server is one of the best. Number two, the final data has to be sorted three different ways, so just making an include is worthless; well it could be done but using xml is organizationally better. Yes, I'm using the simplexml function.

It's much more complex than it probably seems.
 

troytime

Golden Member
Jan 3, 2006
1,996
1
0
interesting.

i'm not trying to hound your or anything, but do you mind sharing more about your application?
I'm interested, and wanting to learn more (or help if possible)
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |