1 and 3 both shout out the database engine.
If the number of entries is not insane, and you only have one client that uses this thing at a time, I would personally recommend sqlite, which works with both Java and Ruby (it will also run # 5). Otherwise, go to a real database system like MySql (since you are not on the Microsoft stack).
source share