db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeffrey Lichtman <swa...@rcn.com>
Subject Re: SQLite/Derby comparison
Date Fri, 27 Aug 2004 22:54:57 GMT
<html>
<body>
<blockquote type=cite class=cite cite>The SQLite folks have been trying
to compare it with Derby, see <br>
<a href="http://www.sqlite.org/cvstrac/wiki?p=SqliteVersusDerby" eudora="autourl">http://www.sqlite.org/cvstrac/wiki?p=SqliteVersusDerby</a>,
although (by<br>
their own admission) they don't have a deep understanding of Derby.
Is<br>
their evaluation correct?<br>
Thanks,<br>
David</blockquote><br>
These parts are definitely incorrect:<br><br>
--------------------------------------------------------------------------------------------------------------------------------------<br>
The basic idea behind Derby appears to be that it reads the entire
database into memory and parses it into various Java data structures. All
database I/O occurs on the in-memory image. When the database is closed,
all the data is written back to disk. Thus the disk image is really just
a serialization of the in-memory database representation. <br>
---<br>
Derby appears to require that the entire database image be stored in
memory. SQLite keeps most the database image on disk and only loads into
memory that portion of the database that it is actualy using. One
therefore expects that the run-time memory requirements for SQLite will
be much smaller. <br>
---<br>
An SQLite database will survive a program crash or even a power failure.
With Derby, if you pull the power plug at the wrong instant, you risk
corrupting the database. (Someone please verify this.) <br>
---<br>
No data is currently available on the relative speed of SQLite and Derby
database engines. One can guess that after initialization Derby runs
faster than SQLite since Derby is operating entirely out of memory. On
the other hand, Derby should be very slow to initialize since it must
read and parse the entire database file. In the balance, one would expect
Derby to be faster in situations where a program opens a database and
then use that database extensively for a long period of time, whereas
SQLite would be expected to be much faster when the program opens a
database, does one or two quick operations, then immediately closes the
database again. <br>
--------------------------------------------------------------------------------------------------------------------------------------<br><br>
I don't know why they think Derby is an in-memory DBMS with no recovery.
Derby uses a cache and a write-ahead log.<br><br>
The following is misleading:<br><br>
--------------------------------------------------------------------------------------------------------------------------------------<br>
<b>Concurrency</b> <br><br>
SQLite allows multiple simultaneous readers and a single writer. Mutiple
processes can have the database open simultaneously. Derby only lets a
single process open the database at one time. <br>
--------------------------------------------------------------------------------------------------------------------------------------<br><br>
While it's true that Derby allows only one process (i.e. JVM) to use a
database at a time, the process can be a multi-threaded server.<br><br>
<x-sigsep><p></x-sigsep>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Jeff Lichtman<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
swazoo@rcn.com<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Check out Swazoo Koolak's Web Jukebox at<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="http://swazoo.com/" eudora="autourl">http://swazoo.com/</a></body>
</html>


Mime
View raw message