Automated Database Schema Synchronization via DDL Generation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

In large database environments, manually creating and managing hundreds of DDL scripts for updating multiple database instances to match a common schema is inefficient and error-prone, and there is a need for a more agile and automated solution to synchronize database schema across instances, especially for version control and rollback purposes.

Innovation Solution

A system and method for synchronizing database schema by generating data structure definitions, comparing object definitions between source and target databases, and creating data definition language (DDL) change instructions to modify the target database structure, including creation, modification, and deletion actions, with an optimized execution sequence and rollback capabilities.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If manual DDL script creation is used to update multiple database instances, then schema synchronization can be achieved, but the process becomes inefficient and error-prone when dealing with hundreds of scripts

Engineering Contradiction:
Improveschema synchronization accuracyVSAvoidschema update efficiency
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The system performs self-service by automatically generating DDL scripts through database schema comparison. The comparison engine autonomously identifies differences between source and target database schemas and generates the necessary creation, modification, and deletion scripts without manual intervention, eliminating human error while maintaining high synchronization accuracy

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The system creates copies of the source database schema definition and compares it against target database schemas. By copying and analyzing schema structures programmatically, the system can efficiently generate synchronization scripts for multiple database instances simultaneously, improving both productivity and reliability

Inventive Principle:
Principle #26Copying

2Productivity

If automated DDL generation is implemented, then productivity improves, but complexity of the system increases

Engineering Contradiction:
Improveschema update efficiencyVSAvoidsystem complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The automated system is segmented into distinct functional modules: a schema comparison engine that identifies differences, a script generation engine that creates DDL statements, and a execution management component. This segmentation allows each module to handle specific tasks independently, managing system complexity while maintaining high automation productivity

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The comparison engine serves multiple functions by simultaneously analyzing various schema objects (tables, columns, constraints, indexes) and generating comprehensive synchronization scripts for all identified differences. This multi-functionality reduces the need for separate specialized tools, managing overall system complexity

Inventive Principle:
Principle #6Universality (Multi-functionality)

3Productivity

If schema changes are applied directly to target databases, then synchronization is achieved, but rollback capability becomes difficult to implement

Engineering Contradiction:
Improvesynchronization speedVSAvoidrollback capability
Core Design Contradiction:
ProductivityVSEase of repair

Solution Approach 1:

The system performs preliminary actions by generating and validating DDL scripts before applying them to target databases. The scripts are prepared in advance with associated rollback commands, allowing quick reversal if issues arise during or after execution, thus maintaining both synchronization speed and rollback capability

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system implements feedback mechanisms by monitoring the execution status of DDL scripts and providing real-time updates on synchronization progress. If errors occur during script execution, the feedback system triggers automatic rollback procedures using pre-generated reverse scripts, ensuring both rapid synchronization and easy repair capability

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS10540371B2Systems and methods for synchronizing database schema
Publication Date: 2020.01.21 WALMART APOLLO LLC
  • US10540371B2 patent drawing
  • US10540371B2 patent drawing
  • US10540371B2 patent drawing

AI summary

Methods and systems for synchronizing a database schema (or data structure) of a source database to a target database are disclosed. A source data structure definition is generated, including definitions of each object in the source database structure. A target database structure is generated, including definitions of each object in the source database structure. Object definitions are compared between the source database structure and the target database structure. A data definition language change instruction sequence is generated that, when executed, will modify the target database structure to correspond to the data structure definition. The change instruction sequence is executed on the target database.