Search
StarWind is a hyperconverged (HCI) vendor with focus on Enterprise ROBO, SMB & Edge

Deep dive into data consistency

  • May 2, 2024
  • 16 min read
Vitalii is a Post-Sales Support Engineer at StarWind about 2 years. Has a broad knowledge of storage, virtualization, backup, and infrastructure implementation. Ping pong as a hobby.
Vitalii is a Post-Sales Support Engineer at StarWind about 2 years. Has a broad knowledge of storage, virtualization, backup, and infrastructure implementation. Ping pong as a hobby.

In this post, we’re going to talk about data consistency — an essential concept when dealing with backups. Consistent data can be reliably used throughout your infrastructure, allowing faster and smoother recovery of applications after a restore. That’s precisely why this topic remains relevant. Even though backup technologies have evolved, understanding the mechanics of consistency still helps avoid pitfalls during recovery operations.

Data consistency

Years ago, preserving data consistency during backups required complex configurations and manual processes. Today, most backup software handles it more gracefully, but it’s still important to understand what consistency means and how it impacts your recovery strategy.

Data consistency means that your data remains logically accurate and synchronized across systems. When data is consistent, applications can access and process it without encountering errors. If consistency is broken, you risk everything from unreadable files to full system crashes.

There are three main types of consistency that backup solutions aim to provide:
– Point-in-time consistency
– Transaction consistency
– Application consistency

Losing any of these types can compromise your data reliability. Let’s look deeper into what each type means.

Point-in-time consistency

This refers to capturing data exactly as it existed at a specific moment. Think of it as taking a snapshot of your entire environment at one fixed time. In this state, all files and services are frozen, ensuring that no modifications occur during the backup process.

A common scenario where point-in-time consistency is compromised is when only a part of the system is restored, such as a single volume that had failed. If that volume was backed up at a different time than the rest, you end up with data inconsistencies. Restoring such data may lead to application errors or corrupt files.

Modern backup tools use snapshot technologies to create consistent restore points, but if not handled properly, outdated settings or partial saves could still lead to problems during recovery. This is particularly relevant for file servers or virtual machines where the state of the entire system needs to be captured simultaneously.

Transaction consistency

This consistency level focuses on ensuring that all parts of a transaction, such as database inserts or updates, are backed up together. A transaction is a logical unit of work, and breaking it can result in incomplete or corrupted data.

If a backup captures a transaction mid-way, you risk losing important changes or ending up with mismatched records. Even if a backup has all files, missing a part of a transaction renders the whole dataset unreliable.

Transaction consistency is critical in database-heavy environments, where complex operations are carried out continuously. Without it, restoration may yield datasets that look intact but are logically broken. For instance, financial systems or e-commerce platforms rely heavily on transaction consistency to ensure data accuracy during recovery.

Application consistency

Application consistency ensures that all application components: files, databases, services – are in sync and accurately reflect the application’s current state. This goes beyond transaction consistency by addressing multi-layer dependencies between services and data structures.

With application consistency, pending I/O operations are flushed, and memory contents are safely written to disk before a backup is taken. This method guarantees that restored data behaves as if the system was gracefully shut down before backup. It is particularly important for workloads involving high-volume transactions or multiple dependent services (e.g., ERP systems or email platforms). Application-consistent backups are crucial for applications like Microsoft Exchange, SharePoint, or Active Directory, where a coordinated backup of all components is essential for a successful recovery.

Inconsistent backups

These backups are created without considering data state or timing. Files are simply copied as they exist at the moment, but no effort is made to freeze I/O or save memory contents. As a result, you may end up with partial files, missing transactions, or conflicts due to ongoing changes during the process.

This backup type is commonly used for archiving non-critical systems or data that doesn’t change often. For example, it’s useful for staging files for archival storage or copying data from inactive virtual machines. Still, inconsistent backups are risky for production workloads because they may not reflect a valid application or system state.

Crash-consistent backups

Crash-consistent backups capture all disk data at a specific instant—similar to what happens during an unexpected system shutdown. All files are saved in their exact state at the time, but without memory data or uncommitted transactions.

These backups are reliable enough for simple restore tasks and can be used in environments where transactional accuracy is less critical. They rely on mechanisms like Microsoft Volume Shadow Copy Service (VSS), which temporarily pauses disk activity and marks active blocks.

While they preserve logical file integrity, crash-consistent backups may still have issues when restoring systems that require fully synchronized app states.

Application-consistent backups

Application-consistent backups go further by capturing data in memory and flushing pending write operations before backup. They represent a true image of the running application at the time of backup, ensuring data integrity across the board.

This is achieved using VSS writers or equivalent tools for Linux and other platforms. VSS, or Volume Shadow Copy Service, plays a crucial role by coordinating with applications to ensure that all pending I/O operations are completed and data is flushed to disk before the backup process begins. VSS writers prepare the system for backup by coordinating services, completing transactions, and temporarily halting I/O activity.

The result is a backup that can be restored with full confidence, allowing services to resume immediately as if the system was gracefully shut down. This method is essential for mission-critical apps like databases, CRM systems, or messaging platforms.

Backup types comparison

 

Feature Inconsistent Backup Crash-Consistent Backup Application-Consistent Backup
Backup creation
Restoring
Snapshot creation
Point-in-time consistency
Volume Shadow Copy (VSS)
Use of VSS writers
Handles I/O flushing
Includes memory state
Data integrity guarantee
Suitable for databases

Data consistency in real-time and distributed systems

Maintaining data consistency becomes significantly more challenging in real-time and distributed systems. These systems often involve multiple nodes or services that need to access and modify data concurrently. The inherent latency and potential for network partitions can lead to various consistency issues.

In real-time systems, the speed at which data changes requires sophisticated synchronization mechanisms to ensure that backups capture a consistent state. Distributed systems, on the other hand, must deal with the CAP theorem, which states that it is impossible for a distributed system to simultaneously guarantee consistency, availability, and partition tolerance. This trade-off often requires careful consideration of the specific application requirements and the selection of appropriate consistency models (e.g., eventual consistency, strong consistency).

Techniques like distributed consensus algorithms (e.g., Paxos, Raft) and distributed transaction management protocols are often employed to address these challenges. However, they can add complexity and overhead to the system.

Data consistency, regulatory compliance, and data governance

Data consistency plays a vital role in regulatory compliance and data governance. Many regulations, such as GDPR, HIPAA, and SOX, require organizations to maintain accurate and reliable data. Inconsistent data can lead to non-compliance, financial penalties, and reputational damage.

For example, in the healthcare industry, maintaining consistent patient records is essential for providing quality care and complying with HIPAA regulations. Similarly, financial institutions must ensure the consistency of transaction data to meet regulatory reporting requirements and prevent fraud.

Data governance frameworks often include policies and procedures for ensuring data consistency across the organization. These frameworks may involve data validation, data reconciliation, and data quality monitoring. Regular audits and assessments are also conducted to verify that data consistency is being maintained.

Performance impact of different consistency levels

Different consistency levels can have a significant impact on the performance of backup operations. Inconsistent backups typically have the lowest performance overhead because they do not require any synchronization or coordination. However, they also provide the least amount of data integrity.

Crash-consistent backups introduce some performance overhead because they require the use of snapshot technologies like VSS, which temporarily pause disk activity. Application-consistent backups have the highest performance impact because they involve coordinating with applications to flush pending I/O operations and ensure data is written to disk. This can require more time and resources, especially for applications with high transaction volumes.

The choice of consistency level should be based on a careful assessment of the application’s requirements and the available resources. Organizations may need to trade off performance for data integrity, depending on the specific use case. Techniques like incremental backups and parallel processing can be used to mitigate the performance impact of higher consistency levels.

Conclusion

Understanding the nuances of data consistency is key to building a reliable backup and recovery strategy. Each consistency level offers different guarantees and serves different use cases. While inconsistent and crash-consistent backups may be enough for static or low-priority systems, application-consistent backups are indispensable for production workloads that rely on transactional integrity and uptime.

By choosing the right approach and knowing how your backup software handles consistency, you can significantly improve data availability and reduce downtime risks in recovery scenarios. It’s also crucial to consider the challenges of maintaining consistency in complex systems, the importance of regulatory compliance, and the performance implications of different consistency levels.

Found Vitalii’s article helpful? Looking for a reliable, high-performance, and cost-effective shared storage solution for your production cluster?
Dmytro Malynka
Dmytro Malynka StarWind Virtual SAN Product Manager
We’ve got you covered! StarWind Virtual SAN (VSAN) is specifically designed to provide highly-available shared storage for Hyper-V, vSphere, and KVM clusters. With StarWind VSAN, simplicity is key: utilize the local disks of your hypervisor hosts and create shared HA storage for your VMs. Interested in learning more? Book a short StarWind VSAN demo now and see it in action!