SoftPerfect Support Forum
All Forums
► RAM Disk & RAM File System
► Current topic
Does image-saving rewrite the entire file or only the altered part?
|
Does image-saving rewrite the entire file or only the altered part? 04 May 2026, 01:33 |
Registered: 5 months ago Posts: 2 |
When I set the software to save the RAMdisk to an image either on shutdown or on a timer, does it re-write the entire file if only part of it has changed?
For example, there's a 2GB SQLite database file in my RAM drive. Part of it has changed, but 99% of the file is unchanged. Will the entire file be re-written to my SSD, or only the changed portion?
Thank you.
For example, there's a 2GB SQLite database file in my RAM drive. Part of it has changed, but 99% of the file is unchanged. Will the entire file be re-written to my SSD, or only the changed portion?
Thank you.
|
|
Re: Does image-saving rewrite the entire file or only the altered part? 04 May 2026, 09:00 |
Admin Registered: 20 years ago Posts: 2 106 |
|
Re: Does image-saving rewrite the entire file or only the altered part? 04 May 2026, 23:00 |
Registered: 5 months ago Posts: 2 |
|
|
Re: Does image-saving rewrite the entire file or only the altered part? 05 May 2026, 14:02 |
Admin Registered: 20 years ago Posts: 2 106 |
That is correct: SSD wear would be minimal.
However, it is worth noting that a database typically performs random I/O, whereas periodically writing an image (snapshot) of the database is usually sequential. If both processes run concurrently (i.e. the database is being written to while the snapshot is being taken), there is a small risk that the snapshot could capture a partially updated state, resulting in an inconsistent image.
This risk is reduced if the database uses write-ahead logging (WAL), since WAL helps ensure transactional consistency and makes it possible to recover a consistent state even if a snapshot is taken during active writes.
However, it is worth noting that a database typically performs random I/O, whereas periodically writing an image (snapshot) of the database is usually sequential. If both processes run concurrently (i.e. the database is being written to while the snapshot is being taken), there is a small risk that the snapshot could capture a partially updated state, resulting in an inconsistent image.
This risk is reduced if the database uses write-ahead logging (WAL), since WAL helps ensure transactional consistency and makes it possible to recover a consistent state even if a snapshot is taken during active writes.