Subject: RE: [hackers-il] Presentation about LAMP (= Linux, Apache, MySQL and Perl/PHP/Python)

From: Chen Shapira <[email-masked]>
Date: Tue, 15 Feb 2005 11:36:19 +0200

- You had lots of comments about the performance of programming languages.
From my experience (and I have 5 years of web development experience in many
languages and frameworks, not to mention being in the business of optimizing
web site performance for customers) it is never a factor. Non-optimal
algorithms can be an issue, non-optimal databases and queries are very often
an issue, and too large pages causing huge network time are very often an
issue.

- You mentioned CGI without mentioning a fork for every session. Unless
things changed drastically in the last few years this is the biggest issue
with CGI.

- JSP and Servlets are pretty much the same thing, they can be on the same
page. I do suggest that you give a more rounded view on that, I'm sure that
if you try you can find at least two good reasons to use Java, not just
reasons not to use it. If you can't think of anything you can ask Tal :-)

- Databases: It is pretty clear from what you wrote that you know close to
zilch about databases. I suggest you learn a bit, databases are quite an
interesting subject this day; they are as complex as operating systems and
do very cool things with very cool technologies. Fast vs. Not so fast isn't
even close to covering anything. "has a lot of features that other servers
don't" isn't that interesting. Databases are as important as the programming
languages, sometimes more, and they have lots of complex parameters that can
affect decisions. I do suggest you look into why Oracle is faster than
MySQL, how do they do this, in which cases it is important, etc, etc.

- MSSQL is also a database. It became pretty good in the last 3 years. Still
no native partitions, but its getting there.

- Non-SQL dbs also include object based DBs. I think Zope has one.

- Of course, you don't need two code bases to support Oracle, MySQL and
Postgres. You need to write a very good DB communication layer that will
hide the different DB implementations from the rest of your program. This is
considered a good programming practice.

- I would mention FireFox in the browser section.

- I think it is rather too long for one lecture. Maybe you should split it
into Server Side lecture and Client Side lecture

- Note that these words of wisdom apply only if you don't plan on Sun, IBM
and HP as customers. Our support for Mozilla earns us millions of dollars
yearly due to such large customers that won't use IE. We find Mozilla very
cost effective :-)

> -----Original Message-----
> From: Shlomi Fish [mailto:[email-masked]]
> Sent: Tuesday, February 15, 2005 10:22 AM
> To: Hackers-IL
> Subject: [hackers-il] Presentation about LAMP (= Linux, Apache, MySQL and
> Perl/PHP/Python)
> 
> 
> I finally finished writing the slides for a presentation I prepared about
> LAMP
> (Linux, Apache, MySQL, and Perl/PHP/Python). You can find them online
> here:
> 
> http://www.shlomifish.org/lecture/LAMP/slides/
> 
> Enjoy!
> 
> Regards,
> 
> 	Shlomi Fish
> 
> ---------------------------------------------------------------------
> Shlomi Fish      [email-masked]
> Homepage:        http://www.shlomifish.org/
> 
> Knuth is not God! It took him two days to build the Roman Empire.
> 
> 
> 
> Yahoo! Groups Links
> 
> 
> 
> 
> 

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

---

From: Shlomi Fish <[email-masked]>
Date: Tue, 15 Feb 2005 14:05:15 +0200

On Tuesday 15 February 2005 11:36, Chen Shapira wrote:
> From my experience (and I have 5 years of web development experience in
> many languages and frameworks, not to mention being in the business of
> optimizing web site performance for customers) it is never a factor.

Not entirely correct. If you have a busy web-site, (or a server serving 
several web-sites) in which requests are not a simple matter of a few 
database queries (but rather the server-side callbacks actually do 
something), then the speed that the requests are ran in does become an issue. 
Otherwise, how can you explain, why people upgrade the servers (tigris.org 
was upgraded and as a result became more responsive.), or use clusters of 
computers.

I agree that in most cases it makes little difference, and usually the server 
will be responsive enough. 

> Non-optimal algorithms can be an issue, 

Right, but that's a common pitfall for all languages.

> non-optimal databases and queries 
> are very often an issue, 

Right, but again, it's common to all languages.

> and too large pages causing huge network time are 
> very often an issue.

Right, and it's also a common pitfall.

> things changed drastically in the last few years this is the biggest issue

I mentioned CGI in the context of C and C++ scripts:

http://www.shlomifish.org/lecture/LAMP/slides/server-technologies/sss-overview/other/c-cgi.html

In UNIX, if you want to run a program, you have no choice but to perform a 
fork() first. And why is having a fork() an issue?

> reasons not to use it. If you can't think of anything you can ask Tal :-)

Reading it again, I agree that the reasons I gave to use Java were not 
well-rounded. Some reasons I can think of pro-Java:

1. A simple yet quite powerful programming language, that is easy to learn.

2. Compiled into bytecode, and then possibly JIT compiled, so it should be 
very fast. (at least in theory).

3. Many people have learned it, so there are probably many people who can be 
used to maintain the code.

> zilch about databases. 

You are possibly right. I have worked with databases in the past on various 
occasions, but never really delved into them or how they work. I have a 
working knowledge of SQL, Relational Database concepts, etc., but would not 
call myself a database expert.

> I suggest you learn a bit, databases are quite an 
> do very cool things with very cool technologies. 

Do you mean that RDBMS are as complex as operating system kernels, or that 
they are as complex as whole operating systems?

> Fast vs. Not so fast isn't even close to covering anything. 

But it can be important.

> "has a lot of features that other servers don't" isn't that interesting.

If the database has a feature that other servers don't, then you don't need to 
implement it yourself, or change the DB schema to accomplish it, etc. It 
happened to me once when I ran into a MySQL limitation, for which I had to 
change the population of a table, and make sure it has a cross-product, 
instead of a less than that. 

> Databases are as important as the 
> programming languages, sometimes more, and they have lots of complex
> parameters that can affect decisions. 

By "parameters" do you mean parameters of varying between different RDBMS 
implementation.

> I do suggest you look into why Oracle 
> is faster than MySQL, how do they do this, in which cases it is important,
> etc, etc.
>

As far as I know, MySQL is considerably faster than Oracle, at least for small 
loads. Did you really mean this sentence as it is, or was it a typo?

> - MSSQL is also a database. It became pretty good in the last 3 years.
> Still no native partitions, but its getting there.
>

I don't mention it because it only runs on Win NT clones, and using it may be 
quite problematic from a UNIX box. (albeit possibly doable). I also don't 
mention Informix, Ingress, Sybase, and a great deal of other commercial 
databases.

> - Non-SQL dbs also include object based DBs. I think Zope has one.

Hmmm... Object based DBs. I don't know how much people know this (I don't) and 
how useful they are, and/or how superior they are over Relational databases 
for web-developers needs.

> hide the different DB implementations from the rest of your program. This
> is considered a good programming practice.

Not two codebases, true (that may have been a bad phrasing on my part), but 
nonetheless, a lot of code for each database. Sometimes, you need to work 
directly with SQL, and that's where the differences between the databases can 
bite you. 

> - I would mention FireFox in the browser section.

It's part of the Mozilla.

> into Server Side lecture and Client Side lecture

It can be given in two parts if needed.

> yearly due to such large customers that won't use IE. We find Mozilla very

When I said "Words of Wisdom" to refer to:

http://www.shlomifish.org/lecture/LAMP/slides/compatibility/words-of-wisdom.html

I spoke in irony. I gave them as a way to illustrate the exact opposite (and 
unhealthy) mode of thinking to what I was conveying in the "Designing for 
Compatibility" section:

http://www.shlomifish.org/lecture/LAMP/slides/compatibility/

I actually received this exact phrase from one of the Orange webmasters, 
after:

1. I complained to him that one of the pages on their site does not work in 
Mozilla.

2. He told me their site was supported by MSIE 5.5 and above.

3. I asked him when their site will support Mozilla.

And then I received this reply. You can read the rest of what happened 
afterwards in:

http://www.whatsup.org.il/modules.php?op=modload&name=News&file=article&sid=2211

Regards,

	Shlomi Fish

--

---

From: "Tzahi Fadida" <[email-masked]>
Date: Wed, 16 Feb 2005 04:40:30 +0200

Just to comment about the comparison between mysql and oracle.
Don't period. Mysql does not support ACID and thus is suited
only for the simplest of matters, usually with no transactions.
If you want ACID, use postgreSQL. Firebird is in a transition right now
and I wouldn't recommend using it if you can use postgreSQL.
Regarding object oriented. postgreSQL has support for inheritance
but I don't like this style very much. just use an ERD and convert
it to tables. It works. Also, serious DBs usually breaks the
normalization
rules you study in DB courses and in fact there is a whole
Denormalization methods in several books. obviously for optimization
purposes. I wouldn't want to start joining a 13 billion records like
in bezeq oracle DB against some table. It could take all day :)
Regarding native partitions. Its overated. Well, actually every
precent you can squeeze from a system is good but if you find
a good balance of a fs-kernel-rdbms its not so far behind.
Also, a good way to really increase performance when using
transactions is to put the WAL file on a static memory like
flash/cmos with a battery. usually 16-64mb will suffice. its
quite a booster I am told.

Regards,
	tzahi.

> Sent: Tuesday, February 15, 2005 2:05 PM
> To: [email-masked]
> Subject: Re: [hackers-il] Presentation about LAMP (= Linux, 
> Apache, MySQL and Perl/PHP/Python)
> 
> 
> 
> > - You had lots of comments about the performance of programming 
> > languages. From my experience (and I have 5 years of web 
> development 
> > experience in many languages and frameworks, not to mention 
> being in 
> > the business of optimizing web site performance for 
> customers) it is 
> > never a factor.
> 
> > - You mentioned CGI without mentioning a fork for every session. 
> > Unless things changed drastically in the last few years this is the 
> > biggest issue with CGI.
> >
> 
> > - JSP and Servlets are pretty much the same thing, they can 
> be on the 
> > same page. I do suggest that you give a more rounded view 
> on that, I'm 
> > sure that if you try you can find at least two good reasons to use 
> > Java, not just reasons not to use it. If you can't think of 
> anything 
> > you can ask Tal :-)
> >
> 
> > - Databases: It is pretty clear from what you wrote that you know 
> > close to zilch about databases.
>