# Database Persistence

> eXtremeDB provides a number of methods for assuring that in-memory database data can be preserved on persistent storage media. First of all, backup is a prudent way to preserve the database in case of hardware failure. (See page Database Backup and Restore for further details.) The backup guarantees that it will be possible to restore the database to the state it had been at the time the last backup was completed. In fact, nothing prevents the application from running the backup continuously from a separate “backup” process or task. (However note that this is not a solution for adding persistence to the in-memory database. To create a persistent database see page Creating Databases or the Data Export and Import page for other persistence options.)

> Following are some of the considerations for deciding which technique for persisting data is appropriate for your application:

> - Can the application afford losing any transactions? If it can't, than the best solution is to create and maintain a persistent database committing every transaction to the media (and this is the default transaction policy). Given that persistent media is slow, there will be a performance hit, yet there are many optimizations that can be applied to the disk manager. (See page Persistent Database I/O for further details.)
> - One alternative to using a persistent database is using eXtremeDB High Availability (HA). It is not without overhead, but given a fast network, which is common these days, it could be faster than writing to a slow persistent medium. The advantage of HA over the persistent database is that the downtime in case of a failure is low. The switch-over is quite instantaneous while synchronous replication guarantees that no transactions are lost.(See page High Availability Introduction for further details.)
> - It is possible to run a backup when the transaction logging is active. It is possible to run a backup on the replica (if using the HA alternative). It is also possible to run a backup for a persistent database. The active backup will have some negative impact on performance but will never lock out the database.