tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Wareham" <cware...@visitlondon.com>
Subject Re: PostgreSQL vs MySQL with Tomcat
Date Fri, 16 Jan 2009 13:44:13 GMT
Ken Bowen wrote:
> Hi all (especially Chris -- very informative long post today on 
> Tomcat/MySQL):
> 
> For a several reasons (including the apparent infinite default for 
> connection timeout), I'm contemplating switching one or two projects 
> from MySQL to PostgreSQL.  I'd like to gather opinions on the tradeoffs, 
> including:
> 
> Unfortunately, MySQL isn't really that tunable. On the other hand, MySQL
> requires very little in the way of tuning!
> 

Not true, unless your needs are very modest. The InnoDB engine has a
large number of tunable parameters - however, they are poorly and
incompletely documented in the MySQL manual, while changing them may
cause your indexes to be silently dropped when you restart MySQL. The
MyISAM engine also has a number of tunable parameters, but I would only
use this engine in preference to InnoDB if you need full text indexing,
and only for the specific tables that require full text indexes.

> I created a couple of proof-of-concept projects with PostgreSQL for 
> someone about six months ago, and the only really puzzling thing what 
> how to set up "sequences" corresponding to MySQL's AUTOINCREMENT (I'm 
> not sure I've really wrapped head around it completely anyway).  For 
> those small projects, it worked well, but there was no stress involved.
> 

Where you would use an AUTO_INCREMENT column in MySQL, use a SERIAL
column in PostgreSQL which creates a sequence for you. There's a good
description in the PostgreSQL manual:

http://www.postgresql.org/docs/8.3/static/datatype-numeric.html#DATATYPE-SERIAL

> I'd like to hear about people's experiences and what they think are the 
> strengths and weaknesses of each DBMS for use behind Tomcat.
> 

PostgreSQL is not perfect, but it has proven to be faster and far more
reliable than MySQL in the projects where I have tested both. The full
text indexing in PostgreSQL is far more sophisticated, although at the
cost of slightly more complexity to use. Tuning is generally
straightforward, and far less of a black art than it is with MySQL.
Finally, I spend far less time analysing query plans and optimising by
hand when using PostgreSQL rather than MySQL, as the former handles
joins across more than one table far better.

> Thanks much in advance,
> Ken Bowen
> 

Chris
--
 
Chris Wareham
Senior Software Engineer
Visit London Ltd
6th floor,
2 More London Riverside, London SE1 2RR
 
Tel:  +44 (0)20 7234 5848
Fax: +44 (0)20 7234 5753

 
www.visitlondon.com





   
   
'Visit London Limited' is registered in England under No.761149;
Registered Office: Visit London, 2 More London Riverside, London SE1 2RR.
 

Visit London is the official visitor organisation for London. Visit London is partly funded
by Partnership, the Mayor's London Development Agency and London Councils.
The information contained in this e-mail is confidential and intended for the named recipient(s)
only.  If you have received it in error, please notify the sender immediately and then delete
the message.  If you are not the intended recipient, you must not use, disclose, copy or distribute
this email. The views expressed in this e-mail are those of the individual and not of Visit
London. We reserve the right to read and monitor any email or attachment entering or leaving
our systems without prior notice.
 
  Please don't print this e-mail unless you really need to.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message