I must store pairs like {long key, long value} and there might be multiple values per every key. I have to effectively enumerate secrets and effectively look for values for any given key.

MultiValueMap appears to become a perfect solution but I will have vast amounts of records, so it's difficult to ensure that they're in RAM.

What is the very best file system alternative for MultiValueMap? What's the best simple but fast key-value database for Java?