As stated in the comment, Trie save you a lot of memory.
You should also use byte instead of char , as this will save you a factor of 2 for plain ASCII text or when using your national encoding if it has no more than 256 different letters.
At first glance, combining this low-level optimization with attempts does not make sense, since with them the size of the node is dominated by pointers. But there is a way if you want to go low.
So, what is important for use is the ability to look at lines in the dictionary, quickly get their keys.
Then forget about any database, as they are slow compared to HashMap s.
If it does not fit into memory, the cheapest solution, as a rule, becomes more. Otherwise, consider downloading only the most common words and doing something slower for others (like a memory mapped file).
I was asked to indicate a successful implementation, especially a bunch. I know nothing.
Assuming the OP doesn't need volatility, especially without key volatility, everything looks very simple.
I assume that the entire dictionary can easily be packaged into one ByteBuffer . Assuming mostly ASCII and a little hack, the arrow will need 1 byte per arrow label character and 1-5 bytes for the child pointer. The child pointer would be relative (i.e., the difference between the current node and the child), which would make most of them fit into one byte if it is stored in base 128 .
I can only assume the total memory consumption, but I would say something like <4 bytes per word. The above compression will slow down the search, but is still not suitable for accessing a single drive.