Persist the tasks in a database