KR20150007435A - Method of duplicating database using pararell-processing and computer readable storage media storing the same) - Google Patents

Method of duplicating database using pararell-processing and computer readable storage media storing the same) Download PDF

Info

Publication number
KR20150007435A
KR20150007435A KR20130081319A KR20130081319A KR20150007435A KR 20150007435 A KR20150007435 A KR 20150007435A KR 20130081319 A KR20130081319 A KR 20130081319A KR 20130081319 A KR20130081319 A KR 20130081319A KR 20150007435 A KR20150007435 A KR 20150007435A
Authority
KR
South Korea
Prior art keywords
slot
value
transaction
query
reflector
Prior art date
Application number
KR20130081319A
Other languages
Korean (ko)
Other versions
KR101549655B1 (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 KR1020130081319A priority Critical patent/KR101549655B1/en
Publication of KR20150007435A publication Critical patent/KR20150007435A/en
Application granted granted Critical
Publication of KR101549655B1 publication Critical patent/KR101549655B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/466Transaction processing

Landscapes

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

Abstract

The present invention relates to a database duplication method using parallel processing and a computer-readable recording medium storing a program therefor, which may significantly reduce processing time by processing transaction in parallel in database duplication equipment. To achieve this, the database duplication method using parallel processing comprises: a first step of extracting a slot ID value and a transaction ID value from each query; a third step of determining whether the lock of a slot indicated by the extracted slot ID value is obtained; a fifth step of determining whether there is a pre-allocated applier in the slot; a seventh step of allocating an applier to the slot when an applier has not been allocated thereto; a ninth step of increasing a reference count value; and an eleventh step of cancelling the lock of the slot.

Description

병렬처리방식의 데이터베이스 이중화 방법 및 그 프로그램을 기록한 컴퓨터 판독 가능한 기록 매체{METHOD OF DUPLICATING DATABASE USING PARARELL-PROCESSING AND COMPUTER READABLE STORAGE MEDIA STORING THE SAME)}BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a parallel processing method and a computer readable recording medium storing the program.

본 발명은 병렬처리방식의 데이터베이스 이중화 방법 및 그 프로그램을 기록한 컴퓨터 판독 가능한 기록매체에 관한 것으로 더욱 상세하게, 데이터베이스 이중화 장비에 트랜젝션을 병렬로 처리하여 처리시간을 획기적으로 줄이는 것에 관한 것이다.BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a parallel processing type database duplication method and a computer readable recording medium on which the program is recorded. More particularly, the present invention relates to a transaction processing time in a database duplication processing system.

최근 기존 데이터베이스 관리도구로 데이터를 수집, 저장, 관리, 분석할 수 있는 역량을 넘어서는 대량의 정형 또는 비정형 데이터 집합 및 이러한 데이터로부터 가치를 추출하고 결과를 분석하는 빅 데이터 처리 등 데이터 베이스 관련 기술의 발전이 눈부시다.Recent advances in database-related technologies, such as large amounts of fixed or unstructured data sets beyond the ability to collect, store, manage, and analyze data with existing database management tools, and big data processing to extract values from these data and analyze the results Let this snow.

다양한 종류의 대규모 데이터에 대한 생성, 수집, 분석, 표현을 그 특징으로 하는 데이터 처리 기술의 발전은 다변화된 현대 사회를 더욱 정확하게 예측하여 효율적으로 작동케 하고 개인화된 현대 사회 구성원 마다 맞춤형 정보를 제공, 관리, 분석 가능케 하며 과거에는 불가능했던 기술을 실현시키기도 한다.The development of data processing technology, which is characterized by the generation, collection, analysis, and expression of various kinds of large data, predicts the more diverse modern society more accurately, works efficiently, provides customized information for individualized modern society members, Management, and analysis, and realizes technologies that were not possible in the past.

이같이 데이터 처리는 정치, 사회, 경제, 문화, 과학 기술 등 전 영역에 걸쳐서 사회와 인류에게 가치있는 정보를 제공할 수 있는 가능성을 제시하며 그 중요성이 부각되고 있다.In this way, data processing presents the possibility of providing valuable information to society and mankind in all areas such as politics, society, economy, culture, and science and technology.

한편, 이러한 데이터 처리의 안정성을 높이기 위해, 물리적으로 떨어져 있는 여러 개의 데이터베이스에 대하여 로컬 데이터베이스의 변경된 내용을 원격데이터베이스에 복제하고 관리하는 이중화(Replication) 과정을 거친다.Meanwhile, in order to increase the stability of the data processing, a plurality of physically separated databases are subjected to a replication process of replicating and managing the changed contents of the local database to the remote database.

특히, 뱅킹, 쇼핑, 예매 등 많은 산업 분야들이 인터넷으로 서비스를 수행하고 있는 최근의 환경에 비추어 볼 때, 인터넷 사이트의 특성상 데이터의 유실 또는 서비스 중단의 치명타를 막기 위한 데이터 베이스 백업과 이중화 과정이 매우 중요하다. 백업(Backup)은 작업 중이던 데이터 등의 사본을 만들어 저장해 두는 것으로 사용자의 실수나 컴퓨터 상의 오류, 바이러스 감염 등의 문제로 데이터의 손실 혹은 삭제되는 것에 대비하는 것인 반면, 이중화는 앞서 설명한 바와 같이 신뢰도와 가용성을 증대시키는 위해 동시에 여러 대의 서버에 동일한 데이터를 기억시켜 두는 것으로 메인 서버에 장애가 발생해도 다른 서버를 투입해 바로 서비스를 복구하는 개념이다.Especially, considering the recent environment in which many industries such as banking, shopping, and advancement are performing services on the Internet, database backup and duplication processes are very important in order to prevent data loss or service interruption due to the nature of the Internet site. It is important. Backup is to prepare and save a copy of the data that was being worked on, so as to prepare for the loss or deletion of data due to user's mistake, computer error, virus infection, etc. However, And the same data is stored in several servers at the same time in order to increase the availability, so that even if the main server fails, another server is turned on and the service is immediately restored.

데이터베이스 이중화와 관련된 선행기술로서 대한민국 특허공개공보 제10-2005-0064278호 등 다수의 문헌이 공개되어있다.As a prior art relating to database duplication, Korean Patent Laid-Open Publication No. 10-2005-0064278 and others have been disclosed.

도 1a는 종래의 데이터베이스를 이중화하는 과정을 도시한 도면이다.1A is a diagram illustrating a process of duplicating a conventional database.

종래의 데이터베이스를 이중화하는 과정을 살펴보면, 서비스 중인 메인 장비 (100)의 이중화할 데이터를 감지하고 상기 이중화할 데이터를 원격지에 위치한 이중화 장비 (200)에 전송한다. 이후 데이터를 수신받은 이중화 장비 (200)는 상기 데이터를 자신의 데이터베이스에 반영시킨다.In the process of duplicating a conventional database, data to be duplicated of the main apparatus 100 being serviced is sensed and the data to be duplicated is transmitted to the redundant apparatus 200 located at a remote place. After receiving the data, the redundancy device 200 reflects the data in its own database.

종래의 데이터베이스 이중화 과정에서는, 메인 장비 (100)의 원본 데이터에 적용된 순서를 반영하기 위해 이중화 장비 (200)의 데이터에도 순차적으로 처리한다. 예를 들어, 원본 데이터 베이스에 하기의 쿼리가 적용되었다고 가정하다. 또한, Col1 (primary key), Col2인 컬럼으로 구성된 테이블 T1에 다음과 같은 쿼리가 적용되었다면 각 쿼리 수행 후에는 커밋(commit)이 수행된다.
In the conventional database duplication process, the data of the redundant device 200 is sequentially processed to reflect the order applied to the original data of the main device 100. [ For example, assume that the following query is applied to the original database. In addition, if the following query is applied to a table T1 composed of columns Col1 (primary key), Col2, commit is performed after each query is executed.

제1 쿼리: Insert Into T1 Values( 1, ‘ABC’ ); // T1 테이블에 새로운 레코드를 삽입함First query: Insert Into T1 Values (1, 'ABC'); // Insert a new record into table T1

제2 쿼리: Update T1 Set Col2=’BCD’ Where Col1=1; // T1 테이블의 두 번째 컬럼 값 ‘ABC’를 ‘BCD’로 변경함Second query: Update T1 Set Col2 = 'BCD' Where Col1 = 1; // Change the second column value 'ABC' in table T1 to 'BCD'

제3 쿼리: Update T1 Set Col2=’CDE’ Where Col1=1; // 위에서 변경된 T1 테이블의 두 번째 컬럼 값‘BCD’를 ‘CDE’로 변경함The third query: Update T1 Set Col2 = 'CDE' Where Col1 = 1; // Change the value of the second column 'BCD' in the table T1 changed to 'CDE'

제4 쿼리: Insert Into T1 Values( 2, ‘ABC’ ); // T1 테이블에 새로운 레코드를 삽입함
The fourth query: Insert Into T1 Values (2, 'ABC'); // Insert a new record into table T1

이 경우, 원본 데이터 베이스에 모든 쿼리가 적용된 후에는 2개의 레코드가 생성되며, 최종적으로 컬럼 1이 ‘1’, 컬럼 2가 ‘CDE’의 값을 갖고 컬럼 1이 ‘2', 컬럼 2가 ‘ABC’의 값을 갖는 2 개의 레코드가 생성된다. 또한, 이중화 과정에서는 위의 데이터를 원격지 서버에 전달하고 적용할 경우 해당 레코드의 최종값은 반드시 동일한 값을 가져야 한다.In this case, after all the queries are applied to the original database, two records are generated. Finally, column 1 is' 1 ', column 2 is' CDE', column 1 is' 2 ', column 2 is' Two records having a value of ABC 'are generated. Also, in the redundancy process, when the above data is transmitted to the remote server and applied, the final value of the corresponding record must have the same value.

이때, 순차적으로 원격지 서버에 쿼리를 적용하지 않고 병렬로 처리하게 되면 쿼리 실행 순서를 보장받을 수 없다. 예를 들어, 만약 병렬로 처리되어 제3 쿼리가 먼저 적용되고 제2 쿼리가 이후에 적용된다면, 해당 레코드의 최종 값은 컬럼 2가 'BCD'가 되므로 원본 데이터 베이스와는 상이한 값을 갖게 된다. 이러한 문제를 막기 위해 원본 데이터에 적용되는 쿼리의 순서를 반드시 지켜 원격지 서버에 그대로 적용하게 된다.In this case, if the query is not applied to the remote server sequentially and processed in parallel, the query execution order can not be guaranteed. For example, if the query is processed in parallel and the third query is applied first and the second query is applied later, the final value of the corresponding record will have a different value from the original database because column 2 becomes 'BCD'. To avoid this problem, the order of the queries applied to the original data must be maintained and applied to the remote server.

그러나 제4 쿼리의 경우 프라이머리(Primary) 값이 상이하기 때문에 제1 내지 제3 쿼리의 순차적인 처리와 상관없이 독립적으로 수행되어도 무방하다. 그러나 종래의 이중화 과정에서는 이러한 쿼리가 실행하는 결과의 성격과 무관하게 모든 쿼리에 대해서 순차적으로 쿼리를 실행시키므로 전체적인 성능 저하의 원인의 원인이 된다.However, since the primary query value is different in the case of the fourth query, it may be performed independently of the sequential processing of the first to third queries. However, in the conventional redundancy process, the query is executed sequentially for all the queries regardless of the nature of the result of the execution of the query, which causes the overall performance degradation.

본 발명의 목적은 원격지 서버에 쿼리를 병렬로 처리할 수 있는 방법을 제공하는 것이다.It is an object of the present invention to provide a method for processing a query in parallel to a remote server.

본 발명에 따른 과제를 해결하기 위한 수단은 각 쿼리(Query)로부터 슬롯ID (SlotID) 값 및 트랜젝션ID (Transaction ID)값을 추출하는 제1 단계; 추출된 상기 슬롯ID 값이 지시하는 슬롯의 락(lock)을 획득하였는지 판단하는 제3 단계; 상기 슬롯에 기 할당된 반영자(Applier)가 존재하는지 판단하는 제5 단계; 반영자가 할당되지 않는 경우 반영자를 할당하는 제7 단계; 레퍼런스 카운트 (Reference Count) 값을 증가시키는 제9 단계; 및 상기 슬롯의 락을 해지하는 제11 단계; 를 포함한다.According to an aspect of the present invention, there is provided a method for processing a query, the method comprising: a first step of extracting a SlotID value and a Transaction ID value from each Query; A third step of determining whether a slot lock indicated by the extracted slot ID value is acquired; A fifth step of determining whether there is a pre-allocated Applicator in the slot; A seventh step of allocating a reflector when the reflector is not allocated; A ninth step of increasing a reference count value; And canceling the lock of the slot; .

또한, 상기 제5 단계에서 존재하는 것으로 판단되면, 상기 기 할당된 반영자가 처리하는 쿼리에서 추출된 트랜젝션ID 값이 상기 제1 단계에서 추출된 트랜젝션ID 값과 동일한지 판단하는 제6 단계;를 더 포함할 수 있다.And a sixth step of determining whether the transaction ID value extracted in the query processed by the pre-allocated reflector is the same as the transaction ID value extracted in the first step .

또한, 상기 제6 단계에서 동일한 것으로 판단되면, 상기 제7 단계를 거치지 않고 상기 제9 단계를 수행할 수 있다.In addition, if it is determined in the sixth step that it is the same, the ninth step may be performed without going through the seventh step.

또한, 상기 제6 단계에서 동일하지 않은 것으로 판단되면, 상기 슬롯에 반영자가 존재하지 않을 때까지 대기할 수 있다.Also, if it is determined in step 6 that it is not the same, it is possible to wait until there is no reflector in the slot.

또한, 상기 제3 단계에서 획득하지 못한 것으로 판단되면, 상기 슬롯의 락을 얻을 때까지 대기할 수 있다.Also, if it is determined that it is not acquired in the third step, it can wait until the lock of the slot is obtained.

한편, 트랜젝션의 커밋(Commit)을 완료하는 제1 단계; 상기 트랜젝션이 사용하고 있는 슬롯의 ID 값을 추출하는 제3 단계; 상기 슬롯의 락을 획득하는 제5 단계;On the other hand, a first step of completing a commit of a transaction; A third step of extracting an ID value of a slot used by the transaction; A fifth step of acquiring a lock of the slot;

레퍼런스 카운트에서 상기 트랜젝션에서 수행된 쿼리의 수만큼을 차감하는 제7 단계; 상기 레퍼런스 카운트의 값을 확인하여 커밋되어야 쿼리가 존재하는지 판단하는 제9 단계; 상기 슬롯에서 반영자를 삭제하는 제11 단계; 상기 슬롯의 락을 해지하는 제13 단계; 및 상기 제3 단계에서 추출한 각각 슬롯의 ID 값이 지시하는 모든 슬롯의 락을 해지하였는지 판단하는 제15 단계;를 포함할 수 있다.A seventh step of subtracting the number of queries performed in the transaction from the reference count; A ninth step of checking whether there is a query to be committed by checking the value of the reference count; An eleventh step of deleting the reflector from the slot; A thirteenth step of releasing the lock of the slot; And determining whether all the slots indicated by the ID values of the slots extracted in the third step are released.

또한, 상기 제5 단계에서 상기 슬롯의 락을 얻지 못한 것으로 판단되면, 상기 슬롯의 락을 얻을 때까지 대기할 수 있다.In addition, if it is determined that the slot lock is not obtained in the fifth step, it can wait until the lock of the slot is obtained.

또한, 상기 제9 단계에서 존재하지 않은 것으로 판단되면, 상기 제11 단계를 거치지 않고 상기 제13 단계를 수행할 수 있다.Also, if it is determined that the ninth step does not exist, the thirteenth step may be performed without going through the eleventh step.

또한, 상기 제15 단계에서 모든 슬롯의 락을 해지하지 않은 것으로 판단되면, 상기 제5 단계에서 해지되지 않은 나머지 슬롯의 락을 획득할 수 있다.In addition, if it is determined in step 15 that all slots are not unlocked, it is possible to acquire the lock of the remaining unallocated slots in the fifth step.

한편, 상기 방법들을 방법을 수행하는 프로그램을 기록한 컴퓨터로 판독가능한 기록매체에 저장될 수 있다.
On the other hand, the above methods can be stored in a computer-readable recording medium on which a program for carrying out the method is recorded.

원격지 서버의 이중화 프로세스를 병렬로 처리할 수 있어, 원격지 서버의 순차적인 데이터 처리과정에서 발생할 수 있는 병목현상을 해결할 수 있다.It is possible to process the duplication process of the remote server in parallel, thereby solving the bottleneck that may occur in the sequential data processing of the remote server.

도 1a는 종래의 데이터 베이스 이중화 과정을 나타낸 도면이다.
도 1b는 본 발명에 따른 데이터 베이스 이중화 과정을 나타낸 도면이다.
도 2는 본 발명에 따른 분배자의 동작과정을 나타낸 순서도이다.
도 3은 본 발명에 따른 반영자를 회수하는 과정을 나타낸 순서도이다.
도 4는 본 발명에 따른 분배자와 반영자의 회수 과정이 결합되는 지점을 나타난 개략저인 순서도이다.
도 5a 및 도 5b는 동일한 슬롯에 반영자가 변경됨에 따라 쿼리가 대기하고 수행하는 동작을 도시한 개념도이다.
도 6a 및 6b는 트랜젝션 수행에 소비되는 시간을 나타낸 도면이다.
1A is a diagram illustrating a conventional database duplication process.
1B is a diagram illustrating a database duplication process according to the present invention.
2 is a flowchart illustrating an operation of a distributor according to the present invention.
3 is a flowchart illustrating a process of recovering a reflector according to the present invention.
FIG. 4 is a schematic flow chart showing points where the process of collecting the distributor and the reflector according to the present invention are combined.
5A and 5B are conceptual diagrams illustrating an operation in which a query is queued and performed in response to a change in reflector in the same slot.
6A and 6B are diagrams showing time consumed in performing a transaction.

이하, 본원이 속하는 기술 분야에서 통상의 지식을 가진 자가 용이하게 실시할 수 있도록 본 발명의 구현예 및 실시예를 들어 상세히 설명한다.Hereinafter, embodiments and examples of the present invention will be described in detail so that those skilled in the art can easily carry out the present invention.

그러나 본원은 여러 가지 상이한 형태로 구현될 수 있으며 여기에서 설명하는 구현예 및 실시예에 한정되지 않는다. It should be understood, however, that the present invention may be embodied in many different forms and is not limited to the embodiments and examples described herein.

본원 명세서 전체에서, 어떤 부분이 어떤 구성요소를 “포함”한다고 할 때, 이는 특별히 반대되는 기재가 없는 한 다른 구성요소를 제외하는 것이 아니라 다른 구성 요소를 더 포함할 수 있는 것을 의미한다. Throughout this specification, when an element is referred to as " including " an element, it is understood that the element may include other elements as well, without departing from the other elements unless specifically stated otherwise.

본원 명세서 전체에서, 어떤 단계가 다른 단계와 “전에”또는 “후에” 위치하고 있다고 할 때, 이는 어떤 단계가 다른 단계와 직접 연동하는 경우 뿐만 아니라 두 단계 사이에 또 다른 단계가 존재하는 경우도 포함한다.Throughout this specification, when a step is positioned "before" or "after" another step, it includes not only when a step directly interacts with another step, but also when there is another step between the two steps .

본원 명세서 전체에서 사용되는 정도의 용어 “약”, “실질적으로” 등은 언급된 의미에 고유한 제조 및 물질 허용오차가 제시될 때 그 수치에서 또는 그 수치에 근접한 의미로 사용되고, 본 발명의 이해를 돕기 위해 정확하거나 절대적인 수치가 언급된 개시 내용을 비양심적인 침해자가 부당하게 이용하는 것을 방지하기 위해 사용된다.         The terms " about ", " substantially ", etc. used to the extent that they are used throughout the specification are used in their numerical value or in close proximity to the numerical values when the manufacturing and material tolerances inherent in the meanings mentioned are presented, To prevent unauthorized exploitation by an unscrupulous infringer of precisely or absolutely stated disclosures.

본원 명세서 전체에서 사용되는 용어 “~ (하는) 단계” 또는 “~의 단계”는 “~를 위한 단계”를 의미하지 않는다.The term " step " or " step of ~ " used throughout the specification does not mean " step for.

본원 명세서 상에서 사용되는 용어인 "전자문서"는 정보처리시스템에 의하여 전자적 형태로 작성, 송신ㆍ수신 또는 저장된 정보를 말하며, 기관에서 발급하는 제증명서를 포함하는 개념이다.
The term "electronic document " used in the present specification is a concept including an electronic certificate issued by an institution, which is information prepared in an electronic form, transmitted, received or stored by an information processing system.

이하, 첨부한 도면 및 실시예를 들어, 본원에 속한 기술 분야의 평균적 지식을 가진 자가 용이하게 본원을 반복 재현할 수 있도록 상세히 설명하도록 한다.BRIEF DESCRIPTION OF THE DRAWINGS The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention.

도 1b는 본 발명에 따른 데이터 베이스 이중화 과정을 나타낸 도면이다.1B is a diagram illustrating a database duplication process according to the present invention.

분배자의 동작을 상술하기 이전에 앞서, 본 명세서에서 언급되는 트랙젝션, 분배자, 슬롯, 반영자, 레퍼런스 카운트 및 커밋의 개념에 대해서 설명한다. Prior to describing the operation of the distributor, the concept of the transactions, distributor, slot, reflector, reference count and commit referred to herein will be described.

먼저, 트랜젝션(Transaction)이란 하나 이상의 쿼리(Query)가 커밋 또는 롤백(rollback)되는 단위를 일컫는다. 하나의 트랜젝션은 하나의 반영자에 의해 이중화 장비의 데이터베이스에 반영된다. 만약, 반영자가 5개 있다면 동시에 수행될 수 있는 트랜젝션은 5개가 된다. 하기에서 더욱 상세히 설명하겠으나, 하기의 제1 실시예에서 보는 바와 같이, 제1 쿼리 내지 제3 쿼리는, 제1 쿼리 내지 제3 쿼리가 입력되고 커밋되므로 동일한 트랜젝션을 구성한다. 한편, 제5 쿼리 및 제6 쿼리는 제5 쿼리 및 제6 쿼리가 입력되고 커밋되므로 제1 쿼리 내지 제3 쿼리와는 다른 트랜젝션을 구성한다.First, a transaction is a unit in which one or more queries are committed or rolled back. One transaction is reflected in the database of the redundant device by one reflector. If there are five reflectors, there are five transactions that can be performed simultaneously. As will be described in more detail below, as shown in the first embodiment, the first to third queries constitute the same transaction since the first to third queries are input and committed. Meanwhile, since the fifth and sixth queries are input and committed, the fifth and sixth queries constitute a transaction different from the first to third queries.

다음으로, 분배자(Distributor)는 이중화 장비에 반영하고 있는 레코드가 어떤 것이 있는지 판단하여 반영자에 분배하는 역할을 한다. 더욱 상세하게, 서로 다른 트랜젝션이 동일한 레코드를 수정하길 원하는 경우, 동일한 레코드에 동시에 처리하지 못하도록 순차적으로 처리하는 역할을 한다.Next, the Distributor determines which records are reflected in the redundant equipment and distributes them to the reflectors. More specifically, when different transactions want to modify the same record, they are sequentially processed to prevent simultaneous processing on the same record.

다음으로, 슬롯(Slot)이란 동일한 레코드에 처리하는 쿼리들의 처리 장소라 개념화할 수 있다. 쿼리가 동일한 레코드에 처리하는지 파악하려면 쿼리를 분석하거나 레코드의 유일한 값인 레코드 ID를 분석하면 알 수 있다. 예를 들어, 일반적으로 동일한 레코드를 처리하는지 알기 위해서는 테이블의 동일한 프라이머리키(primary key)를 사용하는지 혹은 동일한 레코드를 구분할 수 있는 레코드 ID를 사용하는지 파악하면 된다. 동일한 레코드를 처리하는 방법은 상기에서 언급된 것에 한정되지 않음은 물론이다. 한편, 프라이머리 키는 64비트를 사용하기 때문에 전체적인 작업의 계산량(computational complexity)을 증대시켜 로스를 증가시킨다. 물론, 프라이머리 키는 언급된 64비트에 한정되지 않으며 더 큰 값 혹은 더 작은 값이 될 수 있다. 그러므로 본 발명에서는 프라이머리키 혹은 레코드 ID를 사용하는 대신 슬롯이라는 개념을 도입하여 계산량을 대폭 줄인다. 하기에서 더욱 상세히 설명하겠으나, 하기의 제1 실시예에서 보는 바와 같이, 제1 쿼리 내지 제3 쿼리 및 제6 쿼리는 동일한 레코드에 처리하므로 동일한 슬롯을 갖으며, 제5 쿼리는 다른 레코드에 처리하므로 다른 슬롯을 갖는다. 한편, 본 발명에서의 슬롯은 프라이머리 키와 달리 재활용될 수 있다. 하기의 제1 실시예에서는 3개의 슬롯을 사용하는 것으로 예시되어 있는데, 예를 들어 가정하여, 쿼리의 개수가 1,000 개 이상 존재하고, 슬롯의 개수는 100 개로 한정되어 있다고 가정할 때, 101번 째 레코드를 처리하는 233번째 쿼리에 대해서는 1번 내지 100 번 중 어느 하나의 슬롯에 배정될 수 있다. 다시 말해, 수많은 쿼리에 대해서 제한된 개수를 갖는 슬롯이 배정되는 것이다. 제한된 개수를 갖는 슬롯을 각 쿼리에 배정하기 위해 모듈러(module)연산 등을 활용할 수 있으나 이에 한정되는 것은 아니다.Next, a slot (Slot) can be conceptualized as a processing place of queries to be processed in the same record. To determine if a query is processing the same record, you can analyze the query or analyze the record ID, which is the only value in the record. For example, you can determine if you are using the same primary key in a table, or a record ID that can identify the same record, to determine if you are processing the same record. It is needless to say that the method of processing the same record is not limited to that mentioned above. The primary key, on the other hand, uses 64 bits, increasing the overall computational complexity and increasing the loss. Of course, the primary key is not limited to the 64 bits mentioned, but may be a larger value or a smaller value. Therefore, in the present invention, the concept of a slot is used instead of using a primitive key or a record ID, thereby greatly reducing the amount of computation. As will be described in more detail below, as shown in the first embodiment, the first query through the third query and the sixth query are processed in the same record, so they have the same slot, and the fifth query is processed in the other record Have different slots. Meanwhile, the slot in the present invention can be recycled unlike the primary key. Assuming, for example, that there are 1,000 or more queries and the number of slots is limited to 100, it is assumed that three slots are used in the first embodiment, For the 233rd query processing a record, it can be assigned to any one of slots 1 to 100. In other words, a slot with a limited number of queries is allocated for a large number of queries. A module operation or the like may be used to allocate a limited number of slots to each query, but the present invention is not limited thereto.

반영자(Applier)란 트랙젝션을 실제 이중화 장비에 반영하는 역할을 한다. 예컨대, 반영자가 5개 존재한다면 5개의 트랙젝션을 동시에 수행할 수 있다.The reflector is used to reflect the transaction to the actual redundant equipment. For example, if there are five reflectors, five trajectories can be performed at the same time.

레퍼런스 카운트(Reference Count)란 현재 슬롯을 사용 중인 레코드의 개수를 의미한다. 하기에서 더욱 상세히 설명되겠으나, 하기의 제1 실시예에서 보는 바와 같이, 제1 쿼리 내지 제3 쿼리는 동일한 슬롯을 사용하므로 레퍼런스 카운트를 3으로 갖는다.The reference count refers to the number of records in use in the current slot. As will be described in more detail below, the first to third queries use the same slot, and thus have a reference count of 3, as shown in the first embodiment.

커밋(commit)란 데이터베이스와 관련된 일반적인 용어로, 데이터베이스 트랜잭션의 내용 업데이트를 영구적으로 확정하는 것을 말한다. 일반적으로 트랜잭션 종료시 해당 업데이트를 확정한다는 의미에서 "커밋"라고 사용한다.
A commit is a generic term associated with a database that is used to permanently update the content of a database transaction. Normally, you use "commit" to commit the update at the end of the transaction.

도 2는 본 발명에 따른 쿼리의 병렬 처리를 위한 순서도로, 트랜젝션을 동시 수행하기 위한 분배자의 동작을 상세히 기술한 것이다.FIG. 2 is a flow chart for a parallel processing of a query according to the present invention. The operation of a distributor for concurrently performing a transaction is described in detail.

도 2를 참조하면, 분배자의 동작은 슬롯의 ID 값 및 트랜젝션의 ID값을 추출하는 단계(S210); 추출된 트랜젝션에 관한 슬롯의 락(lock)을 획득하는 단계(S220); 락을 획득한 슬롯에 반영자가 존재하는지 확인하는 단계(S230); 획득한 슬롯에 반영자가 존재하지 않는 경우 새로운 반영자를 할당하는 단계(S240); 레퍼런스 카운트 값을 1 증가시키는 단계(S260); 락을 획득했던 해당 슬롯을 언락(unlock)하는 단계(S270); 슬롯의 락을 획득하지 못한 것으로 판단한 경우(S220) 슬롯이 락을 획득할 때까지 대기하는 단계(S225); 락을 획득한 슬롯에 반영자가 존재하는지 확인하여 존재하는 경우, 해당슬롯에 세팅된 반영자가 작업 중인 쿼리의 트랜젝션 ID 값이, S210 단계에서 추출된 트랜젝션 ID 값과 동일한지 판단하는 단계(S250); 반영자 ID 값이 동일하지 않는 경우 대기하는 단계(S255);로 이루어진다.Referring to FIG. 2, operations of the distributor include extracting an ID value of a slot and an ID value of a transaction (S210); Acquiring a lock of a slot relating to the extracted transaction (S220); A step S230 of confirming whether a reflector exists in the slot in which the lock is acquired; Allocating a new reflector if the reflector is not present in the acquired slot (S240); Incrementing the reference count value by 1 (S260); Unlocking the corresponding slot that has acquired the lock (S270); If it is determined that the slot lock can not be obtained (S220), a step S225 is awaited until the slot acquires the lock (S225); (S250) if it is determined that there is a reflector in the slot obtained by acquiring the lock, and whether the transaction ID value of the query whose reflector is set in the corresponding slot is the same as the transaction ID value extracted in step S210; (S255) if the reflector ID values are not identical.

이하, 하기의 제1 실시예를 통하여 본 발명을 더욱 상세히 설명한다.
Hereinafter, the present invention will be described in more detail with reference to the following first embodiment.

쿼리 No.Query No. 처리된 내용Processed content SQLSQL 제1쿼리The first query 새로운 Record를 삽입한다.Insert a new Record. InsertIntoT1Values(1,‘ABC’);InsertIntoT1Values (1, 'ABC'); 제2쿼리The second query 두번째Column의값‘ABC’를‘BCD’로변경한다.Change the value of the second column 'ABC' to 'BCD'. UpdateT1SetCol2=’BCD’WhereCol1=1;UpdateT1SetCol2 = 'BCD'WhereCol1 = 1; 제3쿼리The third query 위에서변경한‘BCD’를‘CDE’로변경한다.Change the above 'BCD' to 'CDE'. UpdateT1SetCol2=’CDE’WhereCol1=1;UpdateT1SetCol2 = 'CDE'WhereCol1 = 1; 제4쿼리The fourth query Transaction을 COMMT한다.Commit the transaction. commit;commit; 제5쿼리Fifth query 새로운 Record를 삽입한다.Insert a new Record. InsertIntoT1Values(2,‘ABC’);InsertIntoT1Values (2, 'ABC'); 제6쿼리The sixth query 두번째 Column의 값 ‘ABC’를 ‘XYZ’로 변경한다.Change the value of the second column 'ABC' to 'XYZ'. UpdateT1SetCol2=’XYZ’WhereCol1=1;UpdateT1SetCol2 = 'XYZ'WhereCol1 = 1; 제7쿼리Seventh query Transaction을 COMMT한다.Commit the transaction. commit;commit; 제8쿼리Eighth query 새로운 Record를 삽입한다.Insert a new Record. InsertIntoT1Values(3,‘ABC’);InsertIntoT1Values (3, 'ABC'); ·· ·· ·· ·· ·· ·· ·· ·· ··

<제1 실시예, 이중화 장비에 수신된 쿼리들>
&Lt; First embodiment, queries received in the redundant equipment >

제1 실시예와 같이 8개의 쿼리가 이중화 장비에 수신되면 먼저 분배자가 수신된 쿼리에서 슬롯 ID 값와 트랜젝션 ID 값을 추출하게 된다 (S210). 제1 쿼리에 대해서는 트랜젝션 ID 값이 1, 슬롯 ID 값이 1로 추출된다. 분배자가 수신된 쿼리로부터 트랙젝션 ID 값 및 슬롯 ID 값을 추출할 수 있도록, 쿼리는 특정 정보를 포함할 수 있다. When eight queries are received in the duplication device as in the first embodiment, the distributor first extracts the slot ID value and the transaction ID value from the received query (S210). For the first query, the transaction ID value is 1 and the slot ID value is 1. The query may include specific information so that the distributor can extract the transaction ID value and the slot ID value from the received query.

다음으로, ID 값으로 1을 갖는 슬롯에 락이 걸려있는지 판단하며, 락이 걸리지 않는 경우 락을 수행한다 (S220).Next, it is determined whether or not the slot having the ID value of 1 is locked. If the slot is not locked, the lock is performed (S220).

이후 ID 값으로 1을 갖는 슬롯에 반영자가 존재하는지 판단한다 (S230). Then, it is determined whether there is a reflector in a slot having an ID value of 1 (S230).

반영자가 존재하지 않는 경우 ID 값으로 1을 갖는 슬롯에 반영자를 세팅한다 (S240). 본 제1 실시예에서는 반영자가 5개 존재한다고 가정하므로, 이 경우 ID 값으로 1 을 갖는 슬롯에 반영자 ID 값으로 1을 세팅한다. 한편, 반영자 ID 값을 세팅하는 것은 슬롯 ID 값을 세팅하는 것과 마찬가지로 램덤하게 수행되어도 무방하다.If there is no reflector, a reflector is set in a slot having an ID value of 1 (S240). In the first embodiment, it is assumed that there are five reflectors. In this case, 1 is set as a reflector ID value in a slot having an ID value of 1. On the other hand, setting the reflector ID value may be performed randomly as setting the slot ID value.

이후 ID 값이 1인 슬롯을 사용하고 있는 레코드는, 첫 번째 레코드로 최초로 처리되는 레코드이므로 레퍼런스 카운트 값을 1 증가시킨다 (S260).Since the record using the slot having the ID value of 1 is the first record to be processed first by the first record, the reference count value is incremented by 1 (S260).

이후 ID 값이 1인 슬롯의 락을 해지한다 (S270).Thereafter, the lock of the slot having the ID value of 1 is canceled (S270).

분배자가 제2 쿼리 및 제3 쿼리를 읽어드릴 때 이와 같은 동작을 반복하며, 동일한 첫 번째 레코드를 처리하므로 레퍼런스 카운트를 증가시킨다. 본 제1 실시예에서 레퍼런스 카운트는 0에서 3까지 증가한다고 볼 수 있다.This action is repeated when the distributor reads the second query and the third query, and increases the reference count because it processes the same first record. In the first embodiment, the reference count is increased from 0 to 3.

다음으로, 분배자가 제5 쿼리를 읽어드리는 단계에 대해서 설명한다. 이 경우 커밋되는 쿼리의 집합이 변경되었기 때문에 트랜젝션 ID 값이 2로 달라지고, 처리하는 레코드도 변경되었기 때문에 슬롯 ID 값도 2로 변경된다 (S210).Next, a step in which the distributor reads the fifth query will be described. In this case, since the set of committed queries is changed, the transaction ID value is changed to 2, and the slot ID value is also changed to 2 (S210) because the transaction to be processed is also changed.

다음으로, ID 값으로 2를 갖는 슬롯에 락이 걸렸있는지 판단하며, 락이 걸리지 않는 경우 락을 수행한다 (S220).Next, it is determined whether or not the slot having the ID value of 2 is locked. If the slot is not locked, the lock is performed (S220).

이후 ID 값으로 2를 갖는 슬롯에 반영자가 존재하는지 판단한다 (S230).Then, it is determined whether a reflector exists in a slot having an ID value of 2 (S230).

반영자가 존재하지 않는 경우 ID 값으로 2를 갖는 슬롯에 반영자를 할당한다 (S240). 본 제1 실시예에서는 ID 값으로 2를 갖는 슬롯에 반영자 ID 값으로 2를 세팅한다.If there is no reflector, a reflector is assigned to a slot having an ID value of 2 (S240). In the first embodiment, the reflector ID value is set to 2 in the slot having the ID value of 2.

이후 ID 값이 2인 슬롯을 사용하고 있는 레코드는 이중화 장비의 테이블 상의 두 번째 레코드이며, 제5 쿼리는 앞서 살펴본 제1 내지 제3 쿼리와 달리 다른 레코드를 처리한다. 그러므로 다른 슬롯을 사용하는 제5 쿼리의 레퍼런스 카운트 값을 1 증가시킨다. 한편, 본 제1 실시예에서는 레퍼런스 카운트 값은 최초 0으로 초기화되어 있다고 가정한다.A record using a slot having an ID value of 2 is the second record on the table of the duplication equipment, and the fifth query processes another record unlike the first to third queries. Therefore, the reference count value of the fifth query using another slot is incremented by one. On the other hand, it is assumed that the reference count value is initialized to 0 in the first embodiment.

이후 ID 값이 2인 슬롯의 락을 해지한다 (S270).Thereafter, the lock of the slot having the ID value of 2 is canceled (S270).

다음으로 분배자가 제6 쿼리를 읽어드린다. 제6 쿼리는 제5 쿼리와 동일하게 커밋되는 쿼리의 집합 내에 포함되기 때문에 여전히 트랜젝션 ID 값은 2로 추출된다. 한편, 제6 쿼리가 제1 내지 제3 쿼리와 동일한 레코드를 처리하므로 제1 내지 제3 쿼리와 동일한 값인 1을 슬롯 ID 값으로 갖는다 (S210).Next, the distributor reads the sixth query. Since the sixth query is contained within the same set of queries that are committed as the fifth query, the transaction ID value is still extracted as two. Meanwhile, since the sixth query processes the same record as the first through third queries, the value of 1, which is the same value as the first through third queries, is used as the slot ID value (S210).

다음으로, ID 값 1을 갖는 슬롯에 락이 걸렸있는지 판단하며, 락이 걸리지 않는 경우 락을 수행한다 (S220).Next, it is determined whether or not the slot having the ID value 1 is locked. If the slot is not locked, the lock is performed (S220).

이후 ID 값으로 1을 갖는 슬롯에 반영자가 존재하는지 판단한다 (S230). 제1 실시예의 제6 쿼리는 ID 값을 1로 갖는 슬롯에 이미 반영자가 할당되어 작업 중이므로 반영자가 존재하는 것으로 판단할 수 있다. 그러므로 S250로 진행하며, 해당 슬롯에 할당된 반영자가 작업 중인 쿼리의 트랜젝션 ID 값과 앞서 S210에서 추출된 트랜젝션 ID 값이 동일한지 판단한다 (S250). 예를 들어 제1 실시예를 참조하면, 현재 ID 값이 1인 슬롯에는 ID 값이 1인 반영자가 작업 중이며, 이 반영자가 작업 중인 쿼리들은 제1 쿼리 내지 제3 쿼리로 트랜젝션의 ID 값이 1이다. 이에 반해, 앞서 S210에서 추출된 쿼리의 트랜젝션의 ID 값은 2이므로 서로 그 값이 다르다. Then, it is determined whether there is a reflector in a slot having an ID value of 1 (S230). In the sixth query of the first embodiment, since the reflector has already been allocated to the slot having the ID value of 1, it can be determined that the reflector exists because the reflector is in operation. In step S250, it is determined whether the transaction ID value of the query being processed by the reflector assigned to the corresponding slot is the same as the transaction ID value extracted in step S210 (S250). For example, referring to the first embodiment, a reflector having an ID value of 1 is currently in operation in a slot having an ID value of 1, and a query in which the reflector is in operation has a transaction ID value of 1 to be. On the other hand, the ID value of the transaction of the query extracted in S210 is 2, and thus the values thereof are different from each other.

그러므로 1을 ID 값으로 갖는 슬롯으로의 락을 해지하고 대기한다 (S255, S225). 왜냐하면 제1 쿼리 내지 제3 쿼리와 연관된 1을 ID 값으로 갖는 슬롯에 1을 ID 값으로 갖는 반영자가 작업을 수행중이므로 제1 쿼리 내지 제3 쿼리가 작업을 수행을 마칠 때까지 대기해야 하기 때문이다. Therefore, the lock to the slot having the ID value of 1 is released and waits (S255, S225). This is because the reflector having 1 as the ID value in the slot having the ID value of 1 associated with the first to third queries must be waiting for the first to third queries to complete the task .

이와 같이 분배자는 동일한 슬롯의 반영자 작업 순서를 규율하는 역할을 한다. 이를 위해, 동일한 트랜젝션 ID 값을 갖는 쿼리들은 동일한 반영자 ID 값을 갖는다.Thus, the distributor plays a role in regulating the reflector work order of the same slot. To this end, queries having the same transaction ID value have the same reflector ID value.

도 3은 반영자를 통해 트랜젝션을 데이터베이스에 반영하고 난 이후의 동작을 중심으로 나타낸 순서도이다. FIG. 3 is a flowchart mainly showing operations after a transaction is reflected in a database through a reflector.

도 3에 따른 트랜젝션을 데이터베이스에 반영하고 난 이후의 동작은 트랜젝션 커밋 완료 단계 (S310); 현재 트랜젝션이 사용하고 있는 슬롯 정보를 얻는 단계 (S320); S320에서 추출한 슬롯의 락을 획득하는 단계 (S330); 레퍼런스 카운트를 감소시키는 단계 (S340); 레퍼런스 카운트가 0인지 확인하는 단계 (S350); 해당슬롯의 반영자를 삭제하는 단계 (S360); 해당 슬롯의 락을 해지하는 단계 (S370); 및 모든 슬롯에 대한 처리를 완료했는지 확인하는 단계 (S380);로 이루어진다.After the transaction according to FIG. 3 is reflected in the database, the operation is performed in a transaction commit completion step S310; Acquiring slot information currently used by the transaction (S320); Acquiring a lock of the slot extracted in S320 (S330); Reducing the reference count (S340); Checking whether the reference count is 0 (S350); Deleting the reflector of the slot (S360); Releasing the lock of the slot (S370); And checking whether all slots have been processed (S380).

이하, 반영자를 통해 트랜젝션을 수행하고 난 이후의 동작에 대해서 제1 실시예를 바탕으로 상세히 분설한다.Hereinafter, the operation after the transaction is performed through the reflector will be described in detail based on the first embodiment.

먼저, 입력된 트랜젝션을 수행한다 (S310). 상기 제1 실시예를 참조할 때 제1 쿼리 내지 제3 쿼리가 하나의 트랙젝션을 구성하므로 상기 제1 쿼리 내지 제3 쿼리에 대해 커밋한다.First, an input transaction is performed (S310). Referring to the first embodiment, since the first to third queries constitute one transaction, the first to third queries are committed.

이후 해당 트랜젝션이 사용하고 있는 슬롯의 정보를 얻는다 (S320). 이 단계에서 슬롯의 정보를 얻는 것은 앞서 도 2의 S210와 같이 쿼리를 분석하여 슬롯 정보를 추출하는 것이 아니라 분배자의 메모리 등을 참조하여 얻는 것일 수 있다.Then, information on a slot used by the transaction is obtained (S320). At this stage, information on a slot may be acquired by referring to a memory of a distributor, rather than extracting slot information by analyzing a query as in S210 of FIG.

다음으로 얻어진 슬롯에 대하여 락을 획득한다 (S330). 앞선 단계인 S320에서 추출한 슬롯의 락을 얻을 수 있는지 판단한다. 왜냐하면 다른 트랙젝션에 영향을 받지 않아야 하기 때문이다. A lock is acquired for the next slot (S330). It is determined whether or not the lock of the extracted slot can be obtained in the preceding step S320. Because it must not be affected by other trackings.

락을 획득한 후, 트랜젝션 내 실행된 쿼리의 개수만큼 레퍼런스 카운트를 감소시킨다 (S340). 제1 실시예의 1을 ID 값으로 갖는 트랜젝션은, 제1 쿼리 내지 제3 쿼리를 포함하고 있기 때문에 3인 레퍼런스 카운트 값에서 쿼리의 수인 3만큼을 감소시켜준다.After acquiring the lock, the reference count is decreased by the number of queries executed in the transaction (S340). Since the transaction having the ID value of 1 in the first embodiment includes the first to third queries, the number of queries is reduced by 3 from the reference count value of three.

이후, 레퍼런스 카운트가 0인지 판단하고 (S350), 이후, 해당슬롯으로부터 반영자를 삭제하며 (S360), 이후, 해당슬롯의 락을 해지한다 (S370). 앞서, 제1 실시예의 제6 쿼리의 경우, 1을 ID 값으로 갖는 슬롯에 1을 ID 값으로 갖는 반영자가 이미 할당되어 있기 때문에, 제1 쿼리 내지 제3 쿼리의 수행이 끝나고 반영자가 프리 상태로 될 때까지 대기해야 함을 이미 설명하였다. Thereafter, it is determined whether the reference count is 0 (S350). Thereafter, the reflector is deleted from the slot (S360), and then the corresponding slot is unlocked (S370). In the case of the sixth query of the first embodiment, since the reflector having 1 as the ID value is already allocated to the slot having the ID value of 1, the execution of the first to third queries is completed, We have already explained that we must wait until

도 4는 도 2 및 도 3의 간략화하여 각 도면에 연관된 프로세스가 결합되는 지점을 나타낸 도면이다. FIG. 4 is a diagram showing the points where the processes associated with the respective drawings are combined in the simplification of FIGS. 2 and 3. FIG.

도 4를 참조하면, S360에서 반영자를 슬롯에서 삭제하면 도 2의 S230 단계와 연계되어 비로소 반영자를 재할당하고 쿼리를 계속적으로 수행해 나갈 수 있다.Referring to FIG. 4, if the reflector is deleted from the slot in S360, the reflector can be reassigned and the query can be continuously performed in conjunction with S230 of FIG.

다시, 도3과 관련하여, 이후 현재 트랜젝션이 포함하고 있는 쿼리의 슬롯에 대해 처리를 완료했는지 확인한다 (S380). 예를 들어, 제1 실시예의 2를 ID 값으로 트랜젝션은 1과 2를 ID 값으로 갖는 슬롯을 이용하게 된다. 그러므로 이용되는 모든 슬롯의 쿼리에 대해 상기 S330 내지 S370 단계를 처리하여야 한다.Referring again to FIG. 3, it is checked whether the processing of the slot of the query included in the current transaction is completed (S380). For example, in the first embodiment, a transaction having an ID value of 2 uses a slot having an ID value of 1 and 2. Therefore, the above-described steps S330 to S370 should be processed for the query of all slots used.

한편, 슬롯의 락을 획득하지 못하면 (S330), 슬롯의 락을 획득할 때까지 대기한다 (S335).On the other hand, if the lock of the slot is not obtained (S330), the process waits until the lock of the slot is obtained (S335).

한편, 레퍼런스 카운트가 0이 아닌 경우에는 해당 슬롯의 반영자를 삭제하지 않고 바로 해당 슬롯의 락을 해지한다 (S370). 레퍼런스 카운트가 0이 아닌 것은 해당 슬롯을 이용하여 처리해야 할 트랜젝션 및 쿼리가 여전히 존재한다는 것을 의미하므로 해당 슬롯의 반영자를 삭제하지 않아도 되기 때문이다.On the other hand, if the reference count is not 0, the lock of the slot is immediately canceled without deleting the reflector of the slot (S370). If the reference count is not 0, it means that transactions and queries to be processed using the corresponding slot still exist, and it is not necessary to delete the reflector of the corresponding slot.

한편, 제1 실시예의 제5 쿼리와 연관된 2를 ID 값으로 갖는 트랜젝션의 커밋이 완료되었다고 가정한다 (S310).Meanwhile, it is assumed that the commit of the transaction having the ID value of 2 associated with the fifth query of the first embodiment is completed (S310).

이후 현재 트랜젝션이 사용하고 있는 슬롯정보로 ID 값 2를 얻는다 (S320). 이후 다시 ID 값이 2인 슬롯의 락을 획득한다 (S330). 제1 실시예에서 ID 값이 2인 슬롯은 하나뿐이기 때문에 락이 잠겨있지 않은 것으로 볼 수 있다.Then, the ID value 2 is obtained from the slot information currently used by the transaction (S320). Thereafter, the lock of the slot having the ID value of 2 is obtained again (S330). In the first embodiment, since there is only one slot having an ID value of 2, it can be seen that the lock is not locked.

이후 제5 쿼리를 실행하였으므로 1인 레퍼런스 카운트 값에서, 레퍼런스 카운트 값을 1만큼 감소시킨다 (S340). 그 결과 레퍼런스 카운트 값은 0이 되며 현재 시점에서 더 이상 슬롯이 사용되고 있지 않은 것으로 판단할 수 있다. 이후 해당 슬롯의 반영자를 삭제하여, 2인 ID 값을 갖는 반영자는 더이상 사용되고 있지 않음을 확인시킨다 (S360). 물론 레퍼런스 카운트 값을 반드시 '0'부터 시작하여 '0'에서 끝날 필요는 없고, 현재 슬롯에서 처리되는 레코드의 처리 회수를 인식할 수 있으면 족하다.Since the fifth query has been executed since then, the reference count value is decremented by 1 from the reference count value of 1 (S340). As a result, the reference count value becomes 0, and it can be determined that the slot is not used any more at the present time. Thereafter, the reflector of the corresponding slot is deleted, and it is confirmed that the reflector having the ID value of 2 is no longer used (S360). Of course, it is not necessary to end the reference count value from '0' to '0', and it is enough to recognize the number of processing times of records processed in the current slot.

이후 해당슬롯인 ID 값이 2인 슬롯의 락을 해지시키고 (S370), 더 이상 처리할 쿼리가 남아 있는지 확인한다 (S380).Thereafter, the lock of the slot having the ID value of 2 as the corresponding slot is canceled (S370), and it is confirmed whether there is any more query to be processed (S380).

이와 같은 방법을 반복하여 슬롯 내 할당된 반영자들을 모두 회수하고 재할당할 수 있다.By repeating this method, all the reflectors allocated in the slot can be retrieved and reallocated.

도 5a 및 도 5b는 동일한 슬롯에 반영자가 변경됨에 따라 쿼리가 대기하고 수행하는 동작을 도시한 개념도이다.5A and 5B are conceptual diagrams illustrating an operation in which a query is queued and performed in response to a change in reflector in the same slot.

도 5a을 참조하면, 1을 ID 값으로 갖는 반영자와 2를 ID 값으로 갖는 반영자가 1을 ID 값으로 갖는 슬롯과 2를 ID 값으로 갖는 슬롯에 각각 할당되어 작업을 시작한다. 이때, 제6 쿼리와 같이 동일 슬롯 내의 다른 트랜젝션 ID 값을 갖는 쿼리가 입력오면 상기 제6 쿼리를 대기큐에서 대기시킨다. 대기큐에 쿼리를 대기 시키 전에 슬롯의 락을 해지함은 물론이다.Referring to FIG. 5A, a reflector having 1 as an ID value and a reflector having 2 as an ID value are assigned to slots having IDs of 1 and slots having IDs of 2, respectively, and work is started. At this time, if a query having another transaction ID value in the same slot is input as in the sixth query, the sixth query is queued in the waiting queue. Of course, the slot is unlocked before queuing the queue.

도 5b를 참조하면, 이후 제1 쿼리 내지 제3 쿼리가 모두 실행되어 해당 슬롯 에서 반영자가 삭제되면, 대기 상태가 해지되고 비로소 제6 쿼리가 1을 ID 값으로 갖는 슬롯을 획득하며 2를 ID 값으로 갖는 반영자에 의해 쿼리를 수행할 수 있게 된다. 도 5b에서 보는 바와 같이, 반영자가 1을 ID 값으로 갖는 슬롯으로 이동하여 작업을 수행하고, 제7 쿼리 및 제8 쿼리 등이 연달아 수행될 수 있다. Referring to FIG. 5B, when all the first to third queries are executed and the reflector is deleted in the corresponding slot, the wait state is canceled and the sixth query acquires a slot having ID as 1, As shown in FIG. As shown in FIG. 5B, the reflector moves to the slot having the ID value of 1 to perform the operation, and the seventh query, the eighth query, and the like can be performed consecutively.

이후 ID 값이 1인 슬롯의 락을 해지한다.Then, the lock of the slot whose ID value is 1 is canceled.

마지막으로 제8 쿼리에 대해서 상기 단계를 반복하여 트랜젝션 ID 값은 3, 슬롯 ID 값은 3, 반영자 ID 값은 3, 레퍼런스 카운트 값은 1로 세팅한다.Finally, the above steps are repeated for the eighth query to set the transaction ID value to 3, the slot ID value to 3, the reflector ID value to 3, and the reference count value to 1.

상기 제1 쿼리 내지 제8 쿼리까지 각 단계 수행에 따른 트랜젝션 ID, 슬롯 ID, 반영자 ID 및 레퍼런스 카운트 값의 관계는 하기 표와 같다.The relationship between the transaction ID, the slot ID, the reflector ID, and the reference count value according to the steps from the first query to the eighth query is shown in the following table.

쿼리 No.Query No. 트랜젝션 IDTransaction ID 슬롯 IDSlot ID 반영자 IDReflector ID 레퍼런스 카운트Reference count 제1쿼리The first query 1One 1One 1One 1One 제2쿼리The second query 1One 1One 1One 22 제3쿼리The third query 1One 1One 1One 33 제4쿼리The fourth query 제5쿼리Fifth query 22 22 22 1One 제6쿼리The sixth query 22 1One 22 1One 제7쿼리Seventh query 제8쿼리Eighth query 33 33 33 1One

<제1 실시예에 따른 ID 값>
<ID value according to the first embodiment>

도 6a 및 6b는 트랜젝션 수행에 소비되는 시간을 나타낸 도면이다.6A and 6B are diagrams showing time consumed in performing a transaction.

도 6a는 종래의 방식에 따른 트랜젝션 수행에 따른 시간을 나타낸 도면이다. 도 6a에서 보는 바와 같이, 핸들하는 레코드가 다름에도 불구하고 하나의 반영자를 이용하여 트랜젝션을 수행하므로 순차적으로 수행할 수밖에 없다. 그러므로 전체 트랜젝션을 완료하는데 소비되는 시간이 길다.FIG. 6A is a diagram illustrating a time taken for performing a transaction according to a conventional method. As shown in FIG. 6A, although the record to be handled is different, a transaction is performed using a single reflector, and therefore, it is inevitable to sequentially perform the transaction. Therefore, the time consumed to complete an entire transaction is long.

도 6b는 본 발명에 따른 트랜젝션 수행에 따른 시간을 나타낸 도면이다. 제1 실시예를 함께 참조하여 설명하면, 1을 ID 값으로 갖는 트랜젝션과 2를 ID 값으로 갖는 트랜젝션이 서로 동일한 레코드를 수정하기 때문에 분배자에 의해서 순차적으로 수행될 것이고, 3을 ID 값으로 갖는 트랜젝션의 경우 다른 레코드를 추가하는 것이기 때문에 분배자에 의해서 병렬로 수행할 수 있다.FIG. 6B is a diagram illustrating a time for performing a transaction according to the present invention. Explaining with reference to the first embodiment, a transaction having an ID value of 1 and a transaction having an ID value of 2 will be sequentially executed by the distributor because they modify the same record. In the case of a transaction, it can be done in parallel by the distributor since it adds another record.

이와 같이, 종래의 방식과 비교한다면 α만큼의 수행시간이 줄어들게 된다. 트랜젝션이 많고 반영자를 많이 생성하여 동시에 수행되는 트랜젝션의 개수가 많아 지면, 전체 데이터베이스를 이중화하는데 소비되는 시간을 획기적으로 줄일 수 있다.Thus, compared with the conventional method, the execution time by? Is reduced. If the number of transactions is large and the number of concurrent transactions is increased, the time required to duplicate the entire database can be drastically reduced.

Claims (10)

각 쿼리(Query)로부터 슬롯ID (SlotID) 값 및 트랜젝션ID (Transaction ID)값을 추출하는 제1 단계;
추출된 상기 슬롯ID 값이 지시하는 슬롯의 락 (lock)을 획득하였는지 판단하는 제3 단계;
상기 슬롯에 기 할당된 반영자(Applier)가 존재하는지 판단하는 제5 단계;
반영자가 할당되지 않는 경우 반영자를 할당하는 제7 단계;
레퍼런스 카운트 (Reference Count) 값을 증가시키는 제9 단계; 및
상기 슬롯의 락을 해지하는 제11 단계; 를 포함하는 것을 특징으로 하는 병렬처리방식의 데이터베이스 이중화 방법.
A first step of extracting a SlotID value and a Transaction ID value from each Query;
A third step of determining whether a slot lock indicated by the extracted slot ID value is acquired;
A fifth step of determining whether there is a pre-allocated Applicator in the slot;
A seventh step of allocating a reflector when the reflector is not allocated;
A ninth step of increasing a reference count value; And
An eleventh step of releasing the lock of the slot; And a database processing unit for executing the parallel processing.
제1 항에 있어서,
상기 제5 단계에서 존재하는 것으로 판단되면, 상기 기 할당된 반영자가 처리하는 쿼리에서 추출된 트랜젝션ID 값이 상기 제1 단계에서 추출된 트랜젝션ID 값과 동일한지 판단하는 제6 단계;를 더 포함하는 것을 특징으로 하는 병렬처리방식의 데이터베이스 이중화 방법.
The method according to claim 1,
And a sixth step of determining whether the transaction ID value extracted in the query processed by the pre-allocated reflector is the same as the transaction ID value extracted in the first step, if it is determined to exist in the fifth step Wherein the parallel processing method is a database duplication method.
제2 항에 있어서,
상기 제6 단계에서 동일한 것으로 판단되면, 상기 제7 단계를 거치지 않고 상기 제9 단계를 수행하는 것을 특징으로 하는 병렬처리방식의 데이터베이스 이중화 방법.
3. The method of claim 2,
And if it is determined to be the same in the sixth step, the ninth step is performed without going through the seventh step.
제2 항에 있어서,
상기 제6 단계에서 동일하지 않은 것으로 판단되면, 상기 슬롯에 반영자가 존재하지 않을 때까지 대기하는 것을 특징으로 하는 병렬처리방식의 데이터베이스 이중화 방법.
3. The method of claim 2,
And if it is determined in step 6 that it is not the same, waits until there is no reflector in the slot.
제1 항 내지 제4 항 중 어느 한 항에 있어서,
상기 제3 단계에서 획득하지 못한 것으로 판단되면, 상기 슬롯의 락을 얻을 때까지 대기하는 것을 특징으로 하는 병렬처리방식의 데이터베이스 이중화 방법.
5. The method according to any one of claims 1 to 4,
And if it is determined in the third step that it is not acquired, waits until the lock of the slot is obtained.
트랜젝션의 커밋(Commit)을 완료하는 제1 단계;
상기 트랜젝션이 사용하고 있는 슬롯의 ID 값을 추출하는 제3 단계;
상기 슬롯의 락을 획득하는 제5 단계;
레퍼런스 카운트에서 상기 트랜젝션에서 수행된 쿼리의 수만큼을 차감하는 제7 단계;
상기 레퍼런스 카운트의 값을 확인하여 커밋되어야 쿼리가 존재하는지 판단하는 제9 단계;
상기 슬롯에서 반영자를 삭제하는 제11 단계;
상기 슬롯의 락을 해지하는 제13 단계; 및
상기 제3 단계에서 추출한 각각 슬롯의 ID 값이 지시하는 모든 슬롯의 락을 해지하였는지 판단하는 제15 단계;를 포함하는 것을 특징으로 하는 병렬처리방식의 데이터베이스 이중화 방법.
A first step of completing a commit of the transaction;
A third step of extracting an ID value of a slot used by the transaction;
A fifth step of acquiring a lock of the slot;
A seventh step of subtracting the number of queries performed in the transaction from the reference count;
A ninth step of checking whether there is a query to be committed by checking the value of the reference count;
An eleventh step of deleting the reflector from the slot;
A thirteenth step of releasing the lock of the slot; And
And determining whether all the slots indicated by the ID values of the slots extracted in the third step are unlocked.
제6 항에 있어서,
상기 제5 단계에서 상기 슬롯의 락을 얻지 못한 것으로 판단되면, 상기 슬롯의 락을 얻을 때까지 대기하는 것을 특징으로 하는 병렬처리방식의 데이터베이스 이중화 방법.
The method according to claim 6,
And if it is determined that the lock of the slot is not obtained in the fifth step, waiting until the lock of the slot is obtained.
제6 항에 있어서,
상기 제9 단계에서 존재하지 않은 것으로 판단되면, 상기 제11 단계를 거치지 않고 상기 제13 단계를 수행하는 것을 특징으로 하는 병렬처리방식의 데이터베이스 이중화 방법.
The method according to claim 6,
And if it is determined in step 9 that it does not exist, the step 13 is performed without going through step 11.
제6 항에 있어서,
상기 제15 단계에서 모든 슬롯의 락을 해지하지 않은 것으로 판단되면, 상기 제5 단계에서 해지되지 않은 나머지 슬롯의 락을 획득하는 것을 특징으로 하는 병렬처리방식의 데이터베이스 이중화 방법.
The method according to claim 6,
And if it is determined in step 15 that all slots are not released, acquiring locks of remaining slots that have not been released in the fifth step.
제1항 내지 제9 항 중 어느 한 항의 방법을 수행하는 프로그램을 기록한 컴퓨터로 판독가능한 기록매체.A computer-readable recording medium having recorded thereon a program for performing the method of any one of claims 1 to 9.
KR1020130081319A 2013-07-11 2013-07-11 Method of duplicating database using pararell-processing and computer readable storage media storing the same) KR101549655B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020130081319A KR101549655B1 (en) 2013-07-11 2013-07-11 Method of duplicating database using pararell-processing and computer readable storage media storing the same)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020130081319A KR101549655B1 (en) 2013-07-11 2013-07-11 Method of duplicating database using pararell-processing and computer readable storage media storing the same)

Publications (2)

Publication Number Publication Date
KR20150007435A true KR20150007435A (en) 2015-01-21
KR101549655B1 KR101549655B1 (en) 2015-09-03

Family

ID=52570340

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020130081319A KR101549655B1 (en) 2013-07-11 2013-07-11 Method of duplicating database using pararell-processing and computer readable storage media storing the same)

Country Status (1)

Country Link
KR (1) KR101549655B1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018216839A1 (en) * 2017-05-24 2018-11-29 (주)선재소프트 Database replication method and database replication system

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102599008B1 (en) * 2022-09-29 2023-11-07 스마트마인드 주식회사 Method for processing multi-queries based on multi-query scheduler and data processing system providing the method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013069189A (en) 2011-09-26 2013-04-18 Hitachi Ltd Parallel distributed processing method and parallel distributed processing system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018216839A1 (en) * 2017-05-24 2018-11-29 (주)선재소프트 Database replication method and database replication system

Also Published As

Publication number Publication date
KR101549655B1 (en) 2015-09-03

Similar Documents

Publication Publication Date Title
US11429641B2 (en) Copying data changes to a target database
US8868577B2 (en) Generic database manipulator
US8306945B2 (en) Associating database log records into logical groups
US8762333B2 (en) Apparatus and method for read optimized bulk data storage
US9626394B2 (en) Method for mass-deleting data records of a database system
US7930271B2 (en) Method and apparatus for data processing
US9747356B2 (en) Eager replication of uncommitted transactions
US7099897B2 (en) System and method for discriminatory replaying of log files during tablespace recovery in a database management system
CN105608086A (en) Transaction processing method and device of distributed database system
JPH0812631B2 (en) Database transaction and query processing system
US20130110873A1 (en) Method and system for data storage and management
CN109643310B (en) System and method for redistribution of data in a database
CN108509462B (en) Method and device for synchronizing activity transaction table
CN102955792A (en) Method for implementing transaction processing for real-time full-text search engine
Yang et al. F1 Lightning: HTAP as a Service
US20140181059A1 (en) Batching content management operations to facilitate efficient database interactions
KR102038529B1 (en) System for processing real-time data modification of in-memory database
EP3026574B1 (en) Affair processing method and device
KR101549655B1 (en) Method of duplicating database using pararell-processing and computer readable storage media storing the same)
JP2017027326A (en) Storage system and program for the same
US11061889B2 (en) Systems and methods of managing manifest refresh in a database
US20180011897A1 (en) Data processing method having structure of cache index specified to transaction in mobile environment dbms
CN102193987B (en) Method and system for increasing node data relationship based on OLTP (online transaction processing)
WO2023124242A1 (en) Transaction execution method and apparatus, device, and storage medium
US11151157B2 (en) Database management method

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
FPAY Annual fee payment

Payment date: 20180823

Year of fee payment: 4

FPAY Annual fee payment

Payment date: 20190826

Year of fee payment: 5