BaseXdb/basex — Issue #278: Binary content should not be stored as plain files
Author: malamut2
Created: 2011-11-18 09:50:58+00:00
State: open

Currently, BaseX stores binary content directly in the file system, using the key as the path name relative to the database's base directory plus '/raw'. This behaviour has several disadvantages:

- Keys must not contain several characters, especially under Windows, including the colon character ':' which is popular in keys, and the '/' character gets a special meaning which is not always desired. For example, URLs ('http://...') can never be keys in this scheme.

- Each single binary value correspons a a file, and all those files reside in the same directory (unless the keys smartly constitute a tree structure using the '/' character). In the case of many thousands of small (<1k) binary values, this leads to a performance degrade and wastes a lot of disk space.

It is possible to work around these issues (except for the waste of disk space) by providing a smart key mapping and storing the mapping in a separate XML structure within BaseX. This solution, however, offers no advantages compared to using a specialized key/value database for binary data storage in the first place and implementing a small forwarder to BaseX in Java.

For those reasons, please consider encapsulating binary files in a standard database file strcuture, just as it is already done with multiple XML files.