read-write hashmap database to file