[kdewebdev-webdeveloper] test

Isaak isaak89 at hotmail.com
Thu Mar 6 07:09:37 EST 2008


Hey,

> I see that this is not really important for the current project you are 
> working on, but, as you say, you are using this as an experience building 
> exercise... so to some degree it is good to do it "correctly" (I believe 
> there is no correct way to do anything with web-design - definitely wrong 
> ways, but no true right way).

I've made my mind and just use PHP to read the XML file(s), too bad because using AJAX was way more fun.. But hey, performance and user experience should be #1 :).

> I do not really understand your point that the "filesystem being much slower 
> than the database".  This is definitely not true!  If you are reading a 
> static file out of the database verses out of a file system, you will get 
> much better performance from the filesystem - The database lives on the 
> filesystem (well some results may be cached in memory - and some 
> databases/table types can be stored in memory - so would be very fast), and 
> the record must be found, and returned using either unix socket or network 
> socket.  There is much more overhead.  The point that a database becomes more 
> efficient is when you want to get only part of the dataset, such as a single 
> news article from the database/parsing a comma separated file or xml file.  
> Even reading from a SMALL csv file can be faster then a database.
> 
> It would be intersting to see which technology would be less load on your 
> server in your situation - PHP serving the file from XML or the Database, 
> verses a pure AJAX solution.  
> I would probably put my money on php being less load on the server, even 
> though you are passing the parsing to the client... the server still has two 
> or three requests verses one (php - one client request, one file returned, 
> AJAX - original request for index.html, possible request for external 
> javascript file [optional as it could be in the header], and the request for 
> the XML file).
> The best way to test would be implement both solutions (just a dummy set of 
> data and layout), and script requests (this could be hard with AJAX - I do 
> not know a way to script load testing for the JavaScript) - Actually using 
> the firefox plugin that does auto-refresh would probably do it - just make 
> sure you turn off your browser cache.  After doing thing, check the server 
> load averages (using the 'uptime' command under linux).

I was rather vague about the "filesystem being much slower than the database" but your explanation explains it so there is no need for me to go deeper into this.
Well, even newbies know that PHP wins over AJAX for parsing the same data so benchmarking the AJAX solution would be out of the question. As you brought the benchmarking up this really interests me, I'm going to test the differences in performance using PHP with XML and PHP with MySQL.
So if I'm correct, you would vote for PHP with XML as long as no file searching is done and the file is of small size? As a web developer using the database system most of the time I'm going to place my bet on PHP with MySQL using MyISAM tables (even though I'm not very confident about it).
I'm going to give this some time and let you know the results.

> Playing with new technologies is good to get experience - my first AJAX 
> project was a pretty complex front end for music player daemon (mpd). To turn 
> my home server into a music player - the current track is constantly updated, 
> complete with slider, time ticker, etc... it puts a bit of load on the server 
> with just the number of requests (one or two per second to update playtime), 
> but this is probably more to do with the way mpd passes the data to php (my 
> playlists are usually on random with about 10-20 thousand tracks - we listen 
> in the background.  It is a personal project, with no real external access, 
> but it works really well..
> Anyway, I guess I am saying, have fun experimenting with the technologies, but 
> remember not to just assume that a given solution is less load then another - 
> you might be very surprised - I know I have been.

Most people would start with simpler projects unlike your first project, my first AJAX experiment was the famous and simple "username already exists?" lookup. And perhaps you won't believe this but this simple project was a real pain for my first time..

Thanks again

---
Isaak
_________________________________________________________________
Deel gratis al je leukste eindejaarsmomenten...
http://get.live.com


More information about the kdewebdev-webdeveloper mailing list