Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

java

xodus

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?

like image 468
Alan47 Avatar asked Nov 09 '18 08:11

Alan47


1 Answers

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.

like image 136
Vyacheslav Lukianov Avatar answered Nov 15 '22 00:11

Vyacheslav Lukianov