Db persistence

Running PR.