Shard-Based Two-Phase Commit Protocol for Distributed Database Consistency

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Distributed database systems face challenges in achieving consistent outcomes while maintaining scalability, as strict two-phase commit approaches ensure data integrity but reduce liveness, and eventually consistent methods may lead to data corruption over time, especially in connected data systems.

Innovation Solution

A specialized two-phase protocol that determines a transaction's outcome based on a majority vote from replicas within a predetermined set of shard members, allowing for scalable and consistent data updates by reducing the number of participants required for agreement and using a coordinator to manage membership and synchronization.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If strict two-phase commit approach is used, then data consistency is ensured, but system liveness and scalability deteriorate

Engineering Contradiction:
Improvedata consistencyVSAvoidsystem liveness
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent segments the distributed database into multiple shards, where each shard can be independently updated and committed. This allows parallel processing of transactions across different shards, improving system liveness while maintaining consistency within each shard through the two-phase commit protocol.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent applies partial two-phase commit by requiring only a majority of replicas within each shard to commit, rather than requiring all replicas across the entire distributed system to commit. This partial action approach maintains data consistency while reducing coordination overhead and improving system liveness.

Inventive Principle:
Principle #16Partial or excessive action

2Reliability

If strict two-phase commit approach is used, then data integrity is maintained, but system scalability deteriorates

Engineering Contradiction:
Improvedata integrityVSAvoidsystem scalability
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

By dividing the distributed database into independent shards, the patent enables horizontal scaling without increasing the complexity of the two-phase commit protocol across the entire system. Each shard can be managed independently, allowing the system to scale to larger numbers of machines while maintaining data integrity.

Inventive Principle:
Principle #1Segmentation

3Productivity

If eventually consistent methods are used, then system liveness is preserved, but data consistency deteriorates

Engineering Contradiction:
Improvesystem livenessVSAvoiddata consistency
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The patent applies partial two-phase commit by requiring only a majority of replicas within each shard to commit, rather than requiring all replicas across the entire distributed system to commit. This partial action approach maintains data consistency while reducing coordination overhead and improving system liveness.

Inventive Principle:
Principle #16Partial or excessive action

Data Source

PatentUS9672266B2Method and apparatus for ensuring consistent outcomes in updates to distributed databases
Publication Date: 2017.06.06 NEO4J SWEDEN AB
  • US9672266B2 patent drawing
  • US9672266B2 patent drawing
  • US9672266B2 patent drawing

AI summary

Methods of conducting database transactions. One such method comprises receiving data to be written to a database; identifying a set of shard replicas corresponding to the database to which the data is to be written; transmitting, to each of the replicas in the set, a request to write the data thereto; receiving votes back from the replicas in the set, each vote representing whether the respective replica commits to a writing of the data thereto; determining whether to commit to the writing of the data to the database according to whether a majority of the replicas of every shard having replicas in the set has transmitted a vote committing to the writing of the data thereto; and transmitting an outcome of the determining to each of the replicas in the set.