What are the main differences between SQLite and HSQLDB? There are lots of applications using both of them, but I don't really see any major difference.
Asked
Active
Viewed 2.5k times
3 Answers
29
SQLite is implemented in C, HSQL is implemented in Java.
It should be more seamless and easy to integrate SQLite with an application project written in C or C++, whereas I would expect the HSQL technology is easier to integrate with a project written in Java.
No doubt there are numerous other more subtle differences between these two embedded databases, but the above is the most prominent difference.

Bill Karwin
- 538,548
- 86
- 673
- 828
-
1Yet [SQLite appears to be the default database for Android](https://developer.android.com/reference/android/database/package-summary.html) - why's that? – dwjohnston Jul 01 '16 at 01:27
-
1@dwjohnston, I don't know, you'd have to ask Google. – Bill Karwin Jul 01 '16 at 02:57
-
2@dwjohnston My guess is, that's because only Android's SDK is in Java, but the underlying linux and even parts of the userland are still in C. Besides, in general, C gives better performance than Java, hence `sqlite` and not `hsql` in android apps by default. – Prahlad Yeri Nov 04 '16 at 07:45
-
1"Besides, in general, C gives better performance than Java" - citation needed. – Christian Brüggemann Nov 04 '16 at 09:59
-
1Java was inefficient in its earliest versions, but that hasn't been true since the 1990's. There might be a few specific tasks for which C has better performance. Java sometimes suffers "stop the world" effects during garbage collection, whereas in C you have to take care of memory yourself. – Bill Karwin Nov 04 '16 at 17:17
-
C is basically an assembly language, which makes it a lot faster than a partly interpreted language like Java – Tom Doodler May 09 '17 at 16:23
-
1@TomDoodler, C is not assembly language. – Bill Karwin May 09 '17 at 16:46
-
@Christian Brüggemann, since java is garbage collected, it is slower than C because we have to do manual memory management. – Bharat Jun 02 '18 at 13:41
-
1@ChristianBrüggemann C is *way* faster than Java. here's your citation: https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/gpp-java.html – hanshenrik Jul 20 '20 at 20:40
-
sqlite is the "universal db", it is present in every linux/unix distribution, macos, and of course android, and also presents in windows ( it was present also in the dead windows phone!). Thus, it is present in Android because it is present everywhere. – Mike May 23 '22 at 11:28
28
The good comparison of HSQLDB & SQLite can be found at http://3rdstage.blogspot.com/2009/03/comparion-of-hsqldb-h2-sqlite.html

user399967
- 381
- 3
- 3
4
IMHO THE biggest difference is, that SQLite has no user management at all in contrast to HSQLDB.
(This does not want to say anything bad about SQLite. SQlite defenitely has its usecases it is also very widely used.)

Robert
- 1,579
- 1
- 21
- 36