Choosing to use a file store for your messaging engine can have several advantages over using a data store.
To achieve best performance using a data store, you often need to use a separate remote database server. A file store can exceed the performance of a data store using a remote database server without needing a separate server.
The file store combines high throughput with little or no administration. This makes it suitable for those who do not want to worry about where the messaging engine is storing its recoverable data. A file store improves on the throughput, and scalability of Derby.
Use of data store might require database administration to configure and manage your messaging engines. File store can be used in environments without a database server.
As a managerial decision, some organizations prefer to use data store because it utilizes their existing resources more effectively. For example, this might be the case for a company with a strong team of database specialists, or a stable database infrastructure.
If there is a transient connectivity loss to the
file system, the application server must be restarted once the connectivity
to the file system is restored. Whereas, in the case of the data store,
the messaging engine can recover from the database itself. In such
situations, the data store will be a preferred high availability option
than the file store system.
One technical advantage of using data store is that some J2EE application can share JDBC connections to benefit from one-phase commit optimization. For more information refer to Sharing connections to benefit from one-phase commit optimization. File store does not support this optimization.