KR20210156680A - Database management devices and methods for active and standby nodes in the main memory database management system - Google Patents

Database management devices and methods for active and standby nodes in the main memory database management system Download PDF

Info

Publication number
KR20210156680A
KR20210156680A KR1020200074558A KR20200074558A KR20210156680A KR 20210156680 A KR20210156680 A KR 20210156680A KR 1020200074558 A KR1020200074558 A KR 1020200074558A KR 20200074558 A KR20200074558 A KR 20200074558A KR 20210156680 A KR20210156680 A KR 20210156680A
Authority
KR
South Korea
Prior art keywords
log
database
node
active node
replication
Prior art date
Application number
KR1020200074558A
Other languages
Korean (ko)
Inventor
오지석
Original Assignee
주식회사 블루디언
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 주식회사 블루디언 filed Critical 주식회사 블루디언
Priority to KR1020200074558A priority Critical patent/KR20210156680A/en
Publication of KR20210156680A publication Critical patent/KR20210156680A/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/16Error detection or correction of the data by redundancy in hardware
    • G06F11/1658Data re-synchronization of a redundant component, or initial sync of replacement, additional or spare unit
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1471Saving, restoring, recovering or retrying involving logging of persistent data for recovery
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/16Error detection or correction of the data by redundancy in hardware
    • G06F11/20Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements
    • G06F11/202Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements where processing functionality is redundant
    • G06F11/2038Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements where processing functionality is redundant with a single idle spare processing component
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/16Error detection or correction of the data by redundancy in hardware
    • G06F11/20Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements
    • G06F11/2097Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements maintaining the standby controller/processing unit updated

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present invention relates to a database management device and method of an active node and a standby node of a main memory database management system. When a transaction is lost due to a failure in either one of the active node and the standby node in the main memory database management system, which is duplicated as the active node and the standby node, the database can be managed to prevent data inconsistency between the active node and the standby node.

Description

메인메모리 데이터베이스 관리 시스템의 액티브 노드 및 스탠바이 노드의 데이터베이스 관리 장치 및 방법{Database management devices and methods for active and standby nodes in the main memory database management system}{Database management devices and methods for active and standby nodes in the main memory database management system}

본 발명은, 메인메모리 데이터베이스 관리 시스템의 액티브 노드 및 스탠바이 노드의 데이터베이스 관리 장치 및 방법에 관한 것으로, 액티브 노드와 스탠바이 노드로 이중화된 메인메모리 데이터베이스 관리시스템에서 액티브 노드 및 스탠바이 노드 중 어느 한쪽에 장애가 발생하여 트랜잭션이 유실되었을 때에 액티브 노드 및 스탠바이 노드 간의 데이터 불일치를 방지할 수 있도록 데이터베이스를 관리하는 데이터베이스 관리 장치 및 방법에 관한 것이다.The present invention relates to an apparatus and method for database management of an active node and a standby node of a main memory database management system. In a main memory database management system duplicated into an active node and a standby node, a failure occurs in either one of the active node and the standby node Accordingly, to a database management apparatus and method for managing a database to prevent data inconsistency between an active node and a standby node when a transaction is lost.

통신 시스템이나 다수의 가입자를 관리하는 인터넷 서비스 시스템 등에서는 고속의 데이터 처리가 필수적이기때문에 이러한 데이터를 저장 또는 관리하는 데이터베이스에서 고속으로 데이터를 처리할 수 있는 성능을 요구한다. 이러한 데이터 고속 처리 성능에 대한 요구를 만족시키기 위한 새로운 개념의 데이터베이스 관리 시스템으로, 메인메모리 데이터베이스 관리 시스템(main memory database management system,"MMDBMS")이 대두되고있다.Since high-speed data processing is essential in a communication system or an Internet service system that manages a large number of subscribers, a high-speed data processing capability is required in a database that stores or manages such data. As a database management system of a new concept to satisfy the demand for such high-speed data processing performance, a main memory database management system ("MMDBMS") is emerging.

메인메모리 데이터베이스 관리 시스템이란, 종래의 디스크 기반 데이터베이스 관리 시스템에서 데이터베이스의테이블과 인덱스 전체가 디스크에 존재하고 접근하려는 레코드가 속한 데이터 페이지 또는 인덱스 페이지를 필요에 따라 디스크로부터 메모리 버퍼에 읽어 들여 처리하는 것과 달리, 최초 구동 시에 디스크에 존재하는 데이터베이스 전체를 메모리에 상주시켜서 모든 레코드의 접근이 메모리에서 이루어지도록 함으로써, 데이터의 고속처리를 가능하게 한다. The main memory database management system is the process of reading and processing the data page or index page containing the record to be accessed from the disk into the memory buffer as needed, and the entire database table and index exist on disk in the conventional disk-based database management system. In contrast, at the time of initial operation, the entire database existing on the disk resides in the memory so that all records are accessed from the memory, thereby enabling high-speed data processing.

일반적으로 데이터베이스 관리 시스템(DBMS)는 데이터베이스의 안정성을 보장하기 위해 데이터 변경에 대한 로깅을 수행한다. 로깅(Logging)이란 발생하는 데이터의 삽입/삭제/변경을 디스크와 같이 안전한 저장 장치(stable storage)에 실시간으로 기록함으로써, 장애 발생시 이를 활용하여 최종의 데이터베이스 상태로 되돌리기 위한 DBMS의 기본 기능이다. 고성능 시스템에 적용되는 메인메모리 DBMS도 마찬가지로, 데이터베이스의 안정성 즉, 어떠한 장애 상황에서도 중단 없는 서비스를 보장해야 하는데, 이를 충족시키기 위해 데이터베이스 관리시스템을 액티브 노드와 스탠바이 노드로 이중화시키는 등의 데이터베이스 이중화 기능을 제공하고 있다.In general, a database management system (DBMS) performs logging of data changes to ensure the stability of the database. Logging is a basic function of DBMS to record the insertion/deletion/change of generated data in a stable storage such as disk in real time, and to use it in case of a failure to return to the final database state. Similarly, the main memory DBMS applied to high-performance systems must guarantee the stability of the database, that is, uninterrupted service in any failure situation. are providing

데이터베이스 관리 시스템은 이러한 데이터베이스의 고속 처리 성능 및 안정성 외에도 지속성(durability)을 보장하는 것이 중요한데, 이러한 지속성(durability)은 트랜잭션 처리에서 중요한 ACID(Atomic, Consistency,Isolation, Durability) 성질 중 하나로, "트랜잭션이 성공적으로 완료되면(COMMIT), 어떠한 시스템 오류에도 트랜잭션 처리 결과는 데이터베이스에 반영됨을 보장해야 한다"로 정의할 수 있다.In addition to the high-speed processing performance and stability of the database, it is important for the database management system to ensure durability. This durability is one of the important ACID (Atomic, Consistency, Isolation, Durability) properties in transaction processing. Upon successful completion (COMMIT), it must be guaranteed that the transaction processing result is reflected in the database in any system error.”

종래의 디스크 기반의 DBMS에서는 이러한 지속성(Durability)를 지원하기 위해서 DBMS에서 수행되는 트랜잭션이 커밋(commit)될 때, 반드시 해당 트랜잭션의 모든 로그를 디스크에 영구적으로 반영(Flush)하는 작업을 거쳤으나 속도가 가장 느린 매체인 디스크에 로그를 영구 반영하는 작업은 DBMS의 전체적인 성능을 저하시켜 왔다.In the conventional disk-based DBMS, when a transaction performed in the DBMS is committed to support such durability, all logs of the transaction must be permanently flushed to the disk. Permanently reflecting logs to disk, which is the slowest medium, has deteriorated the overall performance of the DBMS.

따라서, 메인메모리 데이터베이스 관리 시스템에서는 Durability의 면에서 약간 손해보더라도 더 높은 성능을 제공하기 위해, 트랜잭션이 커밋(commit)될 때, 해당 트랜잭션의 로그 정보가 메모리에만 반영되어있더라도 커밋(commit)을 완료시키고, 그 후에, 트랜잭션 커밋 작업을 수행하는 프로세스(또는 쓰레드)와 별개의 프로세스(또는 쓰레드)를 통해 메모리에 존재하는 로그를 모아서 한꺼번에 디스크에 영구 반영하도록 처리하여 왔다.Therefore, in the main memory database management system, in order to provide higher performance even if there is a slight loss in terms of durability, when a transaction is committed, the commit is completed even if the log information of the transaction is reflected only in memory. , and then, through a process (or thread) separate from the process (or thread) performing the transaction commit operation, the logs existing in memory are collected and processed to be permanently reflected on the disk at once.

그러나, 트랜잭션이 이와 같이 처리되는 경우에 사용자가 수행한 트랜잭션이 커밋(commit)되었더라도, 해당 트랜잭션의 로그를 디스크에 영구 반영하지 않은 상태에서는 커밋된 트랜잭션의 변경 내역이 사라질 위험이 있다.However, when a transaction is processed in this way, even if the transaction performed by the user is committed, there is a risk that the change history of the committed transaction will disappear if the log of the transaction is not permanently reflected on the disk.

예컨대, DBMS에 Power failure나 OS Panic 등의 원인으로 인해 예기치 못한 장애가 발생한 경우에, 장애 발생당시 메모리 상에서는 커밋되었으나, 디스크에 반영되지 않은 트랜잭션의 경우에는 해당 트랜잭션에 속하는 로그가 메모리 상에서만 기록되어 있는 상태이기 때문에 장애 발생에 따라 이미 커밋된 트랜잭션임에도 불구하고유실될 수 있다.For example, when an unexpected failure occurs in the DBMS due to power failure or OS panic, in the case of a transaction that was committed in memory at the time of the failure but not reflected in disk, the log belonging to the transaction is recorded only in memory. Because it is a state, even if a transaction has already been committed, it may be lost depending on the occurrence of a failure.

이러한 트랜잭션의 손실은 이중화된 데이터베이스 관리 시스템의 두 노드 즉, 액티브 노드와 스탠바이 노드 양자간의 데이터 불일치를 발생시키게 된다.The loss of such a transaction causes data inconsistency between the two nodes of the redundant database management system, that is, the active node and the standby node.

따라서, 이중화된 메인메모리 데이터베이스 관리 시스템에서 장애 발생에 따른 트랜잭션 손실로 인한 두 노드사이의 데이터 불일치를 방지하는 기술이 요구된다.Therefore, there is a need for a technique for preventing data inconsistency between two nodes due to a transaction loss due to a failure in the redundant main memory database management system.

본 발명이 이루고자 하는 기술적 과제는, 액티브 노드와 스탠바이 노드로 이중화된 메인메모리 데이터베이스 관리시스템에서 액티브 노드 및 스탠바이 노드 중 어느 한쪽에 장애가 발생하여 트랜잭션이 유실되었을 때에 액티브 노드 및 스탠바이 노드 간의 데이터 불일치를 방지할 수 있도록 데이터베이스를 관리하는 데이터베이스 관리장치 및 방법을 제공하는 데에 있다.The technical problem to be achieved by the present invention is to prevent data inconsistency between the active node and the standby node when a transaction is lost due to a failure in either one of the active node and the standby node in a main memory database management system duplicated with an active node and a standby node It is to provide a database management device and method for managing the database so that

본 발명이 이루고자 하는 기술적 과제들은 이상에서 언급한 기술적 과제들로 제한되지 않으며, 언급되지 않은다른 기술적 과제들은 아래의 기재로부터 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에게 명확하게이해될 수 있을 것이다.The technical problems to be achieved by the present invention are not limited to the technical problems mentioned above, and other technical problems not mentioned can be clearly understood by those of ordinary skill in the art to which the present invention belongs from the description below. There will be.

상기의 기술적 과제를 이루기 위한, 본 발명에 따른 메인메모리 데이터베이스 관리 시스템의 액티브 노드의 데이터베이스 관리 장치는 액티브 노드의 메모리의 로그버퍼에, 시계열적으로 식별번호가 할당된 데이터베이스 로그를 기록하는 메모리로깅부; 기록된 데이터베이스 로그를 스탠바이 노드로 복제하는 복제부; 기록된 데이터베이스 로그를 주기적으로 액티브 노드의 디스크에 저장하는 디스크저장부; 및 액티브 노드의 장애 발생시 마지막으로 복원된 최후복원로그의 식별번호를 스탠바이 노드로 전송하고, 스탠바이 노드로부터 최후복원로그 후에 기록된 유실로그를 포함하는 트랜잭션에 속하는 적어도 하나 이상의 모든 복제 로그를 수신하여, 수신된 복제 로그를 기초로 액티브 노드의 데이터베이스를 복구하는 복구부를 포함한다.In order to achieve the above technical object, the database management apparatus of the active node of the main memory database management system according to the present invention is a memory logging unit that records the database log to which the identification number is assigned in time series in the log buffer of the memory of the active node. ; a replication unit that replicates the recorded database log to the standby node; a disk storage unit for periodically storing the recorded database log on the disk of the active node; And when the failure of the active node occurs, the identification number of the last restored log is transmitted to the standby node, and at least one replication log belonging to the transaction including the loss log recorded after the last restoration log is received from the standby node. It includes a recovery unit that recovers the database of the active node based on the received replication log.

상기의 기술적 과제를 이루기 위한, 본 발명에 따른 메인메모리 데이터베이스 관리 시스템의 액티브 노드의 데이터베이스 관리 방법은 액티브 노드의 메모리의 로그버퍼에, 시계열적으로 식별번호가 할당된 데이터베이스 로그를 기록하는 단계; 기록된 데이터베이스 로그를 스탠바이 노드 복제하는 단계; 기록된 데이터베이스 로그를 주기적으로 액티브 노드의 디스크에 저장하는 단계; 및 스탠바이 노드로부터 주기적으로 스탠바이 노드의 디스크에 저장된 복제 로그에 대응하는 데이터베이스 로그의 식별번호를 보고받는 단계를 포함한다.In order to achieve the above technical object, the method for managing a database of an active node of a main memory database management system according to the present invention includes: writing a database log to which identification numbers are assigned in time series in a log buffer of a memory of the active node; replicating the recorded database log to the standby node; periodically storing the recorded database log on a disk of the active node; and periodically receiving, from the standby node, an identification number of a database log corresponding to the replication log stored on the disk of the standby node.

보다 바람직하게는, 액티브 노드의 장애 발생시 마지막으로 복원된 최후복원로그의 식별번호를 스탠바이 노드로 전송하는 단계; 스탠바이 노드로부터 최후복원로그 후에 기록된 유실로그를 포함하는 트랜잭션에 속하는 적어도 하나 이상의 모든 복제 로그를 수신하는 단계; 및 수신된 복제 로그를 기초로 액티브 노드의 데이터베이스를 복구하는 단계를 더 포함할 수 있다.More preferably, when the failure of the active node occurs, transmitting the identification number of the last restored last restoration log to the standby node; receiving, from the standby node, at least one or more all replication logs belonging to a transaction including a loss log recorded after the last restoration log; and restoring the database of the active node based on the received replication log.

상기의 기술적 과제를 이루기 위한, 본 발명에 따른 메인메모리 데이터베이스 관리 시스템의 스탠바이 노드의 데이터베이스 관리 장치는 액티브 노드로부터 시계열적으로 식별번호가 할당된 데이터베이스 로그를 복제받아, 복제받은 데이터베이스 로그를 기초로 수행된 트랜잭션의 처리 중에 발생한 데이터베이스 변경을 스탠바이 노드의 메모리의 로그 버퍼에 복제 로그로 기록하는 메모리로깅부; 기록된 복제 로그를 주기적으로 스탠바이 노드의 디스크에 저장하는 디스크저장부; 및 디스크저장부에 저장되는 복제 로그에 대응하는 데이터베이스 로그의 식별번호를 액티브 노드에 주기적으로 보고하는 로그저장보고부; 및 스탠바이 노드의 장애 발생시, 액티브 노드로부터 마지막으로 보고된 식별번호의 데이터베이스 로그 후의 데이터베이스 로그를 복제한 복구용 복제 로그를 수신하여, 수신된 복구용 복제 로그를 기초로 스탠바이 노드의 데이터베이스를 복구하는 복구부를 포함한다.In order to achieve the above technical problem, the database management apparatus of the standby node of the main memory database management system according to the present invention receives the database log assigned with the identification number in time series from the active node, and performs it based on the replicated database log a memory logging unit that records database changes that occurred during processing of the transaction as a replication log in the log buffer of the standby node's memory; a disk storage unit for periodically storing the recorded replication log on a disk of the standby node; and a log storage reporting unit periodically reporting an identification number of a database log corresponding to the replication log stored in the disk storage unit to the active node; and when the standby node fails, receiving a recovery replication log that replicates the database log after the database log of the last reported identification number from the active node, and recovering the standby node database based on the received recovery replication log includes wealth.

상기의 기술적 과제를 이루기 위한, 본 발명에 따른 메인메모리 데이터베이스 관리 시스템의 스탠바이 노드의 데이터베이스 관리 방법은 액티브 노드로부터 시계열적으로 식별번호가 할당된 데이터베이스 로그를 복제받는 단계; 복제받은 데이터베이스 로그를 기초로 수행된 트랜잭션의 처리 중에 발생한 데이터베이스 변경을 스탠바이 노드의 메모리의 로그 버퍼에 복제 로그로 기록하는 단계; 복제 로그에 대응되는 데이터베이스 로그의 식별번호와 복제 로그를 매핑하여 트랜잭션 단위로 트랜잭션 테이블에 저장하는 단계; 기록된 복제 로그를 주기적으 로 스탠바이 노드의 디스크에 저장하는 단계; 및 디스크에 저장되는 복제 로그에 대응하는 데이터베이스 로그의 식별번호를 액티브 노드에 주기적으로 보고하는 단계를 포함한다.In order to achieve the above technical problem, a database management method of a standby node of a main memory database management system according to the present invention includes: receiving a database log to which an identification number is assigned time-series from an active node to be copied; recording a database change occurring during processing of a transaction performed based on the replicated database log as a replication log in a log buffer of a memory of a standby node; mapping the replication log with the identification number of the database log corresponding to the replication log and storing it in a transaction table in units of transactions; periodically storing the recorded replication log on a disk of the standby node; and periodically reporting the identification number of the database log corresponding to the replication log stored in the disk to the active node.

본 발명에 따르면, 액티브 노드 및 스탠바이 노드 중 어느 하나의 노드에 예기치 못한 장애 발생시, 다른 노드에 이중화된 정보를 이용하여 장애가 발생한 노드의 데이터 복구를 지원함으로써, 트랜잭션 손실에 의한 데이터불일치를 방지할 수 있으며, 사용자의 추가적인 개입이 없이도 데이터 일관성을 유지할 수 있게 되며, 궁극적으로는 메인메모리 데이터베이스 관리 시스템에서의 트랜잭션의 지속성을 보장할 수 있게 된다.According to the present invention, when an unexpected failure occurs in any one of the active node and the standby node, data inconsistency due to transaction loss can be prevented by supporting data recovery of the failed node using information duplicated in other nodes. In addition, data consistency can be maintained without additional user intervention, and ultimately, transaction continuity in the main memory database management system can be guaranteed.

도 1a는 본 발명의 바람직한 일 실시예에 따른 메인메모리 데이터베이스 관리 시스템의 이중화된 구성을 도시한블록도이다.
도 1b는 본 발명의 바람직한 일 실시예에 따른 메인메모리 데이터베이스 관리 시스템에서 메모리의 로그 버퍼에 기록되는 데이터베이스 로그를 예시한 도면이다
도 2a 내지 2c들은 본 발명의 바람직한 일 실시예에 따른 메인메모리 데이터베이스 관리 시스템에서 트랜잭션의 지속성 보장을 위해 데이터베이스를 관리하는 방법을 예시한 흐름도들이다.
도 3a 내지 3d들은 본 발명의 바람직한 일 실시예에 따른 메인메모리 데이터베이스 관리 시스템에서 트랜잭션의 손실에 따른 데이터의 불일치를 제거하는 과정을 설명하기 위한 도면들이다.
1A is a block diagram illustrating a redundant configuration of a main memory database management system according to a preferred embodiment of the present invention.
1B is a diagram illustrating a database log recorded in a log buffer of a memory in the main memory database management system according to an embodiment of the present invention.
2A to 2C are flowcharts illustrating a method of managing a database to ensure transaction continuity in a main memory database management system according to an embodiment of the present invention.
3A to 3D are diagrams for explaining a process of removing data inconsistency due to transaction loss in the main memory database management system according to an exemplary embodiment of the present invention.

이하의 내용은 단지 본 발명의 원리를 예시한다. 그러므로 당업자는 비록 본 명세서에 명확히 설명되거나 도시되지 않았지만 본 발명의 원리를 구현하고 본 발명의 개념과 범위에 포함된 다양한 장치를 발명할 수 있는 것이다. 또한, 본 명세서에 열거된 모든 조건부 용어 및 실시예들은 원칙적으로, 본 발명의 개념이 이해되도록 하기위한 목적으로만 명백히 의도되고, 이와 같이 특별히 열거된 실시예들 및 상태들에 제한적이지 않는 것으로 이해되어야 한다. 또한, 본 발명의 원리, 관점 및 실시예들뿐만 아니라 특정 실시예를 열거하는 모든 상세한 설명은 이러한 사항의 구조적 및 기능적 균등물을 포함하도록 의도되는 것으로 이해되어야 한다. 또한, 이러한 균등물들은 현재 공지된 균등물뿐만 아니라 장래에 개발될 균등물 즉 구조와 무관하게 동일한 기능을 수행하도록발명된 모든 소자를 포함하는 것으로 이해되어야 한다.The following is merely illustrative of the principles of the invention. Therefore, those skilled in the art will be able to devise various devices that, although not explicitly described or shown herein, embody the principles of the present invention and are included within the spirit and scope of the present invention. Moreover, it is to be understood that all conditional terms and examples listed herein are, in principle, expressly intended only for the purpose of understanding the inventive concept, and not as limiting to the specifically enumerated embodiments and states as such. should be Moreover, it is to be understood that all detailed description reciting the principles, aspects, and embodiments of the invention, as well as specific embodiments, are intended to cover structural and functional equivalents of such matters. Moreover, it is to be understood that such equivalents include not only currently known equivalents, but also equivalents developed in the future, ie, all devices invented to perform the same function, regardless of structure.

따라서, 프로세서 또는 이와 유사한 개념으로 표시된 기능 블록을 포함하는 도면에 도시된 다양한 소자의 기능은 전용 하드웨어뿐만 아니라 적절한 소프트웨어와 관련하여 소프트웨어를 실행할 능력을 가진 하드웨어의 사용으로 제공될 수 있다. 프로세서에 의해 제공될 때, 기능은 단일 전용 프로세서, 단일 공유 프로세서 또는 복수의 개별적 프로세서에 의해 제공될 수 있고, 이들 중 일부는 공유될 수 있다. 또한, 프로세서, 제어 또는 이와 유사한 개념으로 제시되는 용어의 사용은 소프트웨어를 실행할 능력을 가진 하드웨어를 배타적으로 인용하여 해석되어서는 아니 되고, 제한 없이 디지털 신호 프로세서(DSP) 하드웨어, 소프트웨어를 저장하기 위한 롬(ROM),램(RAM) 및 비휘발성 메모리를 암시적으로 포함하는 것으로 이해되어야 한다. 주지 관용의 다른 하드웨어도 포함될 수 있다.Accordingly, the functions of the various elements shown in the drawings including functional blocks denoted as processors or similar concepts may be provided by the use of dedicated hardware as well as hardware having the ability to execute software in association with appropriate software. When provided by a processor, the functionality may be provided by a single dedicated processor, a single shared processor, or a plurality of separate processors, some of which may be shared. In addition, the use of terms presented as processor, control, or similar concepts should not be construed as exclusively referring to hardware having the ability to execute software, and without limitation, digital signal processor (DSP) hardware, ROM for storing software. It should be understood to implicitly include (ROM), RAM (RAM) and non-volatile memory. Other hardware of common knowledge may also be included.

상술한 목적, 특징 및 장점들은 첨부된 도면과 관련한 다음의 상세한 설명을 통하여 더욱 분명해질 것이다. 본발명을 설명함에 있어서, 관련된 공지 기술에 대한 구체적인 설명이 본 발명의 요지를 불필요하게 흐릴 수 있다고 판단되는 경우 그 상세한 설명을 생략하거나 간략하게 설명하는 것으로 한다.The above objects, features and advantages will become more apparent through the following detailed description in conjunction with the accompanying drawings. In describing the present invention, if it is determined that a detailed description of a related known technology may unnecessarily obscure the gist of the present invention, the detailed description will be omitted or briefly described.

한편 어떤 부분이 어떤 구성요소를 "포함"한다고 할 때, 이는 특별히 반대되는 기재가 없는 한 다른 구성요소를 제외하는 것이 아니라, 다른 구성요소를 더 포함할 수 있는 것을 의미한다.On the other hand, when a part "includes" a certain component, this means that other components may be further included, rather than excluding other components unless otherwise stated.

이하, 첨부된 도면을 참조하여 바람직한 실시예에 따른 본 발명을 상세히 설명하기로 한다.Hereinafter, the present invention according to a preferred embodiment will be described in detail with reference to the accompanying drawings.

도 1a는 본 발명의 바람직한 일 실시예에 따른 메인메모리 데이터베이스 관리 시스템의 이중화된 구성을 도시한블록도이고, 도 1b는 본 실시예에 따른 메인메모리 데이터베이스 관리 시스템에서 메모리의 로그 버퍼에 기록되는 데이터베이스 로그를 예시한 도면이다.1A is a block diagram illustrating a redundant configuration of a main memory database management system according to an embodiment of the present invention, and FIG. 1B is a database recorded in a log buffer of a memory in the main memory database management system according to the present embodiment. A diagram illustrating a log.

도 1a를 참조하면, 본 실시예에 따른 메인메모리 데이터베이스 관리 시스템은 액티브 노드(110) 및 스탠바이 노__ 드(120)로 이중화되어 데이터베이스의 안정성을 보장한다.Referring to FIG. 1A , the main memory database management system according to the present embodiment is duplicated into an active node 110 and a standby node 120 to ensure the stability of the database.

본 실시예에 따른 액티브 노드(110)는 메모리로깅부(114), 복제부(115), 디스크저장부([0028] 116), 복구부(117) 및 복구정보관리부(118)를 포함한다.The active node 110 according to this embodiment includes a memory logging unit 114, a replication unit 115, a disk storage unit (116), a recovery unit 117 and a recovery information management unit 118.

메모리로깅부(114)는 로컬 메모리(111)의 로그버퍼에, 데이터베이스 로그를 기록한다.The memory logging unit 114 records the database log in the log buffer of the local memory 111 .

데이터베이스 로그란, 데이터의 삽입/삭제/변경이나 트랜잭션 제어 등과 같이 트랜잭션 처리 중에 발생하는 데이터베이스의 상태 변경을 기록한 것으로, 데이터베이스 관리 시스템은 이러한 데이터베이스 로그를 기반으로redo 또는 undo 를 수행하여 데이터베이스의 상태를 일관성 있게 유지할 수 있게 된다.The database log records changes in the state of the database that occur during transaction processing such as insertion/deletion/change of data or transaction control. be able to keep

도 1b를 참조하면, 본 실시예에 따른 데이터베이스 로그(130)는 해당 로그가 속하는 트랜잭션의 식별자(TID,131)와, 해당 로그에 시계열적으로 할당되는 식별번호(SN, 132)를 포함함으로써, 데이터베이스 관리 시스템에서 해당 데이터베이스 로그가 속한 트랜잭션을 커밋하거나, 복구할 때, 해당 로그가 속하는 트랜잭션 및 해당 로그의 실행 순서 등을 판단할 수 있게 된다.1B, the database log 130 according to the present embodiment includes an identifier (TID, 131) of a transaction to which the log belongs, and an identification number (SN, 132) that is time-series assigned to the log, When the database management system commits or recovers the transaction to which the database log belongs, it is possible to determine the transaction to which the log belongs and the execution order of the log.

복제부(115)는 메모리로깅부(114)에 기록된 데이터베이스 로그를 통신 인터페이스(113)을 통해 스탠바이 노드(120)로 복제한다.The replication unit 115 copies the database log recorded in the memory logging unit 114 to the standby node 120 through the communication interface 113 .

복제부(115)는 데이터베이스 로그가 속한 트랜잭션의 식별번호, 데이터베이스 로그의 식별번호를 포함하는 데이터베이스 로그를 복제하여 스탠바이 노드로 전송한다.The replication unit 115 duplicates the database log including the identification number of the transaction to which the database log belongs and the identification number of the database log and transmits it to the standby node.

디스크저장부(116)는 메모리로깅부(114)에 기록된 데이터베이스 로그를 주기적으로 로컬 디스크(112)에 저장한다.The disk storage unit 116 periodically stores the database log recorded in the memory logging unit 114 in the local disk 112 .

디스크저장부(116)에서 수행되는 데이터베이스 로그의 저장 과정은, 데이터베이스 로그가 포함되는 트랜잭션의커밋(commit) 및 데이터베이스 로그의 복제(replication)와 독립적으로 수행될 수 있다. 예컨대, 데이터베이스관리 시스템의 사용자가 데이터베이스 관리 시스템의 환경 설정 값으로 데이터베이스 로그의 저장 주기를 절대적인 시간 값으로 입력하여 설정될 수 있다.The database log storage process performed by the disk storage unit 116 may be performed independently of commit of a transaction including the database log and replication of the database log. For example, the user of the database management system may be set by inputting the storage period of the database log as an absolute time value as an environment setting value of the database management system.

복구부(117)는 액티브 노드(110)의 장애 발생시 마지막으로 복원된 최후복원로그의 식별번호를 스탠바이 노드(120)로 통신 인터페이스(113)을 통해 전송하고, 이에 대한 응답으로 스탠바이 노드(120)로부터 최후복원로그후에 기록된 유실로그를 포함하는 트랜잭션에 속하는 적어도 하나 이상의 모든 복제 로그를 통신 인터페이스(113)을 통해 수신하여, 수신된 복제 로그를 기초로 액티브 노드(110)의 데이터베이스를 복구한다.The recovery unit 117 transmits the identification number of the last restored log to the standby node 120 through the communication interface 113 when a failure of the active node 110 occurs, and in response to this, the standby node 120 At least one or more all replication logs belonging to a transaction including a loss log recorded after the last restoration log are received from the communication interface 113, and the database of the active node 110 is restored based on the received replication log.

복구정보관리부(118)는 이중화된 상대방 노드의 장애 발생시, 상대방 노드에서 유실된 것으로 판단되는 트랜잭션에 속하는 데이터베이스 로그들을 상대방 노드로 보내어 상대방 노드의 데이터베이스의 복구를 지원하는 구성요소이다.The recovery information management unit 118 is a component that supports recovery of the counterpart node's database by sending database logs belonging to the transaction determined to be lost in the counterpart node to the counterpart node when a duplicated counterpart node fails.

본 실시예에 따른 액티브 노드(110)의 복구정보관리부(118)는 이중화된 상대방 노드인 스탠바이 노드(120)로부터 주기적으로 스탠바이 노드(120)의 로컬 디스크(122)에 저장된 복제 로그에 대응하는 데이터베이스 로그의 식별번호를 보고받아, 이들을 로컬 메모리(111)에 저장해두고, 스탠바이 노드(120)의 장애 발생시, 마지막으로 수신된 식별번호의 데이터베이스 로그 후에 기록된 데이터베이스 로그들을 독출하여, 독출된 데이터베이스 로그들을 스탠바이 노드(120)로 복제하여 장애 발생에 따른 트랜잭션 손실이 있을 가능성이 높은 스탠바이 노드(120)의 데이터베이스를 복구할 수 있게 한다.The recovery information management unit 118 of the active node 110 according to the present embodiment is a database corresponding to the replication log stored in the local disk 122 of the standby node 120 periodically from the standby node 120 which is a duplicated counterpart node. The log identification number is reported, stored in the local memory 111, and when the standby node 120 fails, the database logs recorded after the database log of the last received identification number are read, and the read database logs are stored. By replicating to the standby node 120 , it is possible to recover the database of the standby node 120 with a high possibility of transaction loss due to the occurrence of a failure.

본 실시예에 따른 스탠바이 노드(120)는 메모리로깅부(124), 디스크저장부(125), 보고부(126), 복구부(127) 및 복구정보관리부(128)를 포함하며, 이들 중 메모리로깅부(124), 디스크저장부(125), 복구부(127) 및 복구정보 관리부(128)는 액티브 노드(110)의 메모리로깅부(114), 디스크저장부(116), 복구부(117) 및 복구정보관리부(118)에 대응될 수 있다.The standby node 120 according to this embodiment includes a memory logging unit 124 , a disk storage unit 125 , a reporting unit 126 , a recovery unit 127 , and a recovery information management unit 128 , among which memory The logging unit 124 , the disk storage unit 125 , the recovery unit 127 , and the recovery information management unit 128 are the memory logging unit 114 , the disk storage unit 116 , and the recovery unit 117 of the active node 110 . ) and the recovery information management unit 118 .

메모리로깅부(124)는 액티브 노드(110)로부터 복제된 데이터베이스 로그를 통신 인터페이스(123)을 통해 수신하여 이를 기초로 스탠바이 노드(120)의 데이터베이스 상에 로컬 트랜잭션을 수행하고, 이렇게 수행된 로컬 트랜잭션에 따라 스텐바이 노드(120)의 데이터베이스가 변경된 내용을 복제 로그로서 로컬 메모리(121)의 로그 버퍼에 기록한다.The memory logging unit 124 receives the database log replicated from the active node 110 through the communication interface 123 and performs a local transaction on the database of the standby node 120 based on the received database log, and the local transaction performed in this way Accordingly, the database of the standby node 120 records the changed contents as a replication log in the log buffer of the local memory 121 .

즉, 본 실시예에서의 "복제 로그"는 액티브 노드로부터 수신되는 데이터베이스 로그의 복제본 자체가 아니라,이러한 복제본을 기초로 수행된 트랜잭션에 의한 데이터베이스의 변경에 따라 스탠바이 노드의 로컬 메모리의로그 버퍼에 새로 로깅되는 로그를 의미한다. 본 실시예에서 스탠바이 노드(120)의 로그 버퍼에 기록되는 복제 로그의 식별번호는 [0042] 액티브 노드(110)의 로그버퍼에 기록되는 데이터베이스 로그의 식별번호와 독립적으로 시계열적으로 할당될 수 있다.That is, the "replication log" in this embodiment is not a copy of the database log itself received from the active node, but is newly stored in the log buffer of the local memory of the standby node according to the change of the database by the transaction performed based on the copy. It means the log being logged. In this embodiment, the identification number of the replication log recorded in the log buffer of the standby node 120 may be assigned time-series independently from the identification number of the database log recorded in the log buffer of the active node 110. .

이에 따라, 액티브 노드(110)와 스탠바이 노드(120) 간의 데이터 불일치를 방지하고, 데이터 일관성을 유지하기위해, 메모리로깅부(124)는 복제 로그에 대응되는 데이터베이스 로그의 식별번호와 복제 로그를 매핑하여 트랜잭션 단위로 로컬 메모리(121)의 트랜잭션 테이블에 저장할 수 있다. 예컨대, 데이터베이스 로그의 식별번호와복제 로그의 식별번호가 서로 달리 할당될 경우에는 데이터베이스 로그의 식별번호와 복제로그의 식별번호를 매핑하여 저장하도록 구성하는 것이 바람직하다.Accordingly, in order to prevent data inconsistency between the active node 110 and the standby node 120 and to maintain data consistency, the memory logging unit 124 maps the identification number of the database log corresponding to the replication log and the replication log. Thus, it can be stored in the transaction table of the local memory 121 in units of transactions. For example, when the identification number of the database log and the identification number of the replication log are allocated differently, it is preferable to map the identification number of the database log and the identification number of the replication log to be stored.

디스크저장부(125)는 로컬 메모리(121)의 로그 버퍼에 기록된 복제 로그를 주기적으로 로컬 디스크(122)에 저장한다.The disk storage unit 125 periodically stores the replication log recorded in the log buffer of the local memory 121 in the local disk 122 .

로그저장보고부(126)는 디스크저장부(125)에 저장되는 복제 로그에 대응하는 데이터베이스 로그의 식별번호를 액티브 노드(110)에 주기적으로 보고한다.The log storage reporting unit 126 periodically reports the identification number of the database log corresponding to the replication log stored in the disk storage unit 125 to the active node 110 .

복구부(127)는 스탠바이 노드(120)의 장애 발생시, 액티브 노드(110)로부터 마지막으로 보고된 식별번호의 데이터베이스 로그 후의 데이터베이스 로그를 복제한 복구용 복제 로그를 통신 인터페이스(123)을 통해 수신하여, 수신된 복구용 복제 로그를 기초로 스탠바이 노드(120)의 데이터베이스를 복구한다.The recovery unit 127 receives, through the communication interface 123, a recovery replication log that replicates the database log after the database log of the last reported identification number from the active node 110 when the standby node 120 fails. , restores the database of the standby node 120 based on the received replication log for recovery.

복구정보관리부(128)는 이중화된 상대방 노드의 장애 발생시, 상대방 노드에서 유실된 것으로 판단되는 트랜잭션에 속하는 데이터베이스 로그들을 상대방 노드로 보내어 상대방 노드의 데이터베이스의 복구를 지원하는 구성요소이다.The recovery information management unit 128 is a component that supports recovery of the counterpart node's database by sending database logs belonging to the transaction determined to be lost in the counterpart node to the counterpart node when a duplicated counterpart node fails.

본 실시예에 따른 스탠바이 노드(120)의 복구정보관리부(128)는 로그탐색부(미도시) 및 복제로그전송부(미도시)를 포함할 수 있다.The recovery information management unit 128 of the standby node 120 according to the present embodiment may include a log search unit (not shown) and a duplicate log transmission unit (not shown).

로그탐색부(미도시)는 이중화된 상대방 노드인 액티브 노드(110)의 장애 발생시 액티브 노드(110)로부터 마지막으로 복원된 최후복원로그의 식별번호를 통신 인터페이스(123)을 통해 수신하여 트랜잭션 테이블을 기초로 최후복원로그 후의 유실로그를 포함하는 트랜잭션에 속하는 모든 복제 로그를 탐색한다.The log search unit (not shown) receives, through the communication interface 123, the identification number of the last restored log from the active node 110 when a failure of the active node 110, which is a duplicated counterpart node, occurs through the communication interface 123, and stores the transaction table. As a basis, all replication logs belonging to the transaction including the loss log after the last restoration log are searched.

복제로그전송부(미도시)는 로그탐색부(미도시)에 탐색된 복제 로그를 액티브 노드(110)로 통신 인터페이스(123)을 통해 전송함으로써, 장애 발생에 따른 트랜잭션 손실이 있는 액티브 노드(110)의 데이터베이스를 복구할수 있게 한다.The replication log transmission unit (not shown) transmits the replication log searched for by the log search unit (not shown) to the active node 110 through the communication interface 123, thereby causing a transaction loss due to the occurrence of a failure. ) to recover the database.

도 2a 내지 2c들은 본 발명의 바람직한 일 실시예에 따른 메인메모리 데이터베이스 관리 시스템의 액티브 노드및 스탠바이 노드에서 트랜잭션의 지속성 보장을 위해 데이터베이스를 관리하는 방법을 예시한 흐름도들이다.2A to 2C are flowcharts illustrating a method of managing a database to ensure transaction continuity in an active node and a standby node of the main memory database management system according to an exemplary embodiment of the present invention.

본 실시예에 따른 액티브 노드(210) 및 스탠바이 노드(220)은 도 1에 도시된 메인메모리 데이터베이스 관리 시스템의 액티브 노드(110) 및 스탠바이 노드(120)에 각각 대응된다. 따라서, 도 1에 도시된 메인메모리 데이터베이스 관리 시스템에 관한 설명에서와 동일한 사항에 대해서는 이를 참조한다.The active node 210 and the standby node 220 according to the present embodiment correspond to the active node 110 and the standby node 120 of the main memory database management system shown in FIG. 1 , respectively. Accordingly, reference is made to the same matters as in the description of the main memory database management system shown in FIG. 1 .

이중 도 2a는 본 실시예에 따른 액티브 노드(210) 및 스탠바이 노드(220) 중 어느 한쪽에 장애가 발생하지 않은 일상적인 상황에서의 데이터 관리 방법의 흐름을 예시한다.Of these, FIG. 2A illustrates a flow of a data management method in a daily situation in which a failure does not occur in either one of the active node 210 and the standby node 220 according to the present embodiment.

먼저, 도 2a를 참조하면, 액티브 노드(210)는 로컬 메모리의 로그버퍼에 데이터베이스의 상태 변경에 관한 데이터베이스 로그를 기록한다(S201).First, referring to FIG. 2A , the active node 210 records a database log related to a state change of the database in a log buffer of a local memory ( S201 ).

액티브 노드(210)는 S201 단계에서 기록된 데이터베이스 로그를 복제하여 전송한다(S202).The active node 210 copies and transmits the database log recorded in step S201 (S202).

그리고, S202 단계에서의 복제 로그의 전송과 독립적으로, S201 단계에서 기록된 데이터베이스 로그를 로컬 디스크에 주기적으로 저장한다(S203).And, independently of the transmission of the replication log in step S202, the database log recorded in step S201 is periodically stored in the local disk (S203).

S203 단계의 디스크에의 저장은 S202 단계에서의 데이터베이스 로그의 복제 전송과 독립적으로 수행되므로, 그 수행순서가 뒤바뀌거나, 혹은 동시에 수행될 수도 있으며, 본 발명은 이를 한정하지 않는다. 다만, S203 단계의 디스크에의 저장은 그 수행 빈도가 잦아질수록 전체 데이터베이스 관리 시스템의 성능을 떨어뜨리는 요인이 될수 있으므로, 가급적 낮은 빈도로서, 복수의 데이터베이스 로그들에 대하여 일괄적으로 수행되는 것이 바람직하다.Since the storage on the disk in step S203 is performed independently of the replication and transmission of the database log in step S202, the execution order may be reversed or may be performed simultaneously, but the present invention is not limited thereto. However, since the storage to the disk of step S203 may become a factor of lowering the performance of the entire database management system as the frequency of its execution increases, it is preferable to perform batch processing for a plurality of database logs with as low a frequency as possible. do.

스탠바이 노드(220)는 S202 단계를 통해 복제받은 데이터베이스 로그를 기초로 트랜잭션을 수행하고(S204), 트랜잭션 처리 중에 발생한 로컬 데이터베이스의 변경을 로컬 메모리의 로그 버퍼에 기록하고(S205), 데이터베이 스 로그의 식별번호와 복제로그를 매핑하여 트랜잭션 단위로 로컬 메모리의 트랜잭션 테이블에 저장한다(S206).The standby node 220 performs a transaction based on the database log replicated through step S202 (S204), records changes in the local database that occurred during transaction processing in the log buffer of the local memory (S205), and the database log The identification number and the replication log are mapped and stored in the transaction table of the local memory in units of transactions (S206).

이때 스탠바이 노드(220)에서 복제 로그의 식별번호를 데이터베이스 로그의 식별번호와 달리 할당할 경우에는 트랜잭션 테이블 상에서 데이터베이스 로그의 식별번호와 복제로그의 식별번호를 매핑하여 저장할 수 있다.In this case, when the standby node 220 allocates the identification number of the replication log differently from the identification number of the database log, the identification number of the database log and the identification number of the replication log may be mapped and stored on the transaction table.

그리고, S206 단계에서의 트랜잭션 테이블에의 저장과 독립적으로, S206 단계에서 기록된 복제 로그를 로컬 디스크에 주기적으로 저장한다(S207).Then, independently of the storage in the transaction table in step S206, the replication log recorded in step S206 is periodically stored in the local disk (S207).

S207 단계의 디스크에의 저장은 S206 단계에서의 트랜잭션 테이블에의 저장과 독립적으로 수행되므로, 그 수행순서가 뒤바뀌거나, 혹은 동시에 수행될 수도 있으며, 본 발명은 이를 한정하지 않는다. 다만, S207 단계의 디스크에의 저장은 그 수행 빈도가 잦아질수록 전체 데이터베이스 관리 시스템의 성능을 떨어뜨리는 요인이 될 수있으므로, 가급적 낮은 빈도로서, 복수의 복제 로그들에 대하여 일괄적으로 수행되는 것이 바람직하다.Since the storage in the disk in step S207 is performed independently of the storage in the transaction table in step S206, the execution order may be reversed or may be performed simultaneously, but the present invention is not limited thereto. However, since the storage to the disk of step S207 can become a factor that degrades the performance of the entire database management system as the execution frequency increases, it is recommended to be performed on a plurality of replication logs at a low frequency as much as possible. desirable.

그리고, S207 단계에서의 디스크에의 저장이 완료되면, 이를 보고하기 위해, 주기적으로, 액티브 노드에 디스크에 저장된 복제 로그에 대응하는 데이터베이스의 식별번호를 보고한다(S208). 이는 별도의 보고 메시지를 생성하여 전송할 수도 있고, 또는 S202 단계에서 복제된 데이터베이스 로그의 전송에 대한 수신 성공 확인 메시지(ACK)에 첨부하여 전송할 수 있다.And, when the storage on the disk in step S207 is completed, in order to report this, the identification number of the database corresponding to the replication log stored on the disk is periodically reported to the active node (S208). This may be transmitted by generating a separate report message, or may be transmitted by attaching it to a reception success confirmation message (ACK) for transmission of the replicated database log in step S202.

도 2b는 본 실시예에 따른 액티브 노드(210)에 장애가 발생한 상황에 액티브 노드(210)의 데이터베이스를 복구하는 방법의 흐름을 예시한다.2B illustrates a flow of a method of recovering a database of the active node 210 in a situation in which a failure occurs in the active node 210 according to the present embodiment.

먼저, 액티브 노드(210)는 장애 발생(S211)을 인지하면, 디스크에 반영되거나 비휘발성 메모리 영역에 저장되어유실되지 않은 데이터베이스 로그를 중심으로 복원하고(S212), 이러한 로컬 메모리 및 스토리지에 저장되어 있는 정보만을 기초로 한 복원 작업이 완료된 후에, 마지막으로 복원된 최후복원로그의 식별번호를 스탠바이 노드(220)에 전송한다(S213).First, when the active node 210 recognizes the occurrence of a failure (S211), it is reflected on the disk or stored in the non-volatile memory area to restore the database log that is not lost (S212), and is stored in such local memory and storage. After the restoration operation based on only the existing information is completed, the identification number of the last restored log is transmitted to the standby node 220 (S213).

스탠바이 노드(220)는 로컬 메모리의 트랜잭션 테이블을 기초로 S213 단계에서 수신된 식별번호의 최후복원로그후의 유실로그를 포함하는 트랜잭션을 검색하여, 검색된 트랜잭션에 속하는 모든 복제로그를 탐색한다(S214).The standby node 220 searches for a transaction including a loss log after the last restoration log of the identification number received in step S213 based on the transaction table in the local memory, and searches all replication logs belonging to the searched transaction (S214).

그리고, S214 단계에서 탐색된 복제로그를 액티브 노드(210)로 전송한다(S215).Then, the replication log found in step S214 is transmitted to the active node 210 (S215).

액티브 노드(210)는 S215 단계를 통해 수신된 복제로그를 기초로 데이터베이스 상에서 손실된 트랜잭션을 복구한다(S216).The active node 210 recovers a lost transaction on the database based on the replication log received through step S215 (S216).

도 2c는 본 실시예에 따른 스탠바이 노드(220)에 장애가 발생한 상황에 스탠바이 노드(220)의 데이터베이스를복구하는 방법의 흐름을 예시한다.FIG. 2C illustrates a flow of a method of restoring a database of the standby node 220 in a situation in which a failure occurs in the standby node 220 according to the present embodiment.

먼저, 액티브 노드(210)는 스탠바이 노드(220)의 장애 발생(S221)을 인지하면(S222), 스탠바이 노드(220)로부터 S207 단계를 통해 보고되던 식별번호 중 마지막으로 수신된 식별번호의 데이터베이스 로그 후에 S201 단계를 통해 로컬 메모리의 로그 버퍼에 기록된 데이터베이스 로그를 독출한다(S223).First, when the active node 210 recognizes the occurrence of a failure (S221) of the standby node 220 (S222), the database log of the last received identification number among the identification numbers reported through the step S207 from the standby node 220 After that, the database log recorded in the log buffer of the local memory is read through step S201 (S223).

액티브 노드(210)는 S223 단계에서 독출된 데이터베이스 로그를 복제한 복제 로그를 전송한다(S224).The active node 210 transmits a replication log obtained by copying the database log read in step S223 (S224).

스탠바이 노드(220)는 S224 단계를 통해 수신된 복제 로그를 기초로 데이터베이스 상에서 디스크에 반영되지 않아 유실된 복제 로그 내지 트랜잭션을 복구한다(S225).The standby node 220 recovers the replication log or transaction lost because it is not reflected on the disk on the database based on the replication log received through step S224 (S225).

도 3a 내지 3d들은 본 발명의 바람직한 일 실시예에 따른 메인메모리 데이터베이스 관리 시스템에서 트랜잭션의 손실에 따른 데이터의 불일치를 제거하는 과정을 설명하기 위한 도면들이다.3A to 3D are diagrams for explaining a process of removing data inconsistency due to transaction loss in the main memory database management system according to an exemplary embodiment of the present invention.

도 3a는 본 실시예에 다른 메인메모리 데이터베이스 관리 시스템에서 라이프 사이클이 서로 상이한 4개의 트랜잭션 Tx1, Tx2, Tx3, Tx4 들이 장애가 발생하지 않은 일상적인 상황에서 액티브 노드(Active host)에서 스탠바이 노드(Standby host)로 복제(Replication) 되는 과정을 예시한다.3A is a diagram showing four transactions Tx1, Tx2, Tx3, and Tx4 having different life cycles in the main memory database management system according to the present embodiment in a normal situation in which a failure does not occur from an active node to a standby node (Standby host) ) to illustrate the process of replication.

액티브 노드에서 Tx1, Tx2, Tx3, Tx4의 순서로 트랜잭션이 발생하였으며, Tx3, Tx1, Tx2, Tx4의 순서로 로컬메모리 상에서 트랜잭션이 커밋(commit)된다. 각 트랜잭션에 속하는 로그들은 기록되는 순서대로 스탠바이 노드로 복제(replicate)된다. 따라서, 스탠바이 노드의 트랜잭션 Tx1’, Tx2’, Tx3’, Tx4’들은 액티브 노드의 트랜잭션 Tx1, Tx2, Tx3, Tx4 들에 각각 대응되는 트랜잭션으로 액티브 노드의 트랜잭션의 발생 및 커밋 순서와동일한 순서로 발생 및 커밋된다.Transactions occurred in the order of Tx1, Tx2, Tx3, and Tx4 in the active node, and transactions are committed in the local memory in the order of Tx3, Tx1, Tx2, and Tx4. Logs belonging to each transaction are replicated to the standby node in the order in which they are recorded. Accordingly, the transactions Tx1', Tx2', Tx3', and Tx4' of the standby node correspond to the transactions Tx1, Tx2, Tx3, and Tx4 of the active node, respectively, and occur in the same order as the transaction generation and commit order of the active node. and committed.

그리고 이러한 트랜잭션 중 Tx3 및 Tx1의 전체 로그 그리고, Tx2의 일부 로그에 대하여만 디스크에 반영(flush)된 상황을 예시한다.__ 도 3b는 도 3a에 예시된 상황에서 액티브 노드에 [0074] 장애가 발생한 상황을 예시한다.And among these transactions, a situation in which all logs of Tx3 and Tx1 and only some logs of Tx2 are flushed to the disk is exemplified. exemplify the situation

도 3b를 참조하면, 액티브 노드에서 Tx2, Tx4에 대한 커밋 로그가 디스크에 반영되기 전에 장애가 발생하여 메모리에 기록된 로그들이 유실되므로, 시스템이 재구동되면, Tx2는 롤백되어 사라지며, Tx4는 존재하지 않았던트랜잭션으로 인식되어, Tx2 및 Tx4가 손실되는 상황이 발생한다. 또한 이로 인해, 액티브 노드와 스탠바이 노드 간에 데이터 불일치가 야기될 수 있다. 이는 메인메모리 데이터베이스 관리 시스템에서 메모리 상의 커밋을지원하기 때문에 발생하는 문제점이다.Referring to FIG. 3B , a failure occurs before the commit logs for Tx2 and Tx4 in the active node are reflected on the disk, and the logs recorded in the memory are lost. It is recognized as a transaction that has not been done, and a situation in which Tx2 and Tx4 are lost occurs. Also, this may cause data inconsistency between the active node and the standby node. This is a problem that occurs because the main memory database management system supports commits in memory.

도 3c는 도 3a에 예시된 상황에서 스탠바이 노드에 장애가 발생한 상황을 예시한다.FIG. 3C illustrates a situation in which a failure occurs in the standby node in the situation illustrated in FIG. 3A .

도 3c를 참조하면, 스탠바이 노드에서도 액티브 노드의 장애 발생 상황과 마찬가지로, 스탠바이 노드에서 Tx2’, Tx4’에 대한 커밋 로그가 디스크에 반영되기 전에 장애가 발생하여 메모리에 기록된 로그들이 유실되므로, 시스템이 재구동되면, Tx2’는 취소(Undo)되어 사라지며, Tx4’는 메모리의 로그 버퍼에 어떠한 로그도 기록되어 있지 않으므로, 액티브 노드와 마찬가지로, Tx2’및 Tx4’가 손실되는 상황이 발생한다.Referring to FIG. 3C , in the standby node, similarly to the occurrence of a failure in the active node, a failure occurs before the commit logs for Tx2' and Tx4' in the standby node are reflected on the disk, and the logs recorded in the memory are lost. When it is restarted, Tx2' is undone and disappears, and since no log is recorded in the log buffer of memory, Tx2' and Tx4' are lost like the active node.

또한, 시스템이 재구동되어 복원 프로세스가 진행된 후에 액티브 노드가 스탠바이 노드로 연결을 시도하게되고, 그 연결에 성공하면, 액티브 노드는 이전에 복제되었던 로그 후의 로그부터 다시 복제를 수행하게 된다.Also, after the system is restarted and the restoration process is performed, the active node attempts to connect to the standby node. If the connection is successful, the active node replicates the log again from the log after the previously replicated log.

즉, 액티브 노드는 Tx2, Tx4에 속하는 로그를 모두 전송하였고, 스탠바이 노드에서 모두 커밋이 된 것으로 인식하여 복제 수행 시점이 Tx4 후의 시점으로 설정되어 있는 상태가 될 것이며, 따라서, 액티브 노드는 이미 복제된 Tx2, Tx4에 속하는 로그들을 다시 전송하지 않게 되어, 액티브 노드와 스탠바이 노드 간에 데이터 불일치가발생하게 된다. 이 역시 메인메모리 데이터베이스 관리 시스템에서 메모리 상의 커밋을 지원하기 때문에 발생하는 문제점이다. 따라서, 본 실시예에서는 스탠바이 노드가 디스크에 반영이 된 로그들의 식별번호를 주기적으로액티브 노드에 보고하도록 하고, 액티브 노드는 스탠바이 노드의 장애를 인지하면, 보고된 로그 후의 로그부터다시 복제를 수행하도록 함으로써, 이러한 문제점을 해결하고 있다.That is, the active node has transmitted all of the logs belonging to Tx2 and Tx4, and the standby node recognizes that both have been committed, and the replication execution time is set to a time point after Tx4. Logs belonging to Tx2 and Tx4 are not transmitted again, resulting in data inconsistency between the active node and the standby node. This is also a problem that occurs because the main memory database management system supports commits in memory. Therefore, in this embodiment, the standby node periodically reports the identification numbers of the logs reflected on the disk to the active node, and when the active node recognizes the failure of the standby node, replication is performed again from the log after the reported log. By doing so, these problems are solved.

도 3d는 도 3b에 예시된 상황에서 본 발명에 따른 데이터 관리 방법을 통해 데이터 불일치를 해결하는 과정을예시한다.Fig. 3d illustrates a process of resolving data inconsistency through the data management method according to the present invention in the situation illustrated in Fig. 3b.

도 3d를 참조하면, 본 실시예에 따른 스탠바이 노드는 액티브 노드의 데이터베이스 로그와 이를 복제한 로그를기초로 수행된 트랜잭션에 따라 로깅된 스탠바이 노드의 복제 로그 각각의 식별번호를 매핑하여 이를 트랜잭션단위로 저장하는 트랜잭션 매핑 테이블을 생성한다.Referring to FIG. 3D , the standby node according to the present embodiment maps the identification number of each replication log of the standby node logged according to the transaction performed based on the database log of the active node and the replicated log, and maps it to a transaction unit. Create a transaction mapping table to store.

본 실시예에 따른 트랜잭션 매핑 테이블에서는 트랜잭션에 속하는 모든 로그의 식별번호들을 저장하지 않고, 트랜잭션의 시작 로그 및 커밋 로그들의 식별번호들을 저장하는 형태로 예시되었으나, 이는 하나의 실시예에 불과하며, 본 발명은 이를 한정하지는 않는다.In the transaction mapping table according to this embodiment, the identification numbers of all logs belonging to the transaction are not stored, but the identification numbers of the start log and the commit log of the transaction are exemplified, but this is only one embodiment. The invention does not limit this.

액티브 노드에 장애가 발생하여 7번 데이터베이스 로 후에 기록된 로그 및 트랜잭션 Tx2, Tx4가 모두 유실된경우에, 본 실시예에 따른 액티브 노드는 최후복원로그의 식별번호가 6이라는 메시지를 스탠바이 노드에 전송하고, 이를 수신한 스탠바이 노드는 6번 다음의 데이터베이스 로그인 7, 8, 9번 데이터베이스 로그가 속하는 트랜잭션 Tx2, Tx4를 검출하여, 여기에 속하는 로그들의 복제 로그를 액티브 노드로 전송하여, 액티브 노드가 이를기초로 데이터베이스를 복구하고, 스탠바이 노드와의 데이터 불일치를 해결할 수 있게 지원한다.When the active node fails and all logs and transactions Tx2 and Tx4 recorded later in database 7 are lost, the active node according to this embodiment transmits a message that the identification number of the last restoration log is 6 to the standby node, , the standby node that has received this detects the transactions Tx2 and Tx4 to which the database log 7, 8, and 9 following database log 6 belong, and transmits the replication log of the logs belonging to this to the active node, and the active node based it to recover the database, and to resolve data inconsistencies with the standby node.

이처럼, 본 발명에 따르면, 액티브 노드 및 스탠바이 노드 중 어느 하나의 노드에 예기치 못한 장애 발생시, 다른 노드에 이중화된 정보를 이용하여 장애가 발생한 노드의 데이터 복구를 지원함으로써, 트랜잭션 손실에 의한데이터 불일치를 방지할 수 있으며, 사용자의 추가적인 개입이 없이도 데이터 일관성을 유지할 수 있게 되며,궁극적으로는 메인메모리 데이터베이스 관리 시스템에서의 트랜잭션의 지속성을 보장할 수 있게 된다.As such, according to the present invention, when an unexpected failure occurs in any one of the active node and the standby node, data inconsistency due to transaction loss is prevented by supporting data recovery of the failed node using information duplicated in other nodes. data consistency can be maintained without additional user intervention, and ultimately, the continuity of transactions in the main memory database management system can be guaranteed.

본 발명에 따른 메인메모리 데이터베이스 관리 시스템의 데이터베이스 관리방법은 또한 컴퓨터로 읽을 수 있는기록매체에 컴퓨터가 읽을 수 있는 코드로서 구현하는 것이 가능하다. 컴퓨터가 읽을 수 있는 기록매체는 컴퓨터 시스템에 의해 읽혀질 수 있는 데이터가 저장되는 모든 종류의 기록장치를 포함한다. 컴퓨터가 읽을 수 있는기록매체의 예로는 ROM, RAM, CD-ROM, 자기 테이프, 플로피 디스크, 광데이터 저장장치 등이 있으며, 또한 케리어 웨이브(예를 들어 인터넷을 통한 전송)의 형태로 구현되는 것도 포함한다. 또한, 컴퓨터가 읽을 수 있는 기록매체는 네트워크로 연결된 컴퓨터 시스템에 분산되어, 분산방식으로 컴퓨터가 읽을 수 있는 코드가 저장되고실행될 수 있다. 그리고, 본 발명을 구현하기 위한 기능적인(functional) 프로그램, 코드 및 코드 세그먼트들은본 발명이 속하는 기술분야의 프로그래머들에 의해 용이하게 추론될 수 있다.The database management method of the main memory database management system according to the present invention can also be implemented as computer-readable codes on a computer-readable recording medium. The computer-readable recording medium includes all types of recording devices in which data that can be read by a computer system is stored. Examples of computer-readable recording media include ROM, RAM, CD-ROM, magnetic tape, floppy disk, optical data storage device, etc. include In addition, the computer-readable recording medium is distributed in a computer system connected through a network, so that the computer-readable code can be stored and executed in a distributed manner. In addition, functional programs, codes, and code segments for implementing the present invention can be easily inferred by programmers in the art to which the present invention pertains.

본 발명은 첨부된 도면에 도시된 일 실시예를 참고로 설명되었으나, 이는 예시적인 것에 불과하며, 당해 기술분야에서 통상의 지식을 가진 자라면 이로부터 다양한 변형 및 균등한 타 실시예가 가능하다는 점을 이해할 수 있을 것이다. 따라서, 본 발명의 진정한 보호 범위는 첨부된 청구 범위에 의해서만 정해져야 할 것이다.Although the present invention has been described with reference to one embodiment shown in the accompanying drawings, this is merely exemplary, and those skilled in the art will appreciate that various modifications and equivalent other embodiments are possible therefrom. you will understand Accordingly, the true scope of protection of the present invention should be defined only by the appended claims.

Claims (3)

액티브 노드와 스탠바이 노드로 이중화된 메인메모리 데이터베이스 관리 시스템의 액티브 노드의 데이터베이스 관리 장치에 있어서,
상기 액티브 노드의 메모리의 로그버퍼에, 시계열적으로 식별번호가 할당된 데이터베이스 로그를 기록하는 메모리로깅부;
상기 기록된 데이터베이스 로그를 상기 스탠바이 노드로 복제하는 복제부;
상기 데이터베이스 로그의 복제 및 상기 데이터베이스 로그가 포함되는 트랜잭션의 커밋과 독립적으로 상기 데이터베이스 로그를 주기적으로 상기 액티브 노드의 디스크에 저장하는 디스크저장부; 및
상기 액티브 노드의 장애 발생시 상기 액티브 노드의 디스크에 저장되어 유실되지 않은 데이터베이스 로그를 기초로 상기 액티브 노드의 데이터베이스를 복원하고, 마지막으로 복원된 최후복원로그의 식별번호를 상기 스탠바이 노드로 전송하고, 상기 스탠바이 노드로부터 상기 최후복원로그 후에 기록된 유실로그를 포함하는 트랜잭션에 속하는 적어도 하나 이상의 모든 복제 로그를 수신하여, 상기 수신된 복제 로그를 기초로 상기 액티브 노드의 메모리에서는 커밋되었으나 상기 액티브 노드의 디스크에 저장되기 전에 유실된 트랜잭션을 복구하는 복구부를 포함하고,
상기 복제 로그는 상기 스탠바이 노드에서 상기 복제받은 데이터베이스 로그를 기초로 수행된 트랜잭션의 처리중에 발생한 데이터베이스 변경을 상기 스탠바이 노드의 메모리의 로그 버퍼에 기록한 것이고, 상기 데이터베이스의 로그의 식별번호와 별도로 할당된 식별번호를 갖는 것을 특징으로 하는 액티브 노드의 데이터베이스 관리장치.
In the database management apparatus of the active node of the main memory database management system duplicated into an active node and a standby node,
a memory logging unit for recording, in a log buffer of the memory of the active node, a database log to which identification numbers are assigned in time series;
a replication unit for replicating the recorded database log to the standby node;
a disk storage unit for periodically storing the database log on the disk of the active node independently of replication of the database log and the commit of a transaction including the database log; and
When the failure of the active node occurs, the database of the active node is restored based on the database log stored on the disk of the active node and not lost, and the identification number of the last restored log is transmitted to the standby node, and the Receives from the standby node at least one or more all replication logs belonging to a transaction including the loss log recorded after the last restoration log, and is committed in the memory of the active node based on the received replication log but is stored on the disk of the active node. and a recovery unit to recover lost transactions before they are saved;
The replication log records database changes occurring during the processing of a transaction performed based on the replicated database log in the standby node in a log buffer of the standby node's memory, and an identification assigned separately from the identification number of the log of the database. Database management device of the active node, characterized in that it has a number.
제1항에 있어서,
상기 데이터베이스 로그의 식별번호는 시계열적으로 증가하도록 할당되고,
상기 유실 로그는 상기 최후복원로그의 식별번호보다 큰 식별번호를 갖는데이터베이스 로그인 것을 특징으로하는 액티브 노드의 데이터베이스 관리 장치.
The method of claim 1,
The identification number of the database log is assigned to increase in time series,
The database management apparatus of an active node, characterized in that the lost log is a database login having an identification number greater than the identification number of the last restoration log.
제1항에 있어서,
상기 스탠바이 노드로부터 주기적으로 상기 스탠바이 노드의 디스크에 저장된 복제 로그에 대응하는 데이터베이스 로그의 식별번호를 보고받아, 상기 스탠바이 노드의 장애 발생시, 상기 보고받은 식별번호 중 마지막으로 수신된 식별번호의 데이터베이스 로그 후에 기록된 데이터베이스 로그들을 상기 스탠바이 노드로 복제하여 상기 스탠바이 노드의 데이터베이스를 복구하는 복구정보 관리부를 더 포함하는 것을 특징으로 하는 액티브 노드의 데이터베이스 관리 장치.
The method of claim 1,
The standby node periodically reports the identification number of the database log corresponding to the replication log stored on the disk of the standby node, and when the standby node fails, after the database log of the last received identification number among the reported identification numbers The apparatus for managing the database of an active node according to claim 1, further comprising: a recovery information manager configured to replicate recorded database logs to the standby node and restore the database of the standby node.
KR1020200074558A 2020-06-18 2020-06-18 Database management devices and methods for active and standby nodes in the main memory database management system KR20210156680A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020200074558A KR20210156680A (en) 2020-06-18 2020-06-18 Database management devices and methods for active and standby nodes in the main memory database management system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020200074558A KR20210156680A (en) 2020-06-18 2020-06-18 Database management devices and methods for active and standby nodes in the main memory database management system

Publications (1)

Publication Number Publication Date
KR20210156680A true KR20210156680A (en) 2021-12-27

Family

ID=79177320

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020200074558A KR20210156680A (en) 2020-06-18 2020-06-18 Database management devices and methods for active and standby nodes in the main memory database management system

Country Status (1)

Country Link
KR (1) KR20210156680A (en)

Similar Documents

Publication Publication Date Title
KR101352959B1 (en) Apparatus and method for database management in active and standby nodes of main memory database management system
US11256715B2 (en) Data backup method and apparatus
US6934877B2 (en) Data backup/recovery system
US7330859B2 (en) Database backup system using data and user-defined routines replicators for maintaining a copy of database on a secondary server
US5440727A (en) Asynchronous replica management in shared nothing architectures
US5615329A (en) Remote data duplexing
US7143249B2 (en) Resynchronization of mirrored storage devices
US7577788B2 (en) Disk array apparatus and disk array apparatus control method
EP0902923B1 (en) Method for independent and simultaneous access to a common data set
US5682513A (en) Cache queue entry linking for DASD record updates
US5504861A (en) Remote data duplexing
JP4477950B2 (en) Remote copy system and storage device system
US6983295B1 (en) System and method for database recovery using a mirrored snapshot of an online database
US7610318B2 (en) Autonomic infrastructure enablement for point in time copy consistency
US7913046B2 (en) Method for performing a snapshot in a distributed shared file system
US7457830B1 (en) Method and system of replicating data using a recovery data change log
US20050038968A1 (en) Multi-site remote-copy system
US7761431B2 (en) Consolidating session information for a cluster of sessions in a coupled session environment
JP2005242403A (en) Computer system
EP1209569A1 (en) Data backup/recovery system
CN110121694B (en) Log management method, server and database system
CN111752892B (en) Distributed file system and implementation method, management system, equipment and medium thereof
KR20210156680A (en) Database management devices and methods for active and standby nodes in the main memory database management system
CN110121712A (en) A kind of blog management method, server and Database Systems
KR100503899B1 (en) Database replication system and the replication method