KR101101038B1 - Flash memory based database management system and method for merging pages for the same - Google Patents

Flash memory based database management system and method for merging pages for the same Download PDF

Info

Publication number
KR101101038B1
KR101101038B1 KR1020090133976A KR20090133976A KR101101038B1 KR 101101038 B1 KR101101038 B1 KR 101101038B1 KR 1020090133976 A KR1020090133976 A KR 1020090133976A KR 20090133976 A KR20090133976 A KR 20090133976A KR 101101038 B1 KR101101038 B1 KR 101101038B1
Authority
KR
South Korea
Prior art keywords
data
storage space
block
stored
new version
Prior art date
Application number
KR1020090133976A
Other languages
Korean (ko)
Other versions
KR20110077405A (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 KR1020090133976A priority Critical patent/KR101101038B1/en
Publication of KR20110077405A publication Critical patent/KR20110077405A/en
Application granted granted Critical
Publication of KR101101038B1 publication Critical patent/KR101101038B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2308Concurrency control
    • G06F16/2315Optimistic concurrency control
    • G06F16/2329Optimistic concurrency control using versioning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/219Managing data history or versioning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2358Change logging, detection, and notification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2365Ensuring data consistency and integrity

Landscapes

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

Abstract

본 발명에 따른 데이터베이스 관리 시스템은 복수의 비휘발성 블록들을 포함하는 데이터베이스와, 상기 블록들 각각에 대하여 데이터 저장 공간 및 로그 저장 공간을 할당하고, 상기 데이터 저장 공간에 저장된 원본 데이터에 대한 업데이트 요구가 있을 때, 상기 원본 데이터가 저장된 상기 데이터 저장 공간과 동일한 블록 내의 상기 로그 저장 공간에 변화 기록을 저장하되, 상기 로그 저장 공간이 부족하면 상기 원본 데이터에 대응되는 로그 저장 공간에 저장된 변화기록들을 상기 원본 데이터에 적용 및 합병하여 새 버전의 데이터를 생성하고, 생성된 새 버전의 데이터를 다른 블록의 데이터 저장 공간에 저장하는 데이터베이스 관리부를 포함한다. 따라서, 로그 저장 공간의 오버플로우를 발생시키는 데이터를 페이지 단위로 합병 연산을 수행함으로써, 불필요한 데이터의 합병 연산을 방지하여 시스템의 쓰기 성능을 향상시키는 효과가 있고, 이에 따라 플래시메모리의 수명 단축을 방지할 수 있는 효과가 있다.The database management system according to the present invention allocates a data storage space and a log storage space to a database including a plurality of nonvolatile blocks, and to each of the blocks, there is a request to update the original data stored in the data storage space. When the change record is stored in the log storage space in the same block as the data storage space in which the original data is stored, and the log storage space is insufficient, the change records stored in the log storage space corresponding to the original data are stored in the original data. It is applied to and merged to generate a new version of the data, and includes a database management unit for storing the generated new version of the data in the data storage space of another block. Therefore, by performing merge operation on a page-by-page basis for data that causes overflow of log storage space, there is an effect of preventing unnecessary data merge operation and improving write performance of the system, thereby preventing shortening the life of flash memory. It can work.

플래시 메모리, 데이터 저장 공간, 로그 저장 공간, 블록, 합병 Flash memory, data storage, log storage, blocks, merger

Description

플래시메모리 기반 데이터베이스 관리 시스템 및 이를 위한 페이지 합병 방법{Flash memory based database management system and method for merging pages for the same}Flash memory based database management system and method for merging pages for the same}

본 발명은 플래시메모리 기반 데이터베이스 관리 시스템(DBMS) 및 이를 위한 페이지 합병 방법에 관한 것으로, 특히 업데이트 사항을 로그 형태로 저장하는 기법에서 페이지 합병의 발생을 감소시킴으로써 시스템의 쓰기 성능을 향상시킬 수 있는 합병 방법에 관한 것이다.The present invention relates to a flash memory-based database management system (DBMS) and a page merging method therefor. In particular, a merging that can improve the write performance of a system by reducing the occurrence of page merging in a technique of storing updates in a log form. It is about a method.

플래시메모리는 전원이 나가도 저장한 데이터가 지워지지 않는 비휘발성 메모리로 소형, 저전력, 강한 내구성 등의 특징을 가지고 있어 다양한 분야에 활용되고 있다. 최근에는 대용량화와 가격하락으로 디스크를 대체할 수 있을 만큼의 대량의 데이터를 저장할 수 있게 되었다. 이와 같은 플래시메모리의 대용량화에 따라 디스크보다 연산 속도가 빠른 플래시메모리를 사용하는 데이터베이스 관리시스템(DataBase Management System:DBMS)이 활발히 연구되고 있다.Flash memory is a non-volatile memory that does not erase stored data even when the power goes out. It is used in various fields because of its small size, low power, and strong durability. In recent years, due to the large capacity and low price, it is possible to store a large amount of data to replace the disk. As a result of the large capacity of the flash memory, a database management system (DBMS) using a flash memory whose operation speed is faster than that of a disk has been actively studied.

플래시메모리 기반 DBMS를 효율적으로 설계하기 위하여 가장 고려해야 하는 플래시메모리의 특징은 데이터의 업데이트 연산이다. 플래시메모리는 읽기 연산과 쓰기 연산의 단위가 각각 페이지(page)와 블록(block)이며, 임의의 페이지 업데이트를 위하여 해당 페이지가 속한 블록을 소거하고 새로운 내용을 다시 블록에 써야 하는 특성을 가지고 있다. 이와 같은 특성은 업데이트 하려는 데이터의 위치에서 단지 덮어쓰는 것으로 업데이트를 수행하는 디스크와 비교하여 비효율적이다.The most important feature of flash memory to efficiently design flash memory based DBMS is update operation of data. Flash memory has pages and blocks, which are read and write units, respectively, and have a characteristic of erasing the block to which the page belongs and writing new contents to the block for arbitrary page update. This characteristic is inefficient compared to the disk performing the update by simply overwriting the location of the data to be updated.

따라서, 이러한 비효율적인 업데이트 방식을 해결하기 위한 플래시메모리 데이터베이스 관리시스템의 저장 기법이 연구되어 왔다. 종래 [국내등록특허 제900189호 "비휘발성 메모리 기반의 데이터베이스 관리 시스템 및 방법"]에서는 임의의 데이터 페이지(플래시메모리 상에서 데이터 저장의 최소 단위)에 저장된 원본 데이터에 대한 업데이트 연산이 발생했을 때, 해당 업데이트 사항에 대한 변화 기록을 상기 원본 데이터가 저장된 데이터 저장 공간과 동일한 블록 내의 로그 저장 공간에 저장한다.Therefore, a storage technique of a flash memory database management system has been studied to solve such an inefficient update method. Conventional Patent Registration No. 900189 "Database Management System and Method Based on Non-Volatile Memory", when an update operation on original data stored in an arbitrary data page (minimum unit of data storage on flash memory) occurs, The change record for the update is stored in a log storage space in the same block as the data storage space in which the original data is stored.

이때, 블록은 로그 저장 공간이 가득 차 오버플로우가 발생할 경우 블록 단위 합병 연산을 수행한다.In this case, when the overflow occurs because the log storage space is full, the block performs a block unit merge operation.

합병 연산이란 임의의 데이터 저장 공간에 저장된 원본 데이터와 이에 관련된 업데이트 정보를 담고 있는 모든 변화 기록들(로그 저장 공간에 저장된)을 주 메모리로 읽어와 상기 원본 데이터에 상기 변화 기록들을 반영하여 최신 버전의 데이터를 생성한 후, 이를 플래시메모리의 빈 저장 공간에 저장하는 것이다. 블록 단위 합병은 블록 내의 데이터 저장 공간에 저장된 모든 원본 데이터들에 대하여 각 각의 해당 변화 기록들이 반영되어 합병이 수행되고, 새로운 블록의 데이터 저장 공간에 이 합병된 최신 버전의 데이터들이 저장되는 방법이다.The merge operation reads all the change records (stored in the log storage space) containing the original data stored in the arbitrary data storage space and related update information into the main memory, and reflects the change records in the original data to obtain the latest version. After creating the data, it is stored in the empty storage space of flash memory. Block-by-block merging is a method in which the merge is performed by reflecting each corresponding change record on all original data stored in the data storage space in the block, and the latest version of the merged data is stored in the data storage space of the new block. .

즉, 도 1에 도시한 바와 같이, 합병 전 블록 A의 데이터 저장 공간에 저장된 원본 데이터들 중 하나의 원본 데이터에 대한 업데이트 연산이 발생하면, 블록 A의 로그 저장 공간은 이미 가득 차있으므로 오버플로우가 발생하게 되고, 이에 따라 블록 단위 합병 연산을 수행하게 되어 블록 A 내의 모든 데이터 저장 공간에 저장된 원본 데이터 각각에 관련된 변화 기록들(상기 로그 저장 공간에 저장된)을 적용하여 합병 연산을 수행한다. 이후, 합병된 새 버전의 데이터는 빈 블록 B의 데이터 저장 공간에 순차적으로 저장되고, 블록 A의 모든 원본 데이터의 합병 연산이 완료되어 블록 B로의 저장이 완료되면, 블록 A는 더티(dirty) 상태가 되어 소거되며 합병 연산이 완료된다.That is, as shown in FIG. 1, if an update operation on one of the original data stored in the data storage space of the block A before the merge occurs, the log storage space of the block A is already full and overflow occurs. As a result, a block-by-block merge operation is performed, and the merge operation is performed by applying change records (stored in the log storage space) related to each of the original data stored in all data storage spaces in the block A. FIG. Thereafter, the merged new version of data is sequentially stored in the data storage space of the empty block B, and when the merge operation of all the original data of the block A is completed and the storage to the block B is completed, the block A is dirty. Is erased and the merge operation is completed.

그러나, 이와 같은 방식의 합병 방법은 블록에 저장된 각 데이터들이 로그 저장 공간에 변화 기록을 쓰는 발생률에 상관없이 블록의 로그 저장 공간의 오버플로우의 여부에 따라 수행되기 때문에 비효율적인 문제점이 발생한다. 즉, 블록 내에 빈번한 업데이트가 발생하는 데이터가 있을 경우, 이 데이터에 관련된 많은 수의 변화 기록들이 로그 저장 공간에 저장됨으로써, 많은 데이터들이 자신의 업데이트 발생률과 관계없이 불필요한 합병이 발생할 수 있다.However, the merging method in this manner is inefficient because each data stored in the block is performed according to whether or not the log storage space of the block overflows regardless of the incidence of writing change records in the log storage space. In other words, when there is data in which a frequent update occurs in a block, a large number of change records related to this data are stored in the log storage space, whereby a lot of data may cause unnecessary merging regardless of its update rate.

또한, 블록 단위 합병을 수행하는 경우, 블록 내 저장 가능한 총 데이터 저장 공간의 개수 보다 실제 합병이 발생하는 데이터의 수가 적을 수도 있음에 따라 저장 공간을 낭비할 수 있는 문제도 있다.In addition, when performing block-by-block merging, there may be a problem in that storage space may be wasted as the actual number of data generated by the merge may be smaller than the total number of data storage spaces that can be stored in the block.

본 발명은 불필요한 데이터의 합병 연산 발생을 감소시키고, 저장 공간의 낭비를 방지할 수 있는 데이터베이스 관리 시스템 및 페이지 합병 방법을 제공하는 데 그 목적이 있다.An object of the present invention is to provide a database management system and a page merging method that can reduce unnecessary data merge operations and prevent waste of storage space.

본 발명에 따른 데이터베이스 관리 시스템은 복수의 비휘발성 블록들을 포함하는 데이터베이스와, 상기 블록들 각각에 대하여 데이터 저장 공간 및 로그 저장 공간을 할당하고, 상기 데이터 저장 공간에 저장된 원본 데이터에 대한 업데이트 요구가 있을 때, 상기 원본 데이터가 저장된 상기 데이터 저장 공간과 동일한 블록 내의 상기 로그 저장 공간에 변화 기록을 저장하되, 상기 로그 저장 공간이 부족하면 상기 원본 데이터에 대응되는 로그 저장 공간에 저장된 변화기록들을 상기 원본 데이터에 적용 및 합병하여 새 버전의 데이터를 생성하고, 생성된 새 버전의 데이터를 다른 블록의 데이터 저장 공간에 저장하는 데이터베이스 관리부를 포함한다.The database management system according to the present invention allocates a data storage space and a log storage space to a database including a plurality of nonvolatile blocks, and to each of the blocks, there is a request to update the original data stored in the data storage space. When the change record is stored in the log storage space in the same block as the data storage space in which the original data is stored, and the log storage space is insufficient, the change records stored in the log storage space corresponding to the original data are stored in the original data. It is applied to and merged to generate a new version of the data, and includes a database management unit for storing the generated new version of the data in the data storage space of another block.

상기 데이터베이스 관리부는 상기 생성한 새 버전의 데이터를 상기 다른 블록의 데이터 저장 공간에 저장할 때, 이전 블록의 데이터 저장 공간에서 상기 원본 데이터는 더티(dirty)상태로 전환하는 것을 특징으로 한다.The database manager may convert the original data into a dirty state in the data storage space of the previous block when storing the generated new version of data in the data storage space of the other block.

상기 다른 블록은 사용중인 블록들 중에서 빈 데이터 저장 공간이 있는 블록 또는 사용 중이 아닌 블록인 것이 바람직하다.Preferably, the other block is a block having empty data storage space among blocks that are in use or a block that is not in use.

상기 데이터베이스 관리부는 상기 다른 블록의 데이터 저장 공간에 상기 새 버전의 데이터를 저장한 이후에, 상기 이전 블록의 데이터 저장 공간에 저장된 다른 원본 데이터들 중 하나의 원본 데이터에 대한 업데이트 요구가 발생하면, 해당하는 원본 데이터에 대응되는 상기 이전 블록의 로그 저장 공간에 저장된 변화기록들을 상기 하나의 원본 데이터에 적용 및 합병하여 제2의 새 버전의 데이터를 생성하고, 생성된 제2의 새 버전의 데이터를 상기 다른 블록의 데이터 저장 공간에 저장하고, 이전 블록의 데이터 저장 공간에서 상기 하나의 원본 데이터는 더티(dirty)상태로 전환하는 것이 바람직하다.After the database manager stores the new version of data in the data storage space of the other block, if an update request for one original data among other original data stored in the data storage space of the previous block occurs, Apply and merge change records stored in the log storage space of the previous block corresponding to the original data to the one original data to generate a second new version of the data, and generate the second new version of the data; It is preferable to store in the data storage space of another block, and to convert the one original data into the dirty state in the data storage space of the previous block.

상기 데이터베이스 관리부는 상기 이전 블록의 데이터 저장 공간에 더티(dirty) 상태로 전환된 원본 데이터의 수가 일정 개수 이상이면 해당 블록을 소거하는 것을 특징으로 한다.The database manager may delete the block if the number of original data which is converted into a dirty state in the data storage space of the previous block is a predetermined number or more.

상기 데이터베이스 관리부는 상기 새 버전의 데이터에 대한 업데이트 요구 발생 시, 상기 새 버전의 데이터는 그대로 유지하고 상기 새 버전의 데이터에 관련된 변화 기록을 상기 새 버전의 데이터가 저장된 데이터 저장 공간과 동일한 블록 내의 로그 저장 공간에 저장한다.When the update request for the data of the new version occurs, the database manager keeps the data of the new version as it is and logs a change record related to the data of the new version in the same block as the data storage space in which the data of the new version is stored. Save to storage space.

또한, 상기 데이터베이스 관리 시스템은 상기 원본 데이터 가운데 연산 장치에 의해 엑세스(access)된 원본 데이터를 인 메모리(in-memory) 데이터로 저장하는 데이터베이스 버퍼와, 상기 인 메모리 데이터에 대한 상기 연산 장치의 업데이트 요구가 있으면 상기 인 메모리 데이터를 업데이트하여 상기 데이터베이스 버퍼에 저장하고, 상기 업데이트된 인 메모리 데이터에 관한 업데이트 기록을 상기 데이터 베이스 버퍼의 다른 부분에 저장하는 버퍼 관리부를 더 포함한다.The database management system may further include a database buffer configured to store, in-memory data, original data accessed by a computing device among the original data, and an update request of the computing device to the in-memory data. And a buffer manager configured to update the in-memory data and store the updated in-memory data in the database buffer, and to store an update record regarding the updated in-memory data in another portion of the database buffer.

본 발명에 따른 페이지 합병 방법은 임의의 블록 내의 데이터 저장 공간에 저장된 원본 데이터에 대한 업데이트 요구가 발생하면, 해당 원본 데이터가 저장된 데이터 저장 공간과 동일한 블록 내의 로그 저장 공간에서 오버플로우(overflow)가 발생하는지를 판단하는 제1단계와, 상기 로그 저장 공간에서 오버플로우가 발생하면, 업데이트가 요구된 원본 데이터에 대응하는 모든 변화 기록들을 상기 원본 데이터에 적용 및 합병하여 새 버전의 데이터를 생성하는 제2단계 및 상기 생성된 새 버전의 데이터를 다른 블록의 데이터 저장 공간에 저장하는 제3단계를 포함한다.In the page merging method according to the present invention, when an update request for the original data stored in the data storage space in an arbitrary block occurs, an overflow occurs in the log storage space in the same block as the data storage space in which the original data is stored. A second step of judging whether a change occurs in the log storage space, and a second step of applying and merging all change records corresponding to the original data for which update is required to the original data to generate a new version of data. And a third step of storing the generated new version of data in a data storage space of another block.

상기 제1단계에서 상기 오버플로우가 발생하지 않으면, 상기 업데이트가 요구된 원본 데이터는 그대로 유지하고 상기 원본 데이터에 해당하는 변화 기록을 상기 원본 데이터가 저장된 데이터 저장 공간과 동일한 블록 내의 로그 저장 공간에 저장하는 것이 바람직하다.If the overflow does not occur in the first step, the original data required for updating is maintained and the change record corresponding to the original data is stored in a log storage space in the same block as the data storage space in which the original data is stored. It is desirable to.

상기 제3단계는, 사용중인 블록들 중에서 상기 새 버전의 데이터를 저장할 수 있는 빈 데이터 저장 공간이 있는지를 판단하는 단계와, 빈 데이터 저장 공간이 있는 사용중인 블록이 있으면 해당 블록의 데이터 저장 공간에 상기 새 버전의 데이터를 저장하고, 빈 데이터 저장 공간이 없으면 사용되고 있지 않은 빈 블록의 데이터 저장 공간에 상기 새 버전의 데이터를 저장하는 단계를 포함한다.The third step may include determining whether there is an empty data storage space for storing the new version of data among the in-use blocks, and if there is an in-use block having empty data storage space, the data storage space of the block. Storing the new version of data and storing the new version of data in a data storage space of an empty block that is not in use if there is no empty data storage space.

상기 제3단계 이후, 상기 다른 블록에 저장된 새로운 버전의 데이터와 대응되는 이전 블록의 원본 데이터는 더 이상 사용하지 않는 더티(dirty) 상태로 전환 하는 것이 바람직하다.After the third step, it is preferable to convert the original data of the previous block corresponding to the new version of data stored in the other block into a dirty state that is no longer used.

또한, 상기 제3단계 이후, 상기 이전 블록의 데이터 저장 공간에 저장된 다른 원본 데이터들 중 하나의 원본 데이터에 대한 업데이트 요구가 발생하면, 해당하는 원본 데이터에 대응되는 상기 이전 블록의 로그 저장 공간에 저장된 변화기록들을 상기 하나의 원본 데이터에 적용 및 합병하여 제2의 새 버전의 데이터를 생성하고, 생성된 제2의 새 버전의 데이터를 상기 다른 블록의 데이터 저장 공간에 저장한 후, 이전 블록의 데이터 저장 공간에서 상기 하나의 원본 데이터는 더티(dirty) 상태로 전환한다.Further, after the third step, if an update request for one original data among other original data stored in the data storage space of the previous block occurs, the update is stored in the log storage space of the previous block corresponding to the corresponding original data. Applying and merging change records to the one original data to generate a second new version of the data, storing the generated second new version of data in the data storage of the other block, and then the data of the previous block. In the storage space, the one original data is switched to a dirty state.

상기 이전 블록의 데이터 저장 공간에 더티(dirty) 상태로 전환된 원본 데이터의 수가 일정 개수 이상이면 해당 블록을 소거하는 것이 바람직하다.If the number of original data converted to a dirty state in the data storage space of the previous block is a predetermined number or more, it is preferable to erase the block.

또한, 상기 제3단계 이후, 상기 다른 블록의 데이터 저장 공간에 저장된 상기 새 버전의 데이터에 대한 업데이트 요구가 발생하면, 상기 새 버전의 데이터는 그대로 유지하고 상기 새 버전의 데이터에 관련된 변화 기록을 상기 새 버전의 데이터가 저장된 데이터 저장 공간과 동일한 블록 내의 로그 저장 공간에 저장한다.Further, after the third step, if an update request for the new version of data stored in the data storage space of the other block occurs, the new version of the data is kept as it is and the change record related to the new version of the data is recalled. The new version of the data is stored in the log storage space in the same block as the data storage space.

본 발명은 로그 저장 공간의 오버플로우를 발생시키는 데이터를 페이지 단위로 합병 연산을 수행함으로써, 불필요한 데이터의 합병 연산을 방지하여 시스템의 쓰기 성능을 향상시키는 효과가 있고, 이에 따라 플래시메모리의 수명 단축을 방지할 수 있는 효과가 있다.The present invention has an effect of improving the write performance of a system by preventing a merge operation of unnecessary data by performing a merge operation on a page-by-page basis of data that causes an overflow of a log storage space, thereby shortening the lifespan of a flash memory. There is an effect that can be prevented.

이하, 첨부된 도면을 참조하여 본 발명의 일 실시 예에 따른 데이터베이스 관리 시스템 및 페이지 합병 방법에 관하여 상세히 설명한다.Hereinafter, a database management system and a page merging method according to an embodiment of the present invention will be described in detail with reference to the accompanying drawings.

도 2a는 본 발명의 일 실시 예에 따른 데이터베이스 관리 시스템을 나타내는 블록도이고, 도 2b는 본 발명의 일 실시 예에 따른 데이터베이스 관리 시스템의 데이터베이스의 구조를 나타내는 도면이다.Figure 2a is a block diagram showing a database management system according to an embodiment of the present invention, Figure 2b is a diagram showing the structure of a database of a database management system according to an embodiment of the present invention.

도 2a에 도시한 바와 같이, 본 발명의 일 실시 예에 따른 데이터베이스 관리 시스템은 데이터베이스(201), 데이터베이스 관리부(203), 데이터베이스 버퍼(205) 및 버퍼 관리부(207)를 포함한다.As shown in FIG. 2A, a database management system according to an exemplary embodiment includes a database 201, a database manager 203, a database buffer 205, and a buffer manager 207.

데이터베이스(201)는 도 2b와 같이, 다수의 블록들(210, 220, 230, 240)을 포함한다.The database 201 includes a plurality of blocks 210, 220, 230, 240, as shown in FIG. 2B.

데이터베이스 관리부(203)는 데이터베이스(201) 내의 다수의 블록들 각각에 대하여 복수의 데이터 저장 공간 및 복수의 로그 저장 공간을 할당한다. 즉, 도 2b의 첫 번째 블록(210)을 예로 들면, 데이터 저장 공간을 4개의 페이지(211, 212, 213, 214)로 할당하고, 로그 저장 공간을 4개의 섹터(215, 216, 217, 218)로 할당하는 것이다.The database manager 203 allocates a plurality of data storage spaces and a plurality of log storage spaces to each of the plurality of blocks in the database 201. That is, taking the first block 210 of FIG. 2B as an example, the data storage space is allocated to four pages 211, 212, 213, and 214, and the log storage space is allocated to four sectors 215, 216, 217, and 218. ) Is assigned.

또한, 데이터베이스 관리부(203)는 상기 데이터 저장 공간에 저장된 원본 데이터에 대한 업데이트 요구가 있을 때, 상기 원본 데이터가 저장된 상기 데이터 저 장 공간과 동일한 블록 내의 상기 로그 저장 공간에 변화 기록을 저장하되, 상기 로그 저장 공간이 부족하면 상기 원본 데이터에 대응되는 로그 저장 공간에 저장된 변화기록들을 상기 원본 데이터에 적용 및 합병하여 새 버전의 데이터를 생성하고, 생성된 새 버전의 데이터를 다른 블록의 데이터 저장 공간에 저장한다.Further, when there is a request for updating the original data stored in the data storage space, the database manager 203 stores a change record in the log storage space in the same block as the data storage space in which the original data is stored. If the log storage space is insufficient, a new version of the data is generated by applying and merging change records stored in the log storage space corresponding to the original data to the original data, and creating the new version of the data in the data storage space of another block. Save it.

데이터베이스 버퍼(205)는 상기 원본 데이터 가운데 연산 장치에 의해 엑세스(access)된 원본 데이터를 인 메모리(in-memory) 데이터로 저장한다. 이때, 데이터베이스 버퍼(205)는 데이터베이스(310)와 비교하여 엑세스 타임(access time)이 짧은 휘발성 메모리일 수 있다. 예를 들어, 데이터베이스 버퍼(205)는 다이나믹 램(Dynamic RAM) 또는 스태틱 램(Static RAM)일 수 있다.The database buffer 205 stores the original data accessed by the computing device among the original data as in-memory data. In this case, the database buffer 205 may be a volatile memory having a shorter access time than the database 310. For example, the database buffer 205 may be dynamic RAM or static RAM.

버퍼 관리부(207)는 상기 인 메모리 데이터에 대한 상기 연산 장치의 업데이트 요구가 있으면 상기 인 메모리 데이터를 업데이트하여 데이터베이스 버퍼(205)에 저장하고, 상기 업데이트된 인 메모리 데이터에 관한 업데이트 기록을 데이터베이스 버퍼(205)의 다른 부분에 저장한다.The buffer manager 207 updates the in-memory data and stores the in-memory data in the database buffer 205 when there is a request for updating the in-memory device. 205) in another part.

이때, 데이터베이스 관리부(203)는 상기 인 메모리 데이터가 데이터베이스 버퍼(205)로부터 방출될 때에만, 상기 인 메모리 데이터와 관련된 변화 기록을 상기 인 메모리 데이터에 대응하는 상기 원본 데이터가 저장된 데이터 저장 공간과 동일한 상기 블록 내의 상기 로그 저장 공간에 저장할 수 있다.At this time, the database manager 203 may write a change record related to the in-memory data as the data storage space in which the original data corresponding to the in-memory data is stored only when the in-memory data is released from the database buffer 205. It can be stored in the log storage space in the block.

예로써, 데이터베이스 관리부(203)는 첫 번째 블록(210)내의 두 번째 페이지(212)에 저장된 원본 데이터의 내용을 업데이트하도록 하는 요구가 있으면, 상기 원본 데이터는 그대로 유지되고, 상기 원본 데이터와 관련된 변화 기록(로그)이 첫 번째 블록(210)내의 상기 로그 저장 공간들 중 첫 번째 섹터(215)에 저장된다. 이때, 상기 변화 기록은 로그 저장 공간들 가운데 저장 가능한 영역에 순차적으로 저장되는 것이 바람직하다. 또한, 상기 변화 기록은 상기 변화 기록에 대응되는 원본 데이터의 주소 정보를 포함하는 것이 바람직하다.For example, if the database manager 203 has a request to update the contents of the original data stored in the second page 212 in the first block 210, the original data is maintained as it is, and the change associated with the original data is maintained. A record (log) is stored in the first sector 215 of the log storage spaces in the first block 210. In this case, it is preferable that the change record is sequentially stored in a storage area among log storage spaces. Also, the change record preferably includes address information of original data corresponding to the change record.

이와 같이, 데이터베이스 관리부(203)는 원본 데이터의 내용에 대하여 업데이트 요구가 발생함에 따라, 해당하는 원본 데이터는 그대로 유지하고 변화 기록만을 상기 로그 저장 공간 중 저장 가능한 영역에 순차적으로 저장한다.As described above, as the update request occurs for the content of the original data, the database manager 203 sequentially maintains the corresponding original data and stores only the change record in the storage area of the log storage space.

이때, 만일 첫 번째 블록(210) 내에 상기 변화 기록을 저장할 상기 로그 저장 공간이 부족하게 되는 오버플로우(overflow)가 발생하게 되면, 데이터베이스 관리부(203)는 첫 번째 블록(210) 내의 로그 저장 공간에 오버플로우(overflow)를 발생시킨 변화 기록에 해당하는 원본 데이터와, 이에 대응하는 로그 저장 공간에 저장된 모든 변화 기록들을 읽어와서 합병(merging) 연산을 수행하여 새 버전의 데이터를 생성한다.In this case, if an overflow occurs in which the log storage space for storing the change record is insufficient in the first block 210, the database manager 203 may enter the log storage space in the first block 210. A new version of the data is generated by reading the original data corresponding to the change record causing the overflow and all the change records stored in the corresponding log storage space and performing a merging operation.

이를 도 3을 참조하여 설명하면, 도 3의 (a)에서 A 블록을 첫 번째 블록(210), B 블록을 두 번째 블록(220)이라고 가정하고, A 블록의 데이터 저장 공간들 및 로그 저장 공간들은 꽉 찬 상태, B 블록은 비어 있는 상태라고 가정할 때, A 블록의 데이터 저장 공간에 저장되어 있는 원본 데이터 DP1에 대한 업데이트 요구가 발생하면 이에 대한 변화 기록(로그)을 로그 저장 공간에 저장하여야 하는데, 이미 로그 저장 공간은 꽉 차 있는 상태이므로 오버플로우(overflow)가 발생하게 된다.Referring to FIG. 3, it is assumed in FIG. 3A that the A block is the first block 210 and the B block is the second block 220, and the data storage spaces and the log storage space of the A block. Assuming that it is full and block B is empty, a change record (log) should be stored in the log storage space when an update request for the original data DP1 stored in the data storage space of block A occurs. The log storage is already full, so overflow occurs.

이에 따라, 데이터베이스 관리부(203)는 상기 오버플로우를 발생시킨 원본 데이터 DP1과 이에 대응하는 모든 변화 기록들(상기 로그 저장 공간에 저장된)을 읽어와서 합병 연산을 수행하여 새 버전의 데이터 DP1'을 생성하는 것이다.Accordingly, the database manager 203 reads the original data DP1 that caused the overflow and all corresponding change records (stored in the log storage space) to perform a merge operation to generate a new version of the data DP1 '. It is.

이때, 데이터베이스 관리부(203)는 상기 새 버전의 데이터를 저장할 저장 가능한 다른 블록을 할당하여야 하는데, 할당하는 방법으로는 사용중인 블록들 중 비어있는 데이터 저장 공간이 있는 블록을 할당하는 방법과 사용 중이 아닌 빈 블록을 할당하는 방법이 있다.In this case, the database manager 203 should allocate another block capable of storing the new version of data, and the method of allocating a block having an empty data storage space among the blocks being used and not in use There is a way to allocate an empty block.

우선, 사용중인 블록들 중 비어있는 데이터 저장 공간이 있는 블록이 있는지를 판단하여, 있으면 해당 블록의 빈 데이터 저장 공간 중 가장 상위에 위치한 페이지를 할당하여 상기 새 버전의 데이터를 저장하고, 없으면 사용 중이 아닌 빈 블록의 데이터 저장 공간 중 첫 번째 페이지를 할당하여 상기 새 버전의 데이터를 저장한다.First, it is determined whether there is a block having empty data storage space among the used blocks, and if there is a block, the page located at the top of the free data storage space of the block is allocated and the new version of data is stored. The first page of the data storage space of the empty block is allocated to store the new version of data.

상기 새 버전의 데이터를 저장하고 나면, 이전 블록의 데이터 저장 공간에 저장된 상기 원본 데이터는 더티(dirty) 상태로 전환한다.After storing the new version of the data, the original data stored in the data storage space of the previous block is switched to the dirty state.

본 실시 예에서는 사용 중이 아닌 비어있는 다른 블록에 상기 새 버전의 데이터를 저장하는 방법을 사용하였다. 즉, 도 3의 (b)에 도시한 바와 같이, 사용 중이 아닌 비어 있는 블록 B의 데이터 저장 공간의 첫 번째 페이지를 할당하여 상기 생성된 새로운 버전의 데이터 DP1'을 저장한 후, 블록 A의 원본 데이터 DP1은 더티(dirty) 상태로 전환한다.In this embodiment, a method of storing the new version of data in another empty block that is not in use is used. That is, as shown in (b) of FIG. 3, the first page of the data storage space of the empty block B, which is not in use, is allocated to store the generated new version of data DP1 ', and then the original of the block A. The data DP1 switches to the dirty state.

또한, 상기 다른 블록의 데이터 저장 공간에 상기 새 버전의 데이터를 저장한 이후에, 상기 이전 블록의 데이터 저장 공간에 저장된 다른 원본 데이터들 중 하나의 원본 데이터에 대한 업데이트 요구가 발생하면 이때 역시 상기 이전 블록의 로그 저장 공간은 가득 차 있는 상태이므로 오버플로우가 발생하게 된다. In addition, after storing the new version of the data in the data storage space of the other block, if the update request for one of the original data of the other original data stored in the data storage space of the previous block occurs also at this time Since the log storage space of the block is full, an overflow occurs.

따라서, 오버플로우를 발생시킨 변화 기록에 해당하는 상기 하나의 원본 데이터와, 이에 대응하는 모든 변화 기록들을 상기 이전 블록의 로그 저장 공간으로부터 읽어와서 합병 연산을 수행하여 제2의 새 버전의 데이터를 생성하여 다른 블록에 저장하고, 상기 이전 블록의 상기 하나의 원본 데이터는 더티(dirty) 상태로 전환한다.Thus, a second new version of data is generated by performing a merge operation by reading the one original data corresponding to the change record causing the overflow and all corresponding change records from the log storage space of the previous block. To store in another block, and to convert the one original data of the previous block into a dirty state.

즉 도 3의 (c)에 도시한 바와 같이, 블록 A의 데이터 저장 공간에 저장되어 있는 또 다른 원본 데이터 DPN-1에 대한 업데이트 요구 발생 시, 로그 저장 공간은 이미 꽉 차 있으므로, 데이터베이스 관리부(203)는 원본 데이터 DPN-1과 이에 대응되는 모든 변화 기록들(로그 저장 공간에 저장된)을 읽어와서 합병 연산한 후, 제2의 새 버전의 데이터 DPN-1'을 생성하여 블록 B의 데이터 저장 공간에 순차적으로 저장하고, 블록 A의 DPN-1은 더티(dirty) 상태로 전환하는 것이다.That is, as shown in (c) of FIG. 3, when an update request for another original data DPN-1 stored in the data storage space of block A occurs, the log storage space is already full, and thus the database management unit 203 ) Reads the original data DPN-1 and all corresponding change records (stored in the log storage space), merges them, and generates a second new version of data DPN-1 'to store the data storage space of block B. Are stored sequentially, and DPN-1 of block A is switched to a dirty state.

반면, 상기 다른 블록에 저장된 상기 새 버전의 데이터에 대하여 업데이트 요구가 발생하면, 데이터베이스 관리부(203)는 상기 새 버전의 데이터는 그대로 유지하고, 상기 새 버전의 데이터가 저장된 데이터 저장 공간과 동일한 블록 내의 로그 저장 공간에 발생한 변화 기록을 순차적으로 저장하는 것이 바람직하다.On the other hand, when an update request is generated for the new version of data stored in the other block, the database manager 203 keeps the new version of data in the same block as the data storage space in which the new version of data is stored. It is preferable to sequentially store the change records generated in the log storage space.

즉, 도 3의 (d)에 도시한 바와 같이, 블록 B의 데이터 저장 공간에 저장된 새 버전의 데이터 DP1'에 대한 업데이트 요구 발생 시, 이에 대한 변화 기록(LS0)을 블록 B의 로그 저장 공간에 저장하는 것이다.That is, as shown in (d) of FIG. 3, when an update request for the new version of data DP1 'stored in the data storage space of the block B occurs, the change record LS0 for this is written to the log storage space of the block B. To save.

또한, 상기 이전 블록에서 더티(dirty) 상태로 전환된 원본 데이터들의 수가 일정 개수 이상이 되면, 해당하는 블록을 소거하는 것이 바람직하다. 즉, 블록 A에서 더티(dirty) 상태로 전환된 원본 데이터들의 수가 일정 개수 이상이 되면 블록 A를 소거하여 빈 블록으로 만드는 것이다.In addition, when the number of original data converted to a dirty state from the previous block is a predetermined number or more, it is preferable to erase the corresponding block. That is, when the number of original data that has been changed from the block A to the dirty state is a predetermined number or more, the block A is erased to make an empty block.

도 4는 본 발명의 일 실시 예에 따른 페이지 합병 방법을 나타내는 순서도이다.4 is a flowchart illustrating a page merging method according to an embodiment of the present invention.

먼저, 임의의 블록 내의 데이터 저장 공간에 저장된 원본 데이터에 대한 업데이트 요구가 발생하면, 해당 원본 데이터가 저장된 데이터 저장 공간과 동일한 블록 내의 로그 저장 공간에서 오버플로우(overflow)가 발생하는지를 판단하여(S401), 상기 로그 저장 공간에서 오버플로우가 발생하였으면, 오버플로우(overflow)를 발생시킨 변화 기록에 해당하는 원본 데이터와, 이에 대응하는 모든 변화 기록들(상기 로그 저장 공간에 저장된)을 읽어와서 합병 연산하여 새 버전의 데이터를 생성한다(S403).First, when an update request for original data stored in a data storage space in an arbitrary block occurs, it is determined whether an overflow occurs in the log storage space in the same block as the data storage space in which the corresponding original data is stored (S401). If an overflow occurs in the log storage space, the original data corresponding to the change record causing the overflow and the corresponding change records (stored in the log storage space) are read and merged. Generate a new version of the data (S403).

이후, 사용중인 다른 블록들 중 상기 생성된 새 버전의 데이터를 저장할 수 있는 빈 데이터 저장 공간이 있는지를 판단한 후(S405), 저장할 수 있는 데이터 저장 공간이 있으면 해당하는 사용중인 다른 블록 내의 비어있는 데이터 저장 공간에 상기 새 버전의 데이터를 저장하고(S407), 데이터를 저장할 수 있는 비어있는 데이 터 저장 공간을 갖는 사용중인 다른 블록이 없으면 사용되고 있지 않은 비어있는 다른 블록의 데이터 저장 공간에 상기 새 버전의 데이터를 순차적으로 저장한다(S409).After that, it is determined whether there is an empty data storage space for storing the generated new version of data among other blocks in use (S405), and if there is a data storage space for storing, the empty data in the corresponding other used block. The new version of the data is stored in a storage space (S407), and if there is no other block in use having an empty data storage space for storing data, the new version of the new version is stored in the data storage space of another empty block that is not in use. Data is stored sequentially (S409).

이후, 오버플로우(overflow)가 발생한 이전 블록 내에서 오버플로우(overflow)를 발생시킨 데이터 즉, 상기 새 버전의 데이터와 대응되는 이전의 원본 데이터는 더티(dirty)상태로 전환된다(S411).Thereafter, the data that causes the overflow in the previous block in which the overflow occurs, that is, the original data corresponding to the data of the new version, is switched to the dirty state (S411).

예를 들어, 도 3의 (a)에 도시한 바와 같이, 현재 블록 A는 N개의 데이터 저장 공간과 M개의 로그 저장 공간이 가득 찬 상태이고, 블록 B는 빈 블록이라고 가정할 때, 블록 A의 데이터 저장 공간에 저장된 원본 데이터 DP1에 대한 업데이트 요구가 발생하면, 현재 블록 A의 로그 저장 공간은 가득 찬 상태이기 때문에 오버플로우가 발생하게 된다. For example, as shown in (a) of FIG. 3, assuming that block A is full of N data storage spaces and M log storage spaces, and block B is an empty block, If an update request for the original data DP1 stored in the data storage space occurs, an overflow occurs because the log storage space of the current block A is full.

그러면, 원본 데이터 DP1과 이에 관련된 모든 변화 기록들(블록 A의 로그 저장 공간에 저장된)을 읽어와서 합병하여 새 버전의 데이터 DP1'을 생성하고, 생성된 새 버전의 데이터 DP1'을 빈 블록인 B의 데이터 저장 공간 중 첫 번째 데이터 페이지에 저장하고, 이전 블록 A의 구 버전의 데이터 DP1은 더 이상 사용하지 않는 더티(dirty)상태로 전환한다.Then, the original data DP1 and all related change records (stored in the log storage space of the block A) are read and merged to generate a new version of the data DP1 ', and the generated new version of the data DP1' is stored as an empty block B. In the first data page of the data storage space of the old block A, the old version of the data DP1 is switched to a dirty state that is no longer used.

이후, 상기 새 버전의 데이터에 대한 업데이트 요구가 발생하였는지를 판단한 후(S413), 상기 새 버전의 데이터에 대한 업데이트 요구가 발생하였으면, 상기 새 버전의 데이터가 저장된 데이터 저장 공간과 동일한 블록의 로그 저장 공간에 상기 업데이트에 대한 변화 기록을 저장한다(S415). Then, after determining whether an update request for the data of the new version has occurred (S413), if an update request for the data of the new version occurs, a log storage space of the same block as the data storage space in which the data of the new version is stored. The change record for the update is stored in step S415.

만일, 상기 새 버전의 데이터에 대한 업데이트 요구가 발생하지 않았으면, 상기 이전 블록 내의 데이터 저장 공간에 저장된 다른 원본 데이터들 중 하나의 원본 데이터에 대한 업데이트 요구가 발생하여, 상기 이전 블록 내의 로그 저장 공간에 오버플로우가 발생하였는지를 판단하는 단계(S401)를 수행한다.If the update request for the new version of the data does not occur, an update request for one original data among other original data stored in the data storage space in the previous block occurs, so that the log storage space in the previous block occurs. In step S401, a determination is made whether an overflow has occurred.

예를 들어, 도 3의 (c)에 도시한 바와 같이, 이전 블록 A에서 다시 다른 원본 데이터 DPN-1에 대한 업데이트 연산이 발생하여 로그 저장 공간에 오버플로우가 발생했다고 가정하자. 그러면, 전술한 것과 동일하게 원본 데이터 DPN-1과 이에 관련된 모든 변화 기록들(블록 A의 로그 저장 공간에 저장된)을 합병하여 제2의 새 버전의 데이터 DPN-1'을 생성하고, 이를 빈 블록인 B의 데이터 저장 공간 중 두 번째 데이터 페이지에 저장하고, 이전 블록 A의 구 버전의 데이터 DPN-1은 더티(dirty)상태로 전환한다.For example, suppose that an update operation on another original data DPN-1 occurs again in the previous block A, resulting in an overflow in the log storage space, as shown in FIG. Then, as in the above, the original data DPN-1 and all related change records (stored in the log storage space of the block A) are merged to generate a second new version of the data DPN-1 ', which is an empty block. In the second data page of the data storage space of In B, the old version of the data DPN-1 of the previous block A is switched to the dirty state.

또는, 블록 B의 데이터 저장 공간에 저장된 새로운 버전의 데이터 DP1'에 대한 업데이트 연산이 발생하였다고 가정하자. 그러면, 도 3의 (d)와 같이, 블록 B의 로그 저장 공간에 발생한 업데이트에 대한 변화 기록(LS0)을 저장한다.Alternatively, assume that an update operation has occurred for a new version of data DP1 'stored in the data storage space of block B. Then, as shown in (d) of FIG. 3, the change record LS0 of the update occurring in the log storage space of the block B is stored.

본 발명의 일 실시 예에서는 빈 블록에 새 버전의 데이터를 저장하는 방법을 예로 들었으나, 사용되고 있는 유효한 블록(live 블록)에 빈 데이터 저장 공간이 있는 경우에는 해당 블록의 데이터 저장 공간에 새 버전의 데이터를 저장할 수 있다.In an embodiment of the present invention, a method of storing a new version of data in an empty block is taken as an example. However, when there is an empty data storage space in a valid block (live block) being used, the new version of the data is stored in the data storage space of the block. Data can be saved.

또한, 상기와 같이 합병 연산이 발생함에 따라 이전 블록 내에 더티(dirty) 상태가 되는 데이터의 수가 증가하는데, 더티(dirty) 상태가 되는 데이터의 수가 일정 개수 이상 되면 해당하는 블록을 소거하는 연산을 수행하도록 할 수 있다.In addition, as the merge operation occurs as described above, the number of dirty data in the previous block increases, and when the number of dirty data exceeds a certain number, the operation for erasing the corresponding block is performed. You can do that.

본 발명의 유효성을 증명하기 위하여 플래시 메모리 DBMS에서 블록 단위의 합병 연산과 페이지 단위의 합병연산을 비교하였다. 본 실험에서는 1GB 데이터 베이스, 20MB 버퍼 풀, 100명의 가상 유저로 설정한 TPC-C 벤치마크 트레이스(trace)를 생성하여 추출한 쓰기 연산 관련 로그 레코드들을 입력 데이터로 사용한다.In order to prove the validity of the present invention, the merge operation of block unit and merge unit of page unit are compared in flash memory DBMS. In this experiment, we use the log records related to the write operation extracted by creating a TPC-C benchmark trace set with a 1GB database, a 20MB buffer pool, and 100 virtual users, as input data.

실험 트레이스의 로그 레코드 연산 통계는 아래의 표 1과 같다.The log record calculation statistics of the experiment trace are shown in Table 1 below.

연산calculate 발생 회수Number of occurrences 비율(%)ratio(%) 삽입insertion 673,077673,077 47.1147.11 삭제delete 46,13646,136 3.223.22 업데이트update 709,287709,287 49.6549.65 총합total 1,428,5001,428,500 100.0100.0

표 1. 실험 트레이스(trace)의 로그레코드 통계Table 1. Log Record Statistics for Experiment Traces

표 2는 블록을 8KB 크기의 데이터 페이지 15개와 512B 크기의 로그 섹터 16개로 구성하고, 블록의 삭제조건(페이지 단위 블록 합병의 경우)을 블록 내에 유효한(live) 상태의 데이터 페이지를 '0'개로 설정했을 때의 실험 결과이다.Table 2 shows a block consisting of 15 8KB data pages and 16 512B size log sectors, and the delete condition of the block (in case of page-by-page block consolidation) is set to '0' data pages in the block with live status. Experimental results when set.

블록 단위 합병 : 블록 합병 횟수Block Merger: Number of Block Mergers 47,89647,896 페이지 단위 합병 : 페이지 합병 횟수Page Mergers: Number of Page Mergers 549,961549,961

표 2. 블록단위합병과 페이지단위합병의 합병 연산 횟수 비교Table 2. Comparison of the number of merge operations between block unit merge and page unit merge

표 1로부터 페이지 단위 합병이 블록 단위 합병보다 약 11배 많은 합병이 발생한 것을 알 수 있다. 그러나, 블록 기반 합병은 블록 내 유효한(live) 상태인 모든 페이지에 대하여 합병이 발생하는 것이므로 실제로는 페이지 단위 합병 연산이 더 효율적이다. From Table 1, it can be seen that page-by-page mergers generated about 11 times more merges than block-based mergers. However, block-based merging is the fact that merging occurs for all pages that are in a live state in a block, so in fact, page-by-page merging is more efficient.

만약 블록 내의 페이지가 모두 유효한(live) 상태이면, 실제 데이터 단위 합병이 블록 단위 합병에 비하여 데이터 페이지 합병 연산 횟수가 약 23.45% 감소한 것이다. 따라서, 불필요한 데이터 페이지 합병을 방지하는 페이지 단위 합병이 쓰기 성능에 대하여 더 효율적인 것을 알 수 있다.If the pages in the block are all live, the actual data unit merge reduces the number of data page merge operations by about 23.45% compared to the block unit merge. Thus, it can be seen that page-by-page merge that prevents unnecessary data page merges is more efficient with regard to write performance.

표 3은 페이지 단위 합병과 블록 단위 합병의 삭제 횟수를 비교한 것이다.Table 3 compares the number of deletions of page merges and block merges.

블록 단위 합병 : 블록 삭제 횟수Block unit merge: block delete count 47,89647,896 페이지 단위 합병 : 블록 삭제 횟수Merging Pages: Block Deletion Count 35,30535,305

표 3. 블록단위합병과 페이지단위합병의 블록 삭제 횟수 비교Table 3. Comparison of the number of block deletions between block unit merge and page unit merge

페이지 단위 합병이 블록 단위 합병보다 블록 삭제 횟수가 약 26.28% 정도 감소하였다. 이로부터 페이지 단위 합병 방법이 블록 삭제 발생을 줄여 플래시메모리의 수명을 연장시키는 효과를 가지는 것을 알 수 있다.The number of block deletions is about 26.28% less than that of page merges. From this, it can be seen that the page-by-page merge method has an effect of reducing the occurrence of block deletion and extending the life of the flash memory.

이상 본 발명을 바람직한 실시 예를 사용하여 설명하였으나, 이들 실시 예는 예시적인 것이며 한정적인 것이 아니다. 본 발명이 속하는 기술분야에서 통상의 지직을 지닌 자라면 본 발명의 사상과 첨부된 특허청구범위에 제시된 권리범위에서 벗어나지 않으면서 다양한 변화와 수정을 가할 수 있음을 이해할 것이다.While the present invention has been described using the preferred embodiments, these embodiments are illustrative and not restrictive. Those skilled in the art to which the present invention pertains will appreciate that various changes and modifications can be made without departing from the spirit of the present invention and the scope of rights set forth in the appended claims.

도 1은 종래 N개의 데이터 페이지들과 M개의 로그 섹터들로 구성된 In-Page-Logging의 블록 단위 합병 전과 후의 상태를 나타내는 도면이다.FIG. 1 is a diagram illustrating a state before and after a block unit merging of conventional In-Page-Logging composed of N data pages and M log sectors.

도 2a는 본 발명의 일 실시 예에 따른 데이터베이스 관리 시스템을 나타내는 블록도이다.2A is a block diagram illustrating a database management system according to an embodiment of the present invention.

도 2b는 본 발명의 일 실시 예에 따른 데이터베이스 관리 시스템의 데이터베이스를 나타내는 도면이다.2B is a diagram illustrating a database of a database management system according to an embodiment of the present invention.

도 3은 본 발명의 일 실시 예에 따른 데이터베이스 관리 방법에 따른 블록 내의 데이터 페이지 단위의 합병 방법을 나타내는 도면이다.3 is a diagram illustrating a merging method of data page units in a block according to a database management method according to an exemplary embodiment.

도 4는 본 발명의 일 실시 예에 따른 페이지 합병 방법을 나타내는 순서도이다.4 is a flowchart illustrating a page merging method according to an embodiment of the present invention.

Claims (14)

복수의 비휘발성 블록들을 포함하는 데이터베이스와,A database comprising a plurality of nonvolatile blocks; 상기 블록들 각각에 대하여 데이터 저장 공간 및 로그 저장 공간을 할당하고, 상기 데이터 저장 공간에 저장된 원본 데이터에 대한 업데이트 요구가 있을 때, 상기 원본 데이터가 저장된 상기 데이터 저장 공간과 동일한 블록 내의 상기 로그 저장 공간에 변화 기록을 저장하되, 상기 로그 저장 공간이 부족하면 상기 원본 데이터에 대응되는 로그 저장 공간에 저장된 변화기록들을 상기 원본 데이터에 적용 및 합병하여 새 버전의 데이터를 생성하고, 생성된 새 버전의 데이터를 다른 블록의 데이터 저장 공간에 저장하는 데이터베이스 관리부Allocate a data storage space and a log storage space for each of the blocks, and when there is a request for updating the original data stored in the data storage space, the log storage space in the same block as the data storage space in which the original data is stored. If the log storage space is insufficient, if the log storage space is insufficient, the change records stored in the log storage space corresponding to the original data are applied to the original data and merged to generate a new version of the data, and the generated new version of the data. Management unit to store the data in the data storage space of another block 를 포함하는 플래시메모리 기반 데이터베이스 관리 시스템.Flash memory based database management system comprising a. 제 1항에 있어서,The method of claim 1, 상기 데이터베이스 관리부는 상기 생성한 새 버전의 데이터를 상기 다른 블록의 데이터 저장 공간에 저장할 때, 이전 블록의 데이터 저장 공간에서 상기 원본 데이터는 더티(dirty)상태로 전환하는 것을 특징으로 하는 플래시메모리 기반 데이터베이스 관리 시스템.The database manager, when storing the generated new version of the data in the data storage space of the other block, the original data in the data storage space of the previous block to the dirty state (dirty), characterized in that the flash memory-based database Management system. 제 2항에 있어서,3. The method of claim 2, 상기 다른 블록은 사용중인 블록들 중에서 빈 데이터 저장 공간이 있는 블록 또는 사용 중이 아닌 블록인 것을 특징으로 하는 플래시메모리 기반 데이터베이스 관리 시스템.The other block is a flash memory-based database management system, characterized in that the block having a free data storage space of the block in use or not in use. 제 2항에 있어서,3. The method of claim 2, 상기 데이터베이스 관리부는 상기 다른 블록의 데이터 저장 공간에 상기 새 버전의 데이터를 저장한 이후에, 상기 이전 블록의 데이터 저장 공간에 저장된 다른 원본 데이터들 중 하나의 원본 데이터에 대한 업데이트 요구가 발생하면, 해당하는 원본 데이터에 대응되는 상기 이전 블록의 로그 저장 공간에 저장된 변화기록들을 상기 하나의 원본 데이터에 적용 및 합병하여 제2의 새 버전의 데이터를 생성하고, 생성된 제2의 새 버전의 데이터를 상기 다른 블록의 데이터 저장 공간에 저장하고, 이전 블록의 데이터 저장 공간에서 상기 하나의 원본 데이터는 더티(dirty)상태로 전환하는 것을 특징으로 하는 플래시메모리 기반 데이터베이스 관리 시스템.After the database manager stores the new version of data in the data storage space of the other block, if an update request for one original data among other original data stored in the data storage space of the previous block occurs, Apply and merge change records stored in the log storage space of the previous block corresponding to the original data to the one original data to generate a second new version of the data, and generate the second new version of the data; And storing the one original data in a dirty state in a data storage space of another block, and converting the one original data from a data storage space of a previous block into a dirty state. 제 4항에 있어서,The method of claim 4, wherein 상기 데이터베이스 관리부는 상기 이전 블록의 데이터 저장 공간에 더티(dirty) 상태로 전환된 원본 데이터의 수가 일정 개수 이상이면 해당 블록을 소거하는 것을 특징으로 하는 플래시메모리 기반 데이터베이스 관리 시스템.And the database manager deletes the block when the number of original data which is converted to a dirty state in the data storage space of the previous block is a predetermined number or more. 제 4항에 있어서,The method of claim 4, wherein 상기 데이터베이스 관리부는 상기 새 버전의 데이터에 대한 업데이트 요구 발생 시, 상기 새 버전의 데이터는 그대로 유지하고 상기 새 버전의 데이터에 관련된 변화 기록을 상기 새 버전의 데이터가 저장된 데이터 저장 공간과 동일한 블록 내의 로그 저장 공간에 저장하는 것을 특징으로 하는 플래시메모리 기반 데이터베이스 관리 시스템.When the update request for the data of the new version occurs, the database manager keeps the data of the new version as it is and logs a change record related to the data of the new version in the same block as the data storage space in which the data of the new version is stored. Flash memory based database management system, characterized in that for storing in the storage space. 제 1항에 있어서,The method of claim 1, 상기 데이터베이스 관리 시스템은The database management system 상기 원본 데이터 가운데 연산 장치에 의해 엑세스된 원본 데이터를 인 메모리(in-memory) 데이터로 저장하는 데이터베이스 버퍼;A database buffer which stores original data accessed by a computing device among the original data as in-memory data; 상기 인 메모리 데이터에 대한 상기 연산 장치의 업데이트 요구가 있으면 상기 인 메모리 데이터를 업데이트하여 상기 데이터베이스 버퍼에 저장하고, 상기 업데이트된 인 메모리 데이터에 관한 업데이트 기록을 상기 데이터베이스 버퍼의 다른 부분에 저장하는 버퍼 관리부A buffer manager configured to update the in-memory data and store it in the database buffer if there is an update request of the computing device for the in-memory data, and store an update record regarding the updated in-memory data in another portion of the database buffer. 를 더 포함하는 것을 특징으로 하는 플래시메모리 기반 데이터베이스 관리 시스템.Flash memory-based database management system further comprises. 임의의 블록 내의 데이터 저장 공간에 저장된 원본 데이터에 대한 업데이트 요구가 발생하면, 해당 원본 데이터가 저장된 데이터 저장 공간과 동일한 블록 내의 로그 저장 공간에서 오버플로우(overflow)가 발생하는지를 판단하는 제1단계;A first step of determining whether an overflow occurs in a log storage space in the same block as the data storage space in which the original data is stored when an update request for the original data stored in the data storage space in any block occurs; 상기 로그 저장 공간에서 오버플로우가 발생하면, 업데이트가 요구된 원본 데이터에 대응하는 모든 변화 기록들을 상기 원본 데이터에 적용 및 합병하여 새 버전의 데이터를 생성하는 제2단계;A second step of generating a new version of the data by applying and merging all change records corresponding to the original data that is required to be updated to the original data when an overflow occurs in the log storage space; 상기 생성된 새 버전의 데이터를 다른 블록의 데이터 저장 공간에 저장하는 제3단계A third step of storing the generated new version of data in a data storage space of another block; 를 포함하는 페이지 합병 방법.Page merging method comprising a. 제 8항에 있어서, 상기 제1단계에서The method of claim 8, wherein in the first step 상기 오버플로우가 발생하지 않으면, 상기 업데이트가 요구된 원본 데이터는 그대로 유지하고 상기 원본 데이터에 해당하는 변화 기록을 상기 원본 데이터가 저장된 데이터 저장 공간과 동일한 블록 내의 로그 저장 공간에 저장하는 것을 특징으로 하는 페이지 합병 방법.If the overflow does not occur, the original data for which the update is requested is kept as it is, and a change record corresponding to the original data is stored in a log storage space in the same block as the data storage space in which the original data is stored. How to merge pages. 제 8항에 있어서, 상기 제3단계는,The method of claim 8, wherein the third step, 사용중인 블록들 중에서 상기 새 버전의 데이터를 저장할 수 있는 빈 데이터 저장 공간이 있는지를 판단하는 단계와,Determining whether there is an empty data storage space for storing the new version of data among the blocks in use; 빈 데이터 저장 공간이 있는 사용중인 블록이 있으면 해당 블록의 데이터 저장 공간에 상기 새 버전의 데이터를 저장하고, 빈 데이터 저장 공간이 없으면 사용되고 있지 않은 빈 블록의 데이터 저장 공간에 상기 새 버전의 데이터를 저장하는 단계If there is a block in use with empty data storage space, the new version of the data is stored in the data storage space of the block; if there is no empty data storage space, the new version of data is stored in the data storage space of the unused empty block. Steps to 를 포함하는 페이지 합병 방법.Page merging method comprising a. 제 8항에 있어서, 상기 제3단계 이후,The method of claim 8, wherein after the third step, 상기 다른 블록에 저장된 새로운 버전의 데이터와 대응되는 이전 블록의 원본 데이터는 더 이상 사용하지 않는 더티(dirty) 상태로 전환하는 것을 특징으로 하는 페이지 합병 방법.And converting the original data of the previous block corresponding to the new version of data stored in the other block into a dirty state which is no longer used. 제 11항에 있어서, 상기 제3단계 이후,The method of claim 11, wherein after the third step, 상기 이전 블록의 데이터 저장 공간에 저장된 다른 원본 데이터들 중 하나의 원본 데이터에 대한 업데이트 요구가 발생하면, 해당하는 원본 데이터에 대응되는 상기 이전 블록의 로그 저장 공간에 저장된 변화기록들을 상기 하나의 원본 데이터에 적용 및 합병하여 제2의 새 버전의 데이터를 생성하고, 생성된 제2의 새 버전의 데이터를 상기 다른 블록의 데이터 저장 공간에 저장한 후, 이전 블록의 데이터 저장 공간에서 상기 하나의 원본 데이터는 더티(dirty) 상태로 전환하는 것을 특징으로 하는 페이지 합병 방법.When an update request for one original data among other original data stored in the data storage space of the previous block occurs, change records stored in the log storage space of the previous block corresponding to the corresponding original data are stored in the one original data. Apply and merge to generate a second new version of the data, store the generated second new version of data in the data storage of the other block, and then store the one original data in the data storage of the previous block. Page merge method characterized in that the switch to the dirty (dirty) state. 제 12항에 있어서, The method of claim 12, 상기 이전 블록의 데이터 저장 공간에 더티(dirty) 상태로 전환된 원본 데이터의 수가 일정 개수 이상이면 해당 블록을 소거하는 것을 특징으로 하는 페이지 합병 방법.And deleting the corresponding block if the number of original data converted to a dirty state in the data storage space of the previous block is a predetermined number or more. 제 11항에 있어서, 상기 제3단계 이후,The method of claim 11, wherein after the third step, 상기 다른 블록의 데이터 저장 공간에 저장된 상기 새 버전의 데이터에 대한 업데이트 요구가 발생하면, 상기 새 버전의 데이터는 그대로 유지하고 상기 새 버전의 데이터에 관련된 변화 기록을 상기 새 버전의 데이터가 저장된 데이터 저장 공간과 동일한 블록 내의 로그 저장 공간에 저장하는 것을 특징으로 하는 페이지 합병 방법.When a request for updating the data of the new version stored in the data storage space of the other block occurs, the data of the new version is stored and the change record related to the data of the new version is maintained while the data of the new version is maintained. A page merging method, characterized by storing in log storage space in the same block as the space.
KR1020090133976A 2009-12-30 2009-12-30 Flash memory based database management system and method for merging pages for the same KR101101038B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020090133976A KR101101038B1 (en) 2009-12-30 2009-12-30 Flash memory based database management system and method for merging pages for the same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020090133976A KR101101038B1 (en) 2009-12-30 2009-12-30 Flash memory based database management system and method for merging pages for the same

Publications (2)

Publication Number Publication Date
KR20110077405A KR20110077405A (en) 2011-07-07
KR101101038B1 true KR101101038B1 (en) 2011-12-29

Family

ID=44916996

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020090133976A KR101101038B1 (en) 2009-12-30 2009-12-30 Flash memory based database management system and method for merging pages for the same

Country Status (1)

Country Link
KR (1) KR101101038B1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101666440B1 (en) * 2015-01-23 2016-10-17 주식회사 리얼타임테크 Data processing method in In-memory Database System based on Circle-Queue
WO2021019615A1 (en) * 2019-07-26 2021-02-04 三菱電機株式会社 Programmable logic controller, setting tool, and program

Also Published As

Publication number Publication date
KR20110077405A (en) 2011-07-07

Similar Documents

Publication Publication Date Title
CN110678836B (en) Persistent memory for key value storage
US10409526B2 (en) Adaptive garbage collection
KR100849221B1 (en) Method for managing non-volatile memory, and memory-based apparatus including the non-volatile memory
KR101982251B1 (en) Method for storage devices to achieve low write amplification with low over provision
EP2955633B1 (en) Data erasing method and device for flash memory
US20160217071A1 (en) Cache Allocation in a Computerized System
CN105718530B (en) File storage system and file storage control method thereof
Agarwal et al. A closed-form expression for write amplification in nand flash
KR20110117099A (en) Mapping address table maintenance in a memory device
KR20100115090A (en) Buffer-aware garbage collection technique for nand flash memory-based storage systems
KR101297442B1 (en) Nand flash memory including demand-based flash translation layer considering spatial locality
KR20130075018A (en) Data update apparatus for flash memory file system and method thereof
KR101017067B1 (en) Locality-Aware Garbage Collection Technique for NAND Flash Memory-Based Storage Systems
KR100787856B1 (en) Method for changing page in flash memory storage
KR101077901B1 (en) Apparatus and method for managing flash memory using log block level mapping algorithm
EP2264602A1 (en) Memory device for managing the recovery of a non volatile memory
KR101026634B1 (en) A method of data storage for a hybrid flash memory
KR101101038B1 (en) Flash memory based database management system and method for merging pages for the same
Ross Modeling the performance of algorithms on flash memory devices
US11199983B2 (en) Apparatus for obsolete mapping counting in NAND-based storage devices
KR100745163B1 (en) Method for managing flash memory using dynamic mapping table
KR101020781B1 (en) A method for log management in flash memory-based database systems
KR101353967B1 (en) Data process method for reading/writing data in non-volatile memory cache having ring structure
KR100868674B1 (en) The method of managing flash memory
CN112035065A (en) Data writing method, device and equipment and computer readable storage medium

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
FPAY Annual fee payment

Payment date: 20141203

Year of fee payment: 4

FPAY Annual fee payment

Payment date: 20151209

Year of fee payment: 5

LAPS Lapse due to unpaid annual fee