KR101919816B1 - Consistency checking in database sharding environment - Google Patents

Consistency checking in database sharding environment Download PDF

Info

Publication number
KR101919816B1
KR101919816B1 KR1020170101054A KR20170101054A KR101919816B1 KR 101919816 B1 KR101919816 B1 KR 101919816B1 KR 1020170101054 A KR1020170101054 A KR 1020170101054A KR 20170101054 A KR20170101054 A KR 20170101054A KR 101919816 B1 KR101919816 B1 KR 101919816B1
Authority
KR
South Korea
Prior art keywords
group
group identifier
managed
data
database server
Prior art date
Application number
KR1020170101054A
Other languages
Korean (ko)
Inventor
강철규
강동완
김갑영
박부식
서경식
Original Assignee
네이버 주식회사
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 네이버 주식회사 filed Critical 네이버 주식회사
Priority to KR1020170101054A priority Critical patent/KR101919816B1/en
Application granted granted Critical
Publication of KR101919816B1 publication Critical patent/KR101919816B1/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/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • G06F16/275Synchronous replication
    • G06F17/30581

Landscapes

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

Abstract

A consistency checking technique in a database sharding environment is provided. A consistency checking method according to an embodiment of the present invention can check consistency of a large amount of data by using each group identifier of a preset number of a plurality of groups generated by classifying shardkeys of sharded data.

Description

데이터베이스 샤딩 환경에서의 정합성 검사{CONSISTENCY CHECKING IN DATABASE SHARDING ENVIRONMENT}Checking Consistency in Database Sharding Environment {CONSISTENCY CHECKING IN DATABASE SHARDING ENVIRONMENT}

아래의 설명은 데이터베이스 샤딩 환경에서의 정합성 검사 기술에 관한 것이다.The following description relates to a consistency checking technique in a database sharding environment.

데이터베이스 샤딩(database sharding)은 대량의 데이터를 처리하기 위해 데이터베이스 테이블을 수평 분할(horizontal partitioning)하여 물리적으로 서로 다른 곳에 분산 저장 및 조회하는 기술에 관한 것이다. 예를 들어, 한국등록특허 제10-1527634호는 샤딩 서비스를 제공하는 방법 및 장치에 대해 개시하고 있다.Database sharding is a technique for horizontally partitioning a database table to physically distribute and query the database table in order to process a large amount of data. For example, Korean Patent No. 10-1527634 discloses a method and apparatus for providing a sharding service.

이때, 대량의 데이터에 대한 정합성을 검증하는 것은 매우 어렵다. 예를 들어, 100만 명의 이용자들이 이용하는 서비스에서 이용자들 각각에 대한 데이터가, 다수의 데이터베이스들에 분산 저장된 경우를 고려할 수 있다. 이때, 다수의 데이터베이스들 각각은 자신이 저장하고 있는 데이터만을 관리하기 때문에, 100만 명의 이용자들 중 특정한 1명의 기존 이용자에 대한 데이터를 선택, 갱신, 삭제할 때, 이러한 데이터가 다수의 데이터베이스들 중 특정한 데이터베이스에 포함되어 있는지 확인하기 어렵다는 문제점이 있다.At this time, it is very difficult to verify the consistency with a large amount of data. For example, it can be considered that data for each of users in a service used by one million users is distributed and stored in a plurality of databases. At this time, since each of the plurality of databases manages only the data stored therein, when selecting, updating and deleting data for a specific one of the one million users among users, There is a problem that it is difficult to confirm whether or not it is included in the database.

이를 명확히 파악하기 위해서는 다수의 데이터베이스들 각각이 100만 명의 이용자들 중 어느 이용자들에 대한 정보를 포함하고 있는가에 대한 정합성 정보를 관리해야 하며, 1명의 새로운 이용자에 대한 데이터를 추가함에 있어서도 관리되는 정합성 정보가 다수의 데이터베이스 각각에 대해 갱신되어야 한다. 이러한 관리 및 갱신은 매우 큰 비용을 요구한다는 문제점이 있다.In order to clarify this, it is necessary to manage the consistency information of which one of the plurality of databases contains information about which one of the users of one million users, and to add the data to one new user, The information must be updated for each of the multiple databases. Such management and updating require a very large cost.

샤드키를 그룹핑한 기설정된 수의 복수의 그룹들에 대한 그룹 식별자를 이용하여 대량의 데이터에 대한 정합성을 검사할 수 있는 정합성 검사 방법 및 정합성 검사 방법을 수행하는 컴퓨터 장치, 그리고 컴퓨터와 결합되어 본 발명의 실시예들에 따른 정합성 검사 방법을 컴퓨터에 실행시키기 위해 컴퓨터 판독 가능한 기록매체에 저장된 컴퓨터 프로그램과 그 기록매체를 제공한다.A computer apparatus for performing a consistency checking method and a consistency checking method capable of checking consistency with respect to a large amount of data using group identifiers for a predetermined number of groups in which groups of shard keys are grouped, There is provided a computer program stored in a computer-readable recording medium for causing a computer to execute a consistency checking method according to embodiments of the present invention, and a recording medium thereof.

기설정된 수의 그룹 식별자들에 대해 샤드키들이 해당 그룹 식별자의 그룹에 포함되어 있는지 여부를 검사하는 것만으로 대량의 데이터에 대한 정합성을 검사할 수 있는 정합성 검사 방법 및 정합성 검사 방법을 수행하는 컴퓨터 장치, 그리고 컴퓨터와 결합되어 본 발명의 실시예들에 따른 정합성 검사 방법을 컴퓨터에 실행시키기 위해 컴퓨터 판독 가능한 기록매체에 저장된 컴퓨터 프로그램과 그 기록매체를 제공한다.A computer program product for performing a consistency checking method and a consistency checking method capable of checking consistency of a large amount of data only by checking whether a group of the group identifiers is included in a group of the group identifiers for a predetermined number of group identifiers And a computer program stored on a computer-readable recording medium for causing a computer to execute a consistency checking method according to embodiments of the present invention in combination with a computer, and a recording medium therefor.

데이터베이스 서버의 정합성 검사 방법에 있어서, 샤딩(sharding)된 데이터의 샤드키(shardkey)들을 분류하여 생성된 기설정된 수의 복수의 그룹들 각각의 그룹 식별자들과 관련하여, 상기 데이터베이스 서버가 관리하는 샤드키가 분류된 그룹의 그룹 식별자들을 관리하는 단계; 및 요구된 연산과 관련된 샤드키에 대응하여 추출된 그룹 식별자를 이용하여, 상기 데이터베이스 서버에서 상기 요구된 연산과 연계된 데이터의 정합성을 검사하는 단계를 포함하는 것을 특징으로 하는 정합성 검사 방법을 제공한다.A method for checking a consistency of a database server, the method comprising the steps of: determining, in association with group identifiers of a plurality of groups of a predetermined number generated by classifying shardkeys of sharded data, Managing group identifiers of groups of which the keys are classified; And checking the consistency of the data associated with the requested operation in the database server using the extracted group identifier corresponding to the shard key associated with the requested operation .

상기 정합성 검사 방법을 컴퓨터에 실행시키기 위한 컴퓨터 프로그램이 기록되어 있는 것을 특징으로 하는 컴퓨터 판독 가능한 기록매체를 제공한다.And a computer program for causing the computer to execute the consistency checking method.

컴퓨터와 결합하여 상기 정합성 검사 방법을 컴퓨터에 실행시키기 위해 컴퓨터 판독 가능한 기록매체에 저장된 컴퓨터 프로그램을 제공한다.There is provided a computer program stored in a computer-readable recording medium for causing a computer to execute the consistency checking method in combination with a computer.

데이터베이스 서버를 위한 컴퓨터 장치에 있어서, 컴퓨터에서 판독 가능한 명령을 실행하도록 구현되는 적어도 하나의 프로세서를 포함하고, 상기 적어도 하나의 프로세서는, 샤딩(sharding)된 데이터의 샤드키(shardkey)들을 분류하여 생성된 기설정된 수의 복수의 그룹들 각각의 그룹 식별자들과 관련하여, 상기 데이터베이스 서버가 관리하는 샤드키가 분류된 그룹의 그룹 식별자들을 관리하고, 요구된 연산과 관련된 샤드키에 대응하여 추출된 그룹 식별자를 이용하여, 상기 데이터베이스 서버에서 상기 요구된 연산과 연계된 데이터의 정합성을 검사하는 것을 특징으로 하는 컴퓨터 장치를 제공한다.CLAIMS What is claimed is: 1. A computer device for a database server, the computer device comprising: at least one processor configured to execute computer readable instructions, the at least one processor being configured to classify and generate shardkeys of sharded data; Managing group identifiers of groups in which shard keys managed by the database server are grouped in association with group identifiers of a predetermined number of the plurality of groups, And checks the consistency of the data associated with the requested operation in the database server using the identifier.

샤드키를 그룹핑한 기설정된 수의 복수의 그룹들에 대한 그룹 식별자를 이용하여 대량의 데이터에 대한 정합성을 검사할 수 있다.The consistency of a large amount of data can be checked using a group identifier for a plurality of groups of a predetermined number of grouped shard keys.

기설정된 수의 그룹 식별자들에 대해 샤드키들이 해당 그룹 식별자의 그룹에 포함되어 있는지 여부를 검사하는 것만으로 대량의 데이터에 대한 정합성을 검사할 수 있다.It is possible to check the consistency of a large amount of data only by checking whether or not the shard keys are included in the group of the group identifier for a predetermined number of group identifiers.

도 1은 본 발명의 일실시예에 있어서, 데이터베이스에 저장된 데이터의 예를 도시한 도면이다.
도 2는 본 발명의 일실시예에 있어서, 데이터의 샤딩 예를 도시한 도면이다.
도 3은 본 발명의 일실시예에 있어서, 정합성 검사 과정의 예를 도시한 도면이다.
도 4는 본 발명의 일실시예에 있어서, 잘못된 데이터 조회를 검사하는 예를 도시한 도면이다.
도 5는 본 발명의 일실시예에 있어서, 컴퓨터 장치의 내부 구성을 설명하기 위한 블록도이다.
도 6은 본 발명의 일실시예에 있어서, 정합성 검사 방법의 예를 도시한 흐름도이다.
도 7은 본 발명의 일실시예에 있어서, 그룹 식별자들을 관리하는 제1 예를 도시한 흐름도이다.
도 8은 본 발명의 일실시예에 있어서, 그룹 식별자를 관리하는 제2 예를 도시한 흐름도이다.
1 is a diagram showing an example of data stored in a database in an embodiment of the present invention.
2 is a diagram showing an example of shading of data in an embodiment of the present invention.
3 is a diagram illustrating an example of a consistency checking process according to an embodiment of the present invention.
4 is a diagram showing an example of checking an incorrect data inquiry in an embodiment of the present invention.
5 is a block diagram for explaining an internal configuration of a computer apparatus according to an embodiment of the present invention.
6 is a flowchart showing an example of a consistency checking method in an embodiment of the present invention.
7 is a flowchart illustrating a first example of managing group identifiers in an embodiment of the present invention.
8 is a flowchart showing a second example of managing group identifiers in an embodiment of the present invention.

이하, 실시예를 첨부한 도면을 참조하여 상세히 설명한다.Hereinafter, embodiments will be described in detail with reference to the accompanying drawings.

본 발명의 실시예들에 따른 정합성 검사 방법은 컴퓨터 장치에 의해 수행될 수 있다. 일례로, 컴퓨터 장치에는 컴퓨터 장치가 정합성 검사 방법을 수행하도록 제어하기 위한 컴퓨터 프로그램이 설치 및 구동될 수 있으며, 컴퓨터 프로그램은 컴퓨터 장치와 결합되어 정합성 검사 방법을 컴퓨터 장치에 실행시키기 위해 컴퓨터 판독 가능한 기록매체에 저장될 수 있다.The consistency checking method according to embodiments of the present invention can be performed by a computer apparatus. In one example, a computer program may be installed and run in a computer device for controlling a computer device to perform a consistency checking method, the computer program being coupled to the computer device to cause the computer device to execute a consistency checking method, Can be stored in the medium.

도 1은 본 발명의 일실시예에 있어서, 데이터베이스에 저장된 데이터의 예를 도시한 도면이고, 도 2는 본 발명의 일실시예에 있어서, 데이터의 샤딩 예를 도시한 도면이다. 도 1 및 도 2는 데이터베이스(110)에 저장된 데이터에 대한 데이터베이스 샤딩(database sharding)에 의해, 데이터들이 n 개의 샤드 노드들(210, 220 및 230)로 분산된 예를 나타내고 있다. 예를 들어, 도 1 및 도 2에서는 레코드들을 식별하기 위한 식별자인 'id1', 'id2', 'id3', 'id4'를 샤드키(shardkey)로 이용하여 동일한 샤드키의 레코드들을 모아서 n 개의 샤드들(210, 220 및 230)로 분산한 예를 나타내고 있다. 이때, 샤드키 단위의 데이터는 동일한 샤드키를 통해 식별되는 데이터를 의미할 수 있다. 예를 들어, 도 2에서는 샤드키 'id2'를 통해 식별되는 데이터를 굵은 실선(240)을 통해 표시하고 있다.FIG. 1 is a diagram illustrating an example of data stored in a database according to an embodiment of the present invention. FIG. 2 is a diagram illustrating an example of data sharding in an embodiment of the present invention. 1 and 2 show an example in which data is distributed to n shard nodes 210, 220 and 230 by database sharding of data stored in the database 110. [ For example, in FIG. 1 and FIG. 2, records of the same shard key are collected by using the identifiers 'id1', 'id2', 'id3', and 'id4' Shards 210, 220, and 230, respectively. In this case, the data in units of the shard key may mean data identified through the same shard key. For example, in FIG. 2, the data identified through the shard key 'id2' is indicated by a thick solid line 240.

샤드키 단위의 데이터는 용량과 QPS(Query Per Second)는 상대적으로 작은 편이나, 샤드키의 개수가 매우 많고, 따라서 결과적으로 데이터베이스 전체 용량과 QPS는 매우 크다는 특징을 갖는다. 또한, 샤드키를 통해 식별되는 데이터간의 관계(relation)은 의미가 있지만, 서로 다른 샤드키를 통해 식별되는 데이터간의 관계는 의미가 없다는 특징을 갖는다. 다시 말해, 하나의 샤드키를 통해 식별되는 데이터는 다른 샤드키를 통해 식별되는 데이터에 대해 의존성을 갖지 않으며, 샤드키 단위로 독립적인 개별 연산(트랜잭션)의 처리가 가능하다.The data of the shard key unit has a relatively small capacity and QPS (Query Per Second), but the number of the shard key is very large, and as a result, the database overall capacity and the QPS are very large. Further, the relation between the data identified through the shard key is meaningful, but the relationship between the data identified through the different shard keys is meaningless. In other words, the data identified through one shard key has no dependency on the data identified by the other shard keys, and it is possible to process independent individual operations (transactions) on a shard key basis.

n 개의 샤드 노드들(210, 220 및 230) 각각은 제1 샤드 노드(210)을 통해 나타나는 바와 같이, 하나의 샤드키에 대응하는 데이터를 포함할 수도 있으나, 제2 샤드 노드(220)을 통해 나타나는 바와 같이, 다수의 샤드키에 대응하는 데이터를 포함할 수도 있다.Each of the n shard nodes 210,220 and 230 may include data corresponding to one shard key, as shown through the first shard node 210, As shown, it may include data corresponding to a plurality of shard keys.

이때, 본 발명의 실시예들에서는 앞서 설명한 샤드키 단위의 데이터와 관련하여 샤드키들을 기설정된 수의 복수의 그룹으로 분류하고, 복수의 그룹들의 그룹 식별자들을 통해 데이터에 대한 정합성 검사를 처리할 수 있다. 이때, 각각의 데이터베이스 서버들은 자신이 관리하는 샤드키가 분류된 그룹의 그룹 식별자들을 관리할 수 있다.At this time, in the embodiments of the present invention, the shard keys are classified into a plurality of groups of a predetermined number in relation to the data of the shard key described above, and the consistency check of the data is performed through the group identifiers of the plurality of groups have. At this time, each of the database servers can manage the group identifiers of the group in which the shard key managed by the database servers is classified.

도 3은 본 발명의 일실시예에 있어서, 정합성 검사 과정의 예를 도시한 도면이다. 본 실시예들에 따른 데이터베이스 서버들 각각은 삽입(INSERT), 갱신(UPDATE), 삭제(DELETE)와 같은 모든 DML(Data Manipulation Language) 질의 수행 시 샤딩 데이터에 대한 정합성 검사를 수행할 수 있다.3 is a diagram illustrating an example of a consistency checking process according to an embodiment of the present invention. Each of the database servers according to the present embodiments can perform consistency checking on sharding data when performing all DML (Data Manipulation Language) queries such as INSERT, UPDATE, and DELETE.

도 3의 실시예에서는 입력된 쿼리문(310)에서 JDBC(Java DataBase Connectivity, 320)가 샤드키 'id1'을 추출하고, 샤드키 'id1'을 해싱하여 해시값 '3'을 획득하는 예를 나타내고 있다. 이때, 해시값 '3'은 샤드키 'id1'이 포함된 그룹의 그룹 식별자가 될 수 있다. 예를 들어, 모든 샤드키들 각각이 기설정된 해시 함수의 파라미터로 이용되어 모든 샤드키들 각각을 위한 그룹 식별자들이 계산될 수 있다. 보다 구체적인 예로, 100만 개의 샤드키들이 해시 함수를 거쳐 1만 개의 그룹 식별자들이 계산될 수 있고, 그룹 식별자 각각에 대한 1만개의 그룹으로 분류될 수 있다.In the example of FIG. 3, the JDBC (Java DataBase Connectivity) 320 extracts the shard key 'id1' and hashs the shard key 'id1' to obtain the hash value '3' Respectively. At this time, the hash value '3' may be the group identifier of the group including the shard key 'id1'. For example, each of the shard keys may be used as a parameter of a predetermined hash function so that group identifiers for each shard key may be computed. In a more specific example, one million group identifiers may be computed through a hash function of one million shard keys, and grouped into 10,000 groups for each group identifier.

이 경우, 새로운 샤드키가 추가된다 하더라도 해시 함수를 통해 해시되는 과정에서 1만개의 그룹 중 하나로 분류되기 때문에 그룹이나 그룹 식별자는 추가되지 않는다. 따라서, 각각의 데이터베이스 서버들은 100만개의 샤드키들 중 자신이 관리하는 샤드키들을 관리하는 것이 아니라, 1만개의 그룹 식별자들 중 자신이 관리하는 그룹 식별자만을 관리함으로써, 특정 샤드키가 자신이 관리하는 그룹에 포함되어 있는지 여부를 확인할 수 있다.In this case, even if a new shard key is added, a group or group identifier is not added because it is classified as one of the 10,000 groups in the process of hashing through the hash function. Therefore, each database server does not manage the shard keys managed by itself among the 1 million shard keys but manages only the group identifier managed by itself among the 10,000 group identifiers, so that the specific shard key is managed by itself Group is included in the group.

이때, 데이터베이스 서버들간의 데이터 이동은 그룹 식별자에 대응하는 데이터 단위로 이루어질 수 있다. 예를 들어, 데이터베이스 서버 a이 그룹 식별자 1에 대한 데이터를 저장할 때, 데이터베이스 서버 a에서 데이터베이스 서버 b로의 데이터의 이동은 그룹 식별자 1에 대응하는 데이터의 단위로 이루어질 수 있다.At this time, the data movement between the database servers may be performed in units of data corresponding to the group identifier. For example, when database server a stores data for group identifier 1, the movement of data from database server a to database server b may be in units of data corresponding to group identifier 1.

한편, 도 3에 도시된 바와 같이 데이터베이스 서버(330)는 그룹 식별자들 각각에 대해 자신이 관리하는 데이터에 대응하는 그룹 식별자와 자신이 관리하지 않는 데이터에 대응하는 그룹 식별자를 나타내기 위한 그룹 식별자 비트맵(340)을 관리할 수 있다. 예를 들어, 도 3에서 데이터베이스 서버(330)는 그룹 식별자 1, 3, n에 대응하는 데이터를 데이터베이스 j(350)에 저장하여 관리하며(그룹 식별자 1, 3, n의 값이 1로 설정됨), 그룹 식별자 2에 대응하는 데이터는 관리하지 않음(그룹 식별자 2의 값이 0으로 설정됨)을 알 수 있다.3, the database server 330 includes a group identifier bit for indicating a group identifier corresponding to data managed by the group identifier and a group identifier corresponding to data not managed by the database server 330, The map 340 can be managed. For example, in FIG. 3, the database server 330 stores and manages data corresponding to the group identifiers 1, 3, and n in the database j 350 (the values of the group identifiers 1, 3, and n are set to 1 ), The data corresponding to the group identifier 2 is not managed (the value of the group identifier 2 is set to 0).

이때, 앞서 설명한 바와 같이, JDBC(320)는 쿼리문(310)에서 샤드키 'id1'를 추출하고, 추출된 샤드키 'id1'를 해시 함수를 통해 해싱하여 그룹 식별자 '3'을 추출할 수 있다. 이때, 추출된 그룹 식별자 '3'은 데이터베이스 서버(330)로 전달될 수 있고, 데이터베이스 서버(330)은 추출된 그룹 식별자 '3'을 그룹 식별자 비트맵(340)에서 검색하여 그룹 식별자 '3'에 대응하는 데이터가 데이터베이스 j(350)에 저장되어 데이터베이스 서버(330)에 의해 관리됨을 확인할 수 있다. 다시 말해, 데이터베이스 서버(330)는 요구된 연산과 연계된 데이터의 정합성을 검사할 수 있게 된다. 만약, 추출되어 수신된 그룹 식별자가 '2'라면, 데이터베이스 서버(330)는 잘못된 데이터의 변경 요구가 입력되었음을 파악할 수 있게 된다.At this time, as described above, the JDBC 320 extracts the shard key 'id1' from the query statement 310 and extracts the group identifier '3' by hashing the extracted shard key 'id1' through the hash function have. At this time, the extracted group identifier '3' may be transmitted to the database server 330, and the database server 330 searches the group identifier bitmap 340 for the extracted group identifier '3' Is stored in the database J 350 and is managed by the database server 330. In other words, the database server 330 can check the consistency of the data associated with the requested operation. If the extracted group identifier is '2', the database server 330 can recognize that a wrong data change request has been input.

또한, 데이터베이스 서버(330)는 데이터의 변경 요구뿐만 아니라, 데이터의 조회에 대해서도 정합성 검사를 수행할 수 있다.In addition, the database server 330 can perform consistency checking not only for data change request but also for data inquiry.

도 4는 본 발명의 일실시예에 있어서, 잘못된 데이터 조회를 검사하는 예를 도시한 도면이다. 도 4는 데이터베이스 서버 1(410)과 데이터베이스 서버 2(420) 그리고, 데이터베이스 서버 1(410)이 관리하는 데이터베이스 1(411)과 데이터베이스 서버 2(420)가 관리하는 데이터베이스 2(421)를 각각 도시하고 있다.4 is a diagram showing an example of checking an incorrect data inquiry in an embodiment of the present invention. 4 shows the database server 1 410 and the database server 2 420 and the database 1 411 managed by the database server 1 410 and the database 2 421 managed by the database server 2 420, .

도 4에서는 데이터베이스 1(411)의 그룹 식별자 '3'에 대응하는 데이터가 데이터베이스 2(421)로 이전된 예를 가정한다. 또한, 데이터베이스 1(411)에는 아직 그룹 식별자 '3'에 대응하는 데이터가 삭제되지 않아서 데이터베이스 1(411)과 데이터베이스 2(412) 모두에 그룹 식별자 '3'에 대응하는 데이터가 존재하는 경우를 가정한다. 또한, 모든 데이터베이스 서버들에 대해 샤드키 '1'에 대한 메일을 검색하는 쿼리문(412, 422)이 입력된 경우를 가정한다. 이때, 요청된 연산에 대한 결과는 데이터베이스 1(411)로부터 조회된 결과와 데이터베이스 2(421)로부터 조회된 결과를 모두 포함하게 되기 때문에 잘못된 결과를 제공할 가능성이 존재한다. 예를 들어, 그룹 식별자 '3'에 대응하는 데이터가 데이터베이스 2(421)에서 변경된 경우, 변경전 조회 결과와 변경후 조회 결과가 모두 제공되게 되고, 이는 데이터의 정합성을 훼손시키게 된다.In FIG. 4, it is assumed that the data corresponding to the group identifier '3' of the database 1 (411) is transferred to the database 2 (421). It is assumed that the data corresponding to the group identifier '3' has not yet been deleted in the database 1 411 and the data corresponding to the group identifier '3' exists in both the database 1 411 and the database 2 412 do. It is also assumed that query statements 412 and 422 for retrieving mail for the shard key '1' are input to all database servers. At this time, there is a possibility that the result of the requested operation may include an incorrect result because it includes both the result of inquiry from the database 1 (411) and the result of inquiry from the database 2 (421). For example, when the data corresponding to the group identifier '3' is changed in the database 2 421, both the pre-change inquiry result and the post-change inquiry result are provided, which compromises the consistency of the data.

본 실시예에서는 이러한 문제를 방지하기 위해, 그룹 식별자 비트맵들(413, 423)이 활용될 수 있다. 샤드키 '1'에 대한 해시값이 '3'이라 가정할 때, 그룹 식별자 '3'이 추출될 수 있으며, 데이터베이스 서버 1(410)은 그룹 식별자 '3'을 그룹 식별자 비트맵(413)을 통해 검색함에 따라 그 값이 '0'이고 따라서 데이터베이스 서버 1(410)은 자신이 그룹 식별자 '3'에 대응하는 데이터를 관리하지 않음을 파악할 수 있다.In this embodiment, to prevent this problem, group identifier bitmaps 413 and 423 may be utilized. Assuming that the hash value for the shard key '1' is '3', the group identifier '3' may be extracted, and the database server 1 410 may output the group identifier bitmap 413 The database server 1 410 can recognize that the database server 1 410 does not manage data corresponding to the group identifier '3'.

예를 들어, 데이터베이스 서버 1(410)은 그룹 식별자 '3'에 대응하는 데이터를 데이터베이스 서버 2(420)로 이전할 때, 그룹 식별자 비트맵(413)에서 그룹 식별자 '3'에 대응하는 값을 '1'에서 '0'으로 변경할 수 있다. 따라서, 데이터베이스 서버 1(410)은 그룹 식별자 '3'에 대응하는 데이터가 데이터베이스 1(411)에 아직 남아있다 하더라도, 그룹 식별자 '3'에 대응하는 데이터가 자신이 관리하는 데이터가 아님을 파악할 수 있다.For example, when transferring data corresponding to the group identifier '3' to the database server 2 420, the database server 1 410 sets a value corresponding to the group identifier '3' in the group identifier bitmap 413 as It can be changed from '1' to '0'. Therefore, even if the data corresponding to the group identifier '3' still remains in the database 1 411, the database server 1 410 can grasp that the data corresponding to the group identifier '3' is not the data managed by itself have.

반면, 데이터베이스 서버 2(420)는 그룹 식별자 '3'에 대응하는 데이터를 데이터베이스 서버 1(410)로부터 이전(migration)받을 때, 그룹 식별자 비트맵(423)에서 그룹 식별자 '3'에 대응하는 값을 '0'에서 '1'으로 변경할 수 있다. 따라서, 데이터베이스 서버 2(420)는 데이터베이스 2(421)에 저장된 그룹 식별자 '3'에 대응하는 데이터가 자신이 관리하는 데이터임을 알 수 있게 된다.On the other hand, when the database server 2 420 migrates data corresponding to the group identifier '3' from the database server 1 410, the database server 2 420 deletes the value corresponding to the group identifier '3' from the group identifier bitmap 423 Can be changed from '0' to '1'. Accordingly, the database server 2 420 can know that the data corresponding to the group identifier '3' stored in the database 2 421 is the data managed by itself.

다시 말해, 데이터의 이전이 완료된 후에 입력된 쿼리문들(412, 422)에 대해 데이터베이스 서버 1(410)은 결과값을 제공하지 않고, 데이터베이스 서버 2(420)는 결과값을 제공하게 된다. 다시 말해, 잘못된 데이터 조회에 대한 검사가 가능해진다.In other words, after the transfer of the data is completed, the database server 1 410 does not provide the result value for the query statements 412, 422 entered, and the database server 2 420 provides the result value. In other words, it is possible to check for incorrect data retrieval.

앞서 도 3 및 도 4의 실시예들에서는 비트맵의 형태로 그룹 식별자들을 관리하는 예를 설명하였으나, 각각의 데이터베이스 서버들이 자신이 관리하는 그룹 식별자들을 파악할 수 있는 구조라면, 이에 제한되지 않을 수 있다. 또한, 앞선 실시예들에서는 샤드키들을 복수의 그룹으로 분류함에 있어서 해시 함수를 사용하는 예를 들었으나, 샤드키들을 복수의 그룹으로 분류할 수 있는 방법이라면, 이에 제한되지 않을 수 있다. 예를 들어, 샤드키들을 값의 순서에 따라 순차적으로 복수의 그룹들에 할당할 수도 있다. 보다 자세한 예로, 샤드키들의 값이 {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}이고, 복수의 그룹들의 그룹 식별자들이 {a, b, c}라면, 샤드키 1, 4, 7, 10을 그룹 a로, 샤드키 2, 5, 8를 그룹 b로, 샤드키 3, 6, 9를 그룹 c로, 각각 분류할 수 있다.In the embodiments of FIGS. 3 and 4, an example of managing group identifiers in the form of a bitmap has been described. However, the present invention is not limited to this, as long as each database server can recognize group identifiers managed by the database servers . In the above embodiments, the hash function is used in classifying the shard keys into a plurality of groups. However, the present invention is not limited to this, as long as the shard keys can be classified into a plurality of groups. For example, the shard keys may be sequentially assigned to a plurality of groups according to the order of values. In a more detailed example, if the values of the shard keys are {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} and the group identifiers of the plurality of groups are {a, b, c} 1, 4, 7, and 10 can be classified into group a, shard keys 2, 5, and 8 to group b, and shard keys 3, 6, and 9 to group c, respectively.

도 5는 본 발명의 일실시예에 있어서, 컴퓨터 장치의 내부 구성을 설명하기 위한 블록도이다. 컴퓨터 장치(500)는 메모리(510), 프로세서(520), 통신 인터페이스(530) 그리고 입출력 인터페이스(540)를 포함할 수 있다. 메모리(510)는 컴퓨터에서 판독 가능한 기록매체로서, RAM(random access memory), ROM(read only memory) 및 디스크 드라이브와 같은 비소멸성 대용량 기록장치(permanent mass storage device)를 포함할 수 있다. 여기서 ROM과 디스크 드라이브와 같은 비소멸성 대용량 기록장치는 메모리(510)와는 구분되는 별도의 영구 저장 장치로서 컴퓨터 장치(500)에 포함될 수도 있다. 또한, 메모리(510)에는 운영체제와 적어도 하나의 프로그램 코드가 저장될 수 있다. 이러한 소프트웨어 구성요소들은 메모리(510)와는 별도의 컴퓨터에서 판독 가능한 기록매체로부터 메모리(510)로 로딩될 수 있다. 이러한 별도의 컴퓨터에서 판독 가능한 기록매체는 플로피 드라이브, 디스크, 테이프, DVD/CD-ROM 드라이브, 메모리 카드 등의 컴퓨터에서 판독 가능한 기록매체를 포함할 수 있다. 다른 실시예에서 소프트웨어 구성요소들은 컴퓨터에서 판독 가능한 기록매체가 아닌 통신 인터페이스(530)를 통해 메모리(510)에 로딩될 수도 있다. 예를 들어, 소프트웨어 구성요소들은 네트워크(560)를 통해 수신되는 파일들에 의해 설치되는 컴퓨터 프로그램에 기반하여 컴퓨터 장치(500)의 메모리(510)에 로딩될 수 있다.5 is a block diagram for explaining an internal configuration of a computer apparatus according to an embodiment of the present invention. The computer device 500 may include a memory 510, a processor 520, a communication interface 530, and an input / output interface 540. The memory 510 may be a computer-readable recording medium and may include a permanent mass storage device such as a random access memory (RAM), a read only memory (ROM), and a disk drive. The non-decaying mass storage device, such as a ROM and a disk drive, may be included in the computer device 500 as a separate persistent storage device separate from the memory 510. The memory 510 may also store an operating system and at least one program code. These software components may be loaded into the memory 510 from a computer readable recording medium separate from the memory 510. [ Such a computer-readable recording medium may include a computer-readable recording medium such as a floppy drive, a disk, a tape, a DVD / CD-ROM drive, and a memory card. In other embodiments, the software components may be loaded into the memory 510 via the communication interface 530 rather than a computer-readable recording medium. For example, the software components may be loaded into the memory 510 of the computer device 500 based on the computer program installed by the files received via the network 560.

프로세서(520)는 기본적인 산술, 로직 및 입출력 연산을 수행함으로써, 컴퓨터 프로그램의 명령을 처리하도록 구성될 수 있다. 명령은 메모리(510) 또는 통신 인터페이스(530)에 의해 프로세서(520)로 제공될 수 있다. 예를 들어 프로세서(520)는 메모리(510)와 같은 기록 장치에 저장된 프로그램 코드에 따라 수신되는 명령을 실행하도록 구성될 수 있다.The processor 520 may be configured to process instructions of a computer program by performing basic arithmetic, logic, and I / O operations. The instructions may be provided to the processor 520 by the memory 510 or the communication interface 530. For example, processor 520 may be configured to execute instructions received in accordance with program code stored in a recording device, such as memory 510. [

통신 인터페이스(530)은 네트워크(560)를 통해 컴퓨터 장치(500)가 다른 장치(일례로, 앞서 설명한 저장 장치들)와 서로 통신하기 위한 기능을 제공할 수 있다. 일례로, 컴퓨터 장치(500)의 프로세서(520)가 메모리(510)와 같은 기록 장치에 저장된 프로그램 코드에 따라 생성한 요청이나 명령, 데이터, 파일 등이 통신 인터페이스(530)의 제어에 따라 네트워크(560)를 통해 다른 장치들로 전달될 수 있다. 역으로, 다른 장치로부터의 신호나 명령, 데이터, 파일 등이 네트워크(560)를 거쳐 컴퓨터 장치(500)의 통신 인터페이스(530)를 통해 컴퓨터 장치(500)로 수신될 수 있다. 통신 인터페이스(530)를 통해 수신된 신호나 명령, 데이터 등은 프로세서(520)나 메모리(510)로 전달될 수 있고, 파일 등은 컴퓨터 장치(500)가 더 포함할 수 있는 저장 매체(상술한 영구 저장 장치)로 저장될 수 있다.The communication interface 530 may provide functionality for the computer device 500 to communicate with another device (e. G., The storage devices described above) via the network 560. [ For example, a request or command, data, file, or the like, generated by the processor 520 of the computer device 500 according to the program code stored in the recording device such as the memory 510, 560 to other devices. Conversely, signals, commands, data, files, etc., from other devices may be received by the computer device 500 via the network 560 and the communication interface 530 of the computer device 500. Data or the like received via the communication interface 530 may be transferred to the processor 520 or the memory 510 and the file or the like may be transferred to a storage medium Permanent storage).

입출력 인터페이스(540)는 입출력 장치(550)와의 인터페이스를 위한 수단일 수 있다. 예를 들어, 입력 장치는 마이크, 키보드 또는 마우스 등의 장치를, 그리고 출력 장치는 디스플레이, 스피커와 같은 장치를 포함할 수 있다. 다른 예로 입출력 인터페이스(540)는 터치스크린과 같이 입력과 출력을 위한 기능이 하나로 통합된 장치와의 인터페이스를 위한 수단일 수도 있다. 입출력 장치(550)는 컴퓨터 장치(500)와 하나의 장치로 구성될 수도 있다.The input / output interface 540 may be a means for interfacing with the input / output device 550. For example, the input device may include a device such as a microphone, a keyboard or a mouse, and an output device may include a device such as a display, a speaker, and the like. As another example, the input / output interface 540 may be a means for interfacing with a device having integrated functions for input and output, such as a touch screen. The input / output device 550 may be composed of the computer device 500 and one device.

또한, 다른 실시예들에서 컴퓨터 장치(500)는 도 5의 구성요소들보다 더 적은 혹은 더 많은 구성요소들을 포함할 수도 있다. 그러나, 대부분의 종래기술적 구성요소들을 명확하게 도시할 필요성은 없다. 예를 들어, 컴퓨터 장치(500)는 상술한 입출력 장치(550) 중 적어도 일부를 포함하도록 구현되거나 또는 트랜시버(transceiver), GPS(Global Positioning System) 모듈, 카메라, 각종 센서, 데이터베이스 등과 같은 다른 구성요소들을 더 포함할 수도 있다.Also, in other embodiments, the computer device 500 may include fewer or more components than the components of FIG. However, there is no need to clearly illustrate most prior art components. For example, the computer device 500 may be implemented to include at least some of the input / output devices 550 described above, or may include other components such as a transceiver, Global Positioning System (GPS) module, camera, As shown in FIG.

이러한 컴퓨터 장치(500)는 일례로, 도 3 및 도 4를 통해 설명한 데이터베이스 서버들(330, 410, 420)에 대응할 수 있다. Such a computer device 500 may correspond to the database servers 330, 410, and 420 described with reference to FIGS. 3 and 4, for example.

도 6은 본 발명의 일실시예에 있어서, 정합성 검사 방법의 예를 도시한 흐름도이다. 본 실시예에 따른 정합성 검사 방법은 앞서 설명한 컴퓨터 장치(500)에 의해 수행될 수 있다. 예를 들어, 컴퓨터 장치(500)의 프로세서(520)는 메모리(510)에 로딩된 운영체제의 코드나 적어도 하나의 프로그램의 코드에 따른 제어 명령(instruction)을 실행하도록 구현될 수 있다. 여기서, 프로세서(520)는 이러한 제어 명령에 따라 컴퓨터 장치(500)가 도 6의 정합성 검사 방법이 포함하는 단계들(610 및 620)을 수행하도록 컴퓨터 장치(500)를 제어할 수 있다.6 is a flowchart showing an example of a consistency checking method in an embodiment of the present invention. The consistency checking method according to the present embodiment can be performed by the computer apparatus 500 described above. For example, the processor 520 of the computer device 500 may be implemented to execute a control instruction according to code of an operating system loaded in the memory 510 or code of at least one program. Here, the processor 520 may control the computer apparatus 500 so that the computer apparatus 500 performs the steps 610 and 620 included in the consistency checking method of FIG. 6 according to this control instruction.

단계(610)에서 컴퓨터 장치(500)는 샤딩(sharding)된 데이터의 샤드키(shardkey)들을 분류하여 생성된 기설정된 수의 복수의 그룹들 각각의 그룹 식별자들과 관련하여, 컴퓨터 장치(500)가 관리하는 샤드키가 분류된 그룹의 그룹 식별자들을 관리할 수 있다. 이때, 컴퓨터 장치(500)는 컴퓨터 장치(500)가 관리하는 샤드키가 분류된 그룹 여부에 대한 정보가 기설정된 수의 복수의 그룹들의 그룹 식별자들 각각에 대해 설정된 그룹 식별자 비트맵을 생성 및 관리할 수 있다.In step 610, the computer device 500 determines whether the computer device 500 is associated with group identifiers of each of a plurality of groups of a predetermined number generated by classifying the shardkeys of the sharded data, The group identifier of the group in which the shard key managed by the group key management unit is classified. At this time, the computer device 500 generates and manages a group identifier bitmap, which is set for each group identifier of a predetermined number of groups, in which information on whether or not a shard key group managed by the computer device 500 is grouped can do.

예를 들어, 그룹 식별자는 샤드키들 각각을 기설정된 해시 함수의 파라미터로 입력하여 계산된 해시값을 포함할 수 있으며, 동일한 해시값을 갖는 샤드키들이 동일한 그룹으로 분류될 수 있다. 앞선 도 3 및 도 4의 실시예에서는 전체 그룹 식별자들에 대해 컴퓨터 장치(500)가 관리하는 그룹 식별자들에 대해서는 '1'이 설정되고, 컴퓨터 장치(500)가 관리하지 않는 그룹 식별자들에 대해서는 '0'이 설정된 그룹 식별자 비트맵을 설명하였다. 다른 실시예에서 컴퓨터 장치(500)는 자신이 관리하는 그룹 식별자들의 집합만을 포함하는 형태로 그룹 식별자들을 관리할 수도 있다.For example, the group identifier may include a hash value calculated by inputting each of the shard keys as a parameter of a predetermined hash function, and the shard keys having the same hash value may be classified into the same group. 3 and 4, '1' is set for group identifiers managed by the computer device 500 for all group identifiers, and '1' is set for group identifiers not managed by the computer device 500 A group identifier bitmap in which '0' is set has been described. In another embodiment, the computer device 500 may manage group identifiers in a form that includes only a collection of group identifiers that it manages.

단계(620)에서 컴퓨터 장치(500)는 요구된 연산과 관련된 샤드키에 대응하여 추출된 그룹 식별자를 이용하여, 요구된 연산과 연계된 데이터의 정합성을 검사할 수 있다. 도 3의 실시예에서는 JDBC(320)가 질의에 파라미터로 포함된 샤드키 'id1'을 해싱하여 그룹 식별자 '3'을 추출 및 제공하는 예를 설명한 바 있다. 컴퓨터 장치(500)는 이처럼 요구된 연산과 관련된 샤드키를 통해 추출되는 그룹 식별자를 이용하여 데이터에 대한 정합성을 검사할 수 있다.In step 620, the computer device 500 may check the consistency of the data associated with the requested operation using the extracted group identifier in response to the shard key associated with the requested operation. In the embodiment of FIG. 3, an example has been described in which the JDBC 320 extracts and provides the group identifier '3' by hashing the shard key 'id1' included as a parameter in the query. The computer device 500 can check the consistency of the data using the group identifier extracted through the shard key associated with the requested operation.

예를 들어, 컴퓨터 장치(500)는 추출된 그룹 식별자가 컴퓨터 장치(500)에서 관리되는 그룹 식별자들에 포함된 경우 정합성이 존재하는 것으로 결정하고, 추출된 그룹 식별자가 컴퓨터 장치(500)에서 관리되는 그룹 식별자들에 포함되지 않는 경우 정합성이 결여된 것으로 결정할 수 있다. 또한, 컴퓨터 장치(500)는 정합성이 결여된 것으로 판단되는 경우 오류 메시지를 이용자나 관리자에게 제공할 수 있다.For example, when the extracted group identifier is included in the group identifiers managed by the computer device 500, the computer device 500 determines that the consistency exists, and when the extracted group identifier is managed by the computer device 500 It can be determined that there is lack of consistency if it is not included in the group identifiers. Also, the computer device 500 may provide an error message to the user or the administrator when it is determined that the integrity is lacking.

도 7은 본 발명의 일실시예에 있어서, 그룹 식별자들을 관리하는 제1 예를 도시한 흐름도이다. 도 7의 단계들(710 및 720)은 도 6을 통해 설명한 단계(610)에 포함되어 수행될 수 있다.7 is a flowchart illustrating a first example of managing group identifiers in an embodiment of the present invention. Steps 710 and 720 in FIG. 7 may be performed in step 610 described with reference to FIG.

단계(710)에서 컴퓨터 장치(500)는 데이터베이스 서버들간의 데이터의 이동에 따라 제1 그룹 식별자에 대응하는 데이터가 컴퓨터 장치(500)로 이동된 경우, 제1 그룹 식별자가 컴퓨터 장치에서 관리되는 그룹 식별자들에 포함되어 있는지 확인할 수 있다. In step 710, when the data corresponding to the first group identifier is moved to the computer device 500 as the data moves between the database servers, the first group identifier is stored in the group managed by the computer device It can be confirmed whether it is included in the identifiers.

단계(720)에서 컴퓨터 장치(500)는 제1 그룹 식별자가 컴퓨터 장치(500)에서 관리되는 그룹 식별자들에 포함되어 있지 않은 경우, 제1 그룹 식별자를 컴퓨터 장치(500)에서 관리되는 그룹 식별자들에 추가하여 더 관리할 수 있다.In step 720, if the first group identifier is not included in the group identifiers managed in the computer device 500, the computer device 500 transmits the first group identifier to the group identifiers managed in the computer device 500 Can be added to manage more.

이미 설명한 바와 같이 데이터베이스 서버들간의 데이터의 이동은, 적어도 하나의 그룹 식별자에 대응하는 데이터의 단위로 이루어질 수 있다. 따라서 특정한 그룹 식별자에 대응하는 데이터가 컴퓨터 장치(500)로 이동하는 경우, 컴퓨터 장치(500)는 해당 그룹 식별자를 더 관리할 수 있다.As described above, the movement of data between the database servers can be made in units of data corresponding to at least one group identifier. Thus, when data corresponding to a particular group identifier is moved to the computer device 500, the computer device 500 can further manage the group identifier.

도 8은 본 발명의 일실시예에 있어서, 그룹 식별자를 관리하는 제2 예를 도시한 흐름도이다. 도 8의 단계(810)는 도 6을 통해 설명한 단계(610)에 포함되어 수행될 수 있다.8 is a flowchart showing a second example of managing group identifiers in an embodiment of the present invention. Step 810 of FIG. 8 may be performed in step 610 described above with reference to FIG.

단계(810)에서 컴퓨터 장치(500)는 데이터베이스 서버들간의 데이터의 이동에 따라 컴퓨터 장치(500)에서 관리하는 제1 그룹 식별자에 대응하는 데이터가 다른 데이터베이스 서버로 이동되는 경우, 컴퓨터 장치(500)에서 관리하는 그룹 식별자들에서 제1 그룹 식별자를 제외하고 관리할 수 있다.In step 810, when the data corresponding to the first group identifier managed by the computer device 500 is moved to another database server in accordance with the movement of data between the database servers, the computer device 500 transmits, The first group identifier can be managed by excluding the first group identifier from the group identifiers managed by the second group identifier.

앞서 설명한 바와 같이 데이터베이스 서버들간의 데이터의 이동은, 적어도 하나의 그룹 식별자에 대응하는 데이터의 단위로 이루어질 수 있다. 따라서 특정한 그룹 식별자에 대응하는 데이터가 컴퓨터 장치(500)에서 다른 데이터베이스 서버로 이동하는 경우, 컴퓨터 장치(500)는 해당 그룹 식별자를 제외하고 나머지 그룹 식별자들을 관리할 수 있다.As described above, the movement of data between the database servers can be performed in units of data corresponding to at least one group identifier. Accordingly, when data corresponding to a specific group identifier is moved from the computer device 500 to another database server, the computer device 500 can manage the remaining group identifiers except for the corresponding group identifier.

도 7 및 도 8의 실시예들에서 그룹 식별자 비트맵을 이용하는 경우, 컴퓨터 장치(500)는 제1 그룹 식별자에 대응하는 값을 '1'이나 '0'으로 변경시킬 수 있으며, 이러한 그룹 식별자 비트맵을 통해 특정 그룹 식별자에 대응하는 데이터에 대한 관리 여부를 식별할 수 있다.In the embodiments of FIGS. 7 and 8, when the group identifier bitmap is used, the computer device 500 may change the value corresponding to the first group identifier to '1' or '0' It is possible to identify whether the data corresponding to the specific group identifier is managed through the map.

이처럼 본 발명의 실시예들에 따르면, 샤드키를 그룹핑한 기설정된 수의 복수의 그룹들에 대한 그룹 식별자를 이용하여 대량의 데이터에 대한 정합성을 검사할 수 있다. 또한, 기설정된 수의 그룹 식별자들에 대해 샤드키들이 해당 그룹 식별자의 그룹에 포함되어 있는지 여부를 검사하는 것만으로 대량의 데이터에 대한 정합성을 검사할 수 있다.As described above, according to the embodiments of the present invention, it is possible to check the consistency of a large amount of data using a group identifier for a predetermined number of groups in which the shard keys are grouped. In addition, it is possible to check the consistency of a large amount of data by checking whether or not the shard keys are included in the group of the group identifier for a predetermined number of group identifiers.

이상에서 설명된 시스템 또는 장치는 하드웨어 구성요소, 소프트웨어 구성요소 또는 하드웨어 구성요소 및 소프트웨어 구성요소의 조합으로 구현될 수 있다. 예를 들어, 실시예들에서 설명된 장치 및 구성요소는, 예를 들어, 프로세서, 콘트롤러, ALU(arithmetic logic unit), 디지털 신호 프로세서(digital signal processor), 마이크로컴퓨터, FPGA(field programmable gate array), PLU(programmable logic unit), 마이크로프로세서, 또는 명령(instruction)을 실행하고 응답할 수 있는 다른 어떠한 장치와 같이, 하나 이상의 범용 컴퓨터 또는 특수 목적 컴퓨터를 이용하여 구현될 수 있다. 처리 장치는 운영 체제(OS) 및 상기 운영 체제 상에서 수행되는 하나 이상의 소프트웨어 어플리케이션을 수행할 수 있다. 또한, 처리 장치는 소프트웨어의 실행에 응답하여, 데이터를 접근, 저장, 조작, 처리 및 생성할 수도 있다. 이해의 편의를 위하여, 처리 장치는 하나가 사용되는 것으로 설명된 경우도 있지만, 해당 기술분야에서 통상의 지식을 가진 자는, 처리 장치가 복수 개의 처리 요소(processing element) 및/또는 복수 유형의 처리 요소를 포함할 수 있음을 알 수 있다. 예를 들어, 처리 장치는 복수 개의 프로세서 또는 하나의 프로세서 및 하나의 콘트롤러를 포함할 수 있다. 또한, 병렬 프로세서(parallel processor)와 같은, 다른 처리 구성(processing configuration)도 가능하다.The system or apparatus described above may be implemented as a hardware component, a software component or a combination of hardware components and software components. For example, the apparatus and components described in the embodiments may be implemented within a computer system, such as, for example, a processor, a controller, an arithmetic logic unit (ALU), a digital signal processor, a microcomputer, a field programmable gate array (FPGA) , A programmable logic unit (PLU), a microprocessor, or any other device capable of executing and responding to instructions. The processing device may execute an operating system (OS) and one or more software applications running on the operating system. The processing device may also access, store, manipulate, process, and generate data in response to execution of the software. For ease of understanding, the processing apparatus may be described as being used singly, but those skilled in the art will recognize that the processing apparatus may have a plurality of processing elements and / As shown in FIG. For example, the processing unit may comprise a plurality of processors or one processor and one controller. Other processing configurations are also possible, such as a parallel processor.

소프트웨어는 컴퓨터 프로그램(computer program), 코드(code), 명령(instruction), 또는 이들 중 하나 이상의 조합을 포함할 수 있으며, 원하는 대로 동작하도록 처리 장치를 구성하거나 독립적으로 또는 결합적으로(collectively) 처리 장치를 명령할 수 있다. 소프트웨어 및/또는 데이터는, 처리 장치에 의하여 해석되거나 처리 장치에 명령 또는 데이터를 제공하기 위하여, 어떤 유형의 기계, 구성요소(component), 물리적 장치, 가상 장치(virtual equipment), 컴퓨터 저장 매체 또는 장치에 구체화(embody)될 수 있다. 소프트웨어는 네트워크로 연결된 컴퓨터 시스템 상에 분산되어서, 분산된 방법으로 저장되거나 실행될 수도 있다. 소프트웨어 및 데이터는 하나 이상의 컴퓨터 판독 가능 기록매체에 저장될 수 있다.The software may include a computer program, code, instructions, or a combination of one or more of the foregoing, and may be configured to configure the processing device to operate as desired or to process it collectively or collectively Device can be commanded. The software and / or data may be in the form of any type of machine, component, physical device, virtual equipment, computer storage media, or device As shown in FIG. The software may be distributed over a networked computer system and stored or executed in a distributed manner. The software and data may be stored on one or more computer readable recording media.

실시예에 따른 방법은 다양한 컴퓨터 수단을 통하여 수행될 수 있는 프로그램 명령 형태로 구현되어 컴퓨터 판독 가능 매체에 기록될 수 있다. 상기 컴퓨터 판독 가능 매체는 프로그램 명령, 데이터 파일, 데이터 구조 등을 단독으로 또는 조합하여 포함할 수 있다. 매체는 컴퓨터로 실행 가능한 프로그램을 계속 저장하거나, 실행 또는 다운로드를 위해 임시 저장하는 것일 수도 있다. 또한, 매체는 단일 또는 수개 하드웨어가 결합된 형태의 다양한 기록수단 또는 저장수단일 수 있는데, 어떤 컴퓨터 시스템에 직접 접속되는 매체에 한정되지 않고, 네트워크 상에 분산 존재하는 것일 수도 있다. 매체의 예시로는, 하드 디스크, 플로피 디스크 및 자기 테이프와 같은 자기 매체, CD-ROM 및 DVD와 같은 광기록 매체, 플롭티컬 디스크(floptical disk)와 같은 자기-광 매체(magneto-optical medium), 및 ROM, RAM, 플래시 메모리 등을 포함하여 프로그램 명령어가 저장되도록 구성된 것이 있을 수 있다. 또한, 다른 매체의 예시로, 애플리케이션을 유통하는 앱 스토어나 기타 다양한 소프트웨어를 공급 내지 유통하는 사이트, 서버 등에서 관리하는 기록매체 내지 저장매체도 들 수 있다. 프로그램 명령의 예에는 컴파일러에 의해 만들어지는 것과 같은 기계어 코드뿐만 아니라 인터프리터 등을 사용해서 컴퓨터에 의해서 실행될 수 있는 고급 언어 코드를 포함한다.The method according to an embodiment may be implemented in the form of a program command that can be executed through various computer means and recorded in a computer-readable medium. The computer-readable medium may include program instructions, data files, data structures, and the like, alone or in combination. The medium may be one that continues to store computer executable programs, or temporarily store them for execution or download. In addition, the medium may be a variety of recording means or storage means in the form of a combination of a single hardware or a plurality of hardware, but is not limited to a medium directly connected to a computer system, but may be dispersed on a network. Examples of the medium include a magnetic medium such as a hard disk, a floppy disk and a magnetic tape, an optical recording medium such as CD-ROM and DVD, a magneto-optical medium such as a floptical disk, And program instructions including ROM, RAM, flash memory, and the like. As another example of the medium, a recording medium or a storage medium managed by a site or a server that supplies or distributes an application store or various other software to distribute the application may be mentioned. Examples of program instructions include machine language code such as those produced by a compiler, as well as high-level language code that can be executed by a computer using an interpreter or the like.

이상과 같이 실시예들이 비록 한정된 실시예와 도면에 의해 설명되었으나, 해당 기술분야에서 통상의 지식을 가진 자라면 상기의 기재로부터 다양한 수정 및 변형이 가능하다. 예를 들어, 설명된 기술들이 설명된 방법과 다른 순서로 수행되거나, 및/또는 설명된 시스템, 구조, 장치, 회로 등의 구성요소들이 설명된 방법과 다른 형태로 결합 또는 조합되거나, 다른 구성요소 또는 균등물에 의하여 대치되거나 치환되더라도 적절한 결과가 달성될 수 있다.While the present invention has been particularly shown and described with reference to exemplary embodiments thereof, it is to be understood that the invention is not limited to the disclosed exemplary embodiments. For example, it is to be understood that the techniques described may be performed in a different order than the described methods, and / or that components of the described systems, structures, devices, circuits, Lt; / RTI > or equivalents, even if it is replaced or replaced.

그러므로, 다른 구현들, 다른 실시예들 및 특허청구범위와 균등한 것들도 후술하는 특허청구범위의 범위에 속한다.Therefore, other implementations, other embodiments, and equivalents to the claims are also within the scope of the following claims.

Claims (16)

데이터베이스 서버의 정합성 검사 방법에 있어서,
샤딩(sharding)된 데이터의 샤드키(shardkey)들을 분류하여 생성된 기설정된 수의 복수의 그룹들 각각의 그룹 식별자들과 관련하여, 상기 데이터베이스 서버가 관리하는 샤드키가 분류된 그룹의 그룹 식별자들을 관리하는 단계; 및
요구된 연산과 관련된 샤드키에 대응하여 추출된 그룹 식별자를 이용하여, 상기 데이터베이스 서버에서 상기 요구된 연산과 연계된 데이터의 정합성을 검사하는 단계
를 포함하는 것을 특징으로 하는 정합성 검사 방법.
A method for checking consistency of a database server,
A shard key managed by the database server is associated with a group identifier of a group in which a shard key is classified in association with each group identifier of a predetermined number of groups generated by sorting shardkeys of sharded data Managing; And
Checking the consistency of the data associated with the requested operation in the database server using the group identifier extracted corresponding to the shard key associated with the requested operation
And checking the consistency of the image.
제1항에 있어서,
상기 그룹 식별자들을 관리하는 단계는,
상기 데이터베이스 서버가 관리하는 샤드키가 분류된 그룹 여부에 대한 정보가 상기 기설정된 수의 복수의 그룹들의 그룹 식별자들 각각에 대해 설정된 그룹 식별자 비트맵을 생성 및 관리하는 것을 특징으로 하는 정합성 검사 방법.
The method according to claim 1,
Wherein managing the group identifiers comprises:
Wherein information on whether or not the shard key group managed by the database server is generated and managed is set for each of the group identifiers of the predetermined number of groups.
제1항에 있어서,
상기 그룹 식별자들을 관리하는 단계는,
데이터베이스 서버들간의 데이터의 이동에 따라 제1 그룹 식별자에 대응하는 데이터가 상기 데이터베이스 서버로 이동된 경우, 상기 제1 그룹 식별자가 상기 관리되는 그룹 식별자들에 포함되어 있는지 확인하는 단계; 및
상기 제1 그룹 식별자가 상기 관리되는 그룹 식별자들에 포함되어 있지 않은 경우, 상기 제1 그룹 식별자를 상기 관리되는 그룹 식별자들에 추가하여 더 관리하는 단계
를 포함하는 것을 특징으로 하는 정합성 검사 방법.
The method according to claim 1,
Wherein managing the group identifiers comprises:
Confirming whether the first group identifier is included in the managed group identifiers when data corresponding to the first group identifier is moved to the database server according to movement of data between the database servers; And
If the first group identifier is not included in the managed group identifiers, adding the first group identifier to the managed group identifiers and further managing the first group identifier
And checking the consistency of the image.
제1항에 있어서,
상기 그룹 식별자들을 관리하는 단계는,
데이터베이스 서버들간의 데이터의 이동에 따라 상기 데이터베이스 서버에서 관리하는 제1 그룹 식별자에 대응하는 데이터가 다른 데이터베이스 서버로 이동되는 경우, 상기 관리하는 그룹 식별자들에서 상기 제1 그룹 식별자를 제외하고 관리하는 것을 특징으로 하는 정합성 검사 방법.
The method according to claim 1,
Wherein managing the group identifiers comprises:
When data corresponding to a first group identifier managed by the database server is moved to another database server in accordance with movement of data between database servers, the first group identifier is excluded and managed from the managing group identifiers The method comprising the steps of:
제3항 또는 제4항에 있어서,
상기 데이터베이스 서버들간의 데이터의 이동은, 적어도 하나의 그룹 식별자에 대응하는 데이터의 단위로 이루어지는 것을 특징으로 하는 정합성 검사 방법.
The method according to claim 3 or 4,
Wherein movement of data between the database servers is performed in units of data corresponding to at least one group identifier.
제1항에 있어서,
상기 그룹 식별자는 샤드키들 각각을 기설정된 해시 함수의 파라미터로 입력하여 계산된 해시값을 포함하고,
동일한 해시값을 갖는 샤드키들이 동일한 그룹으로 분류되는 것을 특징으로 하는 정합성 검사 방법.
The method according to claim 1,
The group identifier includes a hash value calculated by inputting each of the shard keys as a parameter of a predetermined hash function,
And the shard keys having the same hash value are classified into the same group.
제1항에 있어서,
상기 정합성을 검사하는 단계는,
상기 추출된 그룹 식별자가 상기 관리되는 그룹 식별자들에 포함된 경우 정합성이 존재하는 것으로 결정하고, 상기 추출된 그룹 식별자가 상기 관리되는 그룹 식별자들에 포함되지 않는 경우 정합성이 결여된 것으로 결정하는 것을 특징으로 하는 정합성 검사 방법.
The method according to claim 1,
Wherein the step of checking consistency comprises:
Determining that there is consistency when the extracted group identifier is included in the managed group identifiers and determining that the extracted group identifier is not included in the managed group identifiers if the extracted group identifier is not included in the managed group identifiers .
컴퓨터와 결합되어 제1항 내지 제4항, 제6항 또는 제7항 중 어느 한 항의 방법을 컴퓨터에 실행시키기 위해 컴퓨터 판독 가능한 기록매체에 저장된 컴퓨터 프로그램.A computer program stored on a computer-readable medium for causing a computer to execute the method of any one of claims 1 to 4, 6, or 7 in combination with the computer. 제1항 내지 제4항, 제6항 또는 제7항 중 어느 한 항의 방법을 컴퓨터에 실행시키기 위한 프로그램이 기록되어 있는 것을 특징으로 하는 컴퓨터에서 판독 가능한 기록매체.A computer-readable recording medium having recorded thereon a program for causing a computer to execute the method according to any one of claims 1 to 4, 6 or 7. 데이터베이스 서버를 위한 컴퓨터 장치에 있어서,
컴퓨터에서 판독 가능한 명령을 실행하도록 구현되는 적어도 하나의 프로세서
를 포함하고,
상기 적어도 하나의 프로세서는,
샤딩(sharding)된 데이터의 샤드키(shardkey)들을 분류하여 생성된 기설정된 수의 복수의 그룹들 각각의 그룹 식별자들과 관련하여, 상기 데이터베이스 서버가 관리하는 샤드키가 분류된 그룹의 그룹 식별자들을 관리하고,
요구된 연산과 관련된 샤드키에 대응하여 추출된 그룹 식별자를 이용하여, 상기 데이터베이스 서버에서 상기 요구된 연산과 연계된 데이터의 정합성을 검사하는 것
을 특징으로 하는 컴퓨터 장치.
A computer device for a database server,
At least one processor configured to execute computer readable instructions,
Lt; / RTI >
Wherein the at least one processor comprises:
A shard key managed by the database server is associated with a group identifier of a group in which a shard key is classified in association with each group identifier of a predetermined number of groups generated by sorting shardkeys of sharded data Management,
Checking the consistency of the data associated with the requested operation in the database server using the extracted group identifier corresponding to the shard key associated with the requested operation
The computer device comprising:
제10항에 있어서,
상기 적어도 하나의 프로세서는,
상기 데이터베이스 서버가 관리하는 샤드키가 분류된 그룹 여부에 대한 정보가 상기 기설정된 수의 복수의 그룹들의 그룹 식별자들 각각에 대해 설정된 그룹 식별자 비트맵을 생성 및 관리하는 것
을 특징으로 하는 컴퓨터 장치.
11. The method of claim 10,
Wherein the at least one processor comprises:
And generating and managing a group identifier bit map in which information on whether or not a shard key group managed by the database server is grouped is set for each of group identifiers of a predetermined number of groups
The computer device comprising:
제10항에 있어서,
상기 적어도 하나의 프로세서는,
데이터베이스 서버들간의 데이터의 이동에 따라 제1 그룹 식별자에 대응하는 데이터가 상기 데이터베이스 서버로 이동된 경우, 상기 제1 그룹 식별자가 상기 데이터베이스 서버에 의해 관리되고 있는지 여부를 확인하고,
상기 제1 그룹 식별자가 상기 관리되는 그룹 식별자들에 포함되어 있지 않은 경우, 상기 제1 그룹 식별자를 상기 관리되는 그룹 식별자들에 추가하여 더 관리하는 것
을 특징으로 하는 컴퓨터 장치.
11. The method of claim 10,
Wherein the at least one processor comprises:
Wherein the database management server determines whether the first group identifier is managed by the database server when the data corresponding to the first group identifier is moved to the database server according to the movement of data between the database servers,
Adding the first group identifier to the managed group identifiers and further managing the first group identifier when the first group identifier is not included in the managed group identifiers
The computer device comprising:
제10항에 있어서,
상기 적어도 하나의 프로세서는,
데이터베이스 서버들간의 데이터의 이동에 따라 상기 데이터베이스 서버에서 관리하는 제1 그룹 식별자에 대응하는 데이터가 다른 데이터베이스 서버로 이동되는 경우, 상기 관리하는 그룹 식별자들에서 상기 제1 그룹 식별자를 제외하고 관리하는 것
을 특징으로 하는 컴퓨터 장치.
11. The method of claim 10,
Wherein the at least one processor comprises:
Managing data of the first group identifier managed by the database server according to the movement of data between the database servers, excluding the first group identifier from the managed group identifiers when the data corresponding to the first group identifier is moved to another database server
The computer device comprising:
제12항 또는 제13항에 있어서,
상기 데이터베이스 서버들간의 데이터의 이동은, 적어도 하나의 그룹 식별자에 대응하는 데이터의 단위로 이루어지는 것을 특징으로 하는 컴퓨터 장치.
The method according to claim 12 or 13,
Wherein movement of data between the database servers is performed in units of data corresponding to at least one group identifier.
제10항에 있어서,
상기 그룹 식별자는 샤드키들 각각을 기설정된 해시 함수의 파라미터로 입력하여 계산된 해시값을 포함하고,
동일한 해시값을 갖는 샤드키들이 동일한 그룹으로 분류되는 것을 특징으로 하는 컴퓨터 장치.
11. The method of claim 10,
The group identifier includes a hash value calculated by inputting each of the shard keys as a parameter of a predetermined hash function,
Wherein the shard keys having the same hash value are classified into the same group.
제10항에 있어서,
상기 적어도 하나의 프로세서는,
상기 추출된 그룹 식별자가 상기 관리되는 그룹 식별자들에 포함된 경우 정합성이 존재하는 것으로 결정하고, 상기 추출된 그룹 식별자가 상기 관리되는 그룹 식별자들에 포함되지 않는 경우 정합성이 결여된 것으로 결정하는 것
을 특징으로 하는 컴퓨터 장치.
11. The method of claim 10,
Wherein the at least one processor comprises:
Determining that there is consistency when the extracted group identifier is included in the managed group identifiers and determining that the extracted group identifier is not included in the managed group identifiers if the extracted group identifier is not included in the managed group identifiers
The computer device comprising:
KR1020170101054A 2017-08-09 2017-08-09 Consistency checking in database sharding environment KR101919816B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020170101054A KR101919816B1 (en) 2017-08-09 2017-08-09 Consistency checking in database sharding environment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020170101054A KR101919816B1 (en) 2017-08-09 2017-08-09 Consistency checking in database sharding environment

Publications (1)

Publication Number Publication Date
KR101919816B1 true KR101919816B1 (en) 2018-11-19

Family

ID=64561845

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020170101054A KR101919816B1 (en) 2017-08-09 2017-08-09 Consistency checking in database sharding environment

Country Status (1)

Country Link
KR (1) KR101919816B1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102571783B1 (en) * 2022-12-16 2023-08-29 스트라토 주식회사 Search processing system performing high-volume search processing and control method thereof

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015049542A (en) 2013-08-29 2015-03-16 パナソニックIpマネジメント株式会社 Distributed database system and selection unit

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015049542A (en) 2013-08-29 2015-03-16 パナソニックIpマネジメント株式会社 Distributed database system and selection unit

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102571783B1 (en) * 2022-12-16 2023-08-29 스트라토 주식회사 Search processing system performing high-volume search processing and control method thereof

Similar Documents

Publication Publication Date Title
CN110799960B (en) System and method for database tenant migration
JP4331746B2 (en) Storage device configuration management method, management computer, and computer system
US11294958B2 (en) Managing a distributed knowledge graph
EP2696555B1 (en) Method and system for identifying storage device
WO2014057520A1 (en) Migration-destination file server and file system migration method
AU2018290753B2 (en) Systems and methods of creation and deletion of tenants within a database
US10922280B2 (en) Policy-based data deduplication
US11055289B2 (en) Framework to transfer rows in storage format, standard format, or combination thereof
EP3243134A1 (en) Multi-tenant upgrading
KR20210058118A (en) Casedb: low-cost put-intensive key-value store for edge computing
KR101989074B1 (en) Migration based on replication log in database sharding environment
US20230099501A1 (en) Masking shard operations in distributed database systems
KR101919816B1 (en) Consistency checking in database sharding environment
US10409787B1 (en) Database migration
WO2013118270A1 (en) Computer system, and method and program for managing data
US10831794B2 (en) Dynamic alternate keys for use in file systems utilizing a keyed index
WO2016117007A1 (en) Database system and database management method
JP6744272B2 (en) Migration management device and migration management method
US11580128B2 (en) Preventing DBMS deadlock by eliminating shared locking
CN116719481B (en) Configuration data processing method and device and related equipment
KR102360268B1 (en) Lock contorl for data in database sharding environment
KR102007788B1 (en) Lock contorl for data in database sharding environment
US20170116300A1 (en) Efficient mirror data re-sync
JP2000347911A (en) Method and system for managing database

Legal Events

Date Code Title Description
GRNT Written decision to grant