@runt9http://h2database.com/html/main.html is a very nice JVM embedded database . If it needs to be used from other languages, https://www.sqlite.org/ is always a good choice
If you don't actually need relational db features, writing to a file is not a bad solution