KR102049417B1 - Data storing and restoring method based on In-memory database using NVDIMM - Google Patents

Data storing and restoring method based on In-memory database using NVDIMM Download PDF

Info

Publication number
KR102049417B1
KR102049417B1 KR1020180035929A KR20180035929A KR102049417B1 KR 102049417 B1 KR102049417 B1 KR 102049417B1 KR 1020180035929 A KR1020180035929 A KR 1020180035929A KR 20180035929 A KR20180035929 A KR 20180035929A KR 102049417 B1 KR102049417 B1 KR 102049417B1
Authority
KR
South Korea
Prior art keywords
database
data
nvdimm
main memory
undo
Prior art date
Application number
KR1020180035929A
Other languages
Korean (ko)
Other versions
KR20190113359A (en
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 KR1020180035929A priority Critical patent/KR102049417B1/en
Publication of KR20190113359A publication Critical patent/KR20190113359A/en
Application granted granted Critical
Publication of KR102049417B1 publication Critical patent/KR102049417B1/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/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/40Information retrieval; Database structures therefor; File system structures therefor of multimedia data, e.g. slideshows comprising image and additional audio data
    • G06F16/41Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]

Abstract

본 발명은 인-메모리 데이터베이스에 관한 것으로, 보다 상세하게는 메인 메모리를 비휘발성 저장매체인 NVDIMM(Non Volatile Dual In-line Memory Module)으로 구현하고, 데이터 복구시 메인 메모리에 저장된 데이터베이스 이미지와 UNDO 로그만을 사용함으로써, 보다 신속하게 데이터 복원 작업을 수행함은 물론, 디스크 I/O를 최소화하여 시스템 성능을 향상시킬 수 있도록 해 주는 기술에 관한 것이다.
본 발명에 따른 NVDIMM을 이용한 인-메모리 데이터베이스 기반의 데이터 저장 및 복원 방법은 운영장치에서 NVDIMM 으로 이루어지는 메인 메모리에 데이터를 저장함과 더불어, 변경 데이터에 대응되는 트랜잭션의 UNDO 로그만을 디스크에 적재하되, UNDO 로그에는 해당 UNDO 대상 데이터가 저장되는 NVDIMM의 위치정보를 추가로 기록하여 저장하는 데이터베이스 저장 단계와, 시스템 복구시 메인 메모리에 최종 저장된 작업 페이지를 캡쳐하여 데이터베이스 이미지를 획득하고, UNDO 로그에 포함된 NVDIMM의 위치정보를 근거로 데이터베이스 이미지의 최종 작업 위치에 대응되는 트랜잭션 UNDO 로그정보를 디스크에서 획득함으로써, 메인 메모리에서 획득한 데이터베이스 이미지와 UNDO 로그를 이용하여 데이터 복원처리를 수행하는 데이터베이스 복원단계를 포함하여 구성되는 것을 특징으로 한다.
The present invention relates to an in-memory database. More specifically, the main memory is implemented as a non-volatile storage medium (Non Volatile Dual In-line Memory Module), and a database image and UNDO log stored in the main memory during data recovery. By using only, it is possible to perform data restoration more quickly, as well as a technology that can improve system performance by minimizing disk I / O.
In the in-memory database-based data storage and restore method using the NVDIMM according to the present invention, in addition to storing the data in the main memory consisting of NVDIMM in the operating device, the UNDO log of the transaction corresponding to the change data is loaded on the disk, UN In the DO log, the database storage step of additionally recording and storing the location information of the NVDIMM in which the corresponding UNDO target data is stored, and capturing a database image by capturing the last working page stored in main memory during system recovery, is included in the UNDO log. A database restoration step of performing data restoration processing by using the database image obtained from main memory and the UNDO log by acquiring transaction UNDO log information corresponding to the final working position of the database image from the disk based on the location information of the NVDIMM; So It is characterized in that the configuration.

Description

NVDIMM을 이용한 인-메모리 데이터베이스 기반의 데이터 저장 및 복원 방법{Data storing and restoring method based on In-memory database using NVDIMM}Data storing and restoring method based on In-memory database using NVDIMM}

본 발명은 인-메모리 데이터베이스에 관한 것으로, 보다 상세하게는 메인 메모리를 비휘발성 저장매체인 NVDIMM(Non Volatile Dual In-line Memory Module)으로 구현하고, 데이터 복구시 메인 메모리에 저장된 데이터베이스 이미지와 UNDO 로그만을 사용함으로써, 보다 신속하게 데이터 복원 작업을 수행함은 물론, 디스크 I/O를 최소화하여 시스템 성능을 향상시킬 수 있도록 해 주는 기술에 관한 것이다. The present invention relates to an in-memory database. More specifically, the main memory is implemented as a non-volatile storage medium (Non Volatile Dual In-line Memory Module), and a database image and UNDO log stored in the main memory during data recovery. By using only, it is possible to perform data restoration more quickly, as well as a technology that can improve system performance by minimizing disk I / O.

빅데이터의 등장에 따른 데이터량의 증가, 빠른 분석 처리에 대한 요구사항이 증대되면서 인-메모리 데이터베이스에 대한 연구가 활발히 진행되고 있다.As the demand for big data increases and rapid analysis processing increases, the research on in-memory database is actively being conducted.

인-메모리 데이터베이스(In-Memory Database)는 메인 메모리에 영구적인 데이터베이스를 구축 및 관리하는 데이터베이스이다. 즉, 데이터베이스의 일부 또는 전부를 메인 메모리에서 관리함으로써, 디스크에 대한 접근 없이 메모리 접근만으로 직접 데이터를 처리하여 효율적인 트랜잭션 처리를 가능하게 하는 기술이다.In-Memory Database is a database that builds and manages a permanent database in main memory. In other words, by managing part or all of the database in the main memory, it is a technology that enables efficient transaction processing by processing data directly with only memory access without access to the disk.

일반적으로 데이터베이스 관리 시스템(DBMS)은 데이터베이스의 안정성을 보장하기 위해 데이터 변경에 대한 로깅을 수행한다. 로깅(Logging)이란 발생하는 데이터의 삽입/삭제/변경을 디스크와 같이 안전한 저장 장치(stable storage)에 실시간으로 기록함으로써, 장애 발생시 이를 활용하여 최종의 데이터베이스 상태로 되돌리기 위한 DBMS의 기본 기능이다. In general, a database management system (DBMS) performs logging of data changes to ensure the stability of the database. Logging is the basic function of DBMS to record the insertion / deletion / change of the data in real time in a safe storage such as disk, and to utilize it in case of failure to return to the final database state.

인-메모리 데이터베이스는 휘발성 메모리를 메인 메모리로 이용하여 데이터베이스를 구축하기 때문에, 장애가 발생하면 메인 메모리에 저장된 데이터가 유실되므로 영속성 보장을 위해 필연적으로 로깅 수행에 따른 디스크 I/O가 발생된다.Since in-memory database is built using volatile memory as main memory, if a failure occurs, the data stored in main memory is lost. Therefore, disk I / O is inevitable due to logging.

도1은 인-메모리 데이터베이스 시스템의 구조를 설명하기 위한 도면으로, 운영장치(10)와 RAM 과 같은 휘발성 저장매체로 이루어지는 메인 메모리(20) 및 디스크(30)를 포함한다. 1 is a view for explaining the structure of an in-memory database system, and includes an operating device 10 and a main memory 20 and a disk 30 formed of a volatile storage medium such as a RAM.

운영장치(10)는 기본적으로 데이터를 메인 메모리(20)에 저장함과 더불어, 데이터 변경시 변경된 기록을 디스크(30)로 내려쓰는 로깅 작업을 진행하고, 일정 주기로 메인 메모리(20)상에 저장된 데이터(백업용 데이터)를 디스크(30)로 내려쓰는 체크 포인트 작업을 수행함으로써, 데이터베이스의 성능을 유지하면서 데이터를 보존한다. The operating device 10 basically stores the data in the main memory 20, and also performs a logging operation to write down the changed record when the data is changed to the disk 30, and the data stored on the main memory 20 at regular intervals. By performing a checkpoint operation that writes down the backup data to the disk 30, the data is preserved while maintaining the performance of the database.

이때, 로깅 작업은 메인 메모리(20)에 데이터의 작업 상태에 대응하여 재실행을 위한 REDO 로그와 되돌리기를 위한 UNDO 로그를 자동 생성하여 디스크(30)에 저장한다. At this time, the logging operation automatically generates a redo log for redo and an UNDO log for reversion in the main memory 20 in response to the working state of the data, and stores them in the disk 30.

또한, 통상적인 종료 또는 장애 발생으로 인한 종료 후 재가동시 운영장치(10)는 체크 포인트로 저장된 마지막 상태의 백업용 데이터를 메인 메모리에 적재한 후 변경 기록인 로그를 통해 마지막 체크포인트 이후 발생한 변경 내용을 반영함으로써, 데이터베이스가 종료되기 직전 마지막 상태로 복원한다. 이는 트랜잭션이 성공적으로 완료되면(COMMIT), 어떠한 시스템 오류에도 트랜잭션 처리 결과는 데이터베이스에 반영됨을 보장해야 한다는 데이터베이스의 지속성(durability)을 보장하기 위한 것이다. In addition, when restarting after the shutdown due to a normal shutdown or failure, the operating device 10 loads the backup data of the last state stored as a checkpoint in the main memory, and then changes the changes that have occurred since the last checkpoint through a log that is a change record. By reflecting, you restore the last state just before the database shuts down. This is to ensure the durability of the database that once a transaction is successfully completed (COMMIT), it should ensure that the transaction processing results are reflected in the database under any system error.

이때, 운영장치(10)는 사용자가 저장을 완료한 로그(REDO)와 저장을 취소한 로그(UNDO)를 따로 유지하여 마지막 체크포인트 이후에 발생한 일련의 작업을 역순으로 수행하여 복구한다.At this time, the operating apparatus 10 maintains the log (REDO) and the log cancel (UNDO) that the user has completed the storage separately to perform a series of operations occurring since the last checkpoint in the reverse order to recover.

도2는 일반적인 인-메모리 데이터베이스에서의 데이터 복원 과정을 설명하기 위한 도면으로, (A)는 종료 직전 구동중인 상태의 데이터베이스 이미지이고, (B)는 재구동 상태의 데이터베이스 이미지이며, (C)는 복구된 상태의 데이터베이스 이미지이다.2 is a view for explaining a data restoration process in a general in-memory database, (A) is a database image of the driving state just before termination, (B) is a database image of the redrive state, (C) Database image in a restored state.

도2를 참조하면, (A)는 데이터베이스의 종료 직전 데이터베이스 이미지로서, 시스템 장애로 데이터베이스가 종료된 상태를 나타낸다. 즉, 메인 메모리(20)에 작업중인 데이터에 대한 UNDO 대상 데이터와 REDO 대상 데이터가 존재한다. Referring to FIG. 2, (A) is a database image immediately before the termination of the database, and shows a state in which the database is terminated due to a system failure. That is, the UNDO target data and the REDO target data for the working data exist in the main memory 20.

이때, 백업용 데이터(31)는 이전 저장 상태, 즉 커밋된 상태의 데이터까지 저장되는 바, 백업용 데이터(31)에 최종적으로 저장된 데이터베이스 이미지는 (B)와 같이 UNDO 대상 데이터와 RE 대상 데이터가 손실된 상태가 된다.At this time, the backup data 31 is stored in the previous storage state, that is, the data of the committed state, the database image finally stored in the backup data 31 is the UNDO target data and RE target data as shown in (B) is lost It becomes a state.

이에, 운영장치는 REDO 로그를 이용하여 REDO 데이터 영역에 대한 복원처리를 수행한 후, UNDO 로그를 이용하여 종료 바로 직전 트랜잭션 상태로 되돌림으로써, (C)와 같이 종료 직전 수행 완료된 상태로 데이터베이스 이미지를 복원한다.Accordingly, the operating apparatus restores the REDO data area using the REDO log, and then returns to the transaction state just before the termination using the UNDO log, thereby restoring the database image to the state of completion just before the termination as shown in (C). Restore

따라서, 종래 인-메모리 시스템에서는 도1과 같이 디스크(20)에 백업용 데이터(31)와 REDO 로그(32) 및 UNDO 로그(33)를 각각 저장하여야 하는 바, 많은 수의 디스크 I/O가 필수적으로 발생된다. Therefore, in the conventional in-memory system, as shown in FIG. 1, the backup data 31, the REDO log 32, and the UNDO log 33 must be stored in the disk 20, respectively, and a large number of disk I / Os are essential. Is caused by.

그러나, 속도가 가장 느린 매체인 디스크로의 I/O의 발생은 데이터베이스 구동에 지연 시간을 발생시키고, 결과적으로 시스템 전체 성능을 저하시키는 문제를 야기한다. However, the generation of I / O to the disk, which is the slowest medium, introduces a delay in running the database, resulting in a problem of degrading the overall system performance.

선행문헌 1(한국공개특허 제10-2017-0089194호)에는 메인 메모리로 사용되는 메모리 디스크와 주변 장치들을 제어하는 디바이스 드라이브와 상기 메모리 디스크에서 작업한 테이블을 임시로 백업하는 NVDIMM과 상기 NVDIMM의 데이터를 영구히 저장하는 HDD/SDD를 포함하는 비휘발성 듀얼 인라인 메모리모듈(NVDIMM)을 이용한 메모리 디스크 구성장치가 개시되어 있다.Prior Art 1 (Korean Patent Publication No. 10-2017-0089194) discloses a NVDIMM for temporarily backing up a device drive for controlling a memory disk and peripheral devices used as main memory and a table working on the memory disk, and data of the NVDIMM. Disclosed is a memory disk configuration apparatus using a nonvolatile dual inline memory module (NVDIMM) including an HDD / SDD for permanently storing the data.

그러나, 상기한 선행문헌1은 데이터 읽기/쓰기 속도가 느린 HDD/SDD 사용을 일부 NVDIMM으로 이전함으로써, 디스크의 읽기/쓰기 성능을 향상시키는 것으로, 이러한 구성에서도 종래와 마찬가지로 데이터 복원을 위해서는 백업용 데이터와 REDO 로그가 필수적으로 요구되기 때문에, 이에 따른 시스템 성능 저하의 문제는 여전히 존재하게 된다.However, the aforementioned document 1 improves the read / write performance of the disk by transferring the use of HDD / SDD with a slow data read / write speed to some NVDIMMs. Since REDO logs are required, there is still a problem of system performance.

1. 한국공개특허 제10-2017-0089194호 (명칭 : 비휘발성 듀얼 인라인 메모리모듈(NVDIMM)을 이용한 메모리 디스크 구동방법 및 장치)1. Korean Patent Publication No. 10-2017-0089194 (Name: Memory disk driving method and apparatus using a nonvolatile dual inline memory module (NVDIMM))

이에, 본 발명은 상기한 사정을 감안하여 창출된 것으로, 비휘발성 저장 매체인 NVDIMM(Volatile Dual In-line Memory Module)를 메인 메모리로 구성하여 데이터베이스를 구축하고, UNDO 로그만을 디스크에 로깅하여 디스크 I/O를 최소화하면서도 데이터에 대한 영속성을 안정적으로 보장하고, 신속하게 데이터 복원 작업을 수행할 수 있도록 해 주는 NVDIMM을 이용한 인-메모리 데이터베이스 기반의 데이터 저장 및 복원 방법을 제공함에 그 기술적 목적이 있다. Accordingly, the present invention has been made in view of the above-described circumstances, and a database is constructed by configuring a NVDIMM (Volatile Dual In-line Memory Module) as a nonvolatile storage medium as a main memory, and logging only UNDO logs to disk to disk I Its technical objective is to provide an in-memory database-based data storage and retrieval method using NVDIMM that can reliably guarantee data persistence while minimizing / O and to perform data restoration operations quickly.

상기 목적을 달성하기 위한 본 발명의 일측면에 따르면, 운영장치에서 비휘발성 메모리인 NVDIMM(Non Volatile Dual In-line Memory Module)으로 이루어지는 메인 메모리에 데이터를 저장함과 더불어, 변경 데이터에 대응되는 트랜잭션의 UNDO 로그만을 디스크에 적재하되, UNDO 로그에는 해당 UNDO 대상 데이터에 대응되는 NVDIMM의 위치정보를 추가로 기록하여 저장하는 데이터베이스 저장 단계와, 운영장치에서 시스템 복구시 메인 메모리에 최종 저장된 정보와 디스크에 저장된 UNDO 로그만을 이용하여 데이터 복원처리를 수행하는 데이터베이스 복원단계를 포함하여 구성되되, 상기 데이터베이스 복원단계는 메인 메모리에 최종 저장된 REDO 대상 데이터와 UNDO 대상 데이터를 포함하는 작업 페이지를 캡쳐하여 데이터베이스 이미지를 획득하고, 이를 데이터베이스 복원처리를 위한 백업용 데이터로 설정하는 제1 단계와, 백업용 데이터에서 REDO 대상 데이터에 대해서는 복원작업을 수행하지 않고, UNDO 로그에 포함된 NVDIMM의 위치정보를 근거로 백업용 데이터의 최종 작업 위치에 대응되는 트랜잭션 UNDO 로그정보를 디스크에서 획득함으로써 UNDO 대상 데이터에 대해서만 UNDO 로그를 이용하여 이전 커밋된 상태로의 되돌리기 복원작업을 수행하는 제2 단계를 포함하여 구성되는 것을 특징으로 하는 NVDIMM을 이용한 인-메모리 데이터베이스 기반의 데이터 저장 및 복원 방법이 제공된다. According to an aspect of the present invention for achieving the above object, in addition to storing data in the main memory consisting of non-volatile memory nonvolatile memory (NVDIMM) in the operating device, the transaction corresponding to the change data Only load UNDO logs to disk, but UNDO In the log, the database storage step of additionally recording and storing the location information of NVDIMM corresponding to the target UNDO target data, and the data restoration process using only the last stored information in main memory and the UNDO log stored on disk during system recovery by the operating system The database restoration step includes performing a database restoration step, wherein the database restoration step captures a work page including REDO target data and UNDO target data finally stored in main memory to obtain a database image, and backs up data for database restoration processing. In the first step of setting the backup data and the backup target data, REDO target data is not restored, and transaction UNDO log information corresponding to the final working position of the backup data is stored based on the location information of the NVDIMM included in the UNDO log. Obtained from The method for storing and restoring data based on in-memory database using NVDIMM is configured to include a second step of performing a restore operation to a previously committed state by using an UNDO log only for UNDO target data. Is provided.

또한, 상기 데이터베이스 저장단계는 메인 메모리가 RAM 슬롯에 장착된 상태에서, 운영장치는 DAX 모드로 활성화되어 메인 메모리에 직접 액세스하도록 동작되는 것을 특징으로 하는 NVDIMM을 이용한 인-메모리 데이터베이스 기반의 데이터 저장 및 복원 방법이 제공된다.In addition, the database storage step is in the state that the main memory is mounted in the RAM slot, the operating device is activated in the DAX mode to operate the in-memory database-based data storage using NVDIMM, characterized in that to operate directly A restoration method is provided.

본 발명에 의하면 메인 메모리를 비휘발성 저장매체인 NVDIMM로 구성하고, NVDIMM에 저장된 최종 저장 상태의 데이터베이스 이미지를 그대로 복원용 데이터로 이용하기 때문에 REDO 로그에 대한 복원이 불필요하여 보다 신속하게 데이터 복원 작업을 수행할 수 있음은 물론, UNDO 로그를 디스크에 저장하기 위한 최소의 디스크 I/O 만을 발생시킴으로써, 시스템 전체 성능을 향상시키는 것이 가능하다.According to the present invention, since the main memory is composed of NVDIMM, which is a nonvolatile storage medium, and the database image of the last storage state stored in the NVDIMM is used as the data for restoring as it is, restoring of the redo log is unnecessary, so that data restoration can be performed more quickly. Not only can it be done, it is possible to improve system-wide performance by generating only a minimum disk I / O for storing UNDO logs on disk.

도1은 일반적인 인-메모리 데이터베이스 시스템의 구조를 설명하기 위한 도면.
도2는 도1에 도시된 인-메모리 데이터베이스 시스템에서의 데이터 복원 과정을 설명하기 위해 예시한 도면.
도3은 본 발명이 적용되는 NVDIMM을 이용한 인-메모리 데이터베이스 시스템의 구성을 설명하기 위한 도면.
도4는 본 발명의 제1 실시예에 따른 NVDIMM을 이용한 인-메모리 데이터베이스 기반의 데이터 저장 및 복원 과정을 설명하기 위한 도면
도5는 도4에서 데이터 복원 과정을 설명하기 위해 예시한 도면.
1 is a diagram for explaining the structure of a general in-memory database system.
FIG. 2 is a diagram for explaining a data restoration process in the in-memory database system shown in FIG.
3 is a diagram for explaining the configuration of an in-memory database system using NVDIMM to which the present invention is applied;
4 is a diagram illustrating an in-memory database-based data storage and restoration process using NVDIMMs according to a first embodiment of the present invention.
FIG. 5 is a diagram for explaining a data restoration process in FIG. 4; FIG.

이하에서는 첨부된 도면을 참조하여 본 발명을 보다 상세하게 설명한다. 도면들 중 동일한 구성요소들은 가능한 한 어느 곳에서든지 동일한 부호로 나타내고 있음을 유의해야 한다. 한편, 이에 앞서 본 명세서 및 특허청구범위에 사용된 용어나 단어는 통상적이거나 사전적인 의미로 한정해서 해석되어서는 아니 되며, 발명자는 그 자신의 발명을 가장 최선의 방법으로 설명하기 위해 용어의 개념을 적절하게 정의할 수 있다는 원칙에 입각하여 본 발명의 기술적 사상에 부합하는 의미와 개념으로 해석되어야만 한다. 따라서 본 명세서에 기재된 실시예와 도면에 도시된 구성은 본 발명의 가장 바람직한 일 실시예에 불과할 뿐이고, 본 발명의 기술적 사상을 모두 대변하는 것은 아니므로, 본 출원시점에 있어서 이들을 대체할 수 있는 다양한 균등물과 변형예들이 있을 수 있음을 이해하여야 한다.Hereinafter, with reference to the accompanying drawings will be described in detail the present invention. It should be noted that the same elements in the figures are denoted by the same reference signs wherever possible. On the other hand, the terms or words used in the present specification and claims are not to be construed as limiting the ordinary or dictionary meanings, the inventors should use the concept of the term in order to explain the invention in the best way. It should be interpreted as meanings and concepts corresponding to the technical idea of the present invention based on the principle that it can be properly defined. Therefore, the embodiments described in the present specification and the configuration shown in the drawings are only the most preferred embodiments of the present invention, and do not represent all of the technical ideas of the present invention, and various alternatives may be substituted at the time of the present application. It should be understood that there may be equivalents and variations.

도3은 본 발명이 적용되는 NVDIMM을 이용한 인-메모리 데이터베이스 시스템의 구성을 설명하기 도면이다. 3 is a view for explaining the configuration of an in-memory database system using NVDIMM to which the present invention is applied.

도3에 도시된 바와 같이 본 발명이 적용되는 NVDIMM을 이용한 인-메모리 데이터베이스 시스템은 운영장치(100)와 NVDIMM 으로 이루어지는 메인 메모리(200) 및 디스크(300)를 포함하여 구성된다. As shown in FIG. 3, the in-memory database system using the NVDIMM to which the present invention is applied includes an operating device 100 and a main memory 200 and a disk 300 formed of NVDIMMs.

본 발명에서는 메인 메모리(200)를 비휘발성 저장매체인 NVDIMM(Non Volatile Dual In-line Memory Module)로 구현하고, 디스크(300)에는 UNDO 로그만 저장되는 것이 큰 특징이다.In the present invention, the main memory 200 is implemented using a non-volatile storage medium (Non Volatile Dual In-line Memory Module), and the disk 300 stores only UNDO logs.

디스크(300)는 백업용 데이터베이스로서, 상기 메인 메모리(200)에서 트랜잭션에 의해 자동 생성되는 UNDO 로그(되돌리기 로그)만을 저장한다.The disk 300 is a backup database, and stores only the UNDO log (return log) automatically generated by a transaction in the main memory 200.

이때, 메인 메모리(200) 즉, NVDIMM은 하드웨적으로 기존 인-메모리 데이터베이스 시스템의 RAM 슬롯에 장착되어 이용될 수 있다. In this case, the main memory 200, that is, the NVDIMM may be mounted in a RAM slot of an existing in-memory database system as a hardware.

이 경우, NVDIMM를 메인 메모리로 이용하기 위해서는 기존 RAM 슬롯을 통한 NVDIMM으로의 액세스를 위해 운영장치(100)가 DAX(Direct Access Storage)모드로 활성화되어야 한다. In this case, in order to use the NVDIMM as the main memory, the operating apparatus 100 must be activated in the direct access storage (DAX) mode to access the NVDIMM through the existing RAM slot.

운영장치(100)는 데이터베이스를 전체적으로 운용하기 위한 프로세서로서, 하드웨어적으로 상기 메인 메모리(100) 내에 구비되어 인-메모리 데이터베이스 시스템을 구성할 수 있다.The operating apparatus 100 is a processor for operating the database as a whole and may be provided in the main memory 100 in hardware to form an in-memory database system.

운영장치(100)는 기본적으로 데이터를 메인 메모리(200)에 저장함과 더불어, 변경 완료된 데이터 즉, 커밋된 트랜잭션에 대한 UNDO 로그를 캡쳐하여 디스크(300)에 저장한다.The operating apparatus 100 basically stores data in the main memory 200, and captures and stores UNDO logs of the changed data, that is, the committed transactions, on the disk 300.

UNDO 로그는 변경되기 전 원래 데이터의 복사본으로서, 데이터를 변경하는 모든 트랜잭션에 대해 캡쳐되고, 적어도 트랜잭션이 종료될 때까지 보존된다. 이러한 UNDO 데이터는 읽기 일관성 및 Flashback Query 를 지원하는 것으로, 유저가 트랜잭션의 커밋(commit) 또는 롤백(rollback)을 결정하기 전에 유저 세션이 비정상적으로 종료되는 등의 이유로 트랜잭션이 실패하는 경우 실패한 트랜잭션 복원을 위해 사용된다. The UNDO log is a copy of the original data before the change, which is captured for every transaction that changes the data and is preserved at least until the transaction ends. This UNDO data supports read consistency and Flashback Query, which prevents a failed transaction recovery if a transaction fails, for example, because the user session terminates abnormally before the user decides to commit or roll back the transaction. Used for.

이때, 운영장치(100)는 메인 메모리(200)의 현재 구동 위치와 UNDO 로그간의 동기화를 위해 UNDO 로그에 UNDO 대상이 되는 데이터의 NVDIMM 위치를 기록하는 메모리 맵 매니저(110)를 구비하여 구성된다. At this time, the operating apparatus 100 is configured to include a memory map manager 110 for recording the NVDIMM position of the data to be UNDO in the UNDO log for synchronization between the current drive position of the main memory 200 and the UNDO log.

또한, 운영장치(100)는 장애 발생을 지속적으로 감시하고, 장애 발생시 또는 시스템 종료 후 재 구동시 메인 메모리(200)에 대한 복원 처리를 수행한다. In addition, the operating apparatus 100 continuously monitors the occurrence of a failure and performs a restoration process on the main memory 200 when the failure occurs or when the system is restarted after the shutdown.

이때, 운영장치(100)는 메인 메모리(200)에 저장된 종료 직전 데이터베이스 이미지와 상기 디스크(300)에 저장된 UNDO 로그를 이용하여 데이터베이스 복원처리를 수행한다. In this case, the operating apparatus 100 performs a database restoration process by using the database image immediately before the termination stored in the main memory 200 and the UNDO log stored in the disk 300.

즉, 본 발명에서는 메인 메모리(200)에 저장된 데이터베이스 이미지를 그대로 복원용 데이터베이스 이미지로 이용하는 것이 또 하나의 큰 특징이다.That is, in the present invention, another big feature is that the database image stored in the main memory 200 is used as the database image for restoration.

도4는 본 발명에 따른 NVDIMM을 이용한 인-메모리 데이터베이스 기반의 데이터 저장 및 복원 방법을 설명하기 위한 도면이다.4 is a diagram illustrating an in-memory database-based data storage and restoration method using NVDIMM according to the present invention.

본 발명은 CPU(100)가 메인 메모리(200)에 위치하는 인-메모리 데이터베이스 시스템에 적용되며, CPU(100)는 인-메모리 데이터베이스 시스템의 전반적인 제어를 수행한다.The present invention is applied to an in-memory database system in which the CPU 100 is located in the main memory 200, and the CPU 100 performs overall control of the in-memory database system.

도4를 참조하면, 인 메모리 데이터베이스 시스템은 데이터 저장과정(ST100)와, 데이터 복원과정(ST200)을 포함한다. Referring to FIG. 4, the in-memory database system includes a data storage process ST100 and a data restoration process ST200.

이때, 데이터 저장과정(ST100)은 데이터베이스의 구동에 의해 반복적으로 수행되고, 데이터 복원과정(ST200)은 장애 발생시 또는 시스템 종료 후 재 구동시에 수행된다. 이하에서는 장애 발생시 데이터 복원을 수행하는 과정으로 데이터 복원 과정을 설명한다.At this time, the data storage process ST100 is repeatedly performed by driving the database, and the data restoration process ST200 is performed when a failure occurs or when the system is restarted after the shutdown. Hereinafter, a process of restoring data when a failure occurs will be described.

데이터 저장과정(ST100)에 대해 살펴보면,Looking at the data storage process (ST100),

먼저, 운영장치(100)는 기존 RAM 슬롯에 장치된 메인 메모리(200)인 NVDIMM를 이용하기 위한 DAX 마운트 모드로 활성화된다(ST110). DAX 모드는 운영장치(100)에서 NVDIMM의 특수한 환경을 지원할 수 있도록 만들어진 통신 규약이 적용된 것으로, 운영장치(100)에서 NVDIMM 에 바이트 단위의 데이터를 직접 억세스할 수 있는 환경을 제공한다. First, the operating apparatus 100 is activated in the DAX mount mode for using the NVDIMM which is the main memory 200 installed in the existing RAM slot (ST110). DAX mode is a communication protocol applied to support the special environment of the NVDIMM in the operating device 100 is applied, and provides an environment in which the operating device 100 can directly access the data in bytes to the NVDIMM.

상기한 상태에서, 운영장치(100)는 데이터 연산 요구에 대응하여 메인 메모리(200) 즉, NVDIMM에 데이터를 저장하는 일련의 데이터 저장 작업을 수행한다(ST120). 이때, pmemory 라이브러리를 이용하여 NVDIMM 으로부터 데이터를 읽어오거나 NVDIMM에 데이터 쓰기를 수행하며, 데이터 저장은 메인 메모리(200) 즉, NVDIMM 에 데이터를 기록/수정/삭제 하는 등의 모든 데이터 변경 작업을 포함한다. In the above state, the operating apparatus 100 performs a series of data storage operations for storing data in the main memory 200, that is, NVDIMM in response to the data operation request (ST120). At this time, the data is read from the NVDIMM or the data is written to the NVDIMM using the pmemory library, and the data storage includes all data change operations such as writing / modifying / deleting data into the main memory 200, that is, the NVDIMM. .

그리고, 메인 메모리(200)의 데이터 변경에 대응하여 트랜잭션이 발생되고, 해당 트랜잭션에 포함된 각 쿼리(Query) 들이 처리될 때마다 UNDO 로그가 자동 생성되며, UNDO 로그가 디스크(300)에 저장되는 로깅 작업이 실시간 수행된다(ST130). 이때, UNDO 로그에는 UNDO 대상이 되는 데이터의 NVDIMM 위치가 자동으로 포함된 상태로 디스크(300)에 저장된다.In addition, a transaction is generated in response to a data change of the main memory 200, and an UNDO log is automatically generated whenever each query included in the transaction is processed, and the UNDO log is stored on the disk 300. Logging operation is performed in real time (ST130). At this time, the UNDO log is stored in the disk 300 with the NVDIMM location of the data subject to UNDO being automatically included.

즉, 디스크(300)에는 UNDO 로그 만이 적재된다. 이에 따라 종래 디스크에 백업용 데이터와 REDO 로그 및 UNDO 로그를 모두 적재함과 더불어, 별도의 백업용 데이터베이스 이미지를 저장하는 과정에 비해 디스크 I/O 횟수를 현격히 감소시킬 수 있다.That is, only UNDO logs are loaded on the disk 300. Accordingly, both the backup data, the REDO log, and the UNDO log are loaded on the conventional disk, and the number of disk I / Os can be significantly reduced as compared to the process of storing a separate backup database image.

이어 데이터 복원과정(ST100)에 대해 살펴보면, Next, the data restoration process (ST100) will be described.

운영장치(100)는 데이터베이스의 동작을 지속적으로 감시하고, 상술한 바와 같이 데이터 저장 과정을 수행하는 중에 장애가 발생되면(ST210), 운영장치(100)는 장애 발생 직전 상태로 저장된 메인 메모리(200)의 데이터베이스 이미지를 캡쳐하여 획득한다(ST220). 이때, 메인 메모리(200)는 비휘발성 저장매체인 NVDIMM 으로 구현되기 때문에, 장애로 인한 시스템 종료시 이전 작업 상태의 데이터가 그대로 유지된다. If the operating apparatus 100 continuously monitors the operation of the database and a failure occurs while performing the data storage process as described above (ST210), the operating apparatus 100 stores the main memory 200 stored in a state immediately before the failure occurs. Capture and obtain a database image (ST220). At this time, since the main memory 200 is implemented as NVDIMM, which is a nonvolatile storage medium, data of a previous working state is maintained as it is when the system is shut down due to a failure.

또한, 운영장치(100)는 디스크(300)에서 장애로 인해 실행 종료된 트랙잭션에 대한 UNDO 로그를 획득한다(ST230).In addition, the operating apparatus 100 obtains a UNDO log for a transaction that has finished execution due to a failure in the disk 300 (ST230).

이어, 운영장치(100)는 메인 메모리(200)에서 획득한 데이터베이스 이미지와 마지막으로 커밋된 트랙잭션에 대한 UNDO 로그를 이용하여 데이터 복원작업을 수행한다(ST240).Subsequently, the operating apparatus 100 performs data restoration using the database image acquired from the main memory 200 and the UNDO log for the last committed transaction (ST240).

도5는 NVDIMM 을 활용한 인-메모리 데이터베이스의 복구 과정을 예시한 도면이다. (X)는 장애 발생으로 인한 종료 직전 메인 메모리(200)에 저장된 데이터베이스 이미지이고, (Y)는 재 구동된 상태의 데이터베이스 이미지이며, (Z)는 복구된 상태의 데이터베이스 이미지이다. 5 is a diagram illustrating a recovery process of an in-memory database using NVDIMM. (X) is a database image stored in the main memory 200 immediately before termination due to a failure, (Y) is a database image in a restarted state, and (Z) is a database image in a restored state.

메인 메모리(200)에는 도5의 (X)와 같이 데이터베이스 구동에 대응하여 항상 종료 직전의 최종 상태의 데이터가 저장되고, 데이터베이스 이미지에는 종료 직전 상태에 대해 현재 작업 위치에 대응하여 REDO 대상 블럭과, UNDO 대상 블럭이 존재한다. 이때, UNDO 대상 블럭에 대한 최종적으로 커밋된 트랙잭션에 해당하는 UNDO 로그만인 디스크(300)에 저장된 상태가 된다.In the main memory 200, as shown in FIG. 5 (X), the data of the last state immediately before the end is always stored in response to the driving of the database, and the database image includes the REDO target block corresponding to the current work position with respect to the state immediately before the end, UNDO target block exists. At this time, only the UNDO log corresponding to the finally committed transaction for the UNDO target block is stored in the disk 300.

상기한 상태에서 데이터베이스가 재 구동을 진행하면, 도5의 (Y)와 같이 REDO 대상 블럭과 UNDO 대상 블럭에 대한 데이터가 그대로 유지된다. When the database is re-driven in the above state, the data for the REDO target block and the UNDO target block are maintained as shown in FIG.

즉, 본 발명에서는 메인 메모리(200)에 최종적으로 저장된 데이터를 그대로 백업용 데이터로 이용하므로, REDO 대상 블럭에 대한 복원 작업을 수행할 필요가 없다.That is, in the present invention, since the data finally stored in the main memory 200 is used as the backup data as it is, there is no need to perform a restore operation on the REDO target block.

다만, 본 발명에서는 종료 후 구동시 커밋이 완료되지 않은 상태의 마지막 저장된 트랜잭션에 대해서는 UNDO 로그를 이용하여 이전 커밋된 상태로의 되돌리기 복원 작업만을 수행한다.However, in the present invention, only the revert restore operation to the previously committed state is performed using the UNDO log for the last stored transaction in which the commit is not completed when the drive is terminated.

즉, 상기 실시예에 의하면, 메인 메모리를 비휘발성 저장매체인 NVDIMM를 이용함으로써, 항상 복구 직전의 최종 상태가 저장되고, NVDIMM에 저장된 최종 저장 상태의 데이터베이스 이미지를 그대로 복원용 데이터로 이용하기 때문에 종래 인-메모리 데이터베이스 복구과정에서 마지막 체크포인트를 메모리에 적재하거나 마지막 체크포인트 이후에 수행된 REDO 로그에 대한 복원이 불필요하다.That is, according to the above embodiment, since the final state immediately before recovery is always stored by using the NVDIMM which is a nonvolatile storage medium, the database image of the last storage state stored in the NVDIMM is used as the restoration data as it is. During in-memory database recovery, it is not necessary to load the last checkpoint into memory or to restore the redo logs performed since the last checkpoint.

따라서, 본 발명은 REDO 로그에 대한 복원이 불필요하여 보다 신속하게 데이터 복원 작업을 수행할 수 있음은 물론, UNDO 로그만을 디스크에 저장하는 최소의 디스크 I/O 발생으로 인해 시스템 전체 성능을 향상시키는 것이 가능하다.Therefore, in the present invention, it is not necessary to restore the redo log so that the data restoration can be performed more quickly, and the system-wide performance is improved due to the minimum disk I / O occurrence that stores only the UNDO log on the disk. It is possible.

100 : 운영장치, 110 : 메모리 맵 매니저,
200 : 메인 메모리(NVDIMM), 300 : 디스크.
100: operating device, 110: memory map manager,
200: main memory (NVDIMM), 300: disk.

Claims (2)

운영장치에서 비휘발성 메모리인 NVDIMM(Non Volatile Dual In-line Memory Module)으로 이루어지는 메인 메모리에 데이터를 저장함과 더불어, 변경 데이터에 대응되는 트랜잭션의 UNDO 로그만을 디스크에 적재하되, UNDO 로그에는 해당 UNDO 대상 데이터에 대응되는 NVDIMM의 위치정보를 추가로 기록하여 저장하는 데이터베이스 저장 단계와,
운영장치에서 시스템 복구시 메인 메모리에 최종 저장된 정보와 디스크에 저장된 UNDO 로그만을 이용하여 데이터 복원처리를 수행하는 데이터베이스 복원단계를 포함하여 구성되되,
상기 데이터베이스 복원단계는 메인 메모리에 최종 저장된 REDO 대상 데이터와 UNDO 대상 데이터를 포함하는 작업 페이지를 캡쳐하여 데이터베이스 이미지를 획득하고, 이를 데이터베이스 복원처리를 위한 백업용 데이터로 설정하는 제1 단계와,
백업용 데이터에서 REDO 대상 데이터에 대해서는 복원작업을 수행하지 않고, UNDO 로그에 포함된 NVDIMM의 위치정보를 근거로 백업용 데이터의 최종 작업 위치에 대응되는 트랜잭션 UNDO 로그정보를 디스크에서 획득함으로써 UNDO 대상 데이터에 대해서만 UNDO 로그를 이용하여 이전 커밋된 상태로의 되돌리기 복원작업을 수행하는 제2 단계를 포함하여 구성되는 것을 특징으로 하는 NVDIMM을 이용한 인-메모리 데이터베이스 기반의 데이터 저장 및 복원 방법.
In addition to storing data in the main memory consisting of non-volatile memory, Non Volatile Dual In-line Memory Module (NVDIMM), the operating system loads only UNDO logs of transactions corresponding to the changed data onto disk. A database storage step of additionally recording and storing the location information of the NVDIMM corresponding to the UNDO target data;
When the system recovers from the operating system, it includes a database restoration step of performing data restoration processing using only the information last stored in the main memory and the UNDO log stored on the disk.
The database restoration step may include a first step of capturing a work page including REDO target data and UNDO target data finally stored in main memory to obtain a database image, and setting it as backup data for database restoration processing;
Only the UNDO target data can be obtained from the disk by acquiring the transaction UNDO log information corresponding to the final working position of the backup data based on the location information of the NVDIMM included in the UNDO log. An in-memory database-based data storage and restoration method comprising a second step of performing a restore operation to a previously committed state by using the UNDO log.
제1항에 있어서,
상기 데이터베이스 저장단계는 메인 메모리가 RAM 슬롯에 장착된 상태에서, 운영장치는 DAX 모드로 활성화되어 메인 메모리에 직접 액세스하도록 동작되는 것을 특징으로 하는 NVDIMM을 이용한 인-메모리 데이터베이스 기반의 데이터 저장 및 복원 방법.
The method of claim 1,
In the database storing step, an in-memory database-based data storage and restoration method using an NVDIMM, wherein the operating device is activated in a DAX mode and directly accesses the main memory while the main memory is mounted in a RAM slot. .
KR1020180035929A 2018-03-28 2018-03-28 Data storing and restoring method based on In-memory database using NVDIMM KR102049417B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020180035929A KR102049417B1 (en) 2018-03-28 2018-03-28 Data storing and restoring method based on In-memory database using NVDIMM

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020180035929A KR102049417B1 (en) 2018-03-28 2018-03-28 Data storing and restoring method based on In-memory database using NVDIMM

Publications (2)

Publication Number Publication Date
KR20190113359A KR20190113359A (en) 2019-10-08
KR102049417B1 true KR102049417B1 (en) 2019-11-27

Family

ID=68208839

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020180035929A KR102049417B1 (en) 2018-03-28 2018-03-28 Data storing and restoring method based on In-memory database using NVDIMM

Country Status (1)

Country Link
KR (1) KR102049417B1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11693593B2 (en) 2020-10-28 2023-07-04 Micron Technology, Inc. Versioning data stored on memory device
US11886728B2 (en) 2021-08-13 2024-01-30 Micron Technology, Inc. Undo capability for memory devices

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011134205A (en) 2009-12-25 2011-07-07 Fujitsu Ltd Information processing apparatus and cache memory control device
JP2016515271A (en) 2013-03-15 2016-05-26 アマゾン・テクノロジーズ・インコーポレーテッド Fast crash recovery for distributed database systems

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100365891B1 (en) * 2000-12-13 2002-12-27 한국전자통신연구원 Backup/recovery Apparatus and method for non-log processing of real-time main memory database system
KR20170089194A (en) 2016-01-26 2017-08-03 주식회사 범우시스템 Memeory disk operating method and apparatus using nvdimm

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011134205A (en) 2009-12-25 2011-07-07 Fujitsu Ltd Information processing apparatus and cache memory control device
JP2016515271A (en) 2013-03-15 2016-05-26 アマゾン・テクノロジーズ・インコーポレーテッド Fast crash recovery for distributed database systems

Also Published As

Publication number Publication date
KR20190113359A (en) 2019-10-08

Similar Documents

Publication Publication Date Title
US9396244B2 (en) Systems and methods for managing replicated database data
US10275164B2 (en) Enforcing persistency for battery-backed mobile devices
EP3724764B1 (en) Write-ahead style logging in a persistent memory device
US7987158B2 (en) Method, system and article of manufacture for metadata replication and restoration
CN101243446B (en) Online page restore from a database mirror
JP4638908B2 (en) System and method for automatically maintaining and repairing a database or file system
US7472139B2 (en) Database recovery method applying update journal and database log
US9626115B2 (en) Threshold based incremental flashcopy backup of a raid protected array
US9600375B2 (en) Synchronized flashcopy backup restore of a RAID protected array
US8214685B2 (en) Recovering from a backup copy of data in a multi-site storage system
US20140379663A1 (en) Reducing reading of database logs by persisting long-running transaction data
EP2590078B1 (en) Shadow paging based log segment directory
US11221927B2 (en) Method for the implementation of a high performance, high resiliency and high availability dual controller storage system
KR102262409B1 (en) NVM-based file system and method for data update using the same
US20180276092A1 (en) Recovering using write data stored by a powerloss data protection technique
KR20170054767A (en) Database management system and method for modifying and recovering data the same
Sauer et al. Single-pass restore after a media failure
KR102049417B1 (en) Data storing and restoring method based on In-memory database using NVDIMM
US9430485B2 (en) Information processor and backup method
US10078558B2 (en) Database system control method and database system
US11226875B2 (en) System halt event recovery
KR20190069201A (en) Data base management method

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant