EmbeddedDB (HSQLDB) in server mode?

HsqlDB supports running in server mode. According to this,

This is the preferred way of running a database server and the fastest one.

Is there a way, or even a hack, to make the embedded database run in server mode? This would improve the performance of using the embedded database, if someone doesn’t want to use a standard database.

Thank you in advance

Well, this

Several different programs can connect to the server and retrieve or update information.

means server mode is probably designed to make it work with multiple programs accessing database. In the case of Openfire, it is one program accessing it. I’m not sure how it operates exactly, but i think it also operates in JVM when used by Openfire. So maybe it is not possible to use server mode in this situation. If one can provide evidence of a major improvement, maybe it can be added (if possible).

Negative. ‘Server mode’ means that the database is not stored in a single file, which when it becomes too big consumes the full memory of Openfire, is slow to access etc., but it splits to multiple files server.database.0, server.database.1 etc. for faster access, like all other DBMSs are doing. As the links I provided show, it is a configuration setting of HSQLDB, but these must be setup in Openfire to make HSQLDB work in server mode. There are other modes, e.g. web mode, etc.

When you say in Openfire, you mean programatically? Or is there a way to do this just by changing some config, say to test how it works?

This is what I 'm asking… How to setup Openfire to use HSQLDB in server mode.

Well, i can’t answer that. I have filed a ticket to investigate this option, though not sure who and when will look into it. OF-1426

the database is mostly a configuration and settings database. It shouldn’t grow to be any crazy size unless you’re logging chats and have a TON of users. If that’s the case, most users will just stick with a more robust external database like mysql or mssql

having no experience with hqslbd, but based on what you posted…it looks like you should be able to manually set it up the way you want. once you have it running as a service use jdbc to connect to it. You should be able to change the jdbc connection string in the openfire.xml file.

1 Like

Thanks for your reply Speedy. So, if I understood correctly, what you 're proposing is that instead of using the EmbeddedConnectionProvider

  <connectionProvider> 
    <className>org.jivesoftware.database.EmbeddedConnectionProvider</className> 
  </connectionProvider>

to setup HSQLDB as an external database DefaultConnectionProvider using the hsqldb.jar driver etc. according to the integration guide. Something I 'll give it a try…

Is there a way to customize the EmbeddedConnectionProvider?