The document discusses how in-memory databases like SAP HANA ensure data durability. It explains that in-memory databases store data in main memory, which is volatile and could lose data during a power failure. To address this, HANA divides main memory into pages and writes those pages to persistent storage like hard disks at regular intervals, such as every 5 minutes by default. It also synchronously writes transaction logs to capture any changes made. After a power failure, the database restarts and restores pages from the save points, then uses the transaction logs to apply any missed changes and restore the database to its original state before the failure.
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
How does in memory computing ensures data durability
1. How In-Memory Computing ensures Data Durability?
Any data base should have to go through the ACID test. This means, a database should have
the below features
Atomicity – When a part of a transaction fails, the entire transaction should fail and the
database should be remain unchanged
Consistency – Invalid data should not enter the database that would tamper the consistency
rules defined for the data. So when a transaction is executed that violates the consistency rules
of the database, then the transaction should be rolled back and the database should be restore
to a state where the consistent rules are followed.
Isolation – One transaction should not interfere with another transaction
Durability – Once a transaction is committed to the database, then it should remain there.
HANA has adapted In-Memory Computing. So the data is stored in the main memory. Main
memory is a volatile storage, so there is a probability that we may lose the data that is
committed to this storage, when there is a power failure. This means, durability is under risk.
How is it addressed?
Main-Memory (in-memory) is divided into pages. When a transaction stores the data in the
main memory, the corresponding page is marked and it is stored in the hard disk (non-volatile
memory) at regular intervals. The database log captures the changes made and this is also
stored in the memory.
In-Memory data bases (HANA) saves the pages in save points. And these pages are written to
the persistent storage asynchronously at regular intervals. In case of HANA, by default it is set
to 5 minutes. The data log is captured synchronously, that means, a transaction is not
completed without writing the data log.
After the power failure, the database is restarted and the pages are restored from the save
points. The changes made by the transactions which are written to the data base log, are then
used to make the changes to these pages. Thus the in-memory database is restored to its
original state that it was before the power failure.