[go: up one dir, main page]

KR102024719B1 - Method and apparatus for journaling of file-based database - Google Patents

Method and apparatus for journaling of file-based database Download PDF

Info

Publication number
KR102024719B1
KR102024719B1 KR1020170123770A KR20170123770A KR102024719B1 KR 102024719 B1 KR102024719 B1 KR 102024719B1 KR 1020170123770 A KR1020170123770 A KR 1020170123770A KR 20170123770 A KR20170123770 A KR 20170123770A KR 102024719 B1 KR102024719 B1 KR 102024719B1
Authority
KR
South Korea
Prior art keywords
database
information
file
change
journaling
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
KR1020170123770A
Other languages
Korean (ko)
Other versions
KR20180054422A (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 한양대학교 산학협력단
Publication of KR20180054422A publication Critical patent/KR20180054422A/en
Application granted granted Critical
Publication of KR102024719B1 publication Critical patent/KR102024719B1/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/162Delete operations

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

파일 기반 데이터베이스의 저널링 방법을 개시한다. 본 발명의 일 실시예에 따른 원본데이터베이스를 복제한 복제데이터베이스를 이용하여 데이터베이스를 저널링하는 방법은 복수의 어플리케이션에 의한 상기 원본데이터베이스의 변경을 상기 복제데이터베이스에 종합하여 반영하는 단계; 상기 원본데이터베이스와 상기 복제데이터베이스를 상호 교환(switch)하여 제2 원본데이터베이스와 제2 복제데이터베이스를 생성하는 단계; 및 상기 제2 복제데이터베이스에 상기 복수의 어플리케이션에 의한 변경이 완료되었음을 나타내는 정보인 완료정보를 기록하는 단계를 포함한다.Discuss a journaling method of a file-based database. According to an embodiment of the present invention, a method of journaling a database by using a replica of a replica of an original database may include: reflecting changes of the original database by a plurality of applications in the replicated database; Generating a second original database and a second replica database by switching the original database and the replica database; And recording completion information, which is information indicating that the change by the plurality of applications is completed, in the second copy database.

Description

파일 기반 데이터베이스의 저널링 방법 및 장치 {METHOD AND APPARATUS FOR JOURNALING OF FILE-BASED DATABASE}Journaling methods and devices for file-based databases {METHOD AND APPARATUS FOR JOURNALING OF FILE-BASED DATABASE}

본 발명은 파일 기반 데이터베이스의 저널링 방법 및 장치에 관한 것으로, 보다 상세하게는 원본데이터베이스와 그 원본데이터베이스를 복제한 복제데이터베이스를 이용하는 파일 기반 데이터베이스의 저널링 방법 및 장치에 관한 것이다.The present invention relates to a method and apparatus for journaling a file-based database, and more particularly, to a method and apparatus for journaling a file-based database using an original database and a replicated database replicating the original database.

데이터베이스는 데이터의 무결성을 보장하기 위하여 데이터 저널링 방식을 채택하고 있다. 모바일용 데이터베이스 중 하나인 SQLite는 저널링을 위해 대표적으로 PERSIST, WAL모드를 제공 하며, 그 밖에도 DELETE, TRUNCATE, MEMORY, NONE 모드를 기본적으로 제공 한다. PERSIST 모드는 데이터베이스의 데이터를 변경하기 전에 저널파일에 기록함으로써 무결성을 보장하지만 무거운 시스템콜(예, fdatasync)를 자주 사용해야 한다. DELETE와 TRUNCATE 모드의 경우 저널 파일의 생성/삭제에 있어서 차이가 있으며, MEMORY와 NONE 모드는 데이터 무결성을 보장해 주지 않는다. WAL 모드는 저널 파일의 마지막 위치에 업데이트 내용을 붙이기 때문에 데이터 파일에 직접 기록하는 것 보다 빠르고 가볍게 동작 한다.The database adopts a data journaling method to ensure data integrity. SQLite, one of the mobile databases, provides PERSIST and WAL modes for journaling. In addition, it basically provides DELETE, TRUNCATE, MEMORY, and NONE modes. PERSIST mode guarantees integrity by writing to a journal file before changing data in the database, but requires heavy system calls (eg fdatasync). DELETE and TRUNCATE modes differ in the creation / deletion of journal files. MEMORY and NONE modes do not guarantee data integrity. WAL mode is faster and lighter than writing directly to the data file because it appends the update to the last position of the journal file.

그러나, SQLite의 저널 모드 중에서 WAL은 쓰기 요청 시 효율적이라는 장점이 있지만, 읽기 요청을 실행할 때는 현재의 로그 파일과 데이터 파일을 참조해서 처리해야 한다는 단점이 있다. 또한, 모바일 환경에서 EXT4와 같이 사용될 때는 설계상의 문제로 인하여 추가적인 입출력 성능 하락이 발생한다. PERSIST 모드의 경우 한 번의 트렌젝션 당 5번의 시스템콜을 필요로 하기 때문에 전반적인 데이터베이스 성능 하락의 요인이 된다.However, although WAL has the advantage of being efficient in write requests among journal modes of SQLite, it has the disadvantage that it should refer to the current log file and data file when executing read request. In addition, when used with EXT4 in a mobile environment, additional input / output performance degradation occurs due to a design problem. The PERSIST mode requires five system calls per transaction, which contributes to overall database performance degradation.

따라서, 성능의 저하를 최소화하면서도, 저널링 기능을 지원하는 파일 기반 데이터베이스의 저널링 방법 및 장치에 대한 필요성이 대두되고 있다.Accordingly, there is a need for a method and apparatus for journaling a file-based database that supports a journaling function while minimizing performance degradation.

관련 선행기술로는 대한민국 등록특허공보 제10-1258589호(발명의 명칭: 저널링 파일 시스템에 따라 데이터를 기록한 정보저장매체, 저널링 파일 시스템을 이용해서 데이터를 기록/복구하는 방법 및 장치, 공고일자: 2013년 5월 2일)가 있다.Related prior art is Korean Patent Publication No. 10-1258589 (Invention name: information storage medium recording data according to the journaling file system, method and apparatus for recording / recovering data using the journaling file system, date of publication: May 2, 2013).

본 발명은 파일 기반 데이터베이스에 적용가능하며, 성능의 저하가 작으면서도 저널링 기능을 지원하여 데이터의 무결성을 보장할 수 있는 저널링 방법 및 장치를 제공하고자 한다.The present invention is applicable to a file-based database, to provide a journaling method and apparatus that can guarantee the integrity of data by supporting a journaling function with a low performance degradation.

본 발명이 해결하고자 하는 과제는 이상에서 언급한 과제(들)로 제한되지 않으며, 언급되지 않은 또 다른 과제(들)은 아래의 기재로부터 당업자에게 명확하게 이해될 수 있을 것이다.The problem to be solved by the present invention is not limited to the problem (s) mentioned above, and other object (s) not mentioned will be clearly understood by those skilled in the art from the following description.

상기 과제를 해결하기 위하여, 본 발명에서 제공하는 원본데이터베이스를 복제한 복제데이터베이스를 이용하여 데이터베이스를 저널링하는 방법은 복수의 어플리케이션에 의한 상기 원본데이터베이스의 변경을 상기 복제데이터베이스에 종합하여 반영하는 단계; 상기 원본데이터베이스와 상기 복제데이터베이스를 상호 교환(switch)하여 제2 원본데이터베이스와 제2 복제데이터베이스를 생성하는 단계; 및 상기 제2 복제데이터베이스에 상기 복수의 어플리케이션에 의한 변경이 완료되었음을 나타내는 정보인 완료정보를 기록하는 단계를 포함한다.In order to solve the above problems, a method of journaling a database using a replicated database that duplicates the original database provided by the present invention includes the steps of reflecting the changes of the original database by a plurality of applications in the replicated database; Generating a second original database and a second replica database by switching the original database and the replica database; And recording completion information, which is information indicating that the change by the plurality of applications is completed, in the second copy database.

바람직하게는, 상기 완료정보를 기록하는 단계의 이전에, 상기 복제데이터베이스에 대하여, 데이터베이스의 변경상태를 나타내는 정보인 변경정보를 소정의 기준에 따라 갱신하는 단계를 더 포함할 수 있다.Preferably, before the recording of the completion information, the method may further include updating, according to a predetermined criterion, change information, which is information indicating a change state of the database, to the duplicated database.

바람직하게는, 상기 완료정보를 기록하는 단계는 상기 변경정보를 초기화하여 기록함으로써, 상기 완료정보를 기록할 수 있다.Preferably, in the recording of the completion information, the completion information may be recorded by initializing and recording the change information.

바람직하게는, 상기 변경정보가 데이터베이스의 변경상태를 나타내는 상태값을 포함할 때, 상기 복제데이터베이스의 변경정보는 상기 원본데이터베이스의 변경정보보다 소정의 크기만큼 큰 상태값을 포함하도록 갱신되고, 상기 제2 복제데이터베이스의 변경정보에 포함된 상태값은 소정의 초기값으로 초기화될 수 있다.Preferably, when the change information includes a state value indicating a change state of the database, the change information of the replica database is updated to include a state value larger by a predetermined size than the change information of the original database, 2 The state value included in the change information of the replica database may be initialized to a predetermined initial value.

바람직하게는, 각각의 단계별로, 상기 원본데이터베이스 또는 상기 복제데이터베이스 파일의 변경을 저장장치와 동기화하기 위한 함수인 동기화함수가 호출될 수 있다.Preferably, at each step, a synchronization function, which is a function for synchronizing changes of the original database or the replica database file with the storage device, may be called.

바람직하게는, 상기 복제데이터베이스에 종합하여 반영하는 단계는 상기 복수의 어플리케이션 각각이 변경하려는 상기 원본데이터베이스 파일의 적어도 하나의 페이지에 관한 정보인 페이지정보를 수집하는 단계; 상기 복수의 어플리케이션 각각에 대한 상기 페이지정보를 분석하여, 상기 복수의 어플리케이션 중 2개 이상이 변경하려는 페이지에 관한 정보인 중복페이지정보와 나머지 페이지에 관한 일반페이지정보를 생성하는 단계; 및 상기 중복페이지정보 및 상기 일반페이지정보에 기초하여, 상기 원본데이터베이스의 변경을 상기 복제데이터베이스에 반영하는 단계를 포함할 수 있다.Preferably, the step of collectively reflecting the duplicated database includes collecting page information which is information on at least one page of the original database file to be changed by each of the plurality of applications; Analyzing the page information for each of the plurality of applications to generate duplicate page information which is information about a page to be changed by two or more of the plurality of applications, and general page information about the remaining pages; And reflecting the change of the original database on the duplicated database based on the duplicated page information and the general page information.

또한, 상기 과제를 해결하기 위하여, 본 발명에서 제공하는 원본데이터베이스를 복제한 복제데이터베이스를 이용하여 데이터베이스를 저널링하는 장치는 복수의 어플리케이션에 의한 상기 원본데이터베이스의 변경을 상기 복제데이터베이스에 종합하여 반영하는 파일갱신부; 및 상기 원본데이터베이스와 상기 복제데이터베이스를 상호 교환(switch)하여 제2 원본데이터베이스와 제2 복제데이터베이스를 생성하는 파일교환부를 포함하고, 상기 파일갱신부는 상기 제2 복제데이터베이스에 상기 복수의 어플리케이션에 의한 변경이 완료되었음을 나타내는 정보인 완료정보를 더 기록한다.In addition, in order to solve the above problems, an apparatus for journaling a database using a replicated database in which the original database provided by the present invention is duplicated is a file that reflects the change of the original database by a plurality of applications to the duplicated database An update unit; And a file exchanger configured to switch the original database and the replicated database to generate a second original database and a second replicated database, wherein the file update unit is changed by the plurality of applications in the second replicated database. Complete information, which is information indicating that the data is completed, is further recorded.

바람직하게는, 상기 파일갱신부는 상기 복제데이터베이스에 대하여, 데이터베이스의 변경상태를 나타내는 정보인 변경정보를 소정의 기준에 따라 더 갱신할 수 있다.Preferably, the file update unit may further update change information, which is information indicating a change state of the database, to the copy database according to a predetermined criterion.

바람직하게는, 상기 파일갱신부는 상기 변경정보를 초기화하여 기록함으로써, 상기 완료정보를 기록할 수 있다.Preferably, the file updating unit may record the completion information by initializing and recording the change information.

바람직하게는, 상기 변경정보가 데이터베이스의 변경상태를 나타내는 상태값을 포함할 때, 상기 복제데이터베이스의 변경정보는 상기 원본데이터베이스의 변경정보보다 소정의 크기만큼 큰 상태값을 포함하도록 갱신되고, 상기 제2 복제데이터베이스의 변경정보에 포함된 상태값은 소정의 초기값으로 초기화될 수 있다.Preferably, when the change information includes a state value indicating a change state of the database, the change information of the replica database is updated to include a state value larger by a predetermined size than the change information of the original database, 2 The state value included in the change information of the replica database may be initialized to a predetermined initial value.

바람직하게는, 상기 파일갱신부 및 상기 파일교환부 각각이 상기 원본데이터베이스 또는 상기 복제데이터베이스 파일을 변경할 때, 상기 변경된 파일을 저장장치와 동기화하기 위한 함수인 동기화함수가 호출될 수 있다.Preferably, when each of the file update unit and the file exchange unit changes the original database or the duplicate database file, a synchronization function, which is a function for synchronizing the changed file with the storage device, may be called.

바람직하게는, 상기 파일갱신부가 상기 원본데이터베이스의 변경을 상기 복제데이터베이스에 종합하여 반영할 때, 상기 복수의 어플리케이션 각각이 변경하려는 상기 원본데이터베이스 파일의 적어도 하나의 페이지에 관한 정보인 페이지정보를 수집하고, 상기 복수의 어플리케이션 각각에 대한 상기 페이지정보를 분석하여, 상기 복수의 어플리케이션 중 2개 이상이 변경하려는 페이지에 관한 정보인 중복페이지정보와 나머지 페이지에 관한 일반페이지정보를 생성하고, 상기 중복페이지정보 및 상기 일반페이지정보에 기초하여, 상기 원본데이터베이스의 변경을 상기 복제데이터베이스에 반영할 수 있다.Preferably, when the file update unit reflects the change of the original database in the replica database, collecting page information which is information on at least one page of the original database file to be changed by each of the plurality of applications and Analyzing the page information for each of the plurality of applications, generating duplicate page information which is information about a page to be changed by two or more of the plurality of applications, and general page information about the remaining pages; And based on the general page information, the change of the original database may be reflected in the duplicate database.

기타 실시예들의 구체적인 사항들은 상세한 설명 및 첨부 도면들에 포함되어 있다.Specific details of other embodiments are included in the detailed description and the accompanying drawings.

본 발명은 파일 기반 데이터베이스에 대하여, 원본데이터베이스와 그 원본데이터베이스를 복제한 복제데이터베이스를 이용하는 저널링 모드를 도입하여 데이터의 무결성을 보장하면서도 성능의 저하를 방지할 수 있는 효과가 있다.The present invention introduces a journaling mode using a source database and a replicated database in which the original database is replicated, thereby ensuring the integrity of the data while preventing performance degradation.

도 1은 본 발명의 일 실시예에 따른 파일 기반 데이터베이스의 저널링 방법을 설명하기 위한 흐름도이다.
도 2는 본 발명의 일 실시예에 따른 원본데이터베이스의 변경을 복제데이터베이스에 종합하여 반영하는 방법을 설명하기 위한 흐름도이다.
도 3은 본 발명의 일 실시예에 따른 파일 기반 데이터베이스의 저널링 장치를 설명하기 위한 도면이다.
도 4는 본 발명의 일 실시예에 따른 원본데이터베이스의 변경을 복제데이터베이스에 종합하여 반영하는 방법을 설명하기 위한 도면이다.
도 5는 본 발명의 일 실시예에 따른 원본데이터베이스와 복제데이터베이스를 상호 교환하는 방법을 설명하기 위한 도면이다.
도 6 및 7은 각각 SQLite의 PERSIST모드 및 WAL모드의 I/O특성을 설명하기 위한 도면이다.
1 is a flowchart illustrating a journaling method of a file-based database according to an embodiment of the present invention.
2 is a flowchart illustrating a method of collectively reflecting a change of an original database in a replica database according to an embodiment of the present invention.
3 is a diagram illustrating a journaling apparatus of a file-based database according to an embodiment of the present invention.
4 is a view for explaining a method of reflecting the changes of the original database combined with the replica database according to an embodiment of the present invention.
5 is a view for explaining a method of exchanging an original database and a replica database according to an embodiment of the present invention.
6 and 7 are diagrams for explaining the I / O characteristics of the PERSIST mode and WAL mode of SQLite, respectively.

본 발명은 다양한 변경을 가할 수 있고 여러 가지 실시예를 가질 수 있는 바, 특정 실시예들을 도면에 예시하고 상세한 설명에 상세하게 설명하고자 한다. 그러나, 이는 본 발명을 특정한 실시 형태에 대해 한정하려는 것이 아니며, 본 발명의 사상 및 기술 범위에 포함되는 모든 변경, 균등물 내지 대체물을 포함하는 것으로 이해되어야 한다. 각 도면을 설명하면서 유사한 참조부호를 유사한 구성요소에 대해 사용하였다.As the invention allows for various changes and numerous embodiments, particular embodiments will be illustrated in the drawings and described in detail in the written description. However, this is not intended to limit the present invention to specific embodiments, it should be understood to include all modifications, equivalents, and substitutes included in the spirit and scope of the present invention. In describing the drawings, similar reference numerals are used for similar elements.

제1, 제2, A, B 등의 용어는 다양한 구성요소들을 설명하는데 사용될 수 있지만, 상기 구성요소들은 상기 용어들에 의해 한정되어서는 안 된다. 상기 용어들은 하나의 구성요소를 다른 구성요소로부터 구별하는 목적으로만 사용된다. 예를 들어, 본 발명의 권리 범위를 벗어나지 않으면서 제1 구성요소는 제2 구성요소로 명명될 수 있고, 유사하게 제2 구성요소도 제1 구성요소로 명명될 수 있다. 및/또는 이라는 용어는 복수의 관련된 기재된 항목들의 조합 또는 복수의 관련된 기재된 항목들 중의 어느 항목을 포함한다.Terms such as first, second, A, and B may be used to describe various components, but the components should not be limited by the terms. The terms are used only for the purpose of distinguishing one component from another. For example, without departing from the scope of the present invention, the first component may be referred to as the second component, and similarly, the second component may also be referred to as the first component. The term and / or includes a combination of a plurality of related items or any item of a plurality of related items.

어떤 구성요소가 다른 구성요소에 "연결되어" 있다거나 "접속되어" 있다고 언급된 때에는, 그 다른 구성요소에 직접적으로 연결되어 있거나 또는 접속되어 있을 수도 있지만, 중간에 다른 구성요소가 존재할 수도 있다고 이해되어야 할 것이다. 반면에, 어떤 구성요소가 다른 구성요소에 "직접 연결되어" 있다거나 "직접 접속되어" 있다고 언급된 때에는, 중간에 다른 구성요소가 존재하지 않는 것으로 이해되어야 할 것이다.When a component is referred to as being "connected" or "connected" to another component, it may be directly connected to or connected to that other component, but it may be understood that other components may be present in between. Should be. On the other hand, when a component is said to be "directly connected" or "directly connected" to another component, it should be understood that there is no other component in between.

본 출원에서 사용한 용어는 단지 특정한 실시예를 설명하기 위해 사용된 것으로, 본 발명을 한정하려는 의도가 아니다. 단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수의 표현을 포함한다. 본 출원에서, "포함하다" 또는 "가지다" 등의 용어는 명세서상에 기재된 특징, 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것이 존재함을 지정하려는 것이지, 하나 또는 그 이상의 다른 특징들이나 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것들의 존재 또는 부가 가능성을 미리 배제하지 않는 것으로 이해되어야 한다.The terminology used herein is for the purpose of describing particular example embodiments only and is not intended to be limiting of the present invention. Singular expressions include plural expressions unless the context clearly indicates otherwise. In this application, the terms "comprise" or "have" are intended to indicate that there is a feature, number, step, operation, component, part, or combination thereof described in the specification, and one or more other features. It is to be understood that the present invention does not exclude the possibility of the presence or the addition of numbers, steps, operations, components, components, or a combination thereof.

다르게 정의되지 않는 한, 기술적이거나 과학적인 용어를 포함해서 여기서 사용되는 모든 용어들은 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자에 의해 일반적으로 이해되는 것과 동일한 의미를 가지고 있다. 일반적으로 사용되는 사전에 정의되어 있는 것과 같은 용어들은 관련 기술의 문맥 상 가지는 의미와 일치하는 의미를 가지는 것으로 해석되어야 하며, 본 출원에서 명백하게 정의하지 않는 한, 이상적이거나 과도하게 형식적인 의미로 해석되지 않는다.Unless defined otherwise, all terms used herein, including technical or scientific terms, have the same meaning as commonly understood by one of ordinary skill in the art. Terms such as those defined in the commonly used dictionaries should be construed as having meanings consistent with the meanings in the context of the related art and shall not be construed in ideal or excessively formal meanings unless expressly defined in this application. Do not.

이하, 본 발명에 따른 바람직한 실시예를 첨부된 도면을 참조하여 상세하게 설명한다.Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings.

도 1은 본 발명의 일 실시예에 따른 파일 기반 데이터베이스의 저널링 방법을 설명하기 위한 흐름도이다.1 is a flowchart illustrating a journaling method of a file-based database according to an embodiment of the present invention.

저널링 파일 시스템(journaling file system)은 시스템 충돌이나 전원 중단 등의 경우에, 디스크의 무결성을 유지시킬 수 있는 파일 시스템이다. 보다 구체적으로는, 디스크의 데이터 영역에서 일어나는 모든 내용을 로그로 유지하면서 충돌이 발생하면 로그에 있는 메타데이터로 유실 데이터를 다시 만들어 충돌 전으로 데이터를 되돌려 줄 뿐 아니라 저장되지 않은 데이터도 제자리에 저장하도록 할 수 있다.Journaling file system is a file system that can maintain the integrity of the disk in case of system crash or power failure. More specifically, if a conflict occurs while keeping a log of everything that happens in the data area of the disk, the metadata in the log recreates the lost data and returns the data before the crash, as well as storing unsaved data in place. You can do that.

본 발명은 저널링 파일 시스템과 같이, 파일 기반의 데이터베이스에 대하여 시스템 충돌이나 전원 중단이 발생된 경우에, 그 데이터베이스를 복구할 수 있도록 하는 저널링 방법 및 장치에 관한 것이다. 이때, 본 발명의 저널링 방법 및 장치는 안드로이드, iOS 또는 기타OS 기반의 스마트폰, 모바일기기, 태블릿기기 및 웨어러블 기기 등에 적용 또는 탑재될 수 있음은 물론이며, 노트북, 데스크탑PC 및 서버 등에 이르기까지 다양한 컴퓨터 장치에 적용 또는 탑재될 수 있다.The present invention relates to a journaling method and apparatus for recovering a database in the event of a system crash or power failure for a file-based database, such as a journaling file system. At this time, the journaling method and apparatus of the present invention can be applied or mounted on an Android, iOS or other OS-based smart phones, mobile devices, tablet devices and wearable devices, as well as a variety of notebooks, desktop PCs and servers, etc. It can be applied or mounted to a computer device.

보다 구체적으로는, 본 발명의 저널링 방법 및 장치는 원본데이터베이스에 적용하고자 하는 변경 사항을 복제데이터베이스에 기록하고, 기록이 완료되면 원본데이터베이스와 복제데이터베이스를 맞바꿔 교환하는 방식으로 동작할 수 있다. 이때, 원본데이터베이스와 복제데이터베이스 각각은 데이터베이스의 변경상태를 나타내는 정보인 변경정보를 포함할 수 있으며, 이 변경상태는 상태값으로 나타낼 수 있다. More specifically, the journaling method and apparatus of the present invention may operate in a manner of recording changes to be applied to the original database in a replica database, and swapping the original database and the replica database when the recording is completed. In this case, each of the original database and the replica database may include change information which is information indicating a change state of the database, and this change state may be represented by a state value.

예컨대, 초기에 원본데이터베이스와 복제데이터베이스의 상태값은 <n, 0>이 될 수 있다. 그 다음, 복제데이터베이스에 변경 사항의 기록이 완료(즉, 트랜잭션이 완료)되면 상태값은 <n, n+1>이 될 수 있다. 그 다음, 원본데이터베이스와 복제데이터베이스에 해당하는 파일을 교환하고 나면 상태값은 <n+1, n>이 될 수 있다. 마지막으로, 새로운 제2 원본데이터베이스(기존의 복제데이터베이스)와 제2 원본데이터베이스를 복제한 제2 복제데이터베이스의 상태값은 <n+1, 0>이 되어, 다시 저널링이 수행될 수 있다. 한편, 상술한 본 발명의 저널링 방법은 SHADOW 모드라고 명명할 수 있다.For example, initially, the status values of the original database and the replica database may be <n, 0>. Then, when the change is written to the replicate database (that is, the transaction is complete), the status can be <n, n + 1>. Next, after exchanging files corresponding to the original database and the replica database, the status value may be <n + 1, n>. Lastly, the state values of the new second original database (the existing replica database) and the second replica database replicating the second original database are <n + 1, 0>, so that journaling may be performed again. Meanwhile, the journaling method of the present invention described above may be referred to as a SHADOW mode.

단계 S110에서는, 데이터베이스 저널링 장치가 복수의 어플리케이션에 의한 원본데이터베이스의 변경을 복제데이터베이스에 종합하여 반영한다.In step S110, the database journaling device reflects the changes of the original database by the plurality of applications in a replicated database.

예컨대, 도 4를 참조하면, 어플리케이션 A와 어플리케이션 B 각각에 의한 원본데이터베이스의 변경을 파일 페이지(file page) 단위로 복제데이터베이스 파일(shadow file)에 종합하여 반영할 수 있다. 다시 말하면, 어플리케이션 A와 어플리케이션 B 각각이 원본데이터베이스에서 바꾸고자 하는 변경 사항이 있는 경우에, 데이터베이스 저널링 장치가 그 변경 사항을 통합하여 복제데이터베이스에 반영할 수 있다.For example, referring to FIG. 4, the change of the original database by each of the application A and the application B may be collectively reflected in a replica file in a file page unit. In other words, if there is a change that each of Application A and Application B wants to change in the original database, the database journaling device can integrate the change and reflect it in the replicate database.

이때, 어플리케이션 A와 B 각각은 복수의 어플리케이션이 동시에 복제데이터베이스를 변경하는 상황을 방지하기 위하여, 복제데이터베이스를 잠금(lock) 및 잠금해제(unlock)할 수 있다. 즉, 어플리케이션 A와 B 각각은 복제데이터베이스가 잠금 상태가 아닌 경우에만 복제데이터베이스를 변경할 수 있으며, 잠금 상태인 경우 잠금해제 상태가 될 때까지, 기다려야 할 수 있다.In this case, each of the applications A and B may lock and unlock the replication database in order to prevent a situation where a plurality of applications simultaneously change the replication database. That is, each of the applications A and B can change the replication database only when the replication database is not in the locked state, and if it is locked, it may have to wait until the lock is released.

한편, 원본데이터베이스의 변경을 복제데이터베이스에 종합하여 반영하는 상세한 방법에 관하여는 도 2에 대한 설명에서 구체적으로 후술한다.On the other hand, a detailed method of reflecting the changes of the original database in the replica database will be described later in detail in FIG.

다른 실시예에서는, 데이터베이스 저널링 장치가 복제데이터베이스에 대하여, 데이터베이스의 변경상태를 나타내는 정보인 변경정보를 소정의 기준에 따라 갱신할 수 있다. In another embodiment, the database journaling device may update the change database, which is information indicating a change state of the database, according to a predetermined criterion.

예컨대, 데이터베이스 저널링 장치가 파일 기반의 데이터베이스인 원본데이터베이스와 복제데이터베이스에 접근하여, 원본데이터베이스와 복제데이터베이스 각각의 변경상태에 관한 변경정보를 소정의 기준에 따라 기록할 수 있다. 즉, 데이터베이스 저널링 장치는 원본데이터베이스의 변경이 복제데이터베이스에 반영되었음을 나타내기 위하여 변경정보를 갱신할 수 있다. 한편, 변경정보를 갱신하는 것은 원본데이터베이스의 변경을 복제데이터베이스에 반영하기 전 또는 후에 언제든지 수행될 수 있다.For example, the database journaling apparatus may access the original database and the replica database, which are file-based databases, and record the change information regarding the change state of each of the original database and the replica database according to a predetermined criterion. That is, the database journaling device may update the change information to indicate that the change of the original database is reflected in the replica database. On the other hand, updating the change information may be performed at any time before or after reflecting the change of the original database to the replica database.

보다 구체적으로, 데이터베이스 저널링 장치가 변경정보를 갱신하기 위하여, 데이터베이스 파일의 헤더에 존재하는 변경상태값(change count)에 일정한 크기(예, +1)의 값을 더하여 갱신할 수 있다. 이와 같이, 데이터베이스 저널링 장치가 데이터베이스 파일에 변경정보를 갱신함으로써, 추후 시스템 충돌 및 전원 중단이 발생하였을 때, 이 변경정보를 이용하여 데이터베이스를 복구할 수 있다. More specifically, in order to update the change information, the database journaling device may update by adding a constant size (eg, +1) to a change count existing in the header of the database file. In this way, the database journaling apparatus updates the database server with the change information, and when the system crash and power interruption occur in the future, the change can be used to recover the database.

단계 S120에서는, 데이터베이스 저널링 장치가 원본데이터베이스와 복제데이터베이스를 상호 교환(switch)하여 제2 원본데이터베이스와 제2 복제데이터베이스를 생성한다.In step S120, the database journaling device switches the original database and the replica database to generate a second original database and a second replica database.

예컨대, 도 5를 참조하면, 데이터베이스 저널링 장치가 복제데이터베이스 파일(shadow file)의 이름을 변경하여 제2 원본데이터베이스 파일을 생성하고, 원본데이터베이스(database file)의 파일의 이름을 변경하여 제2 복제데이터베이스 파일을 생성할 수 있다.For example, referring to FIG. 5, the database journaling device renames a replica file to generate a second original database file, and renames a file of the original database file to a second replicate database. You can create a file.

마지막으로 단계 S130에서는, 데이터베이스 저널링 장치가 제2 복제데이터베이스에 복수의 어플리케이션에 의한 변경이 완료되었음을 나타내는 정보인 완료정보를 기록한다.Finally, in step S130, the database journaling device records the completion information, which is information indicating that the change by the plurality of applications has been completed, in the second replica database.

즉, 데이터베이스 저널링 장치가 제2 복제데이터베이스 파일에 복수의 어플리케이션에 의한 변경에 포함되는 적어도 하나의 트랜잭션이 완료되었음을 나타내는 완료정보를 기록할 수 있다. 데이터베이스 저널링 장치는 새로 생성된 제2 복제데이터베이스 파일에 이 완료정보가 기록되어 있는지 여부에 따라 복수의 어플리케이션에 의한 변경의 적용이 완료되었는지 판단할 수 있다.That is, the database journaling device may record completion information indicating that at least one transaction included in the change by the plurality of applications is completed in the second replica database file. The database journaling device may determine whether the application of the change by the plurality of applications is completed according to whether the completion information is recorded in the newly created second replica database file.

다른 실시예에서는, 데이터베이스 저널링 장치가 제2 복제데이터베이스의 변경정보를 초기화하여 기록함으로써, 완료정보를 기록할 수 있다. In another embodiment, the database journaling device may record the completion information by initializing and recording the change information of the second replica database.

예컨대, 데이터베이스 저널링 장치는 데이터베이스 파일의 헤더에 존재하는 변경상태값을 0으로 초기화하여 기록함으로써, 완료정보를 기록할 수 있다. 즉, 데이터베이스 저널링 장치는 변경상태값에 0이 저장된 경우, 그 데이터베이스 파일에 완료정보가 기록된 것으로 간주할 수 있다.For example, the database journaling device may record the completion information by initializing and recording the change state value present in the header of the database file to zero. That is, when 0 is stored in the changed state value, the database journaling device may consider that completion information is recorded in the database file.

또 다른 실시예에서는, 변경정보가 데이터베이스의 변경상태를 나타내는 상태값을 포함할 때, 복제데이터베이스의 변경정보는 원본데이터베이스의 변경정보보다 소정의 크기만큼 큰 상태값을 포함하도록 갱신되고, 제2 복제데이터베이스의 변경정보에 포함된 상태값은 소정의 초기값으로 초기화될 수 있다.In another embodiment, when the change information includes a state value indicating a change state of the database, the change information of the clone database is updated to include a state value larger by a predetermined size than the change information of the original database, and the second clone is updated. The state value included in the change information of the database may be initialized to a predetermined initial value.

예컨대, 데이터베이스 파일의 헤더에 존재하는 변경상태값이 n인 원본데이터베이스에 관한 변경사항이 복제데이터베이스에 반영된 경우, 그 복제데이터베이스의 변경상태값을 n+1로 1만큼 증가시킬 수 있다.For example, when the change of the original database whose change state value existing in the header of the database file is n is reflected in the replicate database, the change state value of the replicate database can be increased by 1 to n + 1.

또한, 원본데이터베이스와 복제데이터베이스의 교환이 완료되어 새로운 제2 원본데이터베이스와 그 제2 원본데이터베이스를 복제한 제2 복제데이터베이스가 생성된 경우, 제2 복제데이터베이스파일의 헤더에 존재하는 변경상태값을 0으로 초기화하여 다시 저널링을 수행할 수 있는 상태임을 나타낼 수 있다.In addition, when the exchange of the original database and the replica database is completed and a new second source database and a second replica database that duplicates the second source database are created, the change state value existing in the header of the second replica database file is zero. It can be initialized to indicate that the journaling can be performed again.

또 다른 실시예에서는, 각각의 단계별로, 원본데이터베이스 또는 복제데이터베이스 파일의 변경을 저장장치와 동기화하기 위한 함수인 동기화함수가 호출될 수 있다.In another embodiment, at each step, a synchronization function, which is a function for synchronizing changes of the original database or replica database file with the storage device, may be called.

예컨대, 데이터베이스 저널링 장치가 리눅스 또는 유닉스에 기반하는 경우, 동기화함수는 fdatasync()함수일 수 있으며, 단계 S110 내지 S130 각각이 수행될 때마다 fdatasync()함수가 한차례씩만 호출됨으로써, 총 3차례 동기화함수가 호출되어 5차례가 호출되는 종래의 기술(SQLite)과 비교하여 파일 I/O를 줄일 수 있는 효과가 있다.For example, when the database journaling device is based on Linux or Unix, the synchronization function may be the fdatasync () function, and the fdatasync () function is called only once each time steps S110 to S130 are performed, so that the total synchronization function is performed three times. Compared to the conventional technique (SQLite), which is called five times, the file I / O can be reduced.

특히, S110에서 복수의 어플리케이션에 의한 데이터베이스 변경에 대하여 오직 한차례의 fdatasync()함수만 호출함으로써, 시스템의 파일 I/O를 감소시켜 성능저하를 최소화할 수 있다.In particular, only one fdatasync () function is called for a database change made by a plurality of applications in S110, thereby minimizing performance degradation by reducing file I / O of the system.

이와 같이, 본 발명의 일실시예에 따른 파일 기반 데이터베이스의 저널링 방법은 원본데이터베이스와 그 원본데이터베이스를 복제한 복제데이터베이스를 이용하는 저널링 모드를 도입하여 데이터의 무결성을 보장하면서도 성능의 저하를 방지할 수 있는 효과가 있다.As described above, the journaling method of the file-based database according to an embodiment of the present invention can introduce a journaling mode using a source database and a replica database that replicates the source database, thereby guaranteeing data integrity and preventing performance degradation. It works.

도 2는 본 발명의 일 실시예에 따른 원본데이터베이스의 변경을 복제데이터베이스에 종합하여 반영하는 방법을 설명하기 위한 흐름도이다.2 is a flowchart illustrating a method of collectively reflecting a change of an original database in a replica database according to an embodiment of the present invention.

단계 S210에서는, 데이터베이스 저널링 장치가 복수의 어플리케이션 각각이 변경하려는 원본데이터베이스 파일의 적어도 하나의 페이지에 관한 정보인 페이지정보를 수집한다.In step S210, the database journaling device collects page information which is information on at least one page of the original database file that each of the plurality of applications is to change.

예컨대, 도 4를 참조하면, 어플리케이션 A는 원본데이터베이스의 {B1, B2, B9}페이지를 수정하려고 한다. 따라서, 페이지정보는 {B1, B2, B9}의 정보를 포함할 수 있다. 또한, 어플리케이션 B는 원본데이터베이스의 {B2, B4}페이지를 수정하려고 한다. 따라서, 페이지정보는 {B2, B4}의 정보를 포함할 수 있다. 따라서, 데이터베이스 저널링 장치는 {B1, B2, B9}의 페이지정보와 {B2, B4}의 페이지정보를 어플리케이션 A와 B로부터 수집할 수 있다.For example, referring to FIG. 4, application A attempts to modify pages {B1, B2, B9} of the original database. Therefore, the page information may include information of {B 1 , B 2 , B 9 }. Application B also wants to modify the {B 2 , B 4 } page of the original database. Therefore, the page information may include information of {B 2 , B 4 }. Therefore, the database journaling device may collect page information of {B 1 , B 2 , B 9 } and page information of {B 2 , B 4 } from applications A and B.

단계 S220에서는, 데이터베이스 저널링 장치가 복수의 어플리케이션 각각에 대한 페이지정보를 분석하여, 그 복수의 어플리케이션 중 2개 이상이 변경하려는 페이지에 관한 정보인 중복페이지정보와 나머지 페이지에 관한 일반페이지정보를 생성한다.In step S220, the database journaling apparatus analyzes page information about each of the plurality of applications, and generates duplicate page information and general page information about the remaining pages, which are information about a page to be changed by two or more of the plurality of applications. .

예컨대, 도 4를 참조하면, 데이터베이스 저널링 장치는 어플리케이션 A와 B가 모두 변경하려는 페이지인 {B2}의 중복페이지정보와 어플리케이션 A와 B 중 하나만 변경하려는 나머지 페이지인 {B1, B4, B9}의 일반페이지정보를 생성할 수 있다For example, referring to FIG. 4, the apparatus for journaling a database may include duplicate page information of {B 2 }, which is a page to be changed by both applications A and B, and {B 1 , B 4 , B which is a remaining page to change only one of applications A and B. 9 } General page information can be created.

마지막으로 단계 S230에서는, 데이터베이스 저널링 장치가 그 중복페이지정보 및 일반페이지정보에 기초하여, 원본데이터베이스의 변경을 복제데이터베이스에 반영한다.Finally, in step S230, the database journaling device reflects the change of the original database in the duplicate database based on the duplicate page information and the general page information.

이때, 데이터베이스 저널링 장치는 중복페이지정보에 포함된 페이지 {B2}에 관하여는 한차례만 복제데이터베이스에 반영하고, 일반페이지정보에 포함된 페이지 {B1, B4, B9}에 관한여도 한차례만 복제데이터베이스에 반영할 수 있다.At this time, the database journaling device reflects only one time for the page {B 2 } included in the duplicate page information in the replication database, and only one time for the pages {B 1 , B 4 , B 9 } included in the general page information. Can be reflected in the replica database.

이와 같이, 본 발명의 일 실시예에 따른 원본데이터베이스의 변경을 복제데이터베이스에 종합하여 반영하는 방법은 중복페이지정보에 포함된 페이지에 관하여 한차례만 복제데이터베이스에 반영되도록 함으로써, 불필요하게 중복되는 파일 I/O를 최소화할 수 있는 효과가 있다.As described above, the method of reflecting the change of the original database in a duplicate database according to an embodiment of the present invention includes only one case of the page included in the duplicate page information in the duplicate database, thereby causing unnecessary file I / It is effective to minimize O.

한편, 도 6을 참조하면, 모바일 기반의 파일 데이터베이스인 SQLite의 PERSIST 모드는 무거운 시스템 콜인 fdatasync()를 자주 호출하고, 저널링을 위해 추가적인 파일 I/O를 많이 발생시킨다는 단점이 있다. 도 6은 SQLite의 PERSIST 모드를 사용하는 데이터베이스에 100 Byte 의 데이터를 삽입 할 때, 데이터 관련 업데이트는 8KB 정도 밖에 안되지만, 저널링을 위해 20KB의 추가적인 I/O가 발생하는 것을 나타낸다. 또한 각 PERSIST 모드 트렌젝션 마다 다섯 번의 fdatasync()를 호출한다.Meanwhile, referring to FIG. 6, the PERSIST mode of SQLite, a mobile-based file database, frequently calls fdatasync (), which is a heavy system call, and generates a lot of additional file I / O for journaling. Figure 6 shows that when inserting 100 bytes of data into a database using SQLite's PERSIST mode, the data-related update is only 8KB, but additional 20KB of I / O occurs for journaling. In addition, five calls to fdatasync () are made for each PERSIST mode transaction.

또한, 도 7을 참조하면, SQLite의 WAL 모드의 경우, 리눅스 기반 파일시스템(EXT4)의 저널링 설계와 SQLite의 저널링 방식 간의 괴리로 인하여 추가적인 파일 I/O가 발생하기 때문에 효율적이지 못하다. 예를 들어, SQLite 데이터베이스에 100Byte의 데이터를 삽입 할 때, WAL 파일 로깅을 위한 8KB, EXT4 저널 영역에 대한 20KB의 추가적인 파일 I/O를 필요로 한다.In addition, referring to FIG. 7, the WAL mode of SQLite is not efficient because additional file I / O occurs due to a difference between the journaling design of the Linux-based file system EXT4 and the journaling method of SQLite. For example, inserting 100 bytes of data into a SQLite database requires 8 KB of additional file I / O for WAL file logging and 20 KB of EXT4 journal area.

도 3은 본 발명의 일 실시예에 따른 파일 기반 데이터베이스의 저널링 장치를 설명하기 위한 도면이다.3 is a diagram illustrating a journaling apparatus of a file-based database according to an embodiment of the present invention.

도 3을 참조하면, 본 발명의 일 실시예에 따른 파일 기반 데이터베이스의 저널링 장치(300)는 파일갱신부(310) 및 파일교환부(320)를 포함할 수 있다.Referring to FIG. 3, the journaling apparatus 300 of a file-based database according to an embodiment of the present invention may include a file update unit 310 and a file exchange unit 320.

파일갱신부(310)는 복수의 어플리케이션에 의한 원본데이터베이스의 변경을 복제데이터베이스에 종합하여 반영한다.The file update unit 310 reflects the change of the original database by the plurality of applications in a replicated database.

다른 실시예에서는, 파일갱신부(310)는 복제데이터베이스에 대하여, 데이터베이스의 변경상태를 나타내는 정보인 변경정보를 소정의 기준에 따라 더 갱신할 수 있다.In another embodiment, the file update unit 310 may further update the change database, which is information indicating the change state of the database, according to a predetermined criterion.

파일교환부(320)는 원본데이터베이스와 복제데이터베이스를 상호 교환(switch)하여 제2 원본데이터베이스와 제2 복제데이터베이스를 생성한다.The file exchange unit 320 generates a second original database and a second replica database by switching between the original database and the replica database.

이때, 파일갱신부(310)는 제2 복제데이터베이스에 복수의 어플리케이션에 의한 변경이 완료되었음을 나타내는 정보인 완료정보를 더 기록한다.At this time, the file update unit 310 further records the completion information which is information indicating that the change by the plurality of applications is completed in the second replica database.

다른 실시예에서는, 파일갱신부(310)는 변경정보를 초기화하여 기록함으로써, 완료정보를 기록할 수 있다.In another embodiment, the file update unit 310 may record the completion information by initializing and recording the change information.

또 다른 실시예에서는, 변경정보가 데이터베이스의 변경상태를 나타내는 상태값을 포함할 때, 복제데이터베이스의 변경정보는 원본데이터베이스의 변경정보보다 소정의 크기만큼 큰 상태값을 포함하도록 갱신되고, 제2 복제데이터베이스의 변경정보에 포함된 상태값은 소정의 초기값으로 초기화될 수 있다.In another embodiment, when the change information includes a state value indicating a change state of the database, the change information of the clone database is updated to include a state value larger by a predetermined size than the change information of the original database, and the second clone is updated. The state value included in the change information of the database may be initialized to a predetermined initial value.

또 다른 실시예에서는, 파일갱신부(310) 및 파일교환부(320) 각각이 원본데이터베이스 또는 복제데이터베이스 파일을 변경할 때, 그 변경된 파일을 저장장치와 동기화하기 위한 함수인 동기화함수가 호출될 수 있다.In another embodiment, when each of the file updater 310 and the file exchanger 320 changes the original database or duplicate database file, a synchronization function, which is a function for synchronizing the changed file with the storage device, may be called. .

또 다른 실시예에서는, 파일갱신부(310)가 원본데이터베이스의 변경을 복제데이터베이스에 종합하여 반영할 때, 복수의 어플리케이션 각각이 변경하려는 원본데이터베이스 파일의 적어도 하나의 페이지에 관한 정보인 페이지정보를 수집하고, 그 복수의 어플리케이션 각각에 대한 페이지정보를 분석하여, 그 복수의 어플리케이션 중 2개 이상이 변경하려는 페이지에 관한 정보인 중복페이지정보와 나머지 페이지에 관한 일반페이지정보를 생성하고, 그 중복페이지정보 및 일반페이지정보에 기초하여, 원본데이터베이스의 변경을 복제데이터베이스에 반영할 수 있다.In another embodiment, when the file update unit 310 collectively reflects the changes of the original database to the replicate database, the plurality of applications collect page information which is information about at least one page of the original database file to be changed. And analyzing page information for each of the plurality of applications, generating duplicate page information which is information about a page to be changed by two or more of the plurality of applications, and general page information about the remaining pages. And based on the general page information, the change of the original database can be reflected in the replica database.

한편, 상술한 본 발명의 실시예들은 컴퓨터에서 실행될 수 있는 프로그램으로 작성가능하고, 컴퓨터로 읽을 수 있는 기록매체를 이용하여 상기 프로그램을 동작시키는 범용 디지털 컴퓨터에서 구현될 수 있다.Meanwhile, the above-described embodiments of the present invention can be written as a program that can be executed in a computer, and can be implemented in a general-purpose digital computer that operates the program using a computer-readable recording medium.

상기 컴퓨터로 읽을 수 있는 기록매체는 마그네틱 저장매체(예를 들면, 롬, 플로피 디스크, 하드디스크 등), 광학적 판독 매체(예를 들면, 시디롬, 디브이디 등) 를 포함한다.The computer-readable recording medium may include a magnetic storage medium (for example, a ROM, a floppy disk, a hard disk, etc.) and an optical reading medium (for example, a CD-ROM, DVD, etc.).

이제까지 본 발명에 대하여 그 바람직한 실시예들을 중심으로 살펴보았다. 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자는 본 발명이 본 발명의 본질적인 특성에서 벗어나지 않는 범위에서 변형된 형태로 구현될 수 있음을 이해할 수 있을 것이다. 그러므로 개시된 실시예들은 한정적인 관점이 아니라 설명적인 관점에서 고려되어야 한다. 본 발명의 범위는 전술한 설명이 아니라 특허청구범위에 나타나 있으며, 그와 동등한 범위 내에 있는 모든 차이점은 본 발명에 포함된 것으로 해석되어야 할 것이다.
So far I looked at the center of the preferred embodiment for the present invention. Those skilled in the art will appreciate that the present invention can be implemented in a modified form without departing from the essential features of the present invention. Therefore, the disclosed embodiments should be considered in descriptive sense only and not for purposes of limitation. The scope of the present invention is shown in the claims rather than the foregoing description, and all differences within the scope will be construed as being included in the present invention.

Claims (12)

원본데이터베이스의 파일과 상기 원본데이터베이스의 파일을 복제한 복제데이터베이스의 파일을 이용한 파일 기반 데이터베이스의 저널링 방법에 있어서,
데이터베이스의 저널링 장치가 복수의 어플리케이션에 의한 상기 원본데이터베이스의 변경을 상기 복제데이터베이스에 종합하여 반영하는 단계;
상기 데이터베이스의 저널링 장치가 상기 원본데이터베이스와 상기 복제데이터베이스를 상호 교환(switch)하여 제2 원본데이터베이스와 제2 복제데이터베이스를 생성하는 단계; 및
상기 데이터베이스의 저널링 장치가 상기 제2 복제데이터베이스에 상기 복수의 어플리케이션에 의한 변경이 완료되었음을 나타내는 정보인 완료정보를 기록하는 단계를 포함하되,
상기 복제데이터베이스에 종합하여 반영하는 단계는
상기 데이터베이스의 저널링 장치가 상기 복수의 어플리케이션 각각이 변경하려는 상기 원본데이터베이스의 파일 중 적어도 하나의 페이지에 관한 정보인 페이지정보를 수집하는 단계;
상기 데이터베이스의 저널링 장치가 상기 복수의 어플리케이션 각각에 대한 상기 페이지정보를 분석하여, 상기 복수의 어플리케이션 중 2개 이상이 변경하려는 페이지에 관한 정보인 중복페이지정보와 나머지 페이지에 관한 일반페이지정보를 생성하는 단계; 및
상기 데이터베이스의 저널링 장치가 상기 중복페이지정보 및 상기 일반페이지정보에 기초하여, 상기 원본데이터베이스의 변경을 상기 복제데이터베이스에 반영하는 단계
를 포함하는 것을 특징으로 하는 파일 기반 데이터베이스의 저널링 방법.
In the journaling method of a file-based database using a file of the original database and a file of a replica database that duplicates the file of the original database,
Reflecting, by the journaling device of the database, the change of the original database by a plurality of applications in the replica database;
Generating a second original database and a second replica database by switching between the original database and the replica database by a journaling device of the database; And
And recording, by the journaling device of the database, complete information which is information indicating that the change by the plurality of applications is completed in the second replicate database.
Comprehensive reflecting in the replica database
Collecting, by the journaling device of the database, page information which is information on at least one page of a file of the original database to be changed by each of the plurality of applications;
The journaling device of the database analyzes the page information for each of the plurality of applications, and generates duplicate page information and general page information about the remaining pages, which are information about a page to be changed by two or more of the plurality of applications. step; And
The journaling device of the database reflecting the change of the original database to the duplicated database based on the duplicated page information and the general page information;
Journaling method of a file-based database comprising a.
제1항에 있어서,
상기 완료정보를 기록하는 단계의 이전에,
상기 데이터베이스의 저널링 장치가 상기 복제데이터베이스에 대하여, 데이터베이스의 변경상태를 나타내는 정보인 변경정보를 소정의 기준에 따라 갱신하는 단계
를 더 포함하는 것을 특징으로 하는 파일 기반 데이터베이스의 저널링 방법.
The method of claim 1,
Prior to recording the completion information,
Updating, by the journaling device of the database, change information, which is information indicating a change state of the database, to the replicate database according to a predetermined criterion;
Journaling method of a file-based database, characterized in that it further comprises.
제2항에 있어서,
상기 완료정보를 기록하는 단계는
상기 데이터베이스의 저널링 장치가 상기 변경정보를 초기화하여 기록함으로써, 상기 완료정보를 기록하는 것을 특징으로 하는 파일 기반 데이터베이스의 저널링 방법.
The method of claim 2,
The recording of the completion information
And recording the completion information by initializing and recording the change information by the journaling device of the database.
제3항에 있어서,
상기 변경정보가 데이터베이스의 변경상태를 나타내는 상태값을 포함할 때,
상기 데이터베이스의 저널링 장치가 상기 복제데이터베이스의 변경정보를 상기 원본데이터베이스의 변경정보보다 소정의 크기만큼 큰 상태값을 포함하도록 갱신하고,
상기 제2 복제데이터베이스의 변경정보에 포함된 상태값을 소정의 초기값으로 초기화하는 것을 특징으로 하는 파일 기반 데이터베이스의 저널링 방법.
The method of claim 3,
When the change information includes a state value indicating a change state of the database,
The journaling device of the database updates the change information of the replica to include a state value larger than the change information of the original database by a predetermined size,
The journaling method of the file-based database, characterized in that for initializing the state value contained in the change information of the second replica database to a predetermined initial value.
제1항에 있어서,
상기 데이터베이스의 저널링 장치가 각각의 단계별로, 상기 원본데이터베이스 또는 상기 복제데이터베이스의 파일의 변경을 저장장치와 동기화하기 위한 함수인 동기화함수를 호출하는 것을 특징으로 하는 파일 기반 데이터베이스의 저널링 방법.
The method of claim 1,
Journaling method of the file-based database, characterized in that for each step of the journaling device of the database calls a synchronization function that is a function for synchronizing the change of the file of the original database or the replica database with the storage device.
삭제delete 원본데이터베이스의 파일과 상기 원본데이터베이스의 파일을 복제한 복제데이터베이스의 파일을 이용한 파일 기반 데이터베이스의 저널링 장치에 있어서,
복수의 어플리케이션에 의한 상기 원본데이터베이스의 변경을 상기 복제데이터베이스에 종합하여 반영하는 파일갱신부; 및
상기 원본데이터베이스와 상기 복제데이터베이스를 상호 교환(switch)하여 제2 원본데이터베이스와 제2 복제데이터베이스를 생성하는 파일교환부
를 포함하고,
상기 파일갱신부는
상기 제2 복제데이터베이스에 상기 복수의 어플리케이션에 의한 변경이 완료되었음을 나타내는 정보인 완료정보를 더 기록하되,
상기 파일갱신부가 상기 원본데이터베이스의 변경을 상기 복제데이터베이스에 종합하여 반영할 때,
상기 복수의 어플리케이션 각각이 변경하려는 상기 원본데이터베이스의 파일 중 적어도 하나의 페이지에 관한 정보인 페이지정보를 수집하고,
상기 복수의 어플리케이션 각각에 대한 상기 페이지정보를 분석하여, 상기 복수의 어플리케이션 중 2개 이상이 변경하려는 페이지에 관한 정보인 중복페이지정보와 나머지 페이지에 관한 일반페이지정보를 생성하고,
상기 중복페이지정보 및 상기 일반페이지정보에 기초하여, 상기 원본데이터베이스의 변경을 상기 복제데이터베이스에 반영하는 것을 특징으로 하는 파일 기반 데이터베이스의 저널링 장치.
In the journaling device of the file-based database using the file of the original database and the file of the replica database that duplicates the file of the original database,
A file updating unit which reflects the change of the original database by a plurality of applications in the duplicate database; And
A file exchange unit for generating a second original database and a second replica database by switching between the original database and the replica database.
Including,
The file update unit
Wherein the completion information which is information indicating that the change is completed by the plurality of applications in the second replication database is further recorded,
When the file update unit reflects the change of the original database in the replica database,
Collecting page information which is information about at least one page of a file of the original database to be changed by each of the plurality of applications,
Analyzing the page information for each of the plurality of applications, generating duplicate page information which is information about a page to be changed by two or more of the plurality of applications, and general page information about the remaining pages,
And a change of the original database is reflected in the duplicated database based on the duplicated page information and the general page information.
제7항에 있어서,
상기 파일갱신부는
상기 복제데이터베이스에 대하여, 데이터베이스의 변경상태를 나타내는 정보인 변경정보를 소정의 기준에 따라 더 갱신하는 것을 특징으로 하는 파일 기반 데이터베이스의 저널링 장치.
The method of claim 7, wherein
The file update unit
And the change information, which is information indicating a change state of the database, is further updated with respect to the duplicated database according to a predetermined criterion.
제8항에 있어서,
상기 파일갱신부는
상기 변경정보를 초기화하여 기록함으로써, 상기 완료정보를 기록하는 것을 특징으로 하는 파일 기반 데이터베이스의 저널링 장치.
The method of claim 8,
The file update unit
And recording the completion information by initializing and recording the change information.
제9항에 있어서,
상기 변경정보가 데이터베이스의 변경상태를 나타내는 상태값을 포함할 때,
상기 복제데이터베이스의 변경정보는 상기 원본데이터베이스의 변경정보보다 소정의 크기만큼 큰 상태값을 포함하도록 갱신되고,
상기 제2 복제데이터베이스의 변경정보에 포함된 상태값은 소정의 초기값으로 초기화되는 것을 특징으로 하는 파일 기반 데이터베이스의 저널링 장치.
The method of claim 9,
When the change information includes a state value indicating a change state of the database,
The change information of the replica database is updated to include a state value larger by a predetermined size than the change information of the original database,
The state value included in the change information of the second replica database is initialized to a predetermined initial value.
제9항에 있어서,
상기 파일갱신부 및 상기 파일교환부 각각이 상기 원본데이터베이스 또는 상기 복제데이터베이스의 파일을 변경할 때,
상기 변경된 파일을 저장장치와 동기화하기 위한 함수인 동기화함수가 호출되는 것을 특징으로 하는 파일 기반 데이터베이스의 저널링 장치.
The method of claim 9,
When each of the file update unit and the file exchange unit changes a file of the original database or the duplicate database,
And a synchronization function, which is a function for synchronizing the changed file with the storage device, is called.
삭제delete
KR1020170123770A 2016-11-15 2017-09-25 Method and apparatus for journaling of file-based database Active KR102024719B1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR1020160152141 2016-11-15
KR20160152141 2016-11-15

Publications (2)

Publication Number Publication Date
KR20180054422A KR20180054422A (en) 2018-05-24
KR102024719B1 true KR102024719B1 (en) 2019-09-25

Family

ID=62299216

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020170123770A Active KR102024719B1 (en) 2016-11-15 2017-09-25 Method and apparatus for journaling of file-based database

Country Status (1)

Country Link
KR (1) KR102024719B1 (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001236256A (en) * 2000-02-23 2001-08-31 Hitachi Ltd Electronic information distributed arrangement method, database distributed arrangement system, and remote management system
JP2012226453A (en) * 2011-04-15 2012-11-15 Toshiba Corp Database device and database reorganization method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100913196B1 (en) * 2007-12-11 2009-08-24 한국전자통신연구원 File Update System and Method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001236256A (en) * 2000-02-23 2001-08-31 Hitachi Ltd Electronic information distributed arrangement method, database distributed arrangement system, and remote management system
JP2012226453A (en) * 2011-04-15 2012-11-15 Toshiba Corp Database device and database reorganization method

Also Published As

Publication number Publication date
KR20180054422A (en) 2018-05-24

Similar Documents

Publication Publication Date Title
US10452271B2 (en) Reconstructing in-memory indices in a distributed data storage system
US10936547B2 (en) Filesystem replication using a minimal filesystem metadata changelog
CN106462592B (en) System and method for optimizing multi-version support for indexes
JP5339432B2 (en) Storage system
US8433863B1 (en) Hybrid method for incremental backup of structured and unstructured files
US20150213100A1 (en) Data synchronization method and system
US11397749B2 (en) Asynchronous replication of in-scope table data
US8527556B2 (en) Systems and methods to update a content store associated with a search index
US9547706B2 (en) Using colocation hints to facilitate accessing a distributed data storage system
US11093387B1 (en) Garbage collection based on transmission object models
US20160110109A1 (en) Using scratch extents to facilitate copying operations in an append-only storage system
KR102139087B1 (en) Method, server, and computer readable medium for index recovery using index redo log
JP2019519025A (en) Division and movement of ranges in distributed systems
US9772783B2 (en) Constructing an index to facilitate accessing a closed extent in an append-only storage system
EP2562657B1 (en) Management of update transactions and crash recovery for columnar database
JP2016529633A (en) Snapshot and clone replication
US9720607B2 (en) Append-only storage system supporting open and closed extents
US10628298B1 (en) Resumable garbage collection
US9619322B2 (en) Erasure-coding extents in an append-only storage system
KR100961739B1 (en) How to Keep Remote Replication Consistent Using Virtualization
US10671572B2 (en) Storage of log-structured data
US20100293143A1 (en) Initialization of database for synchronization
US11645333B1 (en) Garbage collection integrated with physical file verification
KR102024719B1 (en) Method and apparatus for journaling of file-based database
US12117907B2 (en) Data replication using an extended file replication protocol

Legal Events

Date Code Title Description
A201 Request for examination
PA0109 Patent application

Patent event code: PA01091R01D

Comment text: Patent Application

Patent event date: 20170925

PA0201 Request for examination
PG1501 Laying open of application
E902 Notification of reason for refusal
PE0902 Notice of grounds for rejection

Comment text: Notification of reason for refusal

Patent event date: 20181129

Patent event code: PE09021S01D

AMND Amendment
E601 Decision to refuse application
PE0601 Decision on rejection of patent

Patent event date: 20190730

Comment text: Decision to Refuse Application

Patent event code: PE06012S01D

Patent event date: 20181129

Comment text: Notification of reason for refusal

Patent event code: PE06011S01I

AMND Amendment
PX0901 Re-examination

Patent event code: PX09011S01I

Patent event date: 20190730

Comment text: Decision to Refuse Application

Patent event code: PX09012R01I

Patent event date: 20190129

Comment text: Amendment to Specification, etc.

PX0701 Decision of registration after re-examination

Patent event date: 20190910

Comment text: Decision to Grant Registration

Patent event code: PX07013S01D

Patent event date: 20190830

Comment text: Amendment to Specification, etc.

Patent event code: PX07012R01I

Patent event date: 20190730

Comment text: Decision to Refuse Application

Patent event code: PX07011S01I

Patent event date: 20190129

Comment text: Amendment to Specification, etc.

Patent event code: PX07012R01I

X701 Decision to grant (after re-examination)
GRNT Written decision to grant
PR0701 Registration of establishment

Comment text: Registration of Establishment

Patent event date: 20190918

Patent event code: PR07011E01D

PR1002 Payment of registration fee

Payment date: 20190919

End annual number: 3

Start annual number: 1

PG1601 Publication of registration
PR1001 Payment of annual fee

Payment date: 20221013

Start annual number: 4

End annual number: 4

PR1001 Payment of annual fee

Payment date: 20230918

Start annual number: 5

End annual number: 5

PR1001 Payment of annual fee

Payment date: 20241017

Start annual number: 6

End annual number: 6