Schema Hash Trees for Safe Database Snapshot Import

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Database systems face issues with data corruption and system crashes when recreating database snapshots due to differences in database schemas, particularly in multi-tenant models where the schema of the target database may differ from the schema at the time of snapshot creation.

Innovation Solution

A hash tree with a root hash value is associated with the database schema to identify and compare it with the current schema, allowing the system to determine differences and prevent data import under mismatched schemas, thereby avoiding data corruption.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If database snapshots are recreated without schema comparison, then data import operations can proceed quickly, but data corruption occurs when schemas differ between snapshot creation and current database

Engineering Contradiction:
Improvedata import speedVSAvoiddata integrity
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The system performs preliminary schema comparison using hash trees before data import operations. The hash tree is generated from the current database schema and compared against the snapshot's schema hash to detect differences in advance, preventing data corruption before it occurs while maintaining efficient import operations.

Inventive Principle:
Principle #10Preliminary action

2Reliability

If schema comparison is performed for every data import operation, then data corruption is prevented, but system complexity and processing time increase

Engineering Contradiction:
Improvedata integrityVSAvoidschema validation complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The schema comparison process is segmented into discrete hash tree generations and comparisons. Instead of comparing entire schemas manually, the system divides the schema into hashable components, generates hierarchical hash trees, and compares only the root hashes or specific nodes where differences occur, significantly reducing processing complexity.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The system creates a simplified representation (copy) of the schema structure through hash trees that capture essential schema characteristics without the full complexity of the actual schema definitions. This copied representation can be quickly generated and compared to detect schema differences without processing the complete schema data.

Inventive Principle:
Principle #26Copying

3Measurement precision

If hash tree generation is performed for every schema comparison, then accurate schema differences can be detected, but computational resources are consumed

Engineering Contradiction:
Improveschema difference detection accuracyVSAvoidcomputational resource consumption
Core Design Contradiction:
Measurement precisionVSUse of energy by moving object

Solution Approach 1:

The hash tree is generated and stored as part of the schema metadata when the database schema is initially created or updated, rather than regenerating it for every comparison operation. This preliminary generation allows rapid comparison operations using pre-computed hash trees, reducing computational resource consumption during data import operations.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentEP3864518B1Generating hash trees for database schemas
Publication Date: 2025.11.26 SALESFORCE INC
  • EP3864518B1 patent drawingFigure 1
  • EP3864518B1 patent drawingFigure 2
  • EP3864518B1 patent drawingFigure 3A

AI summary

Techniques are disclosed relating to determining whether a set of database schemas are different. A computer system may receive a request to create a snapshot for a set of data stored in a database having a first database schema. In response to receiving the request, the computer system may create the snapshot for the set of data. As part of the creating, the computer system may generate, based on the first database schema, a first hierarchy of hash values that includes a first root hash value for the first database schema. The first hierarchy of hash values may be usable to determine whether the first database schema is different from a second database schema. The computer system may include the first hierarchy of hash values with the snapshot.