KR101527634B1 - Method and apparatus for providing sharding service - Google Patents

Method and apparatus for providing sharding service Download PDF

Info

Publication number
KR101527634B1
KR101527634B1 KR1020120087699A KR20120087699A KR101527634B1 KR 101527634 B1 KR101527634 B1 KR 101527634B1 KR 1020120087699 A KR1020120087699 A KR 1020120087699A KR 20120087699 A KR20120087699 A KR 20120087699A KR 101527634 B1 KR101527634 B1 KR 101527634B1
Authority
KR
South Korea
Prior art keywords
sharding
node
shard
data
sharding node
Prior art date
Application number
KR1020120087699A
Other languages
Korean (ko)
Other versions
KR20140021345A (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 KR1020120087699A priority Critical patent/KR101527634B1/en
Publication of KR20140021345A publication Critical patent/KR20140021345A/en
Application granted granted Critical
Publication of KR101527634B1 publication Critical patent/KR101527634B1/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/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system

Abstract

샤딩 서비스를 제공하기 위한 방법 및 장치가 제공된다. 샤딩 시스템은 분산 코디네이터 및 복수 개의 서버 머신들을 포함한다. 분산 코디네이터는 샤드의 개수 및 샤드 각각의 범위를 저장한다. 복수 개의 서버 머신들의 복수 개의 샤딩 노드들은 각각 복수 개의 샤드들 중 하나의 샤드의 마스터이고, 하나 이상의 샤드들의 슬레이브이다. 분산 코디네이터는 클라이언트에게 복수 개의 샤드들에 대한 정보를 제공한다.A method and apparatus for providing a sharding service are provided. The sharding system includes a distributed coordinator and a plurality of server machines. The distributed coordinator stores the number of shards and the range of each shard. The plurality of sharding nodes of the plurality of server machines are each a master of one of the plurality of shards and a slave of one or more shards. The distributed coordinator provides the client with information about a plurality of shards.

Figure R1020120087699
Figure R1020120087699

Description

샤딩 서비스를 제공하는 방법 및 장치{METHOD AND APPARATUS FOR PROVIDING SHARDING SERVICE}[0001] METHOD AND APPARATUS FOR PROVIDING SHARDING SERVICE [0002]

아래의 실시예들은 데이터를 분산하여 저장하는 방법 및 장치에 관한 것으로, 보다 상세히는 샤딩을 사용하여 데이터를 제공하는 방법 및 장치가 개시된다.The following embodiments relate to a method and apparatus for distributing and storing data, and more particularly, a method and apparatus for providing data using sharding.

단일한 데이터베이스(DataBase; 이하 DB)로 관리될 수 없을 만큼 큰 데이터를 저장 및 조회하기 위해서, 다수의 DB들를 이용하는 방식이 고려될 필요가 있다.In order to store and retrieve data that can not be managed by a single database (DB), a method using a plurality of DBs needs to be considered.

분산 DB는 분산 환경을 고려하여 만들어진 DB이다. 분산 DB는 범위 검색에 취약하거나 조인(join) 연산을 사용할 수 없는 것과 같은 기능 상의 제약을 가질 수 있다.The distributed DB is a database created considering the distributed environment. Distributed DBs can have functional limitations such as being vulnerable to scope searches or not being able to use join operations.

네트워크의 노드들이 분산 DB를 사용할 경우, 하나의 노드가 처리할 수 있는 최대의 데이터 용량에 있어서 제한이 가해질 수 있다. 말하자면, 기존의 분산 DB는, 데이터 모델이 계층형으로 분할될 수 있을 경우에만 처리 용량이 확장될 수 있기 때문에, 확장성(scalability) 모델에 있어서 제약을 갖는다.When a node in a network uses a distributed DB, a limitation may be imposed on the maximum data capacity that one node can handle. In other words, the existing distributed DB has a limitation in the scalability model because the processing capacity can be expanded only when the data model can be divided into hierarchical types.

또한, 네트워크 내의 분산 DB들 간에는 데이터 무결성(consistency)에 있어서 일반적인 DB에 비해 더 느슨한 기준이 적용될 수 있다. 예컨대, 기존의 분산 DB는 결과적으로 일관성있는(eventually-consistency) 속성을 가질 수 있다. 가용한 복제 노드들 각각에 데이터 쓰기 요청이 전송된 경우, 복제 노드들 중 일부에서는 데이터 쓰기가 성공하고, 다른 일부에서는 데이터 쓰기가 실패할 수 있다. 이때, 하나의 시스템 내의 복수 개의 노드들에서 서로 다른 데이터 상태가 공존할 수 있으며, 일관적이지 않은(inconsistent) 상태가 발생할 수 있다. 말하자면, 결과적으로 일관성있는 속성은, 이러한 일관적이지 않은 상태가 일시적으로 허용된다는 것을 의미하며, 엄격한 일관성이 제공되지 않는다는 것을 의미한다.Further, looser criteria may be applied to the consistency of distributed DBs in the network compared to a general DB. For example, an existing distributed DB may eventually have an eventually-consistent attribute. If a data write request is sent to each of the available replica nodes, the data write may succeed in some of the replica nodes, and the data write may fail in some of the replica nodes. At this time, different data states may coexist in a plurality of nodes in one system, and an inconsistent state may occur. As a result, consequently, a consistent attribute means that this inconsistent state is temporarily granted, which means that strict consistency is not provided.

일 실시예는 복수 개의 샤딩 노드들이 각각 복수 개의 샤드들 중 하나의 샤드의 마스터이고, 하나 이상의 샤드들의 슬레이브인 방법을 제공할 수 있다.One embodiment may provide a method wherein a plurality of sharding nodes are each a master of one of a plurality of shards and a slave of one or more shards.

일 실시예는 복수 개의 샤딩 노드들 중 특정한 샤딩 노드의 데이터가 일정 이상 증가하면, 증가된 데이터를 분할하여 저장하기 위해 신규의 샤딩 노드가 복수 개의 샤딩 노드들에 추가되는 방법을 제공할 수 있다.One embodiment may provide a method in which a new sharding node is added to a plurality of sharding nodes to divide and store the increased data when the data of a particular sharding node among the plurality of sharding nodes increases by a predetermined amount or more.

일 실시예는 적은 개수의 샤딩 노드들을 사용하면서도 각 샤딩 노드 별 데이터의 개수 및 용량을 샤딩 노드가 처리할 수 있는 범위 내로 조정할 수 있는 방법을 제공할 수 있다.One embodiment may provide a method by which the number and capacity of data for each sharding node can be adjusted within a range that the sharding node can handle while using a small number of sharding nodes.

일 실시예는 분산 시스템 내의 모든 노드들에 있어서 데이터로의 접근들이 동일한 순서로 발생하는 인과적 일관성(causally consistency)을 제공할 수 있는 방법을 제공할 수 있다.One embodiment may provide a way for all nodes in a distributed system to provide causally consistent access to data occurring in the same order.

일 측에 따르면, 샤드의 개수 및 샤드 각각의 범위를 저장하는 분산 코디네이터 및 복수 개의 서버 머신들을 포함하고, 상기 복수 개의 서버 머신들은 각각 샤딩 노드로서 동작하고, 상기 복수 개의 서버 머신들의 복수 개의 샤딩 노드들은 각각 상기 복수 개의 샤드들 중 하나의 샤드의 마스터이고, 하나 이상의 샤드들의 슬레이브이며, 상기 분산 코디네이터는 클라이언트에게 복수 개의 샤드들에 대한 정보를 제공하는, 샤딩 시스템이 제공될 수 있다.According to one aspect, there is provided a distributed coordinator comprising: a distributed coordinator for storing a number of shards and a respective range of shards; and a plurality of server machines, each of the plurality of server machines acting as a sharding node, Each of which is a master of one of the plurality of shards and is a slave of one or more shards, wherein the distributed coordinator provides the client with information about the plurality of shards.

상기 복수 개의 서버 머신들 중 적어도 하나의 서버 머신은 2 개 이상의 샤딩 노드들로서 동작할 수 있다.At least one server machine of the plurality of server machines may operate as two or more sharding nodes.

상기 샤딩 시스템은, 상기 클라이언트로부터의 데이터에 대한 접근의 요청을 복수 개의 샤딩 노드들 중 하나의 선택된 샤딩 노드로 전송하는 스위치를 더 포함할 수 있다.The sharding system may further include a switch for transmitting a request for access to data from the client to a selected sharding node of the plurality of sharding nodes.

상기 레벨 4 스위치는 로드 밸런싱에 기반하여 상기 하나의 선택된 샤딩 노드를 결정할 수 있다.The level 4 switch may determine the one selected sharding node based on load balancing.

상기 데이터에 대한 접근은 좌표를 사용하는 공간 검색일 수 있다.Access to the data may be a spatial search using coordinates.

상기 복수 개의 샤딩 노드들 중 제1 샤딩 노드는 상기 클라이언트로부터 검색이 요청된 데이터 중 자신이 복제하고 있지 않은 제2 샤드의 제2 데이터를 상기 복수 개의 샤딩 노드들 중 상기 제2 샤드를 복제하는 샤딩 노드로부터 획득할 수 있고, 상기 요청된 데이터 중 상기 제1 샤딩 노드가 복제하고 있는 제1 샤드의 제1 데이터 및 상기 제2 데이터를 병합함으로써 상기 요청된 데이터를 생성할 수 있고, 상기 요청된 데이터를 상기 클라이언트로 전송할 수 있다.Wherein a first sharding node among the plurality of sharding nodes transmits second data of a second shard not replicated by itself among data requested to be retrieved from the client to a sharding node for replicating the second shard among the plurality of sharding nodes And can generate the requested data by merging the first data of the first shard and the second data of the requested data replicated by the first sharding node, To the client.

상기 제1 샤드는 상기 복수 개의 샤드들 중 제1 샤딩 노드가 마스터인 샤드이고, 상기 제2 샤드는 상기 복수 개의 샤드들 중 제2 샤딩 노드가 마스터인 샤드일 수 있다.The first shard may be a shard where the first sharding node of the plurality of shards is the master, and the second shard may be a shard whose second sharding node is the master.

상기 제1 샤딩 노드는 상기 검색의 질의를 상기 제2 샤딩 노드로 전송할 수 있다.The first sharding node may send the search query to the second sharding node.

상기 제2 샤딩 노드는 상기 검색의 결과인 상기 제2 데이터를 생성하고, 상기 제2 데이터를 상기 제1 샤딩 노드로 전송할 수 있다.The second sharding node may generate the second data resulting from the search and transmit the second data to the first sharding node.

상기 분산 코디네이터는 신규의 샤드를 상기 복수 개의 샤드들에 추가할 수 있다.The distributed coordinator may add a new shard to the plurality of shards.

상기 신규의 샤드의 마스터인 신규의 샤딩 노드가 상기 복수 개의 샤딩 노드들에 추가될 수 있다.A new sharding node, which is the master of the new shard, may be added to the plurality of sharding nodes.

상기 신규의 샤딩 노드는 상기 복수 개의 샤딩 노드들 중 상기 신규의 샤드의 범위에 대응하는 제3 데이터를 복제하는 제3 샤딩 노드로부터 상기 제3 데이터에 대한 기입 전 로그(Write Ahead Log; 이하 WAL)을 수신할 수 있고, 상기 수신한 WAL에 기반하여 상기 신규의 샤드의 제4 데이터를 구축할 수 있다.Wherein the new sharding node sends a write ahead log (WAL) to the third data from a third sharding node that replicates third data corresponding to the range of the new shard among the plurality of sharding nodes, And construct the fourth data of the new shard based on the received WAL.

상기 신규의 샤드의 범위는 상기 제3 샤딩 노드가 마스터인 제3 샤드의 범위의 일부일 수 있다.The range of the new shard may be part of the range of the third shard where the third sharding node is the master.

상기 복수 개의 샤딩 노드들 중 제4 샤딩 노드는 상기 클라이언트로부터 자신이 슬레이브인 제4 샤드의 데이터로의 접근을 요청받을 수 있고, 상기 제4 샤딩 노드는 상기 제4 샤드의 마스터인 제5 샤딩 노드의 상태를 확인할 수 있고, 상기 제5 샤딩 노드에 장애가 발생한 경우 상기 제4 샤딩 노드는 상기 제4 샤드의 리더쉽을 획득할 수 있다.Wherein a fourth sharding node of the plurality of sharding nodes may be requested from the client to access data of a fourth shard which is a slave thereof and the fourth sharding node is a fifth sharding node that is a master of the fourth shard, The fourth sharding node can acquire the leadership of the fourth shard when the failure occurs in the fifth sharding node.

상기 제4 샤딩 노드는 상기 제5 샤딩 노드에 데이터를 전송할 수 있고, 상기 데이터의 전송이 실패하면 상기 제5 샤딩 노드에 장애가 발생한 것으로 판단할 수 있다.The fourth sharding node may transmit data to the fifth sharding node and may determine that the fifth sharding node has failed if the data transmission fails.

다른 일 측에 따르면, 분산 코디네이터가 복수 개의 샤드들에 대한 정보를 클라이언트에게 제공하는 단계, 복수 개의 샤딩 노드들 중 제1 샤딩 노드가 상기 클라이언트로부터 데이터의 검색의 요청을 수신하는 단계, 상기 제1 샤딩 노드가 상기 검색이 요청된 데이터 중 자신이 복제하고 있지 않은 제2 샤드의 제2 데이터를 상기 복수 개의 샤딩 노드들 중 상기 제2 샤드를 복제하는 샤딩 노드로부터 획득하는 단계, 상기 제1 샤딩 노드가 상기 검색이 요청된 데이터 중 상기 제1 샤딩 노드가 복제하고 있는 제1 샤드의 제1 데이터 및 상기 제2 데이터를 병합함으로써 상기 요청된 데이터를 생성하는 단계 및 상기 제1 샤딩 노드가 상기 검색이 요청된 데이터를 상기 클라이언트로 전송하는 단계를 포함하는, 샤딩 시스템의 동작 방법이 제공될 수 있다.According to another aspect, a distributed coordinator provides information about a plurality of shards to a client, a first one of a plurality of sharding nodes receiving a request for retrieval of data from the client, Wherein the sharding node obtains second data of a second shard not replicated by itself from among the data requested to be searched from a sharding node replicating the second shard of the plurality of sharding nodes, Generating the requested data by merging the first data of the first shard and the second data replicated by the first sharding node among the data requested to be searched, And sending the requested data to the client.

상기 샤딩 시스템은 복수 개의 서버 머신들을 포함할 수 있다.The sharding system may include a plurality of server machines.

상기 복수 개의 서버 머신들은 각각 샤딩 노드로서 동작할 수 있다.The plurality of server machines may each operate as a sharding node.

상기 복수 개의 서버 머신들 중 적어도 하나의 서버 머신은 2 개 이상의 샤딩 노드들로서 동작할 수 있다.At least one server machine of the plurality of server machines may operate as two or more sharding nodes.

상기 샤딩 시스템의 동작 방법은, 레벨 4 스위치가 로드 밸런싱에 기반하여 상기 복수 개의 샤딩 노드들 중 상기 제1 샤딩 노드를 상기 클라이언트로부터 상기 요청을 수신할 샤딩 노드로 선택하는 단계를 더 포함할 수 있다.The method of operation of the sharding system may further comprise the step of the level 4 switch selecting the first sharding node of the plurality of sharding nodes from the client as a sharding node to receive the request based on load balancing .

상기 획득하는 단계는, 상기 제1 샤딩 노드가 상기 검색의 질의를 상기 제2 샤딩 노드로 전송하는 단계, 상기 제2 샤딩 노드가 상기 검색의 결과인 상기 제2 데이터를 생성하는 단계 및 상기 제2 데이터를 상기 제1 샤딩 노드로 전송하는 단계를 포함할 수 있다.Wherein the obtaining comprises: the first sharding node sending a query of the search to the second sharding node, the second sharding node generating the second data resulting from the search, And transmitting data to the first sharding node.

또 다른 일 측에 따르면, 분산 코디네이터가 신규의 샤드를 복수 개의 샤드들에 추가하는 단계, 상기 신규의 샤드의 마스터인 신규의 샤딩 노드가 상기 복수 개의 샤딩 노드들에 추가되는 단계, 상기 신규의 샤딩 노드가 상기 복수 개의 샤딩 노드들 중 상기 신규의 샤드의 범위에 대응하는 제1 데이터를 복제하는 제1 샤딩 노드로부터 상기 제1 데이터에 대한 기입 전 로그(Write Ahead Log; 이하 WAL)을 수신하는 단계 및 상기 신규의 샤딩 노드가 상기 수신한 WAL에 기반하여 상기 신규의 샤드의 제2 데이터를 구축하는 단계를 포함하는 샤딩 시스템의 동작 방법이 제공될 수 있다.According to another aspect, a distributed coordinator includes adding a new shard to a plurality of shards, adding a new sharding node, which is the master of the new shard, to the plurality of sharding nodes, A node receives a Write Ahead Log (WAL) for the first data from a first sharding node that replicates first data corresponding to a range of the new shard among the plurality of sharding nodes And constructing second data of the new shard based on the received WAL by the new sharding node.

또 다른 일 측에 따르면, 상기 복수 개의 샤딩 노드들 중 제1 샤딩 노드가 상기 클라이언트로부터 자신이 슬레이브인 제1 샤드의 데이터로의 접근을 요청받는 단계, 상기 제1 샤딩 노드가 상기 제1 샤드의 마스터인 제2 샤딩 노드의 상태를 확인하는 단계 및 상기 제2 샤딩 노드에 장애가 발생한 경우 상기 제1 샤딩 노드가 상기 제1 샤드의 리더쉽을 획득하는 단계를 더 포함할 수 있다.According to another aspect, a first sharding node of the plurality of sharding nodes receives a request from the client for access to data of a first shard, which is a slave of the first sharding node, Checking the status of the second sharding node that is the master, and acquiring the leadership of the first sharding node by the first sharding node when the second sharding node fails.

상기 확인하는 단계는, 상기 제1 샤딩 노드가 상기 제2 샤딩 노드로 데이터를 전송하는 단계 및 상기 데이터의 전송이 실패하면 상기 제1 샤딩 노드가 상기 제2 샤딩 노드에 장애가 발생한 것으로 판단하는 단계를 포함할 수 있다.Wherein the verifying step comprises the steps of the first sharding node transmitting data to the second sharding node and the first sharding node determining that the second sharding node has failed if the transmission of the data fails .

복수 개의 샤딩 노드들이 각각 복수 개의 샤드들 중 하나의 샤드의 마스터이고, 하나 이상의 샤드들의 슬레이브인 방법이 제공될 수 있다.A method may be provided wherein a plurality of sharding nodes are each a master of one of a plurality of shards and a slave of one or more shards.

복수 개의 샤딩 노드들 중 특정한 샤딩 노드의 데이터가 일정 이상 증가하면, 증가된 데이터를 분할하여 저장하기 위해 신규의 샤딩 노드가 복수 개의 샤딩 노드들에 추가되는 방법이 제공될 수 있다.A method may be provided in which a new sharding node is added to a plurality of sharding nodes to divide and store the increased data when the data of a particular sharding node among the plurality of sharding nodes increases by more than a certain amount.

적은 개수의 샤딩 노드들을 사용하면서도 각 샤딩 노드 별 데이터의 개수 및 용량을 샤딩 노드가 처리할 수 있는 범위 내로 조정할 수 있는 방법이 제공될 수 있다.A method may be provided that allows the number and capacity of data for each sharding node to be adjusted to within a range that the sharding node can handle, while using a small number of sharding nodes.

샤딩을 통해 데이터를 분산 처리함으로써 하다의 서버 클러스터가 처리할 수 있는 데이터의 용량에 대한 제한이 해결될 수 있다.By distributing the data through sharding, the limit on the amount of data that a server cluster can handle can be resolved.

샤딩을 통해 데이터를 분산 처리하는 샤딩 시스템을 통해, 분산 시스템 내의 모든 노드들에 있어서 데이터로의 접근들이 동일한 순서로 발생하는 인과적 일관성(causally consistency)이 제공될 수 있다.Through a sharding system that distributes data through sharding, causal consistency can be provided in which all nodes in a distributed system have access to data in the same order.

도 1은 일 실시예에 따른 샤딩 시스템을 나타낸다.
도 2는 일 예에 따른 샤딩을 설명한다.
도 3은 일 예에 따른 샤딩 운영을 설명한다.
도 4는 일 실시예에 따른 샤딩 시스템의 동작을 설명한다.
도 5는 일 실시예에 따른 샤딩 시스템의 데이터의 검색을 설명하는 신호 흐름도이다.
도 6은 일 실시예에 따른 샤딩 노드의 추가 및 샤드 분할을 설명하는 신호 흐름도이다.
도 7은 일 실시예에 따른 장애 처리를 설명하는 신호 흐름도이다.
1 shows a shading system according to one embodiment.
2 illustrates a shingling according to an example.
3 illustrates sharding operations according to an example.
4 illustrates the operation of the shading system according to one embodiment.
5 is a signal flow diagram illustrating retrieval of data in a sharding system according to one embodiment.
6 is a signal flow diagram illustrating addition and shard partitioning of a sharding node in accordance with one embodiment.
7 is a signal flow diagram illustrating fault handling according to one embodiment.

이하에서, 첨부된 도면을 참조하여 실시예들을 상세하게 설명한다. 각 도면에 제시된 동일한 참조 부호는 동일한 부재를 나타낸다.
In the following, embodiments will be described in detail with reference to the accompanying drawings. Like reference symbols in the drawings denote like elements.

상대적으로 풍부한 기능을 사용하면서, 데이터의 확장을 도모할 수 있는 방법 중 관계 DB 관리 시스템(Relational DataBase Management System; 이하 RDBMS)과 같은 데이터페이스를 샤딩(sharding)하여 사용하는 방법이 있다. There is a method of sharding a data face such as a Relational Data Base Management System (RDBMS) among the methods of expanding data while using a relatively rich function.

샤딩은 데이터를 수평 분할하여 저장하는 방법 중 하나이다. 수평 분할이란 데이터를 2 개 이상의 테이블들에 나누어 저장하는 디자인이다. 예컨대, 수평 분할은 하나의 데이터를 처리하기 위해, 스키마가 동일한 2 개 이상의 테이블들을 사용하는 것을 의미한다. 수평 분할은 데이터의 인덱스의 크기를 감소시킬 수 있고, 데이터에 대한 작업의 동시성을 증가시킬 수 있다. 일반적인 수평 분할이 단일한 DB 내에서 이루어지는 것에 비해, 샤딩은 수평 분할을 사용하여 데이터를 물리적으로 상이한 DB들에 분산하여 저장한다. 또한, 샤딩은 분산하여 저장된 데이터에 대한 조회를 제공한다.Sharding is one of the ways to store data horizontally. Horizontal division is a design that divides data into two or more tables. For example, horizontal partitioning means that two or more tables with the same schema are used to process one piece of data. Horizontal partitioning can reduce the size of the index of data and increase the concurrency of operations on data. While a typical horizontal partitioning occurs within a single DB, Sharding uses horizontal partitioning to distribute and store the data physically in different DBs. Sharding also provides an inquiry into the data that is scattered and stored.

샤딩은 애플리케이션 서버에서 샤딩 로직(logic)을 직접 구현함으로써 제공될 수 있고, 샤딩 플랫폼(platform)을 통해 제공될 수 있다. 샤딩 플랫폼은 미들 티어(middle-tier) 또는 샤딩 기능을 제공하는 DB일 수 있다. 샤딩 플랫폼의 핵심적인 기능은, 계속적으로 증가하는 데이터에 대해 장애를 발생시키지 않고 효과적으로 대응하는 것 및 서비스마다 상이한 데이터 특성 및 데이터 모델에 대처하는 방법을 제공하는 것일 수 있다.Sharding can be provided by implementing sharding logic directly in the application server, and can be provided through a sharding platform. The sharding platform may be a middle-tier or a DB providing sharding functionality. A key function of the sharding platform can be to effectively respond to continuously increasing data without causing disruption and to provide a way to cope with different data characteristics and data models for each service.

샤드에 있어서, 샤드를 복제(replicate)하는 복수 개의 샤딩 노드들이 있을 수 있다. 샤드를 복제하는 복수 개의 샤딩 노드들 중 마스터인 샤딩 노드와 슬레이브인 샤딩 노드가 있을 수 있다. 마스터인 샤딩 노드는 샤드를 처리하는 리더(leader)일 수 있다. 슬레이브인 샤딩 노드는 샤드를 복제 또는 백업하는 노드일 수 있다.
In a shard, there may be a plurality of sharding nodes that replicate the shard. There may be a shading node that is a master and a shading node that is a slave among a plurality of sharding nodes that replicate a shard. The sharding node that is the master may be a leader that processes the shard. The sharding node, which is a slave, may be a node that replicates or backs up the shard.

도 1은 일 실시예에 따른 샤딩 시스템을 나타낸다.1 shows a shading system according to one embodiment.

샤딩 시스템(100)은 샤딩을 사용하여 데이터를 제공하는 시스템일 수 있다. 여기서, 데이터는 위치 정보와 같은 다수의 서버 머신들에게 분산되어 처리되어야 하는 대규모의 데이터일 수 있다. Sharding system 100 may be a system that provides data using sharding. Here, the data may be large-scale data that must be distributed and processed by a plurality of server machines, such as location information.

샤딩 시스템(100)은 적어도 하나의 서버 클러스터 및 분산 코디네이터(130)를 포함할 수 있다. 일 실시예에서, 샤딩 시스템은 레벨 4(Level 4; 이하 L4) 스위치(140)를 더 포함할 수 있다.The sharding system 100 may include at least one server cluster and a distributed coordinator 130. In one embodiment, the sharding system may further include a Level 4 (hereafter L4) switch 140.

서버 클러스터는 하나의 스페이스(space)를 처리할 수 있다. 각 스페이스에 대해 하나의 서버 클러스터가 제공될 수 있다. 스페이스는 샤딩 시스템(100)에서 제공하는 스페이스의 식별자(identifier; 이하 ID)에 의해 구분되는 서비스일 수 있다. 스페이스의 ID는 서비스의 코드(code)일 수 있다.Server clusters can handle a single space. One server cluster may be provided for each space. The space may be a service distinguished by an identifier (ID) of a space provided by the sharding system 100. The ID of the space may be the code of the service.

도 1에서, 적어도 하나의 서버 클러스터로서, 제1 서버 클러스터(110-1) 및 제2 서버 클러스터(110-2)가 도시되었다. 각 서버 클러스터는 복수 개의 서버 머신들을 포함할 수 있다. 설명의 편의를 위해 이하에서는, 샤딩 시스템(100)은 하나의 서버 클러스터를 포함하는 것으로 가정될 수 있다. 도 1에서, 제1 서버 클러스터(110-1)의 복수 개의 서버 머신들로서 제1 서버 머신(120-1) 및 제2 서버 머신(120-2)이 도시되었다.In FIG. 1, as at least one server cluster, a first server cluster 110-1 and a second server cluster 110-2 are shown. Each server cluster may include a plurality of server machines. For the sake of convenience, the sharding system 100 may be assumed to include one cluster of servers. In Figure 1, a first server machine 120-1 and a second server machine 120-2 are shown as a plurality of server machines in a first server cluster 110-1.

복수 개의 서버 머신들은 각각 샤딩 노드로서 동작할 수 있다. 서버 머신은 샤딩 노드의 기능을 제공하는 샤딩 서비스를 실행할 수 있으며, 샤딩 서비스를 실행함으로써 샤딩 노드로서 동작할 수 있다. 복수 개의 서버 머신들에 의해 복수 개의 샤딩 노드들이 제공될 수 있다.The plurality of server machines may each operate as a sharding node. The server machine may execute a sharding service that provides the functionality of the sharding node and may operate as a sharding node by executing the sharding service. A plurality of sharding nodes may be provided by a plurality of server machines.

일반적으로 하나의 서버 머신은 하나의 샤딩 서비스를 실행하나, 하나의 서버 머신이 복수 개의 샤딩 서비스들을 실행할 수도 있다. 말하자면, 복수 개의 서버 머신들 중 적어도 하나의 서버 머신은 2 개 이상의 샤딩 노드들로서 동작할 수 있다. 도 1에서, 제2 서버 머신(120-2)은 2 개의 샤딩 서비스들을 실행하는 것으로 도시되었다.Generally, one server machine executes one sharding service, but one server machine may execute a plurality of sharding services. In other words, at least one of the plurality of server machines can operate as two or more sharding nodes. In Figure 1, the second server machine 120-2 is shown executing two sharding services.

클라이언트(150)는 샤딩 시스템(100)이 제공하는 데이터에 접근할 수 있다. 클라이언트(150)는 샤딩 시스템(100)에 데이터를 기입(write)하거나, 샤딩 시스템(100)의 데이터를 독출(read)할 수 있다. 또한, 클라이언트(150)는 샤딩 시스템(100)의 데이터를 삭제(delete) 또는 갱신(update)할 수 있다.The client 150 may access data provided by the sharding system 100. The client 150 can write data to the sharding system 100 or read data from the sharding system 100. In addition, the client 150 may delete or update the data of the sharding system 100.

클라이언트(150)는 샤딩 시스템(100)의 샤딩 노드에 직접 접속할 수 있으며, L4 스위치(140)를 통해 샤딩 노드에 접근할 수도 있다. The client 150 may directly connect to the sharding node of the sharding system 100 and may access the sharding node via the L4 switch 140. [

L4 스위치(140)는 각 서버 클러스터마다 하나 이상 있을 수 있다. 각 서버 클러스터는 자신을 위한 L4 스위치(140)를 포함할 수 있다. L4 스위치(140)는 클라이언트로부터의 데이터의 접근의 요청을 복수 개의 샤딩 노드들 중 하나의 선택된 샤딩 노드로 전송할 수 있다. L4 스위치(140)는 로드 밸런싱(load balancing)에 기반하여 하나의 선택된 샤딩 노드를 결정할 수 있다. 여기서, 로드 밸런싱은 복수 개의 샤딩 노드들 또는 복수 개의 서버 머신들 간의 부하의 분산일 수 있다.There may be more than one L4 switch 140 for each server cluster. Each server cluster may include an L4 switch 140 for itself. L4 switch 140 may send a request for access of data from a client to a selected sharding node of a plurality of sharding nodes. L4 switch 140 may determine one selected sharding node based on load balancing. Here, load balancing may be load balancing between a plurality of sharding nodes or a plurality of server machines.

분산 코디네이터(130)는 적어도 하나의 서버 클러스터들 각각의 설정 정보 및 샤딩 정보를 저장 및 관리할 수 있다. 서버 클러스터 내의 복수 개의 서버 머신들은 각각 분산 코디네이터(130)에 연결될 수 있다. L4 스위치(140) 및 클라이언트 또한 각각 분산 코디네이터(130)에 연결될 수 있다.The distributed coordinator 130 may store and manage setting information and sharding information of each of the at least one server clusters. A plurality of server machines in the server cluster may be connected to the distributed coordinator 130, respectively. L4 switch 140 and the client may also be coupled to the distributed coordinator 130, respectively.

분산 코디네이터(130)의 설정 정보 및 샤딩 정보는 복수 개의 샤딩 노드들 각각에게 제공될 수 있다. 각 샤딩 노드는 상기의 설정 정보 및 샤딩 정보를 사용하여 복수 개의 샤드들 각각의 마스터인 샤딩 노드 및 슬레이브인 샤딩 노드를 식별할 수 있다. 특정한 샤드의 마스터인 노드는 상기의 설정 정보 및 샤딩 정보를 사용하여 상기의 샤드의 슬레이브인 노드를 식별할 수 있다. 분산 코디네이터(130)의 설정 정보 및 샤딩 정보는 클라이언트(150)에게 제공될 수 있다. 클라이언트(150)는 샤딩 시스템(100)의 데이터에 접근함에 있어서 샤딩 정보를 사용할 수 있다.The configuration information and the sharding information of the distributed coordinator 130 may be provided to each of the plurality of sharding nodes. Each sharding node can identify the sharding node, which is the master of each of the plurality of shards, and the sharding node, which is the slave, using the setting information and the sharding information. A node which is a master of a specific shard can identify the node which is a slave of the shard using the above setting information and sharding information. The configuration information and the sharding information of the distributed coordinator 130 may be provided to the client 150. [ The client 150 may use the sharding information in accessing the data of the sharding system 100.

샤딩 시스템(100)은 프로파일(profile) 별로 분리된 네트워크 내의 시스템일 수 있다. 여기서, 프로파일은 개발 프로파일 및 운영 프로파일 등이 있을 수 있다. 분산 코디네이터(130)는 각 프로파일 별로, 복수 개가 존재할 수 있다.
The sharding system 100 may be a system within a separate network by profile. Here, the profile may include a development profile and an operation profile. There may be a plurality of distributed coordinators 130 for each profile.

도 2는 일 예에 따른 샤딩을 설명한다.2 illustrates a shingling according to an example.

도 2에서, 복수 개의 샤딩 노드들로서, 제1 샤딩 노드(210), 제2 샤딩 노드(220), 제3 샤딩 노드(230), 제4 샤딩 노드(240) 및 제5 샤딩 노드(250)가 도시되었다.2, the first shading node 210, the second shading node 220, the third shading node 230, the fourth shading node 240 and the fifth shading node 250 are a plurality of shading nodes Respectively.

샤딩 시스템(100)에 의해 제공되는 샤딩은 멀티 마스터(multi-master) 방식일 수 있다. 복수 개의 샤딩 노드들 각각은 어떤 샤드에 대해서는 유일한 마스터인 샤딩 노드일 수 있으며, 이와 동시에 다른 샤드에 대해서는 슬레이브인 샤딩 노드일 수 있다.The sharding provided by the sharding system 100 may be a multi-master scheme. Each of the plurality of sharding nodes may be a sharding node that is the only master for any shard, while at the same time it may be a saddle sharding node for the other shard.

도 2 에서, A 내지 E의 5 개의 샤드들이 5 개의 샤딩 노드들 내에 분산하여 복제되었다. 샤드들은 데이터가 소정의 범위에 따라 분할된 것일 수 있다. 샤드들 각각은 특정한 범위에 대응할 수 있다. 예컨대, 샤드 A는 범위의 맨 처음부터 C 이하의 범위에 대응할 수 있다.In Fig. 2, five shards A through E are distributed and replicated in five sharding nodes. The shards may be those in which the data is divided according to a predetermined range. Each of the shards may correspond to a specific range. For example, the shard A may correspond to a range from the beginning of the range to a range of C or less.

샤드 A, 샤드 B, 샤드 C, 샤드 D 및 샤드 E 각각의 범위는 하기의 표 1과 같이 설명될 수 있다.The ranges of shard A, shard B, shard C, shard D, and shard E can be described as shown in Table 1 below.

샤드Shard 범위range AA ∼ ≤ C~ C BB C < ∼ ≤ EAC <~ ≤ EA CC EA < ∼ ≤ HCEA <~? HC DD HC < ∼ ≤ SHC <~ S EE S < ∼S <~

샤드가 특정한 범위에 대응한다는 것은 상기의 샤드가 상기의 특정한 범위 내의 데이터를 저장한다는 것을 의미할 수 있다. 샤드들 각각은 자신에게 할당된 범위의 데이터를 저장할 수 있다.The fact that the shard corresponds to a certain range may mean that the shard stores the data within the specified range. Each of the shards may store data in a range assigned to it.

샤딩 노드 내의 원은, 샤딩 노드가 마스터인 샤드를 나타낸다. 샤딩 노드 내의 사각형은, 샤딩 노드가 슬레이브인 샤드를 나타낸다. 도 2에서, 복수 개의 샤딩 노드들 각각은 5 개의 샤드들 중 1 개의 샤드의 마스터이며, 2 개의 샤드들의 슬레이브이다. 5 개의 샤드들 각각은 3 개의 샤딩 노드들에 의해 복제된다. 각 샤드에 있어서, 3 개의 샤딩 노드들 중 1 개의 샤딩 노드가 마스터이며 나머지 2 개의 샤딩 노드들이 슬레이브들이다. 예컨데, 제1 샤딩 노드(210)는 샤드 A의 마스터이고, 샤드 E 및 샤드 D의 슬레이브이다.The circle in the sharding node represents the shard where the sharding node is the master. The rectangle within the sharding node represents the shard where the sharding node is the slave. In Figure 2, each of the plurality of sharding nodes is a master of one of the five shards, and is a slave of two shards. Each of the five shards is replicated by three sharding nodes. For each shard, one sharding node of the three sharding nodes is the master and the remaining two sharding nodes are the slaves. For example, the first sharding node 210 is the master of shard A, and is a slave of shard E and shard D.

도 2에서 도시된 것처럼, 복수 개의 샤딩 노드들은 각각 복수 개의 샤드들 중 하나의 샤드의 마스터일 수 있고, 하나 이상의 샤드들의 슬레이브일 수 있다.As shown in FIG. 2, a plurality of sharding nodes may each be a master of one of the plurality of shards, and may be a slave of one or more shards.

분산 코디네이터(130)는 샤드의 개수 및 샤드 각각의 범위를 저장할 수 있다.The distributed coordinator 130 may store the number of shards and the range of each of the shards.

복수 개의 샤딩 노드들 각각은 설정 파일을 포함할 수 있다. 설정 파일은, 샤딩 노드가 어떤 스페이스를 처리하는에 대한 정보 및 샤딩 노드가 어떤 샤드를 실행하는지에 대한 정보를 포함할 수 있다. 예컨대, 제1 샤딩 노드(210)의 설정 파일은 제1 샤딩 노드(210)가 샤드 A, 샤드 E 및 샤드 D를 처리한다는 정보를 포함할 수 있고, 제1 샤딩 노드(210)가 샤드 A의 마스터이고 샤드 E 및 샤드 D의 슬레이브라는 정보를 포함할 수 있다.Each of the plurality of sharding nodes may include a configuration file. The configuration file may include information about which space the sharding node processes and what sharding node executes which shard. For example, the configuration file of the first sharding node 210 may include information that the first sharding node 210 processes shard A, shard E, and shard D, Master &lt; / RTI &gt; and a slave of shard E and shard D, respectively.

도 3은 일 예에 따른 샤딩 운영을 설명한다.3 illustrates sharding operations according to an example.

샤딩 정보는 샤딩 테이블(300)을 포함할 수 있다.The sharding information may include a sharding table (300).

샤딩 테이블(310)의 1 열은 복수 개의 샤딩 노드들 중 샤딩 테이블(310)의 행이 가리키는 샤딩 노드를 나타낼 수 있다.The first column of the sharding table 310 may represent a sharding node to which the row of the sharding table 310 among the plurality of sharding nodes.

샤딩 테이블(310)의 2 열은 샤딩 테이블(310)의 행이 가리키는 샤딩 노드의 마스터 샤드를 나타낼 수 있다. 마스터 샤드는 샤딩 노드가 마스터인 샤드일 수 있다.The two columns of the sharding table 310 may represent the master shard of the sharding node to which the row of the sharding table 310 points. The master shard may be a shard whose sharding node is the master.

샤딩 테이블(320)의 3 열은 샤딩 테이블(310)의 행이 가리키는 샤딩 노드의 슬레이브 샤드를 나타낼 수 있다. 슬레이브 샤드는 샤딩 노드가 슬레이브인 샤드일 수 있다.The three columns of the sharding table 320 may represent the slave shard of the sharding node to which the row of the sharding table 310 points. The slave shard may be a shard whose sharding node is a slave.

예컨대, 샤딩 노드 a는 샤드 A 및 샤드 E를 복제하며, 샤드 A의 마스터일 수 있고, 샤드 E의 슬레이브일 수 있다.For example, the sharding node a replicates shard A and shard E, and may be the master of shard A and may be a slave of shard E.

도 3에서, 샤드의 복제본은 하나인 것으로 설명되었다. 상기의 설명은 샤딩의 운영의 일 예이다. 운영에 따라서, 샤드의 복제본은 복수 개일 수 있다. 샤드의 복제본은, 마스터가 저장한 샤드 외의, 슬레이브가 저장한 샤드를 의미할 수 있다. 말하자면, 마스터가 저장한 샤드를 원본, 슬레이브가 저장한 샤드를 복제본으로 볼 수 있다.In Figure 3, a replica of the shard was described as being one. The above description is an example of the operation of sharding. Depending on the operation, there may be multiple copies of the shard. A replica of a shard may refer to a shard stored by a slave other than a shard stored by the master. In other words, the shard that the master has saved can be seen as a replica of the original and the sword that the slave has saved.

슬레이브는 시계 방향으로 지정될 수 있다. 예컨대, n 번째의 샤딩 노드는 n 번째 샤드의 마스터이고, n-1 번째 샤드의 슬레이브일 수 있다. 여기서, n은 2 이상 m 이하의 정수일 수 있다. m은 샤드들의 개수일 수 있다. 또한, 첫 번째의 샤딩 노드는 첫 번째 샤드의 마스터이고, m 번째 샤드의 슬레이브일 수 있다.The slave can be clocked. For example, the n- th sharding node may be the master of the n- th shard and may be a slave of the n- 1-th shard. Here, n may be an integer of 2 or more and m or less. m may be the number of shards. Also, the first sharding node may be the master of the first shard and may be the slave of the mth shard.

샤딩 노드가 데이터를 수신하면, 데이터에 대한 기입 전 로그(Write Ahead Log; 이하 WAL)을 기록하고, 자신의 샤드에 대한 순서(order)를 1 증가시킨다. 만약, 샤딩 노드가 WAL을 기록하고, 샤드에 대한 순서를 1 증가시킬 수 있으면, 데이터에 대한 오퍼레이션이 성공한 것으로 간주될 수 있다.When a sharding node receives data, it writes a write ahead log (WAL) to the data, and increases the order of its own shard by one. If the sharding node can write the WAL and increase the order for the shard by one, the operation on the data may be considered successful.

마스터인 샤딩 노드는 슬레이브인 샤딩 노드에 비동기로 변경된 데이터 또는 추가된 데이터를 전송할 수 있다. 만약, 전송에서 타임-아웃 등의 실패가 발생한 경우, 샤딩 노드는 실패가 발생하였음을 분산 코디네이터(130)에 기록할 수 있다. 상기의 기록은 샤드의 순서일 수 있다.
The sharding node, which is the master, can transmit asynchronously changed data or added data to the sharding node which is the slave. If a failure such as a time-out occurs in the transmission, the sharding node may record in the distributed coordinator 130 that a failure has occurred. The above record may be in the order of the shards.

도 4 내지 도 7을 참조하여 설명될 실시예들에서, 샤딩 시스템(100)은 복수 개의 서버 머신들의 복수 개의 샤딩 노드들로서, 샤딩 노드 a(400-1), 샤딩 노드 b(400-2), 샤딩 노드 c(400-3), 샤딩 노드 d(400-4) 및 샤딩 노드 e(400-5)를 포함할 수 있다. 샤딩 노드 f(400-6)는 복수 개의 샤딩 노드들에 추가되는 신규의 샤딩 노드일 수 있다.In the embodiments to be described with reference to Figs. 4-7, the sharding system 100 is a plurality of sharding nodes of a plurality of server machines, including a sharding node a 400-1, a sharding node b 400-2, A sharding node c 400-3, a sharding node d 400-4, and a sharding node e 400-5. Sharding node f (400-6) may be a new sharding node that is added to a plurality of sharding nodes.

각 샤딩 노드 내의 원 내의 문자는, 샤딩 노드가 마스터인 샤드일 수 있다. 각 샤딩 노드 내의 사각형 내의 문자는, 샤딩 노드가 슬레이브인 샤드일 수 있다. 도 4 내지 도 7에서, 샤드들 각각은 도 3을 참조하여 전술된 샤딩 테이블(310)에 따라 복제되었다. 도 1 내지 도 3을 참조하여 전술된 설명들은 하기의 도 4 내지 도 7 각각에도 적용될 수 있다.
The characters in the circle within each sharding node may be a shard whose sharding node is the master. The characters in the rectangles within each sharding node may be shards whose sharding nodes are slaves. In FIGS. 4-7, each of the shards has been cloned according to the sharding table 310 described above with reference to FIG. The above description with reference to Figs. 1 to 3 can also be applied to each of Figs. 4 to 7 below.

도 4는 일 실시예에 따른 샤딩 시스템의 동작을 설명한다.4 illustrates the operation of the shading system according to one embodiment.

단계들(410 내지 440)은 샤딩 시스템 동작하기 위한 기본적인 단계들일 수 있다.Steps 410 through 440 may be the basic steps for operating the sharding system.

단계(410)에서, 복수 개의 샤딩 노드들의 서버 클러스터가 활성화될 수 있다.At step 410, a server cluster of a plurality of sharding nodes may be activated.

특정한 스페이스에 대한 모든 노드 인스턴스들이 가동을 시작하였으면, 상기의 스페이스의 클러스터는 활성화 상태가 될 수 있다. 여기서, 노드 인스턴스들은 복수 개의 서버 머신에서 동작하는 복수 개의 샤딩 노드들일 수 있다.Once all node instances for a particular space have started running, the cluster of space above can become active. Here, the node instances may be a plurality of sharding nodes operating on a plurality of server machines.

단계(420)에서, 클라이언트(150)는 복수 개의 샤드들에 대한 정보를 분산 코디네이터(130)에게 요청할 수 있다.In step 420, the client 150 may request information about a plurality of shards from the distributed coordinator 130. [

복수 개의 샤드들에 대한 정보는 샤드의 개수 및 샤드 각각의 범위 중 하나 이상을 포함할 수 있다.The information about the plurality of shards may include at least one of the number of shards and the range of each of the shards.

단계(425)에서, 분산 코디네이터(130)는 클라이언트(150)에게 복수 개의 샤드들에 대한 정보를 제공할 수 있다. 분산 코디네이터(130)는 샤드의 개수의 정보 및 샤드 각각의 범위의 정보 중 하나 이상을 클라이언트(150)에게 제공할 수 있다.At step 425, the distributed coordinator 130 may provide the client 150 with information about the plurality of shards. The distributed coordinator 130 may provide the client 150 with at least one of the information of the number of shards and the information of the range of each of the shards.

클라이언트(150)는 위해 복수 개의 샤딩 노드들 중 하나의 샤딩 노드에 직접 연결될 수 있다. 또한, 클라이언트(150)는 L4 스위치(140)를 경유하여 하나의 샤딩 노드에 연결할 수 있다. 도 4에서, 클라이언트(150)는 샤딩 노드 a(400-1)에 연결되는 것으로 도시되었다. 실시예에서, 이하 클라이언트(150)가 연결되는 샤딩 노드는 제1 샤딩 노드로 명명될 수 있다.The client 150 may be directly connected to one of the sharding nodes for a plurality of sharding nodes. In addition, the client 150 may connect to one sharding node via the L4 switch 140. In FIG. 4, client 150 is shown connected to sharding node a 400-1. In an embodiment, a sharding node to which a client 150 is connected below may be named a first sharding node.

클라이언트(150)는 분산 코디네이터(130)로부터 전송된 복수 개의 샤드들에 대한 정보에 기반하여 접근할 데이터와 관련된 샤드를 결정할 수 있으며, 결정된 샤드에 따라 복수 개의 샤딩 노드들 중 연결될 샤딩 노드를 결정할 수 있다.The client 150 can determine the shard associated with the data to be accessed based on the information about the shards transmitted from the distributed coordinator 130 and determine the sharding node to be connected among the plurality of sharding nodes according to the determined shard have.

하기의 단계(430, 435 및 440)는 클라이언트(150)가 L4 스위치(140)를 경유하여 샤딩 노드 a(400-1)에 연결될 때 수행될 수 있다.The following steps 430, 435, and 440 may be performed when the client 150 is connected to the sharding node a 400-1 via the L4 switch 140.

단계(430)에서, 클라이언트(150)는 L4 스위치(140)의 네트워크 주소를 사용하여 데이터로의 접근 요청을 L4 스위치(140)에 전송할 수 있다. 여기서, 데이터로의 접근은 데이터의 검색, 기입, 독출, 삭제 및 갱신 등을 포함할 수 있다. 네트워크 주소는 가상 인터넷 프로토콜(Virtual Internet Protocol: VIP) 주소일 수 있다.At step 430, the client 150 may send a request for access to data to the L4 switch 140 using the network address of the L4 switch 140. [ Here, access to data may include retrieving, writing, reading, deleting, and updating data. The network address may be a Virtual Internet Protocol (VIP) address.

단계(435)에서, 클라이언트(150)에 의해 연결될 샤딩 노드가 결정되는 것과는 달리, L4 스위치(140)가 복수 개의 샤딩 노드들 중 상기의 접근 요청을 처리할 하나의 샤딩 노드를 선택할 수도 있다. 예컨대, L4 스위치(140)는 로드 밸런싱에 기반하여 복수 개의 샤딩 노드들 중 제1 샤딩 노드를 클라이언트(150)로부터 데이터의 요청을 수신할 샤딩 노드로 선택할 수 있다.At step 435, the L4 switch 140 may select one sharding node to handle the access request among a plurality of sharding nodes, as opposed to determining that the sharding node to be connected by the client 150 is determined. For example, the L4 switch 140 may select a first sharding node among a plurality of sharding nodes as a sharding node to receive a request for data from the client 150 based on load balancing.

단계(440)에서, L4 스위치(140)는 선택된 샤딩 노드로 접근 요청을 전송할 수 있다. 상기의 전송에 의해 클라이언트(150) 및 선택된 샤딩 노드는 상호 간에 연결될 수 있다. 이후, 접근 요청을 수신한 샤딩 노드는 접근 요청을 처리할 수 있다. 후술될 단계(450)는 접근 요청의 처리의 일 예일 수 있다.At step 440, the L4 switch 140 may send an access request to the selected sharding node. By the above transmission, the client 150 and the selected sharding node can be connected to each other. Then, the sharding node receiving the access request can process the access request. Step 450, which will be described later, may be an example of the processing of an access request.

단계들(430, 435 및 440)과는 달리, 단계(445)에서, 클라이언트(150)는 복수 개의 샤드들에 대한 정보를 사용하여 직접 복수 개의 샤딩 노드들 중 하나의 샤딩 노드에 직접 연결될 수 있다. 단계(445)에서, 클라이언트(150)는 복수 개의 샤딩 노드들 중 하나의 샤딩 노드에게 접근 요청을 전송할 수 있다.Unlike steps 430, 435 and 440, at step 445, the client 150 may be directly connected to one of the plurality of sharding nodes directly using information about the plurality of shardings . At step 445, the client 150 may send an access request to one of the plurality of sharding nodes.

단계들(430, 435 및 440)은 클라이언트(150)가 사용하는 네트워크 프로토콜에 의해 투명하게 처리될 수 있다.Steps 430, 435, and 440 may be transparently handled by the network protocol that client 150 uses.

클라이언트(150)가 L4 스위치(140)를 경유하여 샤딩 노드에 연결될 지, 아니면 직접적으로 샤딩 노드에 연결될지는 클라이언트(150)가 요청하는 데이터로의 접근 타입에 의해 결정될 수 있다. 예컨대, 데이터로의 접근이 좌표를 사용하는 공간 검색의 요청인 경우, 로드 밸런싱을 위해, 클라이언트(150)는 L4 스위치(140)의 주소로 접근할 수 있으며, 단계들(430, 435 및 440)이 수행될 수 있다. 예컨대, 데이터로의 접근이 데이터의 추가 또는 데이터의 갱신일 경우, 클라이언트(150)는 샤딩 노드의 주소를 사용하여 L4 스위치(140)를 경유하지 않고 직접적으로 샤딩 노드에 접근할 수 있다. 예컨대, 데이터로의 접근이 특정한 유닛을 중심으로 한 공간 검색인 경우 클라이언트(150)는 상기의 특정한 유닛을 포함하는 샤드의 마스터인 샤딩 노드에 직접적으로 연결될 수 있다. 유닛은 지오레코드(GeoRecord)와 같은 샤드 내의 데이터의 단위일 수 있다.Whether the client 150 is connected to the sharding node via the L4 switch 140 or directly to the sharding node may be determined by the type of access to the data requested by the client 150. [ For example, for load balancing, the client 150 may access the address of the L4 switch 140 if the access to the data is a request for a spatial search using coordinates, and steps 430, 435, and 440, Can be performed. For example, when access to data is addition of data or update of data, the client 150 may access the sharding node directly without passing through the L4 switch 140 using the address of the sharding node. For example, if access to data is a spatial search around a particular unit, the client 150 may be directly connected to a sharding node that is the master of the shard containing the particular unit. A unit may be a unit of data within a shard, such as a GeoRecord.

단계(450)에서, 클라이언트(150)는 데이터를 검색한다.At step 450, the client 150 retrieves the data.

단계(460)에서, 샤드가 분할된다.In step 460, the shard is divided.

단계(470)에서, 샤딩 노드에 발생한 장애가 처리된다.At step 470, the fault occurring at the sharding node is processed.

단계(450), 단계(460) 및 단계(470)는 각각 하기에서 도 5, 도 6 및 도 7을 참조하여 상세히 설명된다.
Steps 450, 460 and 470 are described in detail below with reference to Figures 5, 6 and 7, respectively.

도 5는 일 실시예에 따른 샤딩 시스템의 데이터의 검색을 설명하는 신호 흐름도이다.5 is a signal flow diagram illustrating retrieval of data in a sharding system according to one embodiment.

도 4를 참조하여 전술된 단계(450)는 단계들(510 내지 560)을 포함할 수 있다.Step 450 described above with reference to FIG. 4 may include steps 510-560.

단계(510)에서, 클라이언트(150)는 샤딩 노드 a(400-1)에게 데이터 검색을 요청할 수 있다. 여기서, 데이터 검색은 데이터 접근의 일 예일 수 있다. 샤딩 노드 a(400-1)는 전술된 도 4에서 클라이언트(150)와 연결된 샤딩 노드일 수 있으며, 제1 샤딩 노드로 명명될 수 있다.In step 510, the client 150 may request sharding node a 400-1 to retrieve data. Here, the data retrieval may be an example of data access. The sharding node a 400-1 may be a sharding node connected to the client 150 in Fig. 4 described above, and may be named as a first sharding node.

도 4의 실시예에서, 클라이언트에 의해 요청된 데이터는 샤드 A의 데이터, 샤드 C의 데이터 및 샤드 D의 데이터 각각의 전부 또는 일부일 수 있다. 클라이언트에 의해 요청된 데이터는 샤딩 노드 a(400-1), 샤딩 노드 c(400-3) 및 샤딩 노드 d(400-4) 내에 분산되어 저장될 수 있다.In the embodiment of FIG. 4, the data requested by the client may be all or part of each of data of shard A, data of shard C, and data of shard D respectively. The data requested by the client may be distributed and stored in the sharding node a 400-1, the sharding node c 400-3 and the sharding node d 400-4.

단계(520) 내지 단계(545)에서, 데이터 검색을 요청받은 샤딩 노드 a(400-1)는 검색이 요청된 데이터 중 자신이 복제하고 있지 않은 미복제 샤드의 데이터를 상기의 미복제 샤드를 복제하는 샤딩 노드 c(400-3) 및 샤딩 노드 d(400-4)부터 획득할 수 있다. In step 520 to step 545, the sharding node a 400-1 requested to retrieve the data replicates the cloned data of the cloned data, which is not cloned by itself, among the data requested to be retrieved, From the sharding node c (400-3) and the sharding node d (400-4).

데이터 검색을 요청받은 샤딩 노드를 제1 샤딩 노드로 명명할 수 있다. 제1 샤딩 노드가 복제하고 있지 않은 미복제 샤드의 데이터를 복제하는 샤딩 노드를 제2 샤딩 노드로 명명할 수 있다.The sharding node requested to retrieve the data may be referred to as a first sharding node. The sharding node, in which the first sharding node replicates data of the non-replicating shard that is not replicated, may be referred to as a second sharding node.

제1 샤딩 노드가 복제하고 있는 샤드를 제1 샤드로 명명할 수 있다. 제1 샤드는 제1 샤딩 노드가 마스터인 샤드일 수 있다. 제1 샤드의 데이터 중 검색이 요청된 데이터를 제1 데이터로 명명할 수 있다.The shard that the first sharding node is replicating may be referred to as the first shard. The first shard may be a shard where the first sharding node is the master. The data requested to be searched out among the data of the first shard can be named as the first data.

검색이 요청된 데이터를 포함하는 샤드들 중 제1 샤딩 노드가 복제하고 있지 않는 샤드를 제2 샤드로 명명할 수 있다. 제2 샤딩 노드는 제2 샤드를 복제하는 샤딩 노드일 수 있다. 말하자면, 제2 샤딩 노드는, 데이터의 검색에 필요한 샤드를 가지고 있는 샤딩 노드일 수 있다. 예컨대, 도 5에서, 검색이 요청된 데이터는 샤드 B, 샤드 C 및 샤드 D 내에 분산되어 저장된 데이터일 수 있다. 샤딩 노드 a(400-1)는 샤드 A의 마스터이므로, 제2 샤딩 노드는 샤딩 노드 c(400-3) 및 샤딩 노드 d(400-4)일 수 있다. 제2 샤드의 데이터 중 검색이 요청된 데이터를 제2 데이터로 명명할 수 있다. 제2 샤드는 제2 샤딩 노드가 마스터인 샤드일 수 있다.The shard that is not replicated by the first sharding node among the shards containing the data for which the search is requested can be named as the second shard. The second sharding node may be a sharding node that replicates the second shard. That is to say, the second sharding node may be a sharding node having a shard necessary for retrieving data. For example, in FIG. 5, the data requested to be retrieved may be data distributed in Shard B, Shard C, and Shard D. Since sharding node a 400-1 is the master of shard A, the second sharding node may be sharding node c 400-3 and sharding node d 400-4. And the data requested to be retrieved from the data of the second shard may be named as the second data. The second shard may be a shard whose second sharding node is the master.

즉, 복수 개의 샤딩 노드들 중 제1 샤딩 노드는 클라이언트(150)로부터 검색이 요청된 데이터 중 자신이 복제하고 있지 않은 제2 샤드의 제2 데이터를 복수 개의 샤딩 노드들 중 제2 샤드를 복제하는 샤딩 노드로부터 획득할 수 있다.That is, the first sharding node among the plurality of sharding nodes replicates the second data of the second shard that is not duplicated among the data requested to be retrieved from the client 150 to the second shard of the plurality of sharding nodes Can be obtained from the sharding node.

제1 샤딩 노드는 제2 샤드를 복제하는 샤딩 노드를 식별하기 위해 분산 코디네이터(130)로부터 전송된 정보를 사용할 수 있다.The first sharding node may use the information sent from the distributed coordinator 130 to identify the sharding node that replicates the second shard.

단계(520)에서, 샤딩 노드 a(400-1)는 데이터 검색 요청의 질의를 샤딩 노드 c(400-3)으로 전송할 수 있다.In step 520, sharding node a 400-1 may send a query of data retrieval request to sharding node c 400-3.

단계(525)에서, 샤딩 노드 a(400-1)는 데이터 검색 요청의 질의를 샤딩 노드 d(400-4)으로 전송할 수 있다. 단계들(520 및 525)을 통해, 제1 샤딩 노드는 요청된 검색의 질의를 제2 샤딩 노드로 전송할 수 있다.At step 525, sharding node a 400-1 may send a query of the data retrieval request to sharding node d 400-4. Through steps 520 and 525, the first sharding node may send a query of the requested search to the second sharding node.

단계(530)에서, 샤딩 노드 a(400-1)은 질의에 기반하여 검색의 결과를 생성할 수 있다. 검색의 결과는 전술된 제1 데이터일 수 있다.In step 530, sharding node a 400-1 may generate a result of the search based on the query. The result of the search may be the first data described above.

단계(532)에서, 샤딩 노드 c(400-3)는 전송된 질의에 기반하여 검색의 결과를 생성할 수 있다. 검색의 결과는 전술된 제2 데이터의 전부 또는 일부일 수 있다.At step 532, sharding node c 400-3 may generate the result of the search based on the transmitted query. The result of the search may be all or part of the second data described above.

단계(534)에서 샤딩 노드 d(400-4)는 전송된 질의에 기반하여 검색의 결과를 생성할 수 있다. 검색의 결과는 전술된 제2 데이터의 전부 또는 일부일 수 있다. In step 534, the sharding node d (400-4) may generate a search result based on the transmitted query. The result of the search may be all or part of the second data described above.

단계들(532 및 534)을 통해, 제2 샤딩 노드는 검색의 결과인 제2 데이터를 생성할 수 있다.Through steps 532 and 534, the second sharding node may generate second data that is the result of the search.

단계(540)에서, 샤딩 노드 c(400-3)는 검색의 결과인 제2 데이터를 샤딩 노드 a(400-1)로 전송할 수 있다.In step 540, the sharding node c 400-3 may send the second data resulting from the search to the sharding node a 400-1.

단계(545)에서, 샤딩 노드 d(400-4)는 검색의 결과인 제2 데이터의 전부 또는 일부를 샤딩 노드 a(400-1)로 전송할 수 있다.In step 545, the sharding node d 400-4 may transmit all or a portion of the second data resulting from the search to the sharding node a 400-1.

단계들(540 및 545)를 통해, 제2 샤딩 노드는 제2 데이터를 제1 샤딩 노드로 전송할 수 있다.Through steps 540 and 545, the second sharding node may send the second data to the first sharding node.

단계(550)에서, 샤딩 노드 a(400-1)은 자신의 검색의 결과, 샤딩 노드 c(400-3)의 겸색의 결과 및 샤딩 노드 d(400-4)의 겸색의 결과를 병합함으로써 클라이언트(150)로부터 요청된 데이터를 생성할 수 있다. 즉, 제1 샤딩 노드는 요청된 데이터 중 제1 샤딩 노드가 복제하고 있는 제1 샤드의 제1 데이터 및 제2 샤딩 노드로부터 전송된 제2 데이터를 병합함으로써 요청된 데이터를 생성할 수 있다.At step 550, sharding node a (400-1) determines whether the sharding node a (400-1) is a member of the client (400-4) by merging the result of its search, Lt; RTI ID = 0.0 &gt; 150 &lt; / RTI &gt; That is, the first sharding node may generate the requested data by merging the first data of the first shard that the first sharding node is replicating and the second data transmitted from the second sharding node of the requested data.

단계(560)에서, 샤딩 노드 a(400-1)는 검색의 요청에 따라 검색된 데이터를 클라이언트(150)로 전송할 수 있다. 검색된 데이터는 단계(550)의 병합에 의해 생성된 데이터일 수 있다. 즉, 제1 샤딩 노드는 클라이언트(150)로부터 요청된 데이터를 클라이언트(150)로 전송할 수 있다.
In step 560, the sharding node a 400-1 may send the retrieved data to the client 150 upon request of the search. The retrieved data may be data generated by the merging of step 550. That is, the first sharding node may transmit the requested data from the client 150 to the client 150.

도 6은 일 실시예에 따른 샤딩 노드의 추가 및 샤드 분할을 설명하는 신호 흐름도이다.6 is a signal flow diagram illustrating addition and shard partitioning of a sharding node in accordance with one embodiment.

도 4를 참조하여 전술된 단계(460)는 단계들(610 내지 680)을 포함할 수 있다.Step 460 described above with reference to FIG. 4 may include steps 610 through 680.

복수 개의 샤딩 노드들 중 특정한 샤딩 노드의 데이터가 일정 이상 증가하면, 상기의 증가된 데이터를 분할하여 저장하기 위해 신규의 샤딩 노드가 복수 개의 샤딩 노드들에 추가될 수 있다.A new sharding node may be added to a plurality of sharding nodes to divide and store the increased data if the data of a particular sharding node among the plurality of sharding nodes increases by more than a certain amount.

도 6에서, 샤딩 노드 f(600)는 복수 개의 샤딩 노드들에 추가되는 샤딩 노드이다. 샤딩 노드 f(600)를 신규의 샤딩 노드로 명명할 수 있다. 또한, 데이터가 분할되는 샤딩 노드를 제3 샤딩 노드로 명명할 수 있다.6, a sharding node f 600 is a sharding node added to a plurality of sharding nodes. The sharding node f 600 may be referred to as a new sharding node. Also, the sharding node to which the data is divided may be referred to as a third sharding node.

단계(610)에서, 분산 코디네이터(130)는 추가되는 샤딩 노드인 샤딩 노드 f(600)에 대한 정보를 추가할 수 있고, 추가되는 샤드 F에 대한 정보를 추가할 수 있다. 샤드 F의 마스터는 샤딩 노드 f(600)일 수 있다.At step 610, the distributed coordinator 130 may add information about the sharding node f 600, which is a sharding node to be added, and may add information about the shard F being added. The master of shard F may be sharding node f (600).

도 6에서, 샤드 F의 범위는 샤드 B의 기존의 범위 중 일부 및 샤드 E의 기존의 범위 중 일부인 것으로 도시되었다. 즉, 샤딩 노드 f(600)는 샤딩 노드 b(400-2)의 데이터 및 샤딩 노드 e(400-5)의 데이터가 증가함에 따라 추가된 것일 수 있다. 샤딩 노드 b(400-2) 및 샤딩 노드 e(400-5)는 각각 제3 샤딩 노드일 수 있다. 신규의 샤드의 범위는 제3 샤딩 노드가 마스터인 제3 샤드의 범위의 일부일 수 있다.6, the range of the shard F is shown as being part of the existing range of shard B and the existing range of shard E. That is, the sharding node f 600 may be added as the data of the sharding node b 400-2 and the data of the sharding node e 400-5 increase. Sharding node b 400-2 and sharding node e 400-5 may each be a third sharding node. The range of the new shard may be part of the range of the third shard where the third sharding node is the master.

단계(620)에서, 샤딩 노드 f(600)는 서버 클러스터 또는 복수 개의 샤딩 노드들에 추가될 수 있다. 샤드 f의 마스터인 샤딩 노드 f(600)가 추가될 수 있다. 즉, 신규의 샤드의 마스터인 신규의 샤딩 노드가 복수 개의 샤딩 노드들에 추가될 수 있다.In step 620, sharding node f 600 may be added to a server cluster or a plurality of sharding nodes. Shading node f 600, which is the master of shard f, may be added. That is, a new sharding node, which is the master of the new shard, may be added to the plurality of sharding nodes.

샤드 B'는 샤드 B 중 샤드 F로 분할된 데이터를 나타내는 샤드일 수 있다. 샤드 B''는 샤드 B 중 샤드 F로 분할된 데이터를 제외한 나머지 데이터의 샤드일 수 있다. 샤드 E'는 샤드 E 중 샤드 F로 분할된 데이터를 나타내는 샤드일 수 있다. 샤드 E''는 샤드 E 중 샤드 F로 분할된 데이터를 제외한 나머지 데이터의 샤드일 수 있다. 샤드 F는 B'+E'로 표현될 수 있다.Shard B 'may be a shard representing data divided into shard F among shard B. Shard B &quot; may be a shard of the remaining data except for data divided into shards F of shard B. Shard E 'may be a shard representing data segmented into shard F among shard E's. The shard E &quot; may be a shard of the remaining data except for the data divided by the shard F of the shard E. Shard F can be expressed as B '+ E'.

단계(630)에서, 샤딩 노드 b(400-2)는 자신이 마스터인 샤드인 샤드 B의 데이터 중 샤드 F의 범위에 대응하는 데이터에 대한 WAL를 샤딩 노드 f(600)로 전송할 수 있다.In step 630, the sharding node b 400-2 may send a WAL to the sharding node f 600 for data corresponding to the range of the shard F among the data of the shard B, which is the shard in which it is the master.

단계(635)에서, 샤딩 노드 e(400-5)는 자신이 마스터인 샤드인 샤드 E의 데이터 중 샤드 F의 범위에 대응하는 데이터에 대한 WAL을 샤딩 노드 f(600)로 전송할 수 있다.In step 635, the sharding node e (400-5) may send a WAL to the sharding node f (600) for data corresponding to the range of the shard F among the data of the shard E that is the master, which is the master.

단계(630) 및 단계(635)를 통해, 신규의 샤딩 노드는 복수 개의 샤딩 노드들 중 신규의 샤드의 범위에 대응하는 제3 데이터를 복제하는 제3 샤딩 노드로부터, 제3 데이터에 대한 WAL을 수신할 수 있다.Through steps 630 and 635, the new sharding node receives a WAL for the third data from the third sharding node that replicates the third data corresponding to the new shard of the plurality of sharding nodes .

단계(635) 및 단계(635)가 수행 중일 때, 샤딩은 하기의 표 2와 같이 운영될 수 있다.When step 635 and step 635 are being performed, the sharding can be operated as shown in Table 2 below.

샤딩 노드Sharding node 마스터 샤드Master Shard 할 일to do 슬레이브Slave 샤드Shard aa AA EE bb BB 샤딩 노드 f로 B'에 대한 WAL 전송WAL transmission for B 'to sharding node f AA cc CC BB dd DD CC ee EE 샤딩 노드 f로 E'에 대한 WAL 전송WAL transmission for E 'to sharding node f DD ff F(= B' + E')F (= B '+ E')

즉, 단계(635) 및 단계(635)가 수행 중일 때, 샤드 B의 마스터는 여전히 샤딩 노드 b(400-2)일 수 있고, 샤드 E의 마스터는 여전히 샤딩 노드 e(400-5)일 수 있다.That is, when steps 635 and 635 are being performed, the master of shard B may still be sharding node b 400-2, and the master of shard E may still be sharding node e (400-5) have.

하기의 단계들(640 내지 680)에서, 신규의 샤딩 노드는 수신한 WAL에 기반하여 신규의 샤드의 제4 데이터를 구축할 수 있다.In the following steps 640 to 680, the new sharding node may build the fourth data of the new shard based on the received WAL.

단계(640)에서, 샤딩 노드 f(600)는 분산 코디네이터(130)에게 샤딩 노드 f에 대한 전역 락(lock)을 요청할 수 있다. 단계(640)는 단계(630) 및 단계(635)가 종료가 거의 완료되었을 - 수행될 수 있다. 즉, 단계(640)는 샤딩 노드 b(400-2) 및 샤딩 노드 e(400-5)가 자신이 가진 WAL을 거의 다 샤딩 노드 f(600)에 전송하였을 때 수행될 수 있다.In step 640, the sharding node f 600 may request the global coordination of the sharding node f to the distributed coordinator 130. Step 640 may be performed where steps 630 and 635 are almost complete. That is, step 640 may be performed when the sharding node b 400-2 and the sharding node e 400-5 transmit their WAL to the shadowing node f 600.

단계(645)에서, 분산 코디네이터(130)는 샤딩 노드 f에 대한 전역 락을 생성할 수 있다.At step 645, the distributed coordinator 130 may generate a global lock for the sharding node f.

단계(650)에서, 샤딩 노드 f(600)는 샤드 F의 순서화(ordering)를 조정 또는 설정할 수 있다. 단계(650)은 샤딩 노드 b(400-2) 및 샤딩 노드 e(400-5)로부터 샤딩 노드 f(600)로의 WAL의 전송이 완료되었을 때 수행될 수 있다.In step 650, the sharding node f 600 may adjust or set the ordering of the shard F. [ Step 650 may be performed when the transmission of WAL from sharding node b 400-2 and sharding node e 400-5 to sharding node f 600 is complete.

WAL의 전송이 완료되면, 단계(660)에서, 샤딩 노드 f(600)는 분산 코디네이터(130)에게 샤드 F의 리더쉽의 교체를 요청할 수 있다. 여기서, 교체의 요청은 샤드 F에 대한 리더쉽의 교체가 종료하였음을 분산 코디네이터(130)에게 알리는 것일 수 있다.When the transmission of the WAL is complete, at step 660, the sharding node f 600 may request the scatter coordinator 130 to replace the shard F's leadership. Here, the request for replacement may be to inform the distributed coordinator 130 that the exchange of leadership for shard F has ended.

복수 개의 샤딩 노드들 각각은 샤드 별로 순서화를 할 수 있다. 리더쉽 변경을 위해 순서화의 정보가 사용될 수 있다.Each of the plurality of sharding nodes can perform ordering on a shard-by-shard basis. Ordering information can be used to change leadership.

단계(665)에서, 분산 코디네이터(130)는 샤드 F의 리더쉽의 교체를 기록할 수 있다.At step 665, the distributed coordinator 130 may record the replacement of the leadership of the shard F. [

단계(670)에서, 상기의 기록에 의해, 서버 클러스터 내의 복수 개의 샤딩 노드들 및 클라이언트 모두에게 샤드 F의 리더쉽의 교체가 알려질 수 있으며, 샤드 F 및 샤딩 노드 f(600)가 활성화될 수 있다.In step 670, by the above recording, the replacement of the shard F's leadership can be known to both a plurality of sharding nodes and clients in the server cluster, and the shard F and the sharding node f 600 can be activated.

샤딩 노드 f(600)가 활성화된 직후, 샤딩은 하기의 표 3과 같이 운영될 수 있다.Immediately after the sharding node f (600) is activated, the sharding can be operated as shown in Table 3 below.

샤딩 노드Sharding node 마스터 샤드Master Shard 할 일to do 슬레이브Slave 샤드Shard aa AA E'' 삭제E '' Delete F(= B' + E')F (= B '+ E') bb B''B '' B' 삭제Delete B ' AA cc CC B' 삭제Delete B ' B''B '' dd DD CC ee E''E '' E' 삭제E 'Delete DD ff F(= B' + E')F (= B '+ E') 샤딩 노드 A에 B'에 대한 WAL 전송WAL transmission for B 'to Shading Node A E''E ''

즉, 단계(470)에서, 복수 개의 샤딩 노드들 각각은 신규의 사드가 추가됨에 따라 변경된 복수 개의 샤드들 각각의 범위에 맞춰 자신이 마스터인 샤드의 범위 및 자신이 슬레이브인 샤드의 범위를 조정할 수 있다. 여기서, 조정은 샤드의 데이터 중 일부를 삭제하는 것일 수 있다. 또한, 조정은 샤드의 데이터 중 일부에 대한 WAL을 다른 샤딩 노드로 전송하는 것일 수 있다.That is, in step 470, each of the plurality of sharding nodes may adjust the range of the shard in which the master is the master and the range of the shard in which it is the slave, in accordance with the range of each of the plurality of shards changed as a new sard is added have. Here, the adjustment may be to delete some of the shard's data. Further, the coordination may be to transfer the WAL for some of the shard's data to another sharding node.

단계(680)에서, 분산 코디네이터(130)는 단계(645)에서 생성되었던 전역 락을 해제할 수 있다.In step 680, the distributed coordinator 130 may release the global lock that was created in step 645. [

전술된 샤드의 추가 및 샤드의 분할은, 샤딩 노드들 각각이 관리하는 데이터의 양을 균일하게 유지하기 위해 수행될 수 있다. 예컨대, 특정한 샤딩 노드가 관리하는 샤드가, 다른 샤딩 노드가 관리하는 샤드에 비해 기준치 이상으로 더 클 때, 전술된 단계들(610 내지 680)이 수행될 수 있다.The addition of the shard and the division of the shard described above can be performed in order to keep the amount of data managed by each of the sharding nodes uniform. For example, when the shard managed by a specific sharding node is larger than the reference value by a shard managed by another sharding node, the above-described steps 610 to 680 can be performed.

도 7은 일 실시예에 따른 장애 처리를 설명하는 신호 흐름도이다.7 is a signal flow diagram illustrating fault handling according to one embodiment.

도 4를 참조하여 전술된 단계(470)는 단계들(710 내지 790)을 포함할 수 있다.Step 470, described above with reference to FIG. 4, may include steps 710 through 790.

복수 개의 샤딩 노드들 중 하나의 노드에 장애가 발생했을 때, 장애가 복구되기 전까지 다른 노드에서 장애가 발생한 샤딩 노드의 샤드들을 처리할 수 있다. 장애가 복구되면, 복수 개의 샤딩 노드들에 의해 리더쉽 변경이 자동으로 진행될 수 있다.When one node of a plurality of sharding nodes fails, the shards of the failed sharding node can be processed by another node until the failure is restored. When the failure is restored, the leadership change can be automatically progressed by a plurality of sharding nodes.

단계(710)에서, 샤딩 노드 b(400-2)에 장애가 발생한 경우, 샤딩 노드 b(400-3)는 샤딩 시스템(100) 내에서 사라질 수 있다.In step 710, if a failure occurs in the sharding node b 400-2, then the sharding node b 400-3 may disappear in the sharding system 100.

단계(720)에서, 클라이언트(150)는 이를 모른채 장애가 발생한 샤딩 노드 b(400-2)가 마스터인 샤드 B의 데이터로의 접근을 요구할 수 있다.At step 720, the client 150 may request access to the data of the shard B, which is the master sharding node b 400-2, which has failed, without knowing it.

상기의 접근은 데이터의 기입일 수 있으며, 상기의 데이터는 샤드 B에 대응하는 데이터일 수 있다.The above approach may be a write of data, and the data may be data corresponding to shard B.

본 실시예에서, 클라이언트가 접근하는 샤드, 즉 샤드 B를 제4 샤드로 명명할 수 있다.In this embodiment, the shard, i.e., shard B, to which the client is approaching may be referred to as the fourth shard.

장애가 발생한 샤딩 노드 b(400-2)는 상기의 요청에 응답하지 못해 요청에 대한 타임-아웃(time-out) 등이 발생하거나, 요청이 전송 불능됨으로써, 단계(730)에서, 클라이언트(150)는 데이터에 대한 접근의 실패를 인식할 수 있다.In step 730, the sharding node b 400-2 fails to respond to the request so that a time-out or the like occurs for the request. May be aware of the failure to access the data.

데이터에 대한 접근이 실패하면, 단계(740)에서, 클라이언트(150)는 샤드 B의 슬레이브인 샤딩 노드 c(400-3)에게 데이터에 대한 접근을 요청할 수 있다. 클라이언트(150)는 분산 코데네이터로부터 제공받은 복수 개의 샤드들의 정보를 통해, 샤드 B의 슬레이브인 샤딩 노드를 알 수 있다.If access to the data fails, at step 740, the client 150 may request access to the data to the sharding node c 400-3, which is a slave of shard B. The client 150 can know the sharding node, which is the slave of the shard B, through the information of the plurality of shards provided from the distributed codenator.

샤딩 노드 c(400-3)는 자신이 슬레이브인 샤드 B의 데이터에 대한 접근의 요청을 수신함으로써, 샤드 B의 마스터인 샤딩 노드 b(400-2)에 장애가 발생한 가능성이 있음을 인식할 수 있다.Sharding node c (400-3) can recognize that there is a possibility of failure in sharding node b (400-2), which is master of shard B, by receiving a request for access to data of shard B, which is its slave .

제4 샤드의 슬레이브인 샤딩 노드를 제4 샤딩 노드로 명명할 수 있다. 제4 샤드의 마스터인 샤딩 노드를 제5 샤딩 노드로 명명할 수 있다.The sharding node that is the slave of the fourth shard may be named as the fourth sharding node. The sharding node that is the master of the fourth shard may be named as the fifth sharding node.

즉, 단계(740)에서, 복수 개의 샤딩 노드들 중 제4 샤딩 노드는 클라이언트(150)로부터 자신이 슬레이브인 제4 샤드의 데이터로의 접근을 요청받을 수 있다.That is, in step 740, the fourth sharding node of the plurality of sharding nodes may be requested from the client 150 to access data of the fourth shard, which is the slave thereof.

샤딩 노드 c(400-3)는 샤딩 노드 b(400-2)가 장애 중이라는 기록에 대한 책임을 갖는다.Sharding node c (400-3) is responsible for recording that sharding node b (400-2) is failing.

하기의 단계들(750 내지 770)에서, 제4 샤딩 노드는 제4 샤드의 마스터인 제5 샤딩 노드의 상태를 확인할 수 있다.In the following steps 750 to 770, the fourth sharding node may check the status of the fifth sharding node, which is the master of the fourth shard.

단계(750)에서, 샤딩 노드 c(400-3)는 샤딩 노드 b(400-2)의 상태를 확인할 수 있다. 예컨대, 샤딩 노드 b(400-2)가 사라진 경우, 샤딩 노드 c(400-3)는 샤딩 노드 b(400-2)에 장애가 발생한 것으로 판단할 수 있다. 샤딩 노드 b(400-2)에 장애가 발생한 것으로 판단된 경우 단계(780)이 수행될 수 있다.In step 750, the sharding node c 400-3 may check the status of the sharding node b 400-2. For example, if the sharding node b 400-2 has disappeared, the sharding node c 400-3 may determine that a failure has occurred in the sharding node b 400-2. If it is determined that a failure has occurred in the sharding node b 400-2, step 780 may be performed.

샤딩 노드 c(400-3)는 샤딩 노드 b(400-2)의 단명(ephemeral) 노드가 사라진 경우, 샤딩 노드 b(400-2)가 사라진 것으로 판단할 수 있다.The sharding node c 400-3 may determine that the sharding node b 400-2 has disappeared when the ephemeral node of the sharding node b 400-2 has disappeared.

샤딩 노드 b(400-2)가 사라지지 않은 경우, 단계(760)에서, 샤딩 노드 c(400-3)는 클라이언트(150)로부터 수신된 데이터를 샤딩 노드 b(400-2)로 전송할 수 있다. 단계(765)에서, 샤딩 노드 c(400-3)는 수신된 데이터의 전송이 성공하였는지 여부를 검사할 수 있다. 데이터의 전송이 성공하였으면, 샤딩 노드 b(400-2)에는 장애가 발생하지 않은 것일 수 있고, 절차가 종료할 수 있다.If sharding node b 400-2 has not disappeared, then at step 760, sharding node c 400-3 may send data received from client 150 to sharding node b 400-2 . In step 765, the sharding node c 400-3 may check whether the transmission of the received data is successful. If the data transmission is successful, the sharding node b (400-2) may not have failed and the procedure may be terminated.

데이터의 전송이 실패하였으면, 샤딩 노드 b(400-2)가 사라지지 않았음에도 불구하고, 샤딩 노드 b(400-2)에서 장애가 발생한 것일 수 있다. 데이터의 전송이 실패하였으면, 단계(770)이 수행될 수 있다.If the data transmission fails, the failure of the sharding node b 400-2 may be that the sharding node b 400-2 has not disappeared. If the transmission of the data has failed, step 770 may be performed.

즉, 제4 샤딩 노드는 제5 샤딩 노드로 데이터를 전송할 수 있고, 데이터의 전송이 실패하면 제4 샤딩 노드는 제5 샤딩 노드에 장애가 발생한 것으로 판단할 수 있다.That is, the fourth sharding node may transmit data to the fifth sharding node, and if the data transmission fails, the fourth sharding node may determine that the fifth sharding node has failed.

단계(770)에서, 샤딩 노드 c(400-3)는 샤딩 노드 b(400-2)에 대한 제어를 수행할 수 있다. 예컨대, 샤딩 노드 c(400-3)는 샤딩 노드 b(400-2)의 단명 노드를 삭제할 수 있다. 단명 노드의 삭제로 인해, 샤딩 노드 b(400-2)는 사라질 수 있다. 이후, 단계(780)에 의해 강제적으로 샤드 B에 대한 리디쉽의 교체가 수행될 수 있다.In step 770, the sharding node c 400-3 may perform control over the sharding node b 400-2. For example, the sharding node c (400-3) may delete the short name node of the sharding node b (400-2). Due to the deletion of the short name node, the sharding node b 400-2 may disappear. Thereafter, a replacement of the redundancy for the shard B can be forcibly performed by the step 780. [

단계(780)에서, 샤딩 노드 c(400-3)는 샤드 B에 대한 리더쉽을 교체할 수 있다. 즉, 제5 샤딩 노드에 장애가 발생한 경우 제4 샤딩 노드가 제4 샤드의 리더쉽을 획득할 수 있다. 샤딩 노드 c(400-3)는 샤드 B에 대한 리더쉽을 갖게 되며, 샤딩 노드 b(400-2)의 장애가 복구되기 전까지 샤드 B를 처리할 수 있다.At step 780, sharding node c 400-3 may replace the leadership for shard B. That is, if a failure occurs in the fifth sharding node, the fourth sharding node can acquire the leadership of the fourth shard. The sharding node c 400-3 has the leadership for the shard B and can process the shard B until the failure of the sharding node b 400-2 is restored.

이후, 샤딩 노드 b(400-2)의 장애가 복구되면, 샤드 B에 대한 리더쉽의 변경이 자동으로 진행될 수 있다.
Thereafter, when the failure of sharding node b 400-2 is restored, the change of leadership for shard B may proceed automatically.

전술된 실시예들에서, 유닛의 데이터는 객체 형태가 아닌 직렬화(serialized)된 로(raw) 데이터로서 처리될 수 있다. 예컨대, 래퍼 객체(wrapper object)인 정수(integer)의 타입(type)으로 4 바이트(byte)의 정수형(int)을 사용할 경우, 24 바이트가 요구될 수 있다. 따라서, 래퍼 객체 대신에 직렬화된 데이터의 옵셋(offset) 및 길이(length)를 이용하여 유닛 데이터가 처리되면, 메모리 사용량이 상당히 감소될 수 있다.In the embodiments described above, the data of the unit may be processed as serialized raw data rather than in object form. For example, when using a 4-byte integer type (int) as a wrapper object integer, 24 bytes may be required. Thus, if the unit data is processed using the offset and length of the serialized data instead of the wrapper object, the memory usage can be significantly reduced.

전술된 실시예들에 따르면, 어떤 샤드의 마스터는 명시적으로 결정된다. 따라서, 각 샤딩 노드는 샤드의 유닛의 히스토리(history)를 관리하지 않을 수 있다. 즉, 복제 방식의 변경에 의해, 샤딩 노드의 메모리의 사용이 감소될 수 있다. 유닛의 히스토리가 제거됨으로써 더 많은 메모리 여유 공간이 확보될 수 있다.
According to the embodiments described above, the master of a certain shard is explicitly determined. Thus, each sharding node may not manage the history of the shard's units. That is, by changing the replication method, the use of the memory of the sharding node can be reduced. By removing the history of the unit, more free memory space can be secured.

이상에서 설명된 장치는 하드웨어 구성요소, 소프트웨어 구성요소, 및/또는 하드웨어 구성요소 및 소프트웨어 구성요소의 조합으로 구현될 수 있다. 예를 들어, 실시예들에서 설명된 장치 및 구성요소는, 예를 들어, 프로세서, 콘트롤러, ALU(arithmetic logic unit), 디지털 신호 프로세서(digital signal processor), 마이크로컴퓨터, FPA(field programmable array), PLU(programmable logic unit), 마이크로프로세서, 또는 명령(instruction)을 실행하고 응답할 수 있는 다른 어떠한 장치와 같이, 하나 이상의 범용 컴퓨터 또는 특수 목적 컴퓨터를 이용하여 구현될 수 있다. 처리 장치는 운영 체제(OS) 및 상기 운영 체제 상에서 수행되는 하나 이상의 소프트웨어 애플리케이션을 수행할 수 있다. 또한, 처리 장치는 소프트웨어의 실행에 응답하여, 데이터를 접근, 저장, 조작, 처리 및 생성할 수도 있다. 이해의 편의를 위하여, 처리 장치는 하나가 사용되는 것으로 설명된 경우도 있지만, 해당 기술분야에서 통상의 지식을 가진 자는, 처리 장치가 복수 개의 처리 요소(processing element) 및/또는 복수 유형의 처리 요소를 포함할 수 있음을 알 수 있다. 예를 들어, 처리 장치는 복수 개의 프로세서 또는 하나의 프로세서 및 하나의 콘트롤러를 포함할 수 있다. 또한, 병렬 프로세서(parallel processor)와 같은, 다른 처리 구성(processing configuration)도 가능하다.The apparatus described above may be implemented as a hardware component, a software component, and / 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 array (FPA) 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), 컴퓨터 저장 매체 또는 장치, 또는 전송되는 신호 파(signal wave)에 영구적으로, 또는 일시적으로 구체화(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 , Or may be permanently or temporarily embodied in a transmitted signal wave. 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.

실시예에 따른 방법은 다양한 컴퓨터 수단을 통하여 수행될 수 있는 프로그램 명령 형태로 구현되어 컴퓨터 판독 가능 매체에 기록될 수 있다. 상기 컴퓨터 판독 가능 매체는 프로그램 명령, 데이터 파일, 데이터 구조 등을 단독으로 또는 조합하여 포함할 수 있다. 상기 매체에 기록되는 프로그램 명령은 실시예를 위하여 특별히 설계되고 구성된 것들이거나 컴퓨터 소프트웨어 당업자에게 공지되어 사용 가능한 것일 수도 있다. 컴퓨터 판독 가능 기록 매체의 예에는 하드 디스크, 플로피 디스크 및 자기 테이프와 같은 자기 매체(magnetic media), CD-ROM, DVD와 같은 광기록 매체(optical media), 플롭티컬 디스크(floptical disk)와 같은 자기-광 매체(magneto-optical media), 및 롬(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 program instructions to be recorded on the medium may be those specially designed and configured for the embodiments or may be available to those skilled in the art of computer software. Examples of computer-readable media include magnetic media such as hard disks, floppy disks and magnetic tape; optical media such as CD-ROMs and DVDs; magnetic media such as floppy disks; Magneto-optical media, and hardware devices specifically configured to store and execute program instructions such as ROM, RAM, flash memory, and the like. 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. The hardware devices described above may be configured to operate as one or more software modules to perform the operations of the embodiments, and vice versa.

이상과 같이 실시예들이 비록 한정된 실시예와 도면에 의해 설명되었으나, 해당 기술분야에서 통상의 지식을 가진 자라면 상기의 기재로부터 다양한 수정 및 변형이 가능하다. 예를 들어, 설명된 기술들이 설명된 방법과 다른 순서로 수행되거나, 및/또는 설명된 시스템, 구조, 장치, 회로 등의 구성요소들이 설명된 방법과 다른 형태로 결합 또는 조합되거나, 다른 구성요소 또는 균등물에 의하여 대치되거나 치환되더라도 적절한 결과가 달성될 수 있다. 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 &gt; or equivalents, even if it is replaced or replaced.

100: 샤딩 시스템
110-1: 제1 서버 클러스터
120-1: 제1 서버 머신
130: 분산 코디네이터
140: L4 스위치
150: 클라이언트
100: Sharding system
110-1: First server cluster
120-1: First server machine
130: Distributed coordinator
140: L4 switch
150: Client

Claims (21)

샤드의 개수 및 샤드 각각의 범위를 저장하는 분산 코디네이터; 및
복수 개의 서버 머신들
을 포함하고,
상기 복수 개의 서버 머신들은 각각 샤딩 노드로서 동작하고,
상기 복수 개의 서버 머신들의 복수 개의 샤딩 노드들은 각각 상기 복수 개의 샤드들 중 하나의 샤드의 마스터이고, 하나 이상의 샤드들의 슬레이브이며,
상기 분산 코디네이터는 클라이언트에게 복수 개의 샤드들에 대한 정보를 제공하고,
상기 클라이언트로부터의 데이터에 대한 접근의 요청을 복수 개의 샤딩 노드들 중 하나의 선택된 샤딩 노드로 전송하는 스위치
를 더 포함하고,
상기 데이터에 대한 접근은 좌표를 사용하는 공간 검색인, 샤딩 시스템.
A distributed coordinator for storing the number of shards and the range of each shard; And
Multiple server machines
/ RTI &gt;
The plurality of server machines each acting as a sharding node,
A plurality of sharding nodes of the plurality of server machines each being a master of one of the plurality of shards and a slave of one or more shards,
Wherein the distributed coordinator provides the client with information about a plurality of shards,
A switch for transmitting a request for access to data from the client to one selected sharding node of the plurality of sharding nodes,
Further comprising:
Wherein the access to the data is a spatial search using coordinates.
제1 항에 있어서,
상기 복수 개의 서버 머신들 중 적어도 하나의 서버 머신은 2 개 이상의 샤딩 노드들로서 동작하는, 샤딩 시스템.
The method according to claim 1,
Wherein at least one of the plurality of server machines operates as two or more sharding nodes.
제1항에 있어서,
상기 스위치는 로드 밸런싱에 기반하여 상기 하나의 선택된 샤딩 노드를 결정하는, 샤딩 시스템.
The method according to claim 1,
Wherein the switch determines the one selected sharding node based on load balancing.
삭제delete 제1항에 있어서,
상기 복수 개의 샤딩 노드들 중 제1 샤딩 노드는 상기 클라이언트로부터 검색이 요청된 데이터 중 자신이 복제하고 있지 않은 제2 샤드의 제2 데이터를 상기 복수 개의 샤딩 노드들 중 상기 제2 샤드를 복제하는 샤딩 노드로부터 획득하고, 상기 요청된 데이터 중 상기 제1 샤딩 노드가 복제하고 있는 제1 샤드의 제1 데이터 및 상기 제2 데이터를 병합함으로써 상기 요청된 데이터를 생성하고, 상기 요청된 데이터를 상기 클라이언트로 전송하는, 샤딩 시스템.
The method according to claim 1,
Wherein a first sharding node among the plurality of sharding nodes transmits second data of a second shard not replicated by itself among data requested to be retrieved from the client to a sharding node for replicating the second shard among the plurality of sharding nodes And generating the requested data by merging the first data of the first shard and the second data of the requested data replicated by the first sharding node and transmitting the requested data to the client Transmitting, sharding system.
제5항에 있어서,
상기 제1 샤드는 상기 복수 개의 샤드들 중 제1 샤딩 노드가 마스터인 샤드이고, 상기 제2 샤드는 상기 복수 개의 샤드들 중 제2 샤딩 노드가 마스터인 샤드인, 샤딩 시스템.
6. The method of claim 5,
Wherein the first shard is a shard where the first sharding node of the plurality of shards is the master and the second shard is the shard whose second sharding node is the master.
제5항에 있어서,
상기 제1 샤딩 노드는 상기 검색의 질의를 상기 제2 샤딩 노드로 전송하고,
상기 제2 샤딩 노드는 상기 검색의 결과인 상기 제2 데이터를 생성하고, 상기 제2 데이터를 상기 제1 샤딩 노드로 전송하는, 샤딩 시스템.
6. The method of claim 5,
Wherein the first sharding node transmits the search query to the second sharding node,
Wherein the second sharding node generates the second data resulting from the search and transmits the second data to the first sharding node.
샤드의 개수 및 샤드 각각의 범위를 저장하는 분산 코디네이터; 및
복수 개의 서버 머신들
을 포함하고,
상기 복수 개의 서버 머신들은 각각 샤딩 노드로서 동작하고,
상기 복수 개의 서버 머신들의 복수 개의 샤딩 노드들은 각각 상기 복수 개의 샤드들 중 하나의 샤드의 마스터이고, 하나 이상의 샤드들의 슬레이브이며,
상기 분산 코디네이터는 클라이언트에게 복수 개의 샤드들에 대한 정보를 제공하고,
상기 분산 코디네이터는 신규의 샤드를 상기 복수 개의 샤드들에 추가하고,
상기 신규의 샤드의 마스터인 신규의 샤딩 노드가 상기 복수 개의 샤딩 노드들에 추가되고,
상기 신규의 샤딩 노드는 상기 복수 개의 샤딩 노드들 중 상기 신규의 샤드의 범위에 대응하는 제3 데이터를 복제하는 제3 샤딩 노드로부터 상기 제3 데이터에 대한 기입 전 로그(Write Ahead Log; WAL)을 수신하고, 상기 수신한 WAL에 기반하여 상기 신규의 샤드의 제4 데이터를 구축하는, 샤딩 시스템.
A distributed coordinator for storing the number of shards and the range of each shard; And
Multiple server machines
/ RTI &gt;
The plurality of server machines each acting as a sharding node,
A plurality of sharding nodes of the plurality of server machines each being a master of one of the plurality of shards and a slave of one or more shards,
Wherein the distributed coordinator provides the client with information about a plurality of shards,
Wherein the distributed coordinator adds a new shard to the plurality of shards,
A new sharding node, which is the master of the new shard, is added to the plurality of sharding nodes,
The new sharding node sends a Write Ahead Log (WAL) for the third data from a third sharding node that replicates third data corresponding to the range of the new shard among the plurality of sharding nodes And constructs the fourth data of the new shard based on the received WAL.
제8항에 있어서,
상기 신규의 샤드의 범위는 상기 제3 샤딩 노드가 마스터인 제3 샤드의 범위의 일부인, 샤딩 시스템.
9. The method of claim 8,
Wherein the range of the new shard is part of the range of the third shard where the third sharding node is the master.
샤드의 개수 및 샤드 각각의 범위를 저장하는 분산 코디네이터; 및
복수 개의 서버 머신들
을 포함하고,
상기 복수 개의 서버 머신들은 각각 샤딩 노드로서 동작하고,
상기 복수 개의 서버 머신들의 복수 개의 샤딩 노드들은 각각 상기 복수 개의 샤드들 중 하나의 샤드의 마스터이고, 하나 이상의 샤드들의 슬레이브이며,
상기 분산 코디네이터는 클라이언트에게 복수 개의 샤드들에 대한 정보를 제공하고,
상기 복수 개의 샤딩 노드들 중 제4 샤딩 노드는 상기 클라이언트로부터 자신이 슬레이브인 제4 샤드의 데이터로의 접근을 요청받고, 상기 제4 샤딩 노드는 상기 제4 샤드의 마스터인 제5 샤딩 노드의 상태를 확인하고, 상기 제5 샤딩 노드에 장애가 발생한 경우 상기 제4 샤딩 노드는 상기 제4 샤드의 리더쉽을 획득하는, 샤딩 시스템.
A distributed coordinator for storing the number of shards and the range of each shard; And
Multiple server machines
/ RTI &gt;
The plurality of server machines each acting as a sharding node,
A plurality of sharding nodes of the plurality of server machines each being a master of one of the plurality of shards and a slave of one or more shards,
Wherein the distributed coordinator provides the client with information about a plurality of shards,
Wherein a fourth sharding node of the plurality of sharding nodes is requested by the client to access data of a fourth shard that is itself a slave and the fourth sharding node receives a status of a state of a fifth sharding node that is the master of the fourth shard And the fourth sharding node acquires the leadership of the fourth shard when the fifth sharding node fails.
제10항에 있어서,
상기 제4 샤딩 노드는 상기 제5 샤딩 노드에 데이터를 전송하고, 상기 데이터의 전송이 실패하면 상기 제5 샤딩 노드에 장애가 발생한 것으로 판단하는, 샤딩 시스템.
11. The method of claim 10,
Wherein the fourth sharding node transmits data to the fifth sharding node and determines that the fifth sharding node has failed if the transmission of the data fails.
분산 코디네이터가 복수 개의 샤드들에 대한 정보를 클라이언트에게 제공하는 단계;
복수 개의 샤딩 노드들 중 제1 샤딩 노드가 상기 클라이언트로부터 데이터의 검색의 요청을 수신하는 단계;
상기 제1 샤딩 노드가 상기 검색이 요청된 데이터 중 자신이 복제하고 있지 않은 제2 샤드의 제2 데이터를 상기 복수 개의 샤딩 노드들 중 상기 제2 샤드를 복제하는 샤딩 노드로부터 획득하는 단계;
상기 제1 샤딩 노드가 상기 검색이 요청된 데이터 중 상기 제1 샤딩 노드가 복제하고 있는 제1 샤드의 제1 데이터 및 상기 제2 데이터를 병합함으로써 상기 요청된 데이터를 생성하는 단계; 및
상기 제1 샤딩 노드가 상기 검색이 요청된 데이터를 상기 클라이언트로 전송하는 단계
를 포함하는, 샤딩 시스템의 동작 방법.
Providing a distributed coordinator with information about a plurality of shards to a client;
The first sharding node among the plurality of sharding nodes receiving a request for retrieval of data from the client;
The first sharding node acquiring second data of a second shard not replicated by itself of the data requested to be searched from a sharding node replicating the second shard of the plurality of sharding nodes;
The first sharding node generating the requested data by merging the first data and the second data of the first shard that the first sharding node is replicating among the data requested to be searched; And
The first sharding node transmitting the data requested to be retrieved to the client
/ RTI &gt;
제12항에 있어서,
상기 샤딩 시스템은 복수 개의 서버 머신들을 포함하고,
상기 복수 개의 서버 머신들은 각각 샤딩 노드로서 동작하고,
상기 복수 개의 서버 머신들 중 적어도 하나의 서버 머신은 2 개 이상의 샤딩 노드들로서 동작하는, 샤딩 시스템의 동작 방법.
13. The method of claim 12,
Wherein the sharding system comprises a plurality of server machines,
The plurality of server machines each acting as a sharding node,
Wherein at least one server machine of the plurality of server machines is operating as two or more sharding nodes.
제12항에 있어서,
스위치가 로드 밸런싱에 기반하여 상기 복수 개의 샤딩 노드들 중 상기 제1 샤딩 노드를 상기 클라이언트로부터 상기 요청을 수신할 샤딩 노드로 선택하는 단계
를 더 포함하는, 샤딩 시스템의 동작 방법.
13. The method of claim 12,
Wherein the switch selects the first sharding node of the plurality of sharding nodes from the client as a sharding node to receive the request based on load balancing
&Lt; / RTI &gt;
제12항에 있어서,
상기 검색은 좌표를 사용하는 공간 검색인, 샤딩 시스템의 동작 방법.
13. The method of claim 12,
Wherein the search is a spatial search using coordinates.
제12항에 있어서,
상기 제1 샤드는 상기 복수 개의 샤드들 중 제1 샤딩 노드가 마스터인 샤드이고, 상기 제2 샤드는 상기 복수 개의 샤드들 중 제2 샤딩 노드가 마스터인 샤드인, 샤딩 시스템의 동작 방법.
13. The method of claim 12,
Wherein the first shard is a shard where the first sharding node of the plurality of shards is the master and the second shard is the shard whose second sharding node is the master.
제12항에 있어서,
상기 획득하는 단계는,
상기 제1 샤딩 노드가 상기 검색의 질의를 상기 제2 샤딩 노드로 전송하는 단계;
상기 제2 샤딩 노드가 상기 검색의 결과인 상기 제2 데이터를 생성하는 단계; 및
상기 제2 데이터를 상기 제1 샤딩 노드로 전송하는 단계
를 포함하는, 샤딩 시스템의 동작 방법.
13. The method of claim 12,
Wherein the acquiring comprises:
The first sharding node transmitting the search query to the second sharding node;
The second sharding node generating the second data as a result of the search; And
Transmitting the second data to the first sharding node
/ RTI &gt;
분산 코디네이터가 신규의 샤드를 복수 개의 샤드들에 추가하는 단계;
상기 신규의 샤드의 마스터인 신규의 샤딩 노드가 상기 복수 개의 샤딩 노드들에 추가되는 단계;
상기 신규의 샤딩 노드가 상기 복수 개의 샤딩 노드들 중 상기 신규의 샤드의 범위에 대응하는 제1 데이터를 복제하는 제1 샤딩 노드로부터 상기 제1 데이터에 대한 기입 전 로그(Write Ahead Log; WAL)을 수신하는 단계; 및
상기 신규의 샤딩 노드가 상기 수신한 WAL에 기반하여 상기 신규의 샤드의 제2 데이터를 구축하는 단계
를 포함하는, 샤딩 시스템의 동작 방법.
Adding a new shard to a plurality of shards by a distributed coordinator;
The new sharding node being a master of the new shard being added to the plurality of sharding nodes;
The new sharding node sends a Write Ahead Log (WAL) for the first data from a first sharding node that replicates first data corresponding to the range of the new shard among the plurality of sharding nodes Receiving; And
The new sharding node establishing second data of the new shard based on the received WAL
/ RTI &gt;
제18항에 있어서,
상기 신규의 샤드의 범위는 상기 제1 샤딩 노드가 마스터인 제1 샤드의 범위의 일부인, 샤딩 시스템의 동작 방법.
19. The method of claim 18,
Wherein the range of the new shard is part of the range of the first shard where the first sharding node is the master.
복수 개의 샤딩 노드들 중 제1 샤딩 노드가 클라이언트로부터 자신이 슬레이브인 제1 샤드의 데이터로의 접근을 요청받는 단계;
상기 제1 샤딩 노드가 상기 제1 샤드의 마스터인 제2 샤딩 노드의 상태를 확인하는 단계; 및
상기 제2 샤딩 노드에 장애가 발생한 경우 상기 제1 샤딩 노드가 상기 제1 샤드의 리더쉽을 획득하는 단계
를 포함하는, 샤딩 시스템의 동작 방법.
The first sharding node among the plurality of sharding nodes requesting access from the client to the data of the first shard, which is the slave;
The first sharding node identifying a state of a second sharding node that is a master of the first shard; And
Wherein the first sharding node acquires the leadership of the first shard when the second sharding node fails
/ RTI &gt;
제20항에 있어서,
상기 확인하는 단계는,
상기 제1 샤딩 노드가 상기 제2 샤딩 노드로 데이터를 전송하는 단계; 및
상기 데이터의 전송이 실패하면 상기 제1 샤딩 노드가 상기 제2 샤딩 노드에 장애가 발생한 것으로 판단하는 단계
를 포함하는, 샤딩 시스템의 동작 방법.
21. The method of claim 20,
Wherein the verifying step comprises:
The first sharding node transmitting data to the second sharding node; And
If the transmission of the data fails, the first sharding node determines that the second sharding node has failed
/ RTI &gt;
KR1020120087699A 2012-08-10 2012-08-10 Method and apparatus for providing sharding service KR101527634B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020120087699A KR101527634B1 (en) 2012-08-10 2012-08-10 Method and apparatus for providing sharding service

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020120087699A KR101527634B1 (en) 2012-08-10 2012-08-10 Method and apparatus for providing sharding service

Publications (2)

Publication Number Publication Date
KR20140021345A KR20140021345A (en) 2014-02-20
KR101527634B1 true KR101527634B1 (en) 2015-06-10

Family

ID=50267862

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020120087699A KR101527634B1 (en) 2012-08-10 2012-08-10 Method and apparatus for providing sharding service

Country Status (1)

Country Link
KR (1) KR101527634B1 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101830504B1 (en) * 2016-05-18 2018-02-20 전자부품연구원 In-Memory DB Connection Support Type Scheduling Method and System for Real-Time Big Data Analysis in Distributed Computing Environment
US10671636B2 (en) 2016-05-18 2020-06-02 Korea Electronics Technology Institute In-memory DB connection support type scheduling method and system for real-time big data analysis in distributed computing environment
KR102008446B1 (en) * 2017-04-26 2019-08-07 주식회사 알티베이스 Hybrid Sharding system
KR102360268B1 (en) * 2017-08-09 2022-02-08 네이버 주식회사 Lock contorl for data in database sharding environment
KR101997978B1 (en) * 2017-09-29 2019-07-08 충북대학교 산학협력단 Apparatus and method for enhancing performance of distributed data store
CN114760323A (en) * 2022-03-02 2022-07-15 浙江吉利控股集团有限公司 Vehicle position information processing method, processing system and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000207266A (en) * 1999-01-13 2000-07-28 Mitsubishi Electric Corp Replica system and replica method
KR20020029441A (en) * 2000-08-21 2002-04-19 김영민 Distributed Server System and Method for Providing Data Using the Same

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000207266A (en) * 1999-01-13 2000-07-28 Mitsubishi Electric Corp Replica system and replica method
KR20020029441A (en) * 2000-08-21 2002-04-19 김영민 Distributed Server System and Method for Providing Data Using the Same

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Research on The Improvement of MongoDB Auto-Sharding in Cloud Environment, Yimeng Liu et al. (2012.07.31), http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=6295203 *
Research on The Improvement of MongoDB Auto-Sharding in Cloud Environment, Yimeng Liu et al. (2012.07.31), http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=6295203*

Also Published As

Publication number Publication date
KR20140021345A (en) 2014-02-20

Similar Documents

Publication Publication Date Title
US7613751B2 (en) Well-known transactions in data replication
KR101527634B1 (en) Method and apparatus for providing sharding service
CN101334797B (en) Distributed file systems and its data block consistency managing method
US8495013B2 (en) Distributed storage system and method for storing objects based on locations
US7761431B2 (en) Consolidating session information for a cluster of sessions in a coupled session environment
JP5952960B2 (en) Computer system, computer system management method and program
US20170249246A1 (en) Deduplication and garbage collection across logical databases
US9390120B1 (en) System and methods for organizing hierarchical database replication
KR20120072908A (en) Distribution storage system having plural proxy servers, distributive management method thereof, and computer-readable recording medium
US20170212939A1 (en) Method and mechanism for efficient re-distribution of in-memory columnar units in a clustered rdbms on topology change
CN113760901A (en) Data processing method, device, equipment and storage medium
CN106873902A (en) A kind of document storage system, data dispatching method and back end
KR101511098B1 (en) System and method for managing data using distributed containers
US11461201B2 (en) Cloud architecture for replicated data services
KR101989074B1 (en) Migration based on replication log in database sharding environment
JP7398567B2 (en) Dynamic adaptive partitioning
US11079960B2 (en) Object storage system with priority meta object replication
US20230126173A1 (en) Methods, devices and systems for writer pre-selection in distributed data systems
KR101748913B1 (en) Cluster management method and data storage system for selecting gateway in distributed storage environment
JP6007340B2 (en) Computer system, computer system management method and program
US11093465B2 (en) Object storage system with versioned meta objects
JP5956364B2 (en) Cluster system
US10908982B2 (en) Method and system for processing data
US11288148B2 (en) Global entity distribution
US20200401312A1 (en) Object Storage System with Meta Object Replication

Legal Events

Date Code Title Description
A201 Request for examination
N231 Notification of change of applicant
E902 Notification of reason for refusal
AMND Amendment
E601 Decision to refuse application
X091 Application refused [patent]
AMND Amendment
X701 Decision to grant (after re-examination)
GRNT Written decision to grant