8

Monero uses LMDB for its database. Various data is saved in this database, including integers, such as the difficulty for a given block. LMDB is type agnostic, so does not any particular processing on integers and other types.

Is this database portable between architectures with a different word size, and between architectures with different endianness ? That is, if the blockchain file is copied between such machines, will it work properly ?

1 Answer 1

8

In general, LMDB files are architecture-dependent and cannot be moved between different architectures.

In Monero, all LMDB structures are 64-bit clean, so the files are portable between 32 and 64 bit architectures. But they are still endian-dependent, and are not portable across endianness. This hasn't been a concern since the two dominant architectures today, x86 and ARM, both use little-endian integers.

Note that, while LMDB also supports concurrent access across multiple processes, Linux glibc has a design flaw such that interprocess mutexes are different sizes in 32 bit processes vs 64 bit processes. So LMDB files on Linux cannot be concurrently shared between processes of different sizes. This flaw does not exist on other platforms (like e.g. BSD or Windows).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.