

Redis for example provides basic string and integer data types while also providing support for Kafka-like streams and geospatial indexing functionality. In-memory databases will provide various data structures for storing your data with different performance characteristics and developer productivity benefits. This is still much faster than using a traditional database because by only appending to disk, the database avoids expensive seek operations. This is the safest persistence method but comes with a slight performance hit because data is being logged for every write. This log can then be used to reconstruct the database if it needs to restart.

The downside of snapshots is that you will lose any data added to the database between snapshots, so if you are taking snapshots every hour and the DB fails 1 minute before the next snapshot, you will lose the last 59 minutes of data.Īppend-only files work by logging every write operation that the database receives. If hardware fails you can simply restart your database and load the snapshot into memory. They are typically generated at some fixed interval like every hour or every 5 minutes. Snapshots are copies of the data in your in-memory database at a moment in time. The 2 primary strategies for persistence are snapshots and append-only files. These built-in solutions make it easier to recover from outages but have their tradeoffs.

Most in-memory databases will provide some way to persist data if hardware fails. Below are some of the most common features. Beyond providing raw performance, in-memory database projects offer some other features to stand out from competing projects.
