Implementing high availability for a database