Xodus: Is there a maximum length of a key and/or value?

Alan47 :

Is there a maximum length for the key and/or value ByteIterable in Xodus? If there is a hard limit, what is that limit (i.e. how many bytes)? And what will happen if a ByteIterable exceeds that limit?

Vyacheslav Lukianov :

Xodus is a log-structured database, all changes are written sequentially to a log, which is an infinite sequence of .xd files. On the lowest level, any key/value pair is written as a single record which can only exist in a single .xd file. That means that the sum of sizes of key and value can't exceed the size of single .xd file. Even more, it's not good to store key/value pairs of size close to the size of single .xd file since this would create a database with much unmovable (by means of the database garbage collector) free space. An attempt to write too big key/value pair would fail with TooBigLoggableException thrown.

The size of single .xd file is controlled by the EnvironmentConfig.LOG_FILE_SIZE setting. It's 8388608 bytes (0x800000, 8MiB) by default, so the answer to the question is like the maximum length of key and value is 8388608 (0x800000) bytes.

To deal with data of arbitrary size, use Virtual File Systems.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=77023&siteId=1