Database Journal Synchronization Thread for Data Loss Prevention

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Electronic devices using specific journaling methods and synchronization modes, such as Android systems in write ahead logging (WAL) mode, often fail to synchronize journal data with nonvolatile memory, leading to data loss during abrupt power-offs or restarts due to the inability to recover journal data from volatile memory.

Innovation Solution

An electronic device with a processor that detects transactions, identifies database and file system characteristics, and creates a thread to synchronize metadata and journal data with nonvolatile memory based on conditions related to data change or time, preventing data loss by ensuring synchronization occurs when necessary.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If periodic synchronization is not performed for journal data in WAL mode and normal synchronization mode, then device performance is improved, but data reliability deteriorates due to potential data loss during abrupt power-off

Engineering Contradiction:
Improvedevice performanceVSAvoiddata reliability
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The system performs preliminary actions by creating a synchronization thread when specific conditions are met (journal mode is WAL and synchronization mode is normal). This thread proactively synchronizes journal data to non-volatile memory before potential data loss can occur, rather than waiting for periodic synchronization intervals. The condition checking and thread creation happen in advance to prevent the harmful effect of data loss while maintaining performance during normal operation.

Inventive Principle:
Principle #10Preliminary action

2Reliability

If synchronization thread is created for all transactions, then data integrity is improved, but device complexity increases due to additional thread management overhead

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

Solution Approach 1:

The system applies local quality by creating synchronization threads selectively based on local conditions specific to each transaction context. The processor checks whether the journal mode is WAL and whether the synchronization mode is normal before creating a thread. This localized approach ensures that threads are created only where and when needed, rather than universally for all transactions, thereby maintaining data integrity for critical cases while avoiding unnecessary complexity in other scenarios.

Inventive Principle:
Principle #3Local quality

Solution Approach 2:

The system changes parameters dynamically by evaluating the journal mode and synchronization mode parameters at runtime. Based on the combination of these parameters, the system decides whether to create a synchronization thread. This parameter-based decision-making allows the system to adapt its behavior to different operational contexts, creating threads only when the specific parameter combination (WAL mode + normal synchronization mode) indicates a risk of data loss.

Inventive Principle:
Principle #35Parameter changes

3Speed

If journal data is stored only in volatile memory for performance, then writing speed is improved, but data loss risk increases during abrupt power-off or restart

Engineering Contradiction:
Improvewriting speedVSAvoiddata recovery capability
Core Design Contradiction:
SpeedVSReliability

Solution Approach 1:

The synchronization thread acts as an intermediary mechanism between the volatile memory journal data and the non-volatile memory database. When the thread is created under specific conditions, it mediates the transfer of journal data from volatile to non-volatile memory, ensuring that critical data is preserved even if power is lost. This intermediary approach allows the system to maintain the speed benefits of volatile memory while periodically ensuring data safety through the thread-mediated synchronization process.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS11423012B2Electronic device for prohibiting loss of data in database and method for operating the same
Publication Date: 2022.08.23 SAMSUNG ELECTRONICS CO LTD
  • US11423012B2 patent drawing
  • US11423012B2 patent drawing
  • US11423012B2 patent drawing

AI summary

An electronic device and a method for operating the electronic device are provided. The electronic device includes a first memory, a second memory configured to store therein journal data including an operation result of a transaction for data in the database and metadata, and at least processor configured to detect an occurrence of the transaction, identify characteristics of a database system to which the data corresponding to the transaction belongs and characteristics of a file system, determine whether to create a thread for synchronizing the metadata stored in the second memory with the first memory based on the characteristics of the file system and the characteristics of the database system, and synchronize the metadata with the first memory using the created thread corresponding to identifying that the transaction of the data satisfies a condition related to a degree of change of time of the data.