Re: mysql vs sqlite vs hsql

From: Steve Menard (steve.menard_at_videotron.ca)
Date: 06/24/04


Date: Thu, 24 Jun 2004 09:33:04 -0400

stan k. wrote:
> First of all i'm on a win32 platform using java. I also have mysql
> installed. My question isabout benchmarks and multiple inserts &
> selects
> SQLITE: http://www.sqlite.org/
> HSQL: http://hsqldb.sourceforge.net
> I current have a mysql database of approx. 80mb.
> Each day I Insert approx .5mb of new records into this table,
> and I might also run mutiple Update, Delete, and Select queries as
> well.
> I'm trying to get an idea of how fast a sql database engine will run
> given that is is inside of the JVM. I know it's going to be slower
> than a db engine written in C and that's a trade off for being
> portable to different operating systems.
> What I want to know is how much of a trade off though - I don't want
> to have to wait 10 mins or deal with screen freezing... Right
> now on a windows platform using mysql things move really fast.
> Can anyone give me an idea of the time delay needed to do these
> Inserts in HSQL (ie: how much does the jvm slow things down)..
> Thanks in advance

<followup redirected to comp.lang.java.programmer, since this question
has nothing to do with python>

Quite a few things to address in this question ...

First, lemme dispell the very common misconception that java is slow. It
USED to be, back when it was fully interpreted. Nowadays, most benchmark
agree that java is on par with C/C++ in raw speed, depending on the kind
of operation you are doing. Modern Java most notable problems are with
memory usage and startup speed, both of which are being addressed (to a
point) in the upcoming JRE 1.5.

Second, a database system is not even CPU bound, but rather IO bound. In
that respect, the algorithm used for in-memory caching and indexing will
have far more influence on overall speed.

As for hsqldb, past experience shows it to be remarkably fast. As you
are clearly trying to embed the database, I would nto even be surprised
that hsql would come out faster for you, since you can get rid of the
network-call overhead of calling MySQL. It will have no problem handling
  the 500 KB of data a day you wish to insert, and should cause no more
"screen freezes" than any other databases.

Lastly sqlite does not (as far as I know) have a JDBC driver, not is it
as full-featured are hsql.

I would recommend you look at your requirements (multi user, gui app,
web app, etc ...) and make a choice based on that, rather than the
mythical slowness of the JVM.

Steve



Relevant Pages

  • Re: Java and MySql program example ?
    ... > I am trying to learn Java and need an example program with MySql ... > MySql database. ... Database connection established ...
    (comp.lang.java.programmer)
  • Re: Java and MySql program example ?
    ... > I am trying to learn Java and need an example program with MySql ... > MySql database. ... wants a copy of the code email me at jdanyjavajunkie at yahoo.com ...
    (comp.lang.java.programmer)
  • Re: How to modify a MySQL database...
    ... and then update them with Java. ... To learn how to create a MySQL database, ... you will need to learn JDBC. ...
    (comp.lang.java.programmer)
  • Re: Memory leak with createStatement?
    ... We think it compares well with MySQL. ... SQL is SQL92 with extensions to support objects. ... FirstSQL/J is written in pure Java, thus providing better integration with Java ... Both editions are fully compatible to the physical database level. ...
    (comp.lang.java.programmer)
  • Re: MySQL Database problem (probably already solved in a message, but this is somewhat urgent)
    ... MySQL server has a database with a table, ... columns, an FSR column, and a password column. ... checked if the supposed arrays that were returned were actually arrays ...
    (comp.lang.php)