Berkeley DB would be the best choice probably but I can't use it due to licensing issues.
Are there any alternatives?