Snapshot:
Snapshot is a point-in-time copy implementation that saves the state of data at a certain point in time. By combining copy-on-write technology and mapping table technology, Snapshot creates a duplicate of the source LUNs at a certain point, rather than a complete physical data copy. Users can use snapshot technology to create recovery points for stored data flexibly and regularly, allowing for quick data recovery when needed.
Classification of Snapshots:
There are two types of snapshots first is full snapshots and the other is Differential or incremental snapshots. So when we go deeper the further classification includes ROW and COW.
Copy-on-write (COW) and Redirect-on-write (ROW) are two different types of Differential snapshot
Now let's have a detailed description of these two
COW:
Copy-on-write needs the provisioning of storage capacity for snapshots, followed by the creation of a volume snapshot utilizing the reserved capacity. The metadata indicating where the original data is located is stored in the copy-on-write snapshot, but the actual data is not copied at the time of generation. As a result, snapshot production is nearly immediate, with minimal impact on the machine that is taking the picture.
Each snapshot includes metadata that describes the data blocks that have changed since it was produced. The original data is replicated into the reserved storage capacity set aside for the snapshot as the blocks change. Read requests for data that hasn't changed are sent to the original volume. The procedure is known as "copy-on-write," and it is the reason for its widespread use.
Write requests to the original volume must wait until the original data is "copied out" to the snapshot, which is a disadvantage. Before a snapshot can be stored, it must have a valid original copy of the data that has changed.
ROW:
Redirect-on-write is related to copy-on-write, except it avoids the performance cost of a double write. ROW also offers storage-saving snapshots, such as copy-on-write. The new writes to the original volume are diverted to the storage allotted for snapshots, which allows ROW to avoid the write performance penalty. The number of new writes is reduced from two to one by using ROW redirection. Instead of writing one copy of the original data plus a copy of the altered data to the storage space as required by COW, ROW writes only the changed data.
When using redirect-on-write, the original copy contains the point-in-time snapshot data, while the altered data is saved to the snapshot storage. The point-in-time snapshot data is stored in the original copy with redirect-on-write. When a picture is erased, there's some complication. On the original volume, the data from the deleted snapshot must be duplicated and made consistent. As additional snapshots are created, the complexity rises dramatically.
Conclusion:
they both have their application scenarios but Before writing the new data in the original location, COW copies the old value to a separate section in the snapshot. This indicates that a file will remain continuous. ROW saves the original data in the snapshot while writing to a new region. This saves the copy, making it faster, but also creates non-contiguous files. As a result, COW is better suited to read-intensive applications or apps that are prone to write hotspots, or applications that only write data to a small set of data. Multiple write operations to the same data will only result in one replication operation since data changes are confined to a range. ROW is better for applications that require a lot of writing. In the event of distributed storage, ROW will outperform COW in terms of read performance.
Sources and references:
https://support.huawei.com/enterprise/en/doc/EDOC1100200561
https://support.huawei.com/enterprise/en/doc/EDOC1100049150/2e33469b/about-snapshots
https://www.techtarget.com/searchdatabackup/tip/Using-different-types-of-storage-snapshot-technologies-for-data-protection