KR102351220B1 - Database duplexing method for efficient server load distribution when processing large amounts of data and apparatus thereof - Google Patents

Database duplexing method for efficient server load distribution when processing large amounts of data and apparatus thereof Download PDF

Info

Publication number
KR102351220B1
KR102351220B1 KR1020210133618A KR20210133618A KR102351220B1 KR 102351220 B1 KR102351220 B1 KR 102351220B1 KR 1020210133618 A KR1020210133618 A KR 1020210133618A KR 20210133618 A KR20210133618 A KR 20210133618A KR 102351220 B1 KR102351220 B1 KR 102351220B1
Authority
KR
South Korea
Prior art keywords
data
slave
master
replica set
manager
Prior art date
Application number
KR1020210133618A
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 KR1020210133618A priority Critical patent/KR102351220B1/en
Application granted granted Critical
Publication of KR102351220B1 publication Critical patent/KR102351220B1/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/16Error detection or correction of the data by redundancy in hardware
    • G06F11/20Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements
    • G06F11/2053Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements where persistent mass storage functionality or persistent mass storage control functionality is redundant
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/182Distributed file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/214Database migration support
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2365Ensuring data consistency and integrity

Landscapes

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

Abstract

Provided is a method that is performed by a device including a plurality of databases (DBs), in which the method includes: distributing acquired data to generate first data and second data; storing the first data in a first master DB of a first replica set; duplicating the first data by the first master DB to transmit the first data to a first slave DB of the first replica set; storing the first data by the first slave DB; loading the first data from the first slave DB; storing the second data in a second master DB of a second replica set; duplicating the second data by the second master DB to transmit the second data to a second slave DB of the second replica set; storing the second data by the second slave DB; and loading the duplicated second data from the second slave DB, wherein the first replica set includes the first master DB, the first slave DB, and a first manager, the second replica set includes the second master DB, the second slave DB, and a second manager, the first manager is formed in the same server as the second master DB or the second slave DB, so that the first replica set and the second replica set are configured in a complementary manner, or the second manager is formed in the same server as the first master DB or the first slave DB, so that the first replica set and the second replica set are configured in a complementary manner. The present invention can minimize the delay caused by the disk input/output (I/O) of the DB.

Description

대용량 데이터 처리 시 효율적인 서버 부하 분산을 위한 DB 이중화 방법 및 이를 지원하는 장치{DATABASE DUPLEXING METHOD FOR EFFICIENT SERVER LOAD DISTRIBUTION WHEN PROCESSING LARGE AMOUNTS OF DATA AND APPARATUS THEREOF}A DB duplication method for efficient server load balancing when processing large amounts of data and a device supporting it

본 발명은 대용량 데이터 처리 시 효율적인 서버 부하 분산을 위해 데이터베이스를 이중화시키는 방법에 관한 것이다.The present invention relates to a method of duplicating a database for efficient server load balancing when processing large amounts of data.

메모리(In-memory) 데이터베이스(DB: database)는 일반적으로 적은 용량의 데이터를 캐시(cache)에 저장하는 용도로 개발되어 있어, 대용량 데이터 처리에는 맞지 않는 것이 현실이다. In-memory databases (DB: database) are generally developed for the purpose of storing small-capacity data in a cache, and the reality is that they are not suitable for processing large amounts of data.

이에 빅데이터 또는 대용량 데이터의 처리를 위해 DBMS 개발사들이 HA(high availability)를 위한 레플리카 세트(replica set) 구성을 지원하고 있다.For this reason, DBMS developers are supporting the configuration of replica sets for HA (high availability) in order to process big data or large amounts of data.

미국특허출원공보 제14/145,444호, 2013.12.31US Patent Application Publication No. 14/145,444, 2013.12.31 특허공개공보 제10-2020-0100173호, 2018.07.06Patent Publication No. 10-2020-0100173, 2018.07.06

DBMS(데이터베이스 관리 시스템)는 데이터가 레플리카 세트(replica set)에 자동으로 분산되어 저장되도록 지원하고 있다. 그러나 입력되는 데이터의 양이 매우 많은 경우엔 DBMS에서 데이터를 판단하고 나누고 저장하는 연산시간이 더 소요되므로 오히려 독립 방식(Standalone)이나 한 개의 레플리카 세트만 사용하는 경우 보다 성능이 떨어지는 문제점이 발생하게 된다.A DBMS (database management system) supports to automatically distribute and store data in a replica set. However, when the amount of input data is very large, it takes more time for the DBMS to determine, divide, and store the data, so performance is lower than when using the standalone method or only one replica set. .

본 발명은 이와 같은 문제를 해결하기 위한 DB 레플리카 세트의 구성을 제공하고자 한다. 구체적으로, 본 발명은 효율적인 부하 분산을 위해 DB 레플리카 세트에 포함된 마스터 DB 및 슬레이브 DB가 각각 하나의 서버에 포함되도록 한다.An object of the present invention is to provide a configuration of a DB replica set to solve such a problem. Specifically, the present invention allows the master DB and the slave DB included in the DB replica set to be included in one server, respectively, for efficient load balancing.

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

상술한 과제를 해결하기 위한 본 발명의 일 실시예에 따르면 복수 개의 데이터베이스(database, DB)들을 포함하는 장치가 수행하는 방법에 있어서, 획득한 데이터를 분산하여 제1 데이터 및 제2 데이터를 생성하고; 상기 제1 데이터를 상기 제1 레플리카 세트의 제1 마스터 DB에 저장하고; 상기 제1 마스터 DB는 상기 제1 데이터를 복제하여 상기 제1 레플리카 세트의 제1 슬레이브 DB에 전송하고; 상기 제1 슬레이브 DB는 상기 제1 데이터를 저장하고; 상기 제1 슬레이브 DB로부터 상기 제1 데이터를 로딩하고; 상기 제2 데이터를 상기 제2 레플리카 세트의 제2 마스터 DB에 저장하고; 상기 제2 마스터 DB는 상기 제2 데이터를 복제하여 상기 제2 레플리카 세트의 제2 슬레이브 DB에 전송하고; 상기 제2 슬레이브 DB는 상기 제2 데이터를 저장하고; 및 상기 제2 슬레이브 DB로부터 상기 복제된 제2 데이터를 로딩하는 것을 포함할 수 있다.According to an embodiment of the present invention for solving the above problems, in a method performed by an apparatus including a plurality of databases (DB), the obtained data is distributed to generate first data and second data, ; storing the first data in a first master DB of the first replica set; the first master DB duplicates the first data and transmits it to a first slave DB of the first replica set; the first slave DB stores the first data; loading the first data from the first slave DB; store the second data in a second master DB of the second replica set; the second master DB duplicates the second data and transmits it to a second slave DB of the second replica set; the second slave DB stores the second data; and loading the duplicated second data from the second slave DB.

상기 제1 레플리카 세트는 상기 제1 마스터 DB, 상기 제1 슬레이브 DB, 및 제1 매니저를 포함하고, 상기 제2 레플리카 세트는 상기 제2 마스터 DB, 상기 제2 슬레이브 DB, 및 제2 매니저를 포함할 수 있다.The first replica set includes the first master DB, the first slave DB, and a first manager, and the second replica set includes the second master DB, the second slave DB, and a second manager can do.

상기 제1 매니저가 상기 제2 마스터 DB 또는 상기 제2 슬레이브 DB와 같은 서버에 형성되어 상기 제1 레플리카 세트와 상기 제2 레플리카 세트가 상보적으로 구성될 수 있다.The first manager may be formed in the same server as the second master DB or the second slave DB, so that the first replica set and the second replica set are complementary.

상기 제2 매니저가 상기 제1 마스터 DB 또는 상기 제1 슬레이브 DB와 같은 서버에 형성되어 상기 제1 레플리카 세트와 상기 제2 레플리카 세트가 상보적으로 구성될 수 있다.The second manager may be formed in the same server as the first master DB or the first slave DB, so that the first replica set and the second replica set are complementary.

상기 제1 매니저를 사용할 수 없는 경우, 상기 제1 마스터 DB와 상기 제1 슬레이브 DB는 상기 제2 매니저에 연결될 수 있다.When the first manager is unavailable, the first master DB and the first slave DB may be connected to the second manager.

상기 제2 매니저를 사용할 수 없는 경우, 상기 제2 마스터 DB와 상기 제2 슬레이브 DB는 상기 제1 매니저에 연결될 수 있다.When the second manager is unavailable, the second master DB and the second slave DB may be connected to the first manager.

상기 제1 데이터를 상기 제1 마스터 DB에 저장하는 것은 상기 제1 마스터 DB의 바이너리 로그(binary log) 파일에 저장하는 것을 더 포함할 수 있다.Storing the first data in the first master DB may further include storing in a binary log file of the first master DB.

상기 제1 데이터를 상기 제1 슬레이브 DB에 저장하는 것은 상기 제1 슬레이브 DB의 릴레이 로그(relay log)파일에 저장하는 것을 더 포함할 수 있다.Storing the first data in the first slave DB may further include storing in a relay log file of the first slave DB.

상기 제1 레플리카 세트를 사용할 수 없는 경우, 상기 제1 데이터는 상기 제2 레플리카 세트 내에서 처리될 수 있다.If the first replica set is unavailable, the first data may be processed in the second replica set.

상기 제2 레플리카 세트를 사용할 수 없는 경우, 상기 제2 데이터는 상기 제1 레플리카세트 내에서 처리될 수 있다.If the second replica set is unavailable, the second data may be processed in the first replica set.

상기 제1 마스터 DB, 상기 제1 슬레이브 DB, 상기 제2 마스터 DB, 및 상기 제2 슬레이브 DB는 같은 서버에 구성되지 않도록 구성될 수 있다.The first master DB, the first slave DB, the second master DB, and the second slave DB may be configured not to be configured in the same server.

상기 방법은 N-1번째 레플리카 세트와 N번째 레플리카 세트를 상보적으로 구성하는 것을 포함할 수 있다.The method may include complementarily configuring an N-1 th replica set and an N th replica set.

상기 N-1번째 레플리카 세트와 상기 N번째 레플리카 세트를 상보적으로 구성하는 것은: 상기 N번째 레플리카 세트의 마스터 DB 또는 슬레이브 DB와 상기 N-1번째 레플리카 세트의 매니저는 같은 서버에 포함되도록 구성하거나, 또는 상기 N-1번째 레플리카 세트의 마스터 DB 또는 슬레이브 DB와 상기 N번째 레플리카 세트의 매니저는 같은 서버에 포함되도록 구성하는 것을 포함할 수 있다.Complementarily configuring the N-1 th replica set and the N th replica set includes: configuring the master DB or slave DB of the N th replica set and the manager of the N-1 th replica set to be included in the same server, or , or configuring the master DB or slave DB of the N-1 th replica set and the manager of the N th replica set to be included in the same server.

상기 방법은 레플리카 세트를 증설하는 것을 더 포함할 수 있다.The method may further include expanding the replica set.

상기 레플리카 세트를 증설하는 것은 2개의 레플리카 세트 당 4개의 서버가 할당되도록 2의 배수 단위의 개수로 레플리카 세트를 증설하는 것을 포함할 수 있다.Expanding the replica set may include expanding the replica set in a number of multiples of 2 so that four servers are allocated per two replica sets.

상기 제1 데이터를 상기 제1 마스터 DB에 저장하고; 상기 제1 슬레이브 DB로부터 상기 제1 데이터를 로딩하고; 상기 제2 데이터를 상기 제2 마스터 DB에 저장하고; 및 상기 제2 슬레이브 DB로부터 상기 제2 데이터를 로딩하는 것이 상기 DB 커넥터를 통해 수행될 수 있다.storing the first data in the first master DB; loading the first data from the first slave DB; storing the second data in the second master DB; and loading the second data from the second slave DB may be performed through the DB connector.

본 발명의 일 실시예에 따르면, 복수 개의 데이터베이스(database, DB)들을 포함하는 장치를 제공할 수 있다.According to an embodiment of the present invention, it is possible to provide an apparatus including a plurality of databases (databases, DBs).

상기 장치는 데이터를 저장하도록 구성된 메모리; 및 상기 메모리와 연결된 하나 이상의 프로세서를 포함할 수 있다.The apparatus includes a memory configured to store data; and one or more processors connected to the memory.

상기 하나 이상의 프로세서는: 획득한 데이터를 분산하여 제1 데이터 및 제2 데이터를 생성하고; 상기 제1 데이터를 상기 제1 레플리카 세트의 제1 마스터 DB에 저장하고; 상기 제1 마스터 DB는 상기 제1 데이터를 복제하여 상기 제1 레플리카 세트의 제1 슬레이브 DB에 전송하고; 상기 제1 슬레이브 DB는 상기 제1 데이터를 저장하고; 상기 제1 슬레이브 DB로부터 상기 제1 데이터를 로딩하고; 상기 제2 데이터를 상기 제2 레플리카 세트의 제2 마스터 DB에 저장하고; 상기 제2 마스터 DB는 상기 제2 데이터를 복제하여 상기 제2 레플리카 세트의 제2 슬레이브 DB에 전송하고; 상기 제2 슬레이브 DB는 상기 제2 데이터를 저장하고; 및 상기 제2 슬레이브 DB로부터 상기 복제된 제2 데이터를 로딩하도록 구성될 수 있다.The one or more processors are configured to: distribute the acquired data to generate first data and second data; storing the first data in a first master DB of the first replica set; the first master DB duplicates the first data and transmits it to a first slave DB of the first replica set; the first slave DB stores the first data; loading the first data from the first slave DB; store the second data in a second master DB of the second replica set; the second master DB duplicates the second data and transmits it to a second slave DB of the second replica set; the second slave DB stores the second data; and loading the duplicated second data from the second slave DB.

상기 제1 레플리카 세트는 상기 제1 마스터 DB, 상기 제1 슬레이브 DB, 및 제1 매니저를 포함할 수 있다.The first replica set may include the first master DB, the first slave DB, and a first manager.

상기 제2 레플리카 세트는 상기 제2 마스터 DB, 상기 제2 슬레이브 DB, 및 제2 매니저를 포함할 수 있다.The second replica set may include the second master DB, the second slave DB, and a second manager.

상기 하나 이상의 프로세서는: 제1 마스터 DB, 제1 슬레이브 DB, 및 제1 매니저를 포함하는 제1 레플리카 세트를 구성하고; 및 제2 마스터 DB, 제2 슬레이브 DB, 및 제2 매니저를 포함하는 제2 레플리카 세트를 구성하도록 구성될 수 있다.The one or more processors are configured to: configure a first replica set including a first master DB, a first slave DB, and a first manager; and a second replica set including a second master DB, a second slave DB, and a second manager.

상기 제1 매니저는 상기 제2 마스터 DB 또는 상기 제2 슬레이브 DB와 같은 서버에 형성되어 상기 제1 레플리카 세트와 상기 제2 레플리카 세트가 상보적으로 구성되고, 또는 상기 제2 매니저는 상기 제1 마스터 DB 또는 상기 제1 슬레이브 DB와 같은 서버에 형성되어 상기 제1 레플리카 세트와 상기 제2 레플리카 세트가 상보적으로 구성될 수 있다.The first manager is formed in the same server as the second master DB or the second slave DB so that the first replica set and the second replica set are complementary, or the second manager is the first master DB It may be formed in the same server as the DB or the first slave DB, so that the first replica set and the second replica set are complementary.

본 발명의 기타 구체적인 사항들은 상세한 설명 및 도면들에 포함되어 있다.Other specific details of the invention are included in the detailed description and drawings.

본 발명에 따르면 많은 양의 데이터를 DBMS의 최소 두 개 이상의 레플리카 세트에 나누어 저장함으로써 효율적인 서버 부하 분산의 효과가 있으며 DB의 Disk I/O(입출력, input/output)로 인한 지연을 최소화할 수 있다.According to the present invention, a large amount of data is divided and stored in at least two or more replica sets of the DBMS, thereby effectively balancing the server load and minimizing the delay due to the DB's disk I/O (input/output, input/output). .

본 발명의 효과들은 이상에서 언급된 효과로 제한되지 않으며, 언급되지 않은 또 다른 효과들은 아래의 기재로부터 통상의 기술자에게 명확하게 이해될 수 있을 것이다.Effects of the present invention are not limited to the effects mentioned above, and other effects not mentioned will be clearly understood by those skilled in the art from the following description.

본 발명에 대한 이해를 돕기 위해 상세한 설명의 일부로 포함된, 첨부 도면은 다양한 실시예들을 제공하고, 상세한 설명과 함께 다양한 실시예들의 기술적 특징을 설명한다.
도 1은 데이터베이스 시스템을 도시한 도면이다.
도 2는 데이터베이스의 마스터(Master)-슬레이브(Slave) 구조의 일 예시를 도시한 도면이다.
도 3은 본 발명에 따른 마스터 DB와 슬레이브 DB를 포함하는 두 개의 레블리카 세트를 도시한 도면이다.
도 4는 DBMS에서 레플리카 세트에 자동으로 데이터를 나누어 저장되도록 지원하는 경우의 일 실시예를 도시한 도면이다.
도 5는 본 발명에 따른 레플리카 세트를 이용하여 부하 분산 처리를 하는 경우에 대한 일 실시예를 도시한 도면이다.
도 6은 본 발명에 따른 DBMS 자체 기능이 아닌 레플리카 세트를 이용하여 부하 분산 처리를 하는 경우에 대한 다른 실시예를 도시한 도면이다.
도 7은 본 발명에 따른 레플리카 세트를 이용하여 부하 분산 처리하는 과정을 도시한 도면이다.
도 8은 본 발명이 구현될 수 있는 장치의 일 예를 도시한 도면이다.
BRIEF DESCRIPTION OF THE DRAWINGS The accompanying drawings, which are included as part of the detailed description to aid understanding of the present invention, provide various embodiments and, together with the detailed description, explain technical features of the various embodiments.
1 is a diagram illustrating a database system.
2 is a diagram illustrating an example of a master-slave structure of a database.
3 is a diagram illustrating two replica sets including a master DB and a slave DB according to the present invention.
4 is a diagram illustrating an embodiment of the DBMS supporting to automatically divide and store data in a replica set.
5 is a diagram illustrating an embodiment of a case in which load balancing processing is performed using a replica set according to the present invention.
6 is a diagram illustrating another embodiment of a case in which load balancing processing is performed using a replica set rather than a DBMS own function according to the present invention.
7 is a diagram illustrating a process of load balancing processing using a replica set according to the present invention.
8 is a diagram illustrating an example of an apparatus in which the present invention may be implemented.

본 발명의 이점 및 특징, 그리고 그것들을 달성하는 방법은 첨부되는 도면과 함께 상세하게 후술되어 있는 실시예들을 참조하면 명확해질 것이다. 그러나, 본 발명은 이하에서 개시되는 실시예들에 제한되는 것이 아니라 서로 다른 다양한 형태로 구현될 수 있으며, 단지 본 실시예들은 본 발명의 개시가 완전하도록 하고, 본 발명이 속하는 기술 분야의 통상의 기술자에게 본 발명의 범주를 완전하게 알려주기 위해 제공되는 것이며, 본 발명은 청구항의 범주에 의해 정의될 뿐이다. Advantages and features of the present invention and methods of achieving them will become apparent with reference to the embodiments described below in detail in conjunction with the accompanying drawings. However, the present invention is not limited to the embodiments disclosed below, but may be implemented in various different forms, and only the present embodiments allow the disclosure of the present invention to be complete, and those of ordinary skill in the art to which the present invention pertains. It is provided to fully understand the scope of the present invention to those skilled in the art, and the present invention is only defined by the scope of the claims.

본 명세서에서 사용된 용어는 실시예들을 설명하기 위한 것이며 본 발명을 제한하고자 하는 것은 아니다. 본 명세서에서, 단수형은 문구에서 특별히 언급하지 않는 한 복수형도 포함한다. 명세서에서 사용되는 "포함한다(comprises)" 및/또는 "포함하는(comprising)"은 언급된 구성요소 외에 하나 이상의 다른 구성요소의 존재 또는 추가를 배제하지 않는다. 명세서 전체에 걸쳐 동일한 도면 부호는 동일한 구성 요소를 지칭하며, "및/또는"은 언급된 구성요소들의 각각 및 하나 이상의 모든 조합을 포함한다. 비록 "제1", "제2" 등이 다양한 구성요소들을 서술하기 위해서 사용되나, 이들 구성요소들은 이들 용어에 의해 제한되지 않음은 물론이다. 이들 용어들은 단지 하나의 구성요소를 다른 구성요소와 구별하기 위하여 사용하는 것이다. 따라서, 이하에서 언급되는 제1 구성요소는 본 발명의 기술적 사상 내에서 제2 구성요소일 수도 있음은 물론이다.The terminology used herein is for the purpose of describing the embodiments and is not intended to limit the present invention. In this specification, the singular also includes the plural unless specifically stated otherwise in the phrase. As used herein, “comprises” and/or “comprising” does not exclude the presence or addition of one or more other components in addition to the stated components. Like reference numerals refer to like elements throughout, and "and/or" includes each and every combination of one or more of the recited elements. Although "first", "second", etc. are used to describe various elements, these elements are not limited by these terms, of course. These terms are only used to distinguish one component from another. Accordingly, it goes without saying that the first component mentioned below may be the second component within the spirit of the present invention.

다른 정의가 없다면, 본 명세서에서 사용되는 모든 용어(기술 및 과학적 용어를 포함)는 본 발명이 속하는 기술분야의 통상의 기술자에게 공통적으로 이해될 수 있는 의미로 사용될 수 있을 것이다. 또한, 일반적으로 사용되는 사전에 정의되어 있는 용어들은 명백하게 특별히 정의되어 있지 않는 한 이상적으로 또는 과도하게 해석되지 않는다.Unless otherwise defined, all terms (including technical and scientific terms) used herein will have the meaning commonly understood by those of ordinary skill in the art to which this invention belongs. In addition, terms defined in a commonly used dictionary are not to be interpreted ideally or excessively unless specifically defined explicitly.

공간적으로 상대적인 용어인 "아래(below)", "아래(beneath)", "하부(lower)", "위(above)", "상부(upper)" 등은 도면에 도시되어 있는 바와 같이 하나의 구성요소와 다른 구성요소들과의 상관관계를 용이하게 기술하기 위해 사용될 수 있다. 공간적으로 상대적인 용어는 도면에 도시되어 있는 방향에 더하여 사용시 또는 동작시 구성요소들의 서로 다른 방향을 포함하는 용어로 이해되어야 한다. 예를 들어, 도면에 도시되어 있는 구성요소를 뒤집을 경우, 다른 구성요소의 "아래(below)"또는 "아래(beneath)"로 기술된 구성요소는 다른 구성요소의 "위(above)"에 놓여질 수 있다. 따라서, 예시적인 용어인 "아래"는 아래와 위의 방향을 모두 포함할 수 있다. 구성요소는 다른 방향으로도 배향될 수 있으며, 이에 따라 공간적으로 상대적인 용어들은 배향에 따라 해석될 수 있다.Spatially relative terms "below", "beneath", "lower", "above", "upper", etc. It can be used to easily describe the correlation between a component and other components. Spatially relative terms should be understood as terms including different directions of components during use or operation in addition to the directions shown in the drawings. For example, when a component shown in the drawing is turned over, a component described as “beneath” or “beneath” of another component may be placed “above” of the other component. can Accordingly, the exemplary term “below” may include both directions below and above. Components may also be oriented in other orientations, and thus spatially relative terms may be interpreted according to orientation.

이하, 본 명세서에 따른 바람직한 실시 형태를 첨부된 도면을 참조하여 상세하게 설명한다. 첨부된 도면과 함께 이하에 개시될 상세한 설명은 다양한 실시예들의 예시적인 실시형태를 설명하고자 하는 것이며, 유일한 실시형태를 나타내고자 하는 것이 아니다. Hereinafter, preferred embodiments according to the present specification will be described in detail with reference to the accompanying drawings. DETAILED DESCRIPTION The detailed description set forth below in conjunction with the appended drawings is intended to describe exemplary embodiments of various embodiments, and is not intended to represent the only embodiments.

본 발명에서 사용되는 용어의 정의는 다음과 같다.Definitions of terms used in the present invention are as follows.

DBS(database system): 데이터베이스 시스템이란 데이터베이스에 데이터를 저장하고, 저장된 데이터를 관리하여 조직에 필요한 정보를 생성해주는 시스템이다. 본 발명의 데이터베이스 시스템은 데이터베이스와 데이터베이스 관리 시스템을 이용해 조직에 필요한 정보를 제공해주는 역할을 한다.DBS (database system): A database system is a system that stores data in a database, manages the stored data, and creates necessary information for the organization. The database system of the present invention serves to provide information necessary for an organization using a database and a database management system.

DB(database): 일반적으로 데이터베이스는 특정 조직의 여러 사용자가 공유하여 사용할 수 있도록 통합해서 저장한 운영 데이터의 집합이라고 정의된다. 데이터베이스는 유용하게 활용할 수 있는 정보를 정확히 추출할 수 있도록 복잡한 데이터를 대신 관리해주는 역할을 한다.DB (database): Generally, a database is defined as a set of operational data that is integrated and stored so that it can be shared and used by multiple users in a specific organization. The database plays a role of managing complex data instead of extracting useful information accurately.

DBMS(database management system): 데이터베이스 관리 시스템은 데이터베이스를 관리하며 응용 프로그램들이 데이터베이스를 공유하며 사용할 수 있는 환경을 제공하는 소프트웨어이다. DBMS은 데이터베이스를 구축하는 틀을 제공하고 효율적으로 데이터를 검색하고 저장하는 기능을 제공한다. DBMS는 프로그램 별로 흩어져 있는 자료들을 통합하고 통합된 자료들을 각 프로그램이 공유하여 정보를 체계적으로 활용할 수 있도록 한다. 일반적 형태의 DBMS는 관계형 데이터베이스 관리시스템(RDBMS)이고, RDBMS의 표준화된 사용자 및 프로그램 인터페이스를 SQL(structured query language)이라고 한다.DBMS (database management system): A database management system is software that manages a database and provides an environment where applications can share and use the database. DBMS provides a framework for building a database and provides functions for efficiently retrieving and storing data. DBMS integrates the scattered data for each program, and each program shares the integrated data so that information can be systematically utilized. A general type of DBMS is a relational database management system (RDBMS), and the standardized user and program interface of the RDBMS is called SQL (structured query language).

SQL(structured query language): SQL은 데이터베이스를 구축하고 활용하기 위해 사용하는 언어이다. SQL은 크게 데이터 정의언어(DDL: Data Definition Language)와 데이터 조작 언어(DML: Data Manipulation Language)로 나뉜다.SQL (structured query language): SQL is a language used to build and utilize databases. SQL is largely divided into Data Definition Language (DDL) and Data Manipulation Language (DML).

NoSQL(non SQL, not only SQL): 빅데이터 처리를 위한 비관계형(non-relational) DBMS로, 대규모의 데이터를 유연하게 처리할 수 있다. 노에스큐엘(NoSQL)은 테이블-컬럼과 같은 스키마 없이, 분산 환경에서 단순 검색 및 추가 작업을 위한 키 값을 최적화하고, 지연(latency)과 처리율(throughput)이 우수하다. NoSQL 데이터베이스는 단순 검색 및 추가 작업을 위한 매우 최적화된 키 값 저장 공간으로, 레이턴시와 스루풋과 관련하여 상당한 성능 이익을 내는 것이 목적이다. NoSQL 데이터베이스는 빅데이터와 실시간 웹 애플리케이션의 상업적 이용에 널리 쓰인다. 또, NoSQL 시스템은 SQL 계열 쿼리 언어를 사용할 수 있다는 사실을 강조한다는 면에서 "Not only SQL"로 불리기도 한다. NoSQL (non SQL, not only SQL): As a non-relational DBMS for big data processing, it can flexibly process large-scale data. NoSQL optimizes key values for simple search and addition operations in a distributed environment without a schema such as table-column, and has excellent latency and throughput. A NoSQL database is a highly optimized key-value storage for simple search and append operations, with the goal of yielding significant performance gains in terms of latency and throughput. NoSQL databases are widely used for commercial use of big data and real-time web applications. Also, the NoSQL system is sometimes called "Not only SQL" because it emphasizes the fact that a SQL-like query language can be used.

DB 클러스터링(clustering): DB 클러스터링이란 여러 개의 DB를 묶어서 수평적인 구조로 구축하여 하나처럼 사용하는 방식이다. DB clustering: DB clustering is a method of grouping multiple DBs to build a horizontal structure and use them as one.

DB 리플리케이션(replication): DB 리플리케이션이란 여러 개의 DB를 권한에 따라 수직적인 구조(Master-Slave)로 구축함으로써 데이터를 복제하는 방식이다. 앞서 살펴본 클러스터링 방식의 경우 서버를 여러 대 사용하지만 결국 물리적인 storage는 하나이기 때문에 문제가 발생한다. 리플리케이션은 이런 문제를 해결하기 위해 서버와 함께 storage도 복제한다. 복제된 DB는 master와 slave로 역할이 나뉠 수 있다.DB replication: DB replication is a method of replicating data by building multiple DBs in a vertical structure (Master-Slave) according to authority. In the case of the clustering method discussed above, several servers are used, but in the end, a problem occurs because there is only one physical storage. Replication also replicates storage along with the server to solve this problem. The replicated DB can be divided into master and slave roles.

도 1은 데이터베이스 시스템을 도시한 도면이다.1 is a diagram illustrating a database system.

데이터베이스 시스템은 도 1과 같이 데이터베이스(DB: database), 데이터베이스 관리 시스템 (DBMS: database management system), 데이터베이스 언어(database language) 그리고 사용자로 구성된다. (또는 데이터베이스와 데이터베이스 관리 시스템 외에도 사용자, 사용자가 데이터베이스에 접근하는 데 사용하는 데이터 언어, 데이터베이스와 데이터베이스 관리 시스템을 설치하고 데이터 처리 연산을 담당하는 컴퓨터로 구성된다.)The database system includes a database (DB), a database management system (DBMS), a database language, and a user, as shown in FIG. 1 . (Or, in addition to the database and the database management system, it consists of the user, the data language used by the user to access the database, and the computer that installs the database and the database management system and is responsible for data processing operations.)

데이터베이스는 한 조직의 여러 응용 시스템이 공유하기 위해(shared) 최소한의 중복으로 통합되고(integrated), 저장된(stored) 운영 데이터의 집합을 의미한다.A database means a set of integrated and stored operational data with minimal redundancy to be shared by multiple application systems of an organization.

데이터베이스 언어는 데이터베이스를 구축, 조작, 검색하는데 사용되는 프로그래밍 언어이다.A database language is a programming language used to build, manipulate, and retrieve databases.

사용자는 크게 1) 데이터베이스 시스템을 관리하고 운영하는 데이터베이스 관리자(DBA: database administrator), 2) 개발 툴을 사용하여 데이터베이스 응용프로그램을 개발하는 데이터베이스 응용 프로그래머(DB application programmer), 및 3) 데이터베이스를 사용하는 사용자(일반 사용자 또는 최종 사용자(end user))로 분류된다.Users are largely 1) a database administrator (DBA) who manages and operates a database system, 2) a database application programmer who develops a database application program using a development tool, and 3) a user who uses the database. classified as users (normal users or end users).

데이터베이스 관리 시스템(DBMS)은 응용 프로그램과 데이터베이스의 중재자 역할을 하며, 따라서 데이터베이스는 응용 프로그램들이 직접 조작하지 않고 DBMS를 통해 조작, 관리된다.The database management system (DBMS) acts as an intermediary between the application program and the database, and thus the database is manipulated and managed through the DBMS rather than being directly manipulated by the application programs.

도 2는 데이터베이스의 마스터(Master)-슬레이브(Slave) 구조의 일 예시를 도시한 도면이다.2 is a diagram illustrating an example of a master-slave structure of a database.

도 2에 따르면, DB의 고가용성(high availability)를 위한 레플리카 세트를 제공하기 위해 두 개 이상의 DB를 마스터 및 슬레이브 로 나누어 동일한 데이터를 저장하는 방식을 개시하고 있다. DB의 고가용성란 시스템의 장애 피해 등으로부터 가동률을 높이기 위하여 데이터베이스와 관련된 장비를 다중화 시키는 것이다.2, in order to provide a replica set for high availability of the DB, a method of storing the same data by dividing two or more DBs into a master and a slave is disclosed. High availability of DB means multiplexing the equipment related to the database in order to increase the operation rate from system failure.

도 2를 참조하면, DB의 고가용성 기능은 각기 다른 서버에 두 개 이상의 DB를 구성하여 매니저(manager), 마스터 DB, 슬레이브 DB 로 설정되는 레플리카 세트를 통해 구현된다. Referring to FIG. 2 , the DB high availability function is implemented through a replica set configured as a manager, a master DB, and a slave DB by configuring two or more DBs on different servers.

매니저는 마스터 DB 와 슬레이브 DB의 상태를 주기적으로 체크하여 마스터 DB를 선출하는 역할을 한다.The manager plays a role in selecting the master DB by periodically checking the status of the master DB and the slave DB.

일반적으로 마스터 DB는 삽입(insert)/삭제(delete)/업데이트(update)와 같이 데이터가 변경되는 경우에 사용되고, 슬레이브 DB는 데이터의 조회(선택, select) 처리에 사용된다. 따라서 마스터 DB 와 슬레이브 DB에서 디스크 입출력(Disk input/output)이 많이 발생한다.In general, the master DB is used when data is changed such as insert/delete/update, and the slave DB is used for data inquiry (selection) processing. Therefore, a lot of disk input/output occurs in the master DB and the slave DB.

예시적인 실시예에 따르면, 마스터 DB 또는 슬레이브 DB의 개수는 하나 또는 두개 이상이 될 수 있다.According to an exemplary embodiment, the number of master DBs or slave DBs may be one or two or more.

도 2는 DBMS 자체 기능을 이용하여 부하 분산을 시키는 경우를 도시한다.2 shows a case of balancing the load using the DBMS's own function.

마스터 DB는 삽입/삭제/업데이트 쿼리 요청을 받으면 변경을 기록하기 위한 Binarylog를 생성하고 변경 기록 또는 변경된 데이터를 슬레이브 DB로 전달할 수 있다. 마스터 DB의 데이터는 복제(replication)되어 슬레이브 DB에 저장되며, 슬레이브 DB는 데이터의 읽기(read) 또는 선택(select) 요청을 담당한다. When the master DB receives an insert/delete/update query request, it creates a binarylog to record changes and can deliver change records or changed data to the slave DB. The data of the master DB is replicated and stored in the slave DB, and the slave DB is in charge of data read or select requests.

이와 같이, DBMS는 쿼리의 대부분을 차지하는 select 요청을 슬레이브 DB가 분담함으로써 DB 부하를 분산시키고 read 성능을 향상시킬 수 있다. In this way, the DBMS can distribute the DB load and improve read performance by sharing the select request, which accounts for most of the query, by the slave DB.

DBMS에 따라 자동으로 전술된 작업이 수행될 수도 있다. 이는 마스터 DB에 데이터가 삽입(insert)되면 자동으로 실시간으로 슬레이브 DB에 복제하여 최소 두 개 이상의 데이터 세트가 유지될 수 있도록 하기 위함이다.Depending on the DBMS, the above-described operation may be performed automatically. This is to ensure that at least two data sets can be maintained by automatically replicating data to the slave DB in real time when data is inserted into the master DB.

도 3은 본 발명에 따른 마스터 DB와 슬레이브 DB를 포함하는 두 개의 레블리카 세트를 도시한 도면이다.3 is a diagram illustrating two replica sets including a master DB and a slave DB according to the present invention.

도 3을 참조하면 DBMS가 2개의 레플리카 세트를 포함하고, 각각의 레플리카 세트는 마스터 DB, 슬레이브 DB, 및 매니저(manager)를 포함할 수 있다. Referring to FIG. 3 , the DBMS includes two replica sets, and each replica set may include a master DB, a slave DB, and a manager.

DBMS는 각각의 레플리카 세트에 자동으로 데이터를 나누어 저장하도록 지원한다. DBMS supports to automatically divide and store data in each replica set.

각각의 레플리카 세트에 데이터를 삽입(insert) 또는 선택(select)하는 것은 DB 커넥터(DB connector)를 통해 처리되도록 도시되어 있으나, DB 커넥터 없이도 프로세서(또는 프로세싱 시스템)가 직접 레플리카 세트의 슬레이브 DB로부터 데이터 선택(SELECT)을 하거나 데이터를 레플리카 세트의 마스터 DB에 삽입(INSERT)하는 것도 가능하다.Inserting or selecting data into each replica set is shown to be processed through a DB connector, but without a DB connector, the processor (or processing system) directly sends data from the slave DB of the replica set. It is also possible to select (SELECT) or insert (INSERT) data into the master DB of the replica set.

도 4는 DBMS에서 레플리카 세트에 자동으로 데이터가 나누어 저장되는 과정의 일 실시예를 도시한 도면이다.4 is a diagram illustrating an embodiment of a process in which data is automatically divided and stored in a replica set in a DBMS.

도 4를 참조하면, 마스터 DB, 슬레이브 DB, 및 매니저가 6개의 서버 각각에 하나씩 할당되어있으며 제1 레플리카 세트(DB Replica Set #1) 및 제2 레플리카 세트(DB Replica Set #2)는 각각 마스터 DB, 슬레이브 DB, 매니저를 포함할 수있다.Referring to FIG. 4 , one master DB, one slave DB, and one manager are assigned to each of six servers, and the first replica set (DB Replica Set #1) and the second replica set (DB Replica Set #2) are respectively the master It can include DB, slave DB, and manager.

도 4의 DB 커넥터/프록시는 컴퓨터 네트워크에서 다른 서버로의 자원 요청을 중계하는 서버로, 분산 시스템의 구조를 단순화하고 캡슐화하여 서비스의 복잡도를 줄이는 역할을 한다.The DB connector/proxy of FIG. 4 is a server that relays resource requests to other servers in a computer network, and serves to reduce the complexity of services by simplifying and encapsulating the structure of a distributed system.

프로세싱 시스템은 데이터를 가공하여 DB 커넥터/프록시에 저장하고, 및 DB 커넥터/프록시에 저장된 데이터를 읽어올 수 있다.The processing system may process the data, store it in the DB connector/proxy, and read the data stored in the DB connector/proxy.

구체적으로, 프로세싱 시스템은 데이터를 1차적으로 가공하고, 1차 가공된 데이터(이하, 제1 데이터)를 DB 커넥터/프록시)를 통하여 제1 레플리카 세트의 마스터 DB에 저장한다(S401). Specifically, the processing system primarily processes data, and stores the primary processed data (hereinafter, first data) in the master DB of the first replica set through a DB connector/proxy (S401).

마스터 DB는 제1 데이터를 저장한다. 또한, 마스터 DB는 제1 데이터를 복제하여 제1 레플리카 세트의 슬레이브 DB에 전송한다. 슬레이브 DB는 마스터 DB로부터 수신한 제1 데이터를 저장한다. The master DB stores the first data. In addition, the master DB replicates the first data and transmits it to the slave DB of the first replica set. The slave DB stores the first data received from the master DB.

프로세싱 시스템은 DB 커넥터/프록시를 통해 슬레이브 DB에 저장된 제1 데이터를 읽어온다(read, select) (S403).The processing system reads (read, select) the first data stored in the slave DB through the DB connector/proxy (S403).

프로세싱 시스템은 데이터를 2차 가공하고, 2차 가공된 데이터(이하, 제2 데이터)를 DB 커넥터/프록시를 통해 제2 레플리카 세트의 마스터 DB에 저장한다(S405).The processing system performs secondary processing of data, and stores the secondary processed data (hereinafter, second data) in the master DB of the second replica set through the DB connector/proxy (S405).

마스터 DB는 제2 데이터를 복제하여 제2 레플리카 세트의 슬레이브 DB에 전달하고, 슬레이브 DB는 제2 데이터를 저장한다.The master DB replicates the second data and delivers it to the slave DB of the second replica set, and the slave DB stores the second data.

마스터 DB는 제2 데이터를 저장한다. 또한, 마스터 DB는 제2 데이터를 복제하여 제2 레플리카 세트의 슬레이브 DB에 전송한다. 슬레이브 DB는 마스터 DB로부터 수신한 제2 데이터를 저장한다. The master DB stores the second data. In addition, the master DB replicates the second data and transmits it to the slave DB of the second replica set. The slave DB stores the second data received from the master DB.

프로세싱 시스템은 DB 커넥터/프록시를 통해 슬레이브 DB에 저장된 제2 데이터를 읽어온다(read, select)(S407).The processing system reads the second data stored in the slave DB through the DB connector/proxy (read, select) (S407).

상기 과정에서 매니저는 마스터 DB 및 슬레이브 DB의 상태를 주기적으로 체크하고, 마스터 DB가 될 대상을 지속적으로 업데이트하는 역할을 한다.In the above process, the manager periodically checks the status of the master DB and the slave DB, and plays a role in continuously updating the target to be the master DB.

상기 과정에서 매니저에 오류가 발생, 매니저에 연결할 수 없는 경우 등 매니저를 사용할 수 없는 경우가 있을 수 있다. 이와 같이 매니저를 사용할 수 없는 경우, DB 커넥터가 매니저의 역할을 대신 수행할 수 있다.In the above process, there may be cases in which the manager cannot be used, such as when an error occurs in the manager or when the manager cannot be connected. In this way, when the manager cannot be used, the DB connector can perform the role of the manager instead.

상기와 같은 과정을 통해, 2 개 이상의 DB 레플리카 세트를 사용하여 DB의 부하 분산을 통해 성능을 향상시킬 수 있다.Through the above process, performance can be improved by balancing the DB load by using two or more DB replica sets.

이하 두 개 이상의 DB 레플리카 세트를 사용하는 경우, DB의 부하 분산을 통해 성능을 높일 수 있는 또 다른 방안을 개시한다.Hereinafter, when two or more DB replica sets are used, another method for improving performance through DB load balancing will be disclosed.

도 5는 본 발명에 따른 레플리카 세트를 이용하여 부하 분산 처리를 하는 경우에 대한 일 실시예를 도시한 도면이다.5 is a diagram illustrating an embodiment of a case in which load balancing processing is performed using a replica set according to the present invention.

도 5는 프로세싱 시스템에서 데이터를 제1 데이터와 제2 데이터로 분산하는 경우의 예시를 도시하고 있다.5 illustrates an example of distributing data into first data and second data in a processing system.

제1 데이터는 제1 레플리카 세트(DB Replica Set #1)의 마스터 DB(이하 제1 마스터 DB)에 입력된다(insert, write)(S501). The first data is input (insert, write) into the master DB (hereinafter, the first master DB) of the first replica set (DB Replica Set #1) (S501).

제1 마스터 DB는 제1 데이터를 저장하고, 제1 데이터를 복제하여 제1 레플리카 세트의 슬레이브 DB(이하 제1 슬레이브 DB)에 전달한다. 제1 마스터 DB는 Binary Log 파일에 제1 데이터를 저장할 수 있다.The first master DB stores the first data, duplicates the first data, and transfers the first data to the slave DB (hereinafter, referred to as the first slave DB) of the first replica set. The first master DB may store the first data in a binary log file.

제1 슬레이브 DB는 제1 마스터 DB로부터 수신한 제1 데이터를 저장하고, 프로세싱 시스템은 제1 데이터를 읽을 때 제1 슬레이브 DB로부터 읽어온다(read, select)(S503). 제1 슬레이브 DB는 Relay Log 파일에 제1 데이터를 저장할 수 있다.The first slave DB stores the first data received from the first master DB, and when the processing system reads the first data, it reads from the first slave DB (read, select) (S503). The first slave DB may store the first data in a relay log file.

제2 데이터는 제2 레플리카 세트(DB Replica Set #2)의 마스터 DB(이하 제2 마스터 DB)에 입력된다(S505).The second data is input to the master DB (hereinafter referred to as the second master DB) of the second replica set (DB Replica Set #2) (S505).

제2 마스터 DB는 제2 데이터를 저장하고, 제2 데이터를 복제하여 제2 레플리카 세트의 슬레이브 DB(이하 제2 슬레이브 DB)에 전달한다.The second master DB stores the second data, replicates the second data, and transfers the second data to the slave DB (hereinafter, referred to as the second slave DB) of the second replica set.

제2 슬레이브 DB는 제2 마스터 DB로부터 수신한 제2 데이터를 저장하고, 프로세싱 시스템은 제2 데이터를 읽을 때 제2 슬레이브 DB로부터 읽어온다(read, select)(S507).The second slave DB stores the second data received from the second master DB, and the processing system reads the second data from the second slave DB (read, select) (S507).

상기 과정에서 DBMS에 오류가 생겨 제1 레플리카 세트를 사용할 수 없거나(깨지거나) 또는 제1 매니저를 사용할 수 없는 경우, 제1 마스터 DB와 제1 슬레이브 DB는 제2 매니저에 연결되고, 제2 레플리카 세트 내에서 처리(또는 운영)될 수 있다. 또한, 상기 과정에서 제2 레플리카 세트를 사용할 수 없거나 또는 제2 매니저를 사용할 수 없는 경우, 제2 마스터 DB와 제2 슬레이브 DB는 제1 매니저에 연결되고, 제2 레플리카 세트 내에서 처리될 수 있다.In the above process, if an error occurs in the DBMS and the first replica set cannot be used (broken) or the first manager cannot be used, the first master DB and the first slave DB are connected to the second manager, and the second replica It may be processed (or operated) within a set. In addition, in the above process, when the second replica set cannot be used or the second manager cannot be used, the second master DB and the second slave DB are connected to the first manager and processed in the second replica set. .

이와 같은 연결 및 처리 과정은 임시적이고, 다시 레플리카 세트 또는 매니저를 사용할 수 있는 경우, 원래의 연결 형태로 복원될 수 있다.Such a connection and processing process is temporary, and when the replica set or manager can be used again, the original connection form can be restored.

도 5에는 DB 커넥터/프록시가 생략되어 있지만, DB 커넥터/프록시도 프로세싱 시스템과 레플리카 세트 사이에 구성될 수 있다. Although the DB connector/proxy is omitted in FIG. 5, a DB connector/proxy may also be configured between the processing system and the replica set.

상기 과정에서 매니저를 사용할 수 없는 경우, DB 커넥터는 마스터 DB 및 슬레이브 DB 사이를 연결시켜주는 역할을 수행할 수 있으며, 프로세싱 시스템과 마스터 DB 및 슬레이브 DB를 연결시켜주는 역할을 수행할 수도 있다.When the manager cannot be used in the above process, the DB connector may play a role of connecting the master DB and the slave DB, and may play a role of connecting the processing system and the master DB and the slave DB.

이와 같은 연결은 임시적이고, 매니저를 다시 사용할 수 있는 경우 다시 매니저와 연결되어 원래의 형태로 복원된다.Such a connection is temporary, and when the manager can be used again, it is connected to the manager again and restored to its original form.

데이터를 삽입/삭제/업데이트하도록 구성된 마스터 DB, 및 데이터를 조회/선택하도록 구성된 슬레이브 DB에는 데이터 처리량에 관한 컴퓨팅 파워가 많이 요구된다. 그에 비해, 매니저는 마스터 DB 및 슬레이브 DB의 상태를 주기적으로 체크하고, 마스터 DB가 될 대상을 지속적으로 업데이트할 뿐인 점에서 컴퓨팅 파워의 요구는 비교적 적다. 따라서, 데이터 처리에 대한 부하를 고려하기 위해서는 마스터 DB 및 슬레이브 DB의 부하가 매니저의 부하에 비해 우선한다. A master DB configured to insert/delete/update data and a slave DB configured to inquire/select data require a lot of computing power in terms of data throughput. In contrast, the manager periodically checks the status of the master DB and the slave DB, and only continuously updates the target to be the master DB, so the demand for computing power is relatively small. Therefore, in order to consider the load for data processing, the load of the master DB and the slave DB has priority over the load of the manager.

도 5를 참조하면, 복수의 서버에 마스터 DB, 슬레이브 DB, 및 매니저를 적절히 분배시키되, 하나의 서버에 마스터 DB 및 슬레이브 DB 모두를 배치하지 않음으로써 하나의 서버에 부하의 집중이 방지될 수 있고, 컴퓨팅 능력 및 부하의 분산이 달성될 수 있다. 따라서, 레플리카 세트를 이용하여 DBMS를 이용하지 않고 서버간 부하 분산이 가능한 효과가 있다.5 , the master DB, the slave DB, and the manager are appropriately distributed to a plurality of servers, but concentration of the load on one server can be prevented by not arranging both the master DB and the slave DB on one server. , a distribution of computing power and load can be achieved. Therefore, there is an effect that load balancing between servers is possible without using a DBMS by using a replica set.

도 6은 본 발명에 따른 DBMS 자체 기능이 아닌 레플리카 세트를 이용하여 부하 분산 처리를 하는 경우에 대한 다른 실시예를 도시한 도면이다.6 is a diagram illustrating another embodiment of a case in which load balancing processing is performed using a replica set rather than a DBMS own function according to the present invention.

도 6은 레플리카 세트의 구성에 대한 개념도를 도시한 것이다.6 is a conceptual diagram illustrating the configuration of a replica set.

DB 레플리카 세트를 구성하는 경우, 각 서버당 마스터 DB와 슬레이브 DB는 각각 하나씩 할당 가능하나, 매니저는 마스터 DB와 슬레이브 DB와 같은 서버에 할당(형성)되는 것이 가능하다. When configuring a DB replica set, one master DB and one slave DB can be assigned to each server, but a manager can be assigned (formed) to the same server as the master DB and slave DB.

따라서, 레플리카 세트 하나를 더 구성하는 경우 서버는 2개가 더 필요하다.Therefore, when configuring one more replica set, two more servers are required.

또는, 마스터 DB, 슬레이브 DB, 및 매니저 각각 상보적으로 구성되도록 하려면 2개의 레플리카 세트가 필요하고 이 경우 2개의 레플리카 세트 당 서버는 4개가 더 필요하다.Alternatively, two replica sets are required to complement each of the master DB, the slave DB, and the manager, and in this case, 4 more servers are required for each of the two replica sets.

데이터를 처리하는 과정은 상기 도 5와 실질적으로 동일하므로 생략한다.Since the data processing process is substantially the same as that of FIG. 5, it is omitted.

도 7은 본 발명에 따른 레플리카 세트를 이용하여 부하 분산 처리하는 과정을 도시한 도면이다. 7 is a diagram illustrating a process of load balancing processing using a replica set according to the present invention.

프로세싱 시스템(또는 프로세서)은 획득한 데이터를 제1 데이터 및 제2 데이터로 분산 및 생성한다. The processing system (or processor) distributes and generates the acquired data as first data and second data.

생성된 제1 데이터는 제1 레플리카 세트의 마스터 DB에 입력된다(write)(S701). The generated first data is input (write) to the master DB of the first replica set (S701).

제1 레플리카 세트의 마스터 DB는 제1 데이터를 저장 및 복제한다(S703). 제1 데이터는 마스터 DB의 Binary Log 파일에 저장되고, 복제된 제1 데이터는 슬레이브 DB로 전송된다.The master DB of the first replica set stores and replicates the first data (S703). The first data is stored in the binary log file of the master DB, and the duplicated first data is transmitted to the slave DB.

제1 레플리카 세트의 슬레이브 DB는 복제된 제1 데이터를 저장한다(S705). 제1 데이터는 슬레이브 DB의 Relay Log 파일에 저장된다.The slave DB of the first replica set stores the duplicated first data (S705). The first data is stored in the relay log file of the slave DB.

데이터를 읽어오는 경우, 제1 레플리카 세트의 슬레이브 DB로부터 제1 데이터를 로딩한다(read)(S707). 즉 프로세싱 시스템이 슬레이브 DB에 저장된 데이터 중 제1 데이터를 선택하여 읽어오는 것이다.When data is read, first data is loaded from the slave DB of the first replica set (read) (S707). That is, the processing system selects and reads the first data among the data stored in the slave DB.

제2 데이터는 제2 레플리카 세트의 마스터 DB에 입력된다(S709).The second data is input to the master DB of the second replica set (S709).

제2 레플리카 세트의 마스터 DB는 제2 데이터를 저장 및 복제한다(S711). 복제된 제1 데이터는 슬레이브 DB로 전송된다.The master DB of the second replica set stores and replicates the second data (S711). The replicated first data is transmitted to the slave DB.

제2 레플리카 세트의 슬레이브 DB는 복제된 제2 데이터를 저장한다(S713).The slave DB of the second replica set stores the duplicated second data (S713).

데이터를 읽어오는 경우, 제2 레플리카 세트의 슬레이브 DB로부터 제2 데이터를 로딩한다(S715). When data is read, second data is loaded from the slave DB of the second replica set (S715).

마스터 DB 및 슬레이브 DB는 같은 서버에 형성(구성)될 수 없다. 데이터를 삽입/삭제/업데이트하도록 구성된 마스터 DB, 및 데이터를 조회/선택하도록 구성된 슬레이브 DB에는 데이터 처리량에 관한 컴퓨팅 파워가 많이 요구되기 때문이다. 따라서 한 레플리카 세트에 포함된 마스터 DB 및 슬레이브 DB는 각각 다른 서버에 형성될 수 있으며, 또한 한 레플리카 세트에 포함된 마스터 DB 또는 슬레이브 DB와 같은 서버에 형성될 수 있는 것은 다른 레플리카 세트의 매니저뿐이다.Master DB and slave DB cannot be formed (configured) on the same server. This is because the master DB configured to insert/delete/update data and the slave DB configured to inquire/select data require a lot of computing power in terms of data throughput. Therefore, the master DB and slave DB included in one replica set can be formed on different servers, and only the manager of the other replica set can be formed on the same server as the master DB or slave DB included in one replica set.

예를들어, 제1 레플리카 세트의 마스터 DB와 슬레이브 DB는 각각 다른 서버에 형성된다. 제2 레플리카 세트의 마스터 DB와 슬레이브 DB는 상기 제1 레플리카 세트의 마스터 DB 및 슬레이브 DB가 형성된 서버에 형성되지 않으며, 다른 서버에 형성된다. 매니저는 마스터 DB 또는 슬레이브 DB와 같은 서버에 형성될 수 있으므로, 제2 레플리카 세트의 매니저는 제1 레플리카 세트의 마스터 DB 또는 슬레이브 DB와 같은 서버에 형성될 수 있다.For example, the master DB and the slave DB of the first replica set are formed on different servers. The master DB and the slave DB of the second replica set are not formed in the server where the master DB and the slave DB of the first replica set are formed, but are formed in another server. Since the manager may be formed in the same server as the master DB or the slave DB, the manager of the second replica set may be formed in the same server as the master DB or the slave DB of the first replica set.

레플리카 세트의 형성에 필요한 서버의 개수를 최소화하기 위해, 마스터 DB, 슬레이브 DB, 매니저가 포함된 제1 레플리카 세트가 형성된 후, 제2 레플리카 세트는 제1 레플리카 세트에 상보적인 형태로 형성될 수 있다.In order to minimize the number of servers required to form the replica set, after the first replica set including the master DB, the slave DB, and the manager is formed, the second replica set may be formed in a form complementary to the first replica set. .

예를들어, 제1 레플리카 세트의 마스터 DB 또는 슬레이브 DB가 형성된 서버에 제2 레플리카 세트의 매니저가 포함되도록 형성될 수 있다. 또한 제2 레플리카 세트의 마스터 DB 또는 슬레이브 DB가 형성된 서버에는 제3 레플리카 세트의 매니저가 포함되도록 형성될 수 있다. N번째 레플리카 세트의 마스터 DB 또는 슬레이브 DB가 형성된 서버에는 N-1번째 레플리카 세트의 매니저가 포함되도록 형성될 수 있다. 본 발명에서는 같은 레플리카 세트는 마스터 DB, 슬레이브 DB, 매니저를 포함하는 구성을 실시예로 들어 설명하고 있다. 이는 일 실시예이므로, 같은 레플리카 세트에 다수의 마스터 DB, 다수의 슬레이브 DB, 또는 다수의 매니저를 포함할 수도 있다.For example, the server in which the master DB or the slave DB of the first replica set is formed may include a manager of the second replica set. In addition, the server in which the master DB or the slave DB of the second replica set is formed may include a manager of the third replica set. The server in which the master DB or the slave DB of the N-th replica set is formed may include the manager of the N-1th replica set. In the present invention, a configuration including a master DB, a slave DB, and a manager is described as an embodiment of the same replica set. Since this is an embodiment, a plurality of master DBs, a plurality of slave DBs, or a plurality of managers may be included in the same replica set.

본 발명에서는 "1) 데이터를 1차 가공 후 저장 및 해당 1차 가공된 데이터를 다시 읽음, 2) 데이터를 2차 가공 후 저장 및 해당 2차 가공된 데이터를 읽어 들임" 과정만 설명하였으나, 빅 데이터 또는 대용량의 데이터 처리 시, 실제로 더 많은 수의 DB 서버가 필요할 수 있다.In the present invention, only the process of "1) storing data after primary processing and reading the primary processed data again, 2) storing data after secondary processing and reading the secondary processed data" has been described, but When processing data or large amounts of data, a larger number of DB servers may be required.

데이터의 양에 따라서 제1 레플리카 세트와 제2 레플리카 세트를 지속적으로 번갈아 가며 이용하여 데이터를 반복 처리하는 작업을 할 수 있다. According to the amount of data, it is possible to repeatedly process data by continuously alternately using the first replica set and the second replica set.

저장이 필요한 데이터의 양이 계속 증가되는 시스템의 경우엔, 지속적으로 레플리카 세트를 추가함으로써 DB를 늘릴 수도 있다.In the case of a system where the amount of data that needs to be stored continuously increases, the DB can be increased by continuously adding replica sets.

이상에서 설명한 본 발명의 다양한 실시예들에 따르면 복수의 DB 레플리카 세트에 적절하게 데이터가 분산됨으로써 시스템 전체적인 성능이 향상되는 효과가있다.According to various embodiments of the present invention described above, there is an effect of improving overall system performance by appropriately distributing data to a plurality of DB replica sets.

도 8은 본 발명이 구현될 수 있는 장치의 일 예를 도시한 도면이다8 is a diagram illustrating an example of an apparatus in which the present invention can be implemented.

도 8을 참고하면 장치는 입/출력부(310), 통신부(320), 센싱부(330), 데이터베이스(340) 및 프로세서(350)를 포함할 수 있다.Referring to FIG. 8 , the device may include an input/output unit 310 , a communication unit 320 , a sensing unit 330 , a database 340 , and a processor 350 .

입/출력부(310)는 사용자 입력을 받거나 또는 사용자에게 정보를 출력하는 각종 인터페이스나 연결 포트 등일 수 있다. 입/출력부(310)는 입력 모듈과 출력 모듈로 구분될 수 있는데, 입력 모듈은 사용자로부터 사용자 입력을 수신한다. 사용자 입력은 키 입력, 터치 입력, 음성 입력을 비롯한 다양한 형태로 이루어질 수 있다. 이러한 사용자 입력을 받을 수 있는 입력 모듈의 예로는 전통적인 형태의 키패드나 키보드, 마우스는 물론, 사용자의 터치를 감지하는 터치 센서, 음성 신호를 입력 받는 마이크, 영상 인식을 통해 제스처 등을 인식하는 카메라, 사용자 접근을 감지하는 조도 센서나 적외선 센서 등으로 구성되는 근접 센서, 가속도 센서나 자이로 센서 등을 통해 사용자 동작을 인식하는 모션 센서 및 그 외의 다양한 형태의 사용자 입력을 감지하거나 입력 받는 다양한 형태의 입력 수단을 모두 포함하는 포괄적인 개념이다. 여기서, 터치 센서는 디스플레이 패널에 부착되는 터치 패널이나 터치 필름을 통해 터치를 감지하는 압전식 또는 정전식 터치 센서, 광학적인 방식에 의해 터치를 감지하는 광학식 터치 센서 등으로 구현될 수 있다. 이외에도 입력 모듈은 자체적으로 사용자 입력을 감지하는 장치 대신 사용자 입력을 입력 받는 외부의 입력 장치를 연결시키는 입력 인터페이스(USB 포트, PS/2 포트 등)의 형태로 구현될 수도 있다. 또 출력 모듈은 각종 정보를 출력해 사용자에게 이를 제공할 수 있다. 출력 모듈은 영상을 출력하는 디스플레이, 소리를 출력하는 스피커(및/또는 이와 연결된 증폭기(amplifier)), 진동을 발생시키는 햅틱 장치 및 그 외의 다양한 형태의 출력 수단을 모두 포함하는 포괄적인 개념이다. 이외에도 출력 모듈은 상술한 개별 출력 수단을 연결시키는 포트 타입의 출력 인터페이스의 형태로 구현될 수도 있다.The input/output unit 310 may be various interfaces or connection ports that receive user input or output information to the user. The input/output unit 310 may be divided into an input module and an output module, and the input module receives a user input from a user. The user input may be made in various forms including a key input, a touch input, and a voice input. Examples of input modules that can receive such user input include a traditional keypad, keyboard, and mouse, as well as a touch sensor that detects a user's touch, a microphone that receives a voice signal, a camera that recognizes gestures through image recognition, A proximity sensor composed of an illuminance sensor or infrared sensor that detects a user's approach, a motion sensor that recognizes a user's motion through an acceleration sensor or a gyro sensor, and various other input means for sensing or receiving various types of user input It is a comprehensive concept that includes all Here, the touch sensor may be implemented as a piezoelectric or capacitive touch sensor for detecting a touch through a touch panel or a touch film attached to the display panel, an optical touch sensor for detecting a touch by an optical method, and the like. In addition, the input module may be implemented in the form of an input interface (USB port, PS/2 port, etc.) that connects an external input device that receives a user input instead of a device that detects a user input by itself. In addition, the output module can output various information and provide it to the user. An output module is a comprehensive concept including a display that outputs an image, a speaker that outputs a sound (and/or an amplifier connected thereto), a haptic device that generates vibration, and other various types of output means. In addition, the output module may be implemented in the form of a port-type output interface for connecting the above-described individual output means.

일 예로, 디스플레이 형태의 출력 모듈은 텍스트, 정지 영상, 동영상을 디스플레이 할 수 있다. 디스플레이는 액정 디스플레이(LCD: Liquid Crystal Display), 발광 다이오드(LED: light emitting diode) 디스플레이, 유기 발광 다이오드(OLED: Organic Light Emitting Diode) 디스플레이, 평판 디스플레이(FPD: Flat Panel Display), 투명 디스플레이(transparent display), 곡면 디스플레이(Curved Display), 플렉시블 디스플레이(flexible display), 3차원 디스플레이(3D display), 홀로그래픽 디스플레이(holographic display), 프로젝터 및 그 외의 영상 출력 기능을 수행할 수 있는 다양한 형태의 장치를 모두 포함하는 광의의 영상 표시 장치를 의미하는 개념이다. 이러한 디스플레이는 입력 모듈의 터치 센서와 일체로 구성된 터치 디스플레이의 형태일 수도 있다.For example, the display-type output module may display text, still images, and moving images. The display includes a liquid crystal display (LCD), a light emitting diode (LED) display, an organic light emitting diode (OLED) display, a flat panel display (FPD), and a transparent display. display), a curved display, a flexible display, a three-dimensional display, a holographic display, a projector, and various types of devices capable of performing other image output functions. It is a concept meaning an image display device in a broad sense that includes all. Such a display may be in the form of a touch display integrally formed with the touch sensor of the input module.

통신부(320)는 외부 기기와 통신할 수 있다. 따라서, 장치(디바이스)는 통신부를 통해 외부 기기와 정보를 송수신할 수 있다. 예를 들어, 장치는 통신부를 이용해 불법 주·정차 경고 시스템에 저장 및 생성된 정보들이 공유되도록 외부 기기와 통신을 수행할 수 있다.The communication unit 320 may communicate with an external device. Accordingly, the device (device) may transmit/receive information to and from an external device through the communication unit. For example, the device may communicate with an external device so that information stored and generated in the illegal parking/stop warning system is shared using the communication unit.

여기서, 통신, 즉 데이터의 송수신은 유선 또는 무선으로 이루어질 수 있다. 이를 위해 통신부는 LAN(Local Area Network)를 통해 인터넷 등에 접속하는 유선 통신 모듈, 이동 통신 기지국을 거쳐 이동 통신 네트워크에 접속하여 데이터를 송수신하는 이동 통신 모듈, 와이파이(Wi-Fi) 같은 WLAN(Wireless Local Area Network) 계열의 통신 방식이나 블루투스(Bluetooth), 직비(Zigbee)와 같은 WPAN(Wireless Personal Area Network) 계열의 통신 방식을 이용하는 근거리 통신 모듈, GPS(Global Positioning System)과 같은 GNSS(Global Navigation Satellite System)을 이용하는 위성 통신 모듈 또는 이들의 조합으로 구성될 수 있다. 통신에 사용되는 무선 통신 기술은 저전력 통신을 위한 NB-IoT(Narrowband Internet of Things) 를 포함할 수 있다. 이때, 예를 들어 NB-IoT 기술은 LPWAN(Low Power Wide Area Network) 기술의 일례일 수 있고, LTE Cat(category) NB1 및/또는 LTE Cat NB2 등의 규격으로 구현될 수 있으며, 상술한 명칭에 한정되는 것은 아니다. 추가적으로 또는 대체적으로, 다양한 실시예들에 따른 무선 기기에서 구현되는 무선 통신 기술은 LTE-M 기술을 기반으로 통신을 수행할 수 있다. 이때, 일 예로, LTE-M 기술은 LPWAN 기술의 일례일 수 있고, eMTC(enhanced Machine Type Communication) 등의 다양한 명칭으로 불릴 수 있다. 예를 들어, LTE-M 기술은 1) LTE CAT 0, 2) LTE Cat M1, 3) LTE Cat M2, 4) LTE non-BL(non-Bandwidth Limited), 5) LTE-MTC, 6) LTE Machine Type Communication, 및/또는 7) LTE M 등의 다양한 규격 중 적어도 어느 하나로 구현될 수 있으며 상술한 명칭에 한정되는 것은 아니다. 추가적으로 또는 대체적으로, 다양한 실시예들에 따른 무선 기기에서 구현되는 무선 통신 기술은 저전력 통신을 고려한 지그비(ZigBee), 블루투스(Bluetooth) 및 저전력 광역 통신망(Low Power Wide Area Network, LPWAN) 중 적어도 어느 하나를 포함할 수 있으며, 상술한 명칭에 한정되는 것은 아니다. 일 예로 ZigBee 기술은 IEEE 802.15.4 등의 다양한 규격을 기반으로 소형/저-파워 디지털 통신에 관련된 PAN(personal area networks)을 생성할 수 있으며, 다양한 명칭으로 불릴 수 있다.Here, communication, that is, transmission and reception of data may be performed by wire or wirelessly. To this end, the communication unit includes a wired communication module that accesses the Internet through a local area network (LAN), a mobile communication module that accesses a mobile communication network through a mobile communication base station and transmits and receives data, and a wireless local area network (WLAN) such as Wi-Fi. A short-distance communication module using an area network communication method or a wireless personal area network (WPAN) communication method such as Bluetooth or Zigbee, or a global navigation satellite system (GNSS) such as GPS (Global Positioning System) ) using a satellite communication module or a combination thereof. A wireless communication technology used for communication may include a Narrowband Internet of Things (NB-IoT) for low-power communication. In this case, for example, NB-IoT technology may be an example of LPWAN (Low Power Wide Area Network) technology, and may be implemented in standards such as LTE Cat (category) NB1 and/or LTE Cat NB2, It is not limited. Additionally or alternatively, a wireless communication technology implemented in a wireless device according to various embodiments may perform communication based on LTE-M technology. In this case, as an example, the LTE-M technology may be an example of an LPWAN technology, and may be called by various names such as enhanced machine type communication (eMTC). For example, LTE-M technology is 1) LTE CAT 0, 2) LTE Cat M1, 3) LTE Cat M2, 4) LTE non-BL (non-Bandwidth Limited), 5) LTE-MTC, 6) LTE Machine Type Communication, and/or 7) may be implemented in at least one of various standards such as LTE M, and is not limited to the above-described name. Additionally or alternatively, a wireless communication technology implemented in a wireless device according to various embodiments may include at least one of ZigBee, Bluetooth, and Low Power Wide Area Network (LPWAN) in consideration of low power communication. may include, and is not limited to the above-mentioned names. For example, the ZigBee technology can create PAN (personal area networks) related to small/low-power digital communication based on various standards such as IEEE 802.15.4, and can be called by various names.

식별부(330)는 영상 인식을 통해 오브젝트 등을 인식하는 카메라, 오브젝트 접근을 감지하는 감지 센서 및 그 외의 다양한 형태의 외부 입력을 감지하거나 입력 받는 다양한 형태의 식별/센싱 수단을 모두 포함하는 포괄적인 개념일 수 있다. 식별부는 입/출력부(310) 내의 입력 모듈과 동일한 것으로 이해될 수 있거나 및/또는 입력 모듈과는 별도의 것으로 이해될 수도 있다. 식별부(330)는 지자기 센서(Magnetic sensor), 가속도 센서(Acceleration sensor), 온/습도 센서, 적외선 센서, 자이로스코프 센서, 위치 센서(예컨대, GPS), 기압 센서, 근접 센서, RGB 센서(illuminance sensor), 라이다(radar) 센서, 조도 센서, 및 전류 센서 중 하나 이상을 더 포함할 수 있으나, 이에 한정되는 것은 아니다. 각 센서들의 기능은 그 명칭으로부터 당업자가 직관적으로 추론할 수 있으므로, 구체적인 설명은 생략하기로 한다.The identification unit 330 includes a camera that recognizes an object through image recognition, a detection sensor that detects an object approach, and various types of identification/sensing means that detect or receive various types of external inputs. could be a concept. The identification unit may be understood to be the same as the input module in the input/output unit 310 and/or may be understood to be separate from the input module. The identification unit 330 includes a geomagnetic sensor, an acceleration sensor, a temperature/humidity sensor, an infrared sensor, a gyroscope sensor, a location sensor (eg, GPS), a barometric pressure sensor, a proximity sensor, and an RGB sensor (illuminance). sensor), a lidar sensor, an illuminance sensor, and a current sensor may further include, but is not limited thereto. Since a function of each sensor can be intuitively inferred from the name of a person skilled in the art, a detailed description thereof will be omitted.

데이터베이스(340)는 각종 정보를 저장할 수 있다. 데이터베이스는 데이터를 임시적으로 또는 반영구적으로 저장할 수 있다. 예를 들어, 데이터베이스에는 제1 디바이스 및/또는 제2 디바이스를 구동하기 위한 운용 프로그램(OS: Operating System), 웹 사이트를 호스팅하기 위한 데이터나 또는 애플리케이션(예를 들어, 웹 애플리케이션)에 관한 데이터 등이 저장될 수 있다. 또, 데이터베이스는 상술한 바와 같이 모듈들을 컴퓨터 코드 형태로 저장할 수 있다. The database 340 may store various types of information. A database can store data temporarily or semi-permanently. For example, in the database, an operating program (OS) for driving the first device and/or the second device, data for hosting a website or data about an application (eg, a web application), etc. This can be saved. In addition, the database may store the modules in the form of computer code as described above.

데이터베이스(340)의 예로는 하드 디스크(HDD: Hard Disk Drive), SSD(Solid State Drive), 플래쉬 메모리(flash memory), 롬(ROM: Read-Only Memory), 램(RAM: Random Access Memory) 등이 있을 수 있다. 이러한 데이터베이스는 내장 타입 또는 탈부착 가능한 타입으로 제공될 수 있다.Examples of the database 340 include a hard disk (HDD), a solid state drive (SSD), a flash memory, a read-only memory (ROM), a random access memory (RAM), and the like. This can be. Such a database may be provided in a built-in type or a detachable type.

프로세서(350)는 장치(디바이스)의 전반적인 동작을 제어한다. 이를 위해 프로세서(350)는 각종 정보의 연산 및 처리를 수행하고 제1 디바이스 및/또는 제2 디바이스의 구성요소들의 동작을 제어할 수 있다. 예를 들어, 프로세서(350)는 효율적인 서버 부하 분산이 되도록 데이터베이스를 이중화 시켜 대용량 데이터 처리를 수행하는 방법을 위한 프로그램 내지 애플리케이션을 실행시킬 수 있을 것이다. 프로세서(350)는 하드웨어 소프트웨어 또는 이들의 조합에 따라 컴퓨터나 이와 유사한 장치로 구현될 수 있다. 하드웨어적으로 프로세서(350)는 전기적인 신호를 처리하여 제어 기능을 수행하는 전자 회로 형태로 제공될 수 있으며, 소프트웨어적으로는 하드웨어적인 프로세서(240)를 구동시키는 프로그램 형태로 제공될 수 있다. 한편, 이하의 설명에서 특별한 언급이 없는 경우에는 제1 디바이스 및/또는 제2 디바이스의 동작은 프로세서(350)의 제어에 의해 수행되는 것으로 해석될 수 있다. 즉, 대용량 데이터의 반복 연산 및 저장 작업을 수행하는 경우 데이터베이스(340)의 Disk I/O 지연을 최소화하기 위해 데이터베이스 레플리카 세트를 이용한 부하 분산 처리를 수행하는 방법에 요구되는 모듈들이 실행되는 경우, 모듈들은 프로세서(350)가 제1 디바이스 및/또는 제2 디바이스를 이하의 동작들을 수행하도록 제어하는 것으로 해석될 수 있다.The processor 350 controls the overall operation of the device (device). To this end, the processor 350 may perform calculation and processing of various types of information and may control operations of components of the first device and/or the second device. For example, the processor 350 may execute a program or application for a method of performing large-scale data processing by duplicating a database to achieve efficient server load balancing. The processor 350 may be implemented as a computer or a similar device according to hardware software or a combination thereof. In terms of hardware, the processor 350 may be provided in the form of an electronic circuit that processes electrical signals to perform a control function, and in software, it may be provided in the form of a program for driving the processor 240 in hardware. Meanwhile, in the following description, unless otherwise specified, the operations of the first device and/or the second device may be interpreted as being performed under the control of the processor 350 . That is, if the modules required for the method of performing load balancing processing using the database replica set to minimize the disk I/O delay of the database 340 when performing repeated operation and storage of large data are executed, the module These may be interpreted as controlling the processor 350 to perform the following operations on the first device and/or the second device.

요약하면, 본 발명은 다양한 수단을 통해 구현될 수 있다. 예를 들어, 다양한 실시예들은 하드웨어, 펌웨어(firmware), 소프트웨어 또는 그것들의 결합 등에 의해 구현될 수 있다.In summary, the present invention may be implemented through various means. For example, various embodiments may be implemented by hardware, firmware, software, or a combination thereof.

하드웨어에 의한 구현의 경우, 본 발명에 따른 방법은 하나 또는 그 이상의 ASICs(application specific integrated circuits), DSPs(digital signal processors), DSPDs(digital signal processing devices), PLDs(programmable logic devices), FPGAs(field programmable gate arrays), 프로세서, 콘트롤러, 마이크로 콘트롤러, 마이크로 프로세서 등에 의해 구현될 수 있다.In the case of implementation by hardware, the method according to the present invention may include one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays), a processor, a controller, a microcontroller, a microprocessor, and the like.

펌웨어나 소프트웨어에 의한 구현의 경우, 본 발명에 따른 방법은 이하에서 설명된 기능 또는 동작들을 수행하는 모듈, 절차 또는 함수 등의 형태로 구현될 수 있다. 예를 들어, 소프트웨어 코드는 메모리에 저장되어 프로세서에 의해 구동될 수 있다. 상기 메모리는 상기 프로세서 내부 또는 외부에 위치할 수 있으며, 이미 공지된 다양한 수단에 의해 상기 프로세서와 데이터를 주고받을 수 있다. 본 발명의 실시예와 관련하여 설명된 방법 또는 알고리즘의 단계들은 하드웨어로 직접 구현되거나, 하드웨어에 의해 실행되는 소프트웨어 모듈로 구현되거나, 또는 이들의 결합에 의해 구현될 수 있다. 소프트웨어 모듈은 RAM(Random Access Memory), ROM(Read Only Memory), EPROM(Erasable Programmable ROM), EEPROM(Electrically Erasable Programmable ROM), 플래시 메모리(Flash Memory), 하드 디스크, 착탈형 디스크, CD-ROM, 또는 본 발명이 속하는 기술 분야에서 잘 알려진 임의의 형태의 컴퓨터 판독가능 기록매체에 상주할 수도 있다.In the case of implementation by firmware or software, the method according to the present invention may be implemented in the form of a module, procedure, or function that performs the functions or operations described below. For example, the software code may be stored in a memory and driven by a processor. The memory may be located inside or outside the processor, and data may be exchanged with the processor by various known means. The steps of the method or algorithm described in relation to the embodiment of the present invention may be implemented directly in hardware, as a software module executed by hardware, or by a combination thereof. A software module may include random access memory (RAM), read only memory (ROM), erasable programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), flash memory, hard disk, removable disk, CD-ROM, or It may reside in any type of computer-readable recording medium well known in the art to which the present invention pertains.

본 발명에 따르면, 데이터베이스(340)는 본 발명에서 master-slave 아키텍쳐를 갖는데, 레플리카 세트는 마스터 DB와 슬레이브 DB를 포함한다. 이‹š, 서버 별로 DB들이 오버랩되지 않도록 구성되어야 한다. 프로세서(350)는 데이터를 분산하여 각 레플리카 세트의 마스터 DB에 입력하고, 각 레플리카 세트의 슬레이브 DB로부터 데이터를 읽어오는 동작을 수행한다.According to the present invention, the database 340 has a master-slave architecture in the present invention, and the replica set includes a master DB and a slave DB. In this case, DBs for each server should be configured so that they do not overlap. The processor 350 distributes data, inputs it to the master DB of each replica set, and reads data from the slave DB of each replica set.

이상, 첨부된 도면을 참조로 하여 본 발명의 실시예를 설명하였지만, 본 발명이 속하는 기술분야의 통상의 기술자는 본 발명이 그 기술적 사상이나 필수적인 특징을 변경하지 않고서 다른 구체적인 형태로 실시될 수 있다는 것을 이해할 수 있을 것이다. 그러므로, 이상에서 기술한 실시예들은 모든 면에서 예시적인 것이며, 제한적이 아닌 것으로 이해해야만 한다. As mentioned above, although embodiments of the present invention have been described with reference to the accompanying drawings, those skilled in the art to which the present invention pertains know that the present invention may be embodied in other specific forms without changing the technical spirit or essential features thereof. you will be able to understand Therefore, it should be understood that the embodiments described above are illustrative in all respects and not restrictive.

310: 입/출력부
320: 통신부
330: 식별부
340: 데이터베이스
350: 프로세서
310: input / output unit
320: communication unit
330: identification unit
340: database
350: processor

Claims (11)

복수 개의 데이터베이스(database, DB)들을 포함하는 장치가 수행하는 방법에 있어서,
획득한 데이터를 분산하여 제1 데이터 및 제2 데이터를 생성하고;
상기 제1 데이터를 제1 레플리카 세트의 제1 마스터 DB에 저장하고;
상기 제1 마스터 DB는 상기 제1 데이터를 복제하여 상기 제1 레플리카 세트의 제1 슬레이브 DB에 전송하고;
상기 제1 슬레이브 DB는 상기 제1 데이터를 저장하고;
상기 제1 슬레이브 DB로부터 상기 제1 데이터를 로딩하고;
상기 제2 데이터를 제2 레플리카 세트의 제2 마스터 DB에 저장하고;
상기 제2 마스터 DB는 상기 제2 데이터를 복제하여 상기 제2 레플리카 세트의 제2 슬레이브 DB에 전송하고;
상기 제2 슬레이브 DB는 상기 제2 데이터를 저장하고; 및
상기 제2 슬레이브 DB로부터 상기 복제된 제2 데이터를 로딩하는 것을 포함하되,
상기 제1 레플리카 세트는 상기 제1 마스터 DB, 상기 제1 슬레이브 DB, 및 제1 매니저를 포함하고,
상기 제2 레플리카 세트는 상기 제2 마스터 DB, 상기 제2 슬레이브 DB, 및 제2 매니저를 포함하고,
상기 제1 매니저가 상기 제2 마스터 DB 또는 상기 제2 슬레이브 DB와 같은 서버에 형성되어 상기 제1 레플리카 세트와 상기 제2 레플리카 세트가 상보적으로 구성되고, 또는
상기 제2 매니저가 상기 제1 마스터 DB 또는 상기 제1 슬레이브 DB와 같은 서버에 형성되어 상기 제1 레플리카 세트와 상기 제2 레플리카 세트가 상보적으로 구성되며,
레플리카 세트를 증설하는 것을 더 포함하되,
상기 레플리카 세트를 증설하는 것은 2개의 레플리카 세트 당 4개의 서버가 할당되도록 2의 배수 단위의 개수로 레플리카 세트를 증설하는 것을 특징으로 하는, 방법.
In a method performed by an apparatus including a plurality of databases (database, DB),
distributing the acquired data to generate first data and second data;
storing the first data in a first master DB of a first replica set;
the first master DB duplicates the first data and transmits it to a first slave DB of the first replica set;
the first slave DB stores the first data;
loading the first data from the first slave DB;
store the second data in a second master DB of a second replica set;
the second master DB duplicates the second data and transmits it to a second slave DB of the second replica set;
the second slave DB stores the second data; and
Comprising loading the duplicated second data from the second slave DB,
The first replica set includes the first master DB, the first slave DB, and a first manager,
The second replica set includes the second master DB, the second slave DB, and a second manager,
The first manager is formed in the same server as the second master DB or the second slave DB, so that the first replica set and the second replica set are complementary; or
the second manager is formed in the same server as the first master DB or the first slave DB, so that the first replica set and the second replica set are complementary;
Further comprising adding a replica set,
Expanding the replica set is characterized in that the expansion of the replica set in the number of units of multiples of 2 so that 4 servers are allocated per 2 replica sets.
제1항에 있어서,
상기 제1 매니저 또는 상기 제2 매니저를 사용할 수 없는 경우, 상기 제1 마스터 DB와 상기 제1 슬레이브 DB 사이의 연결 또는 상기 제2 마스터 DB와 상기 제2 슬레이브 DB 사이의 연결은 DB 커넥터를 사용하여 이루어지는 것을 특징으로 하는, 방법.
According to claim 1,
When the first manager or the second manager cannot be used, the connection between the first master DB and the first slave DB or the connection between the second master DB and the second slave DB is performed using a DB connector. A method, characterized in that it is made.
제1항에 있어서,
상기 제1 매니저를 사용할 수 없는 경우, 상기 제1 마스터 DB와 상기 제1 슬레이브 DB는 상기 제2 매니저에 연결되고, 및
상기 제2 매니저를 사용할 수 없는 경우, 상기 제2 마스터 DB와 상기 제2 슬레이브 DB는 상기 제1 매니저에 연결되는 것을 특징으로 하는, 방법.
According to claim 1,
When the first manager is unavailable, the first master DB and the first slave DB are connected to the second manager, and
When the second manager is unavailable, the second master DB and the second slave DB are connected to the first manager.
제1항에 있어서,
상기 제1 데이터를 상기 제1 마스터 DB에 저장하는 것은 상기 제1 마스터 DB의 바이너리 로그(binary log) 파일에 저장하는 것을 더 포함하는, 방법.
According to claim 1,
Storing the first data in the first master DB further comprises storing in a binary log file of the first master DB.
제1항에 있어서,
상기 제1 데이터를 상기 제1 슬레이브 DB에 저장하는 것은 상기 제1 슬레이브 DB의 릴레이 로그(relay log)파일에 저장하는 것을 더 포함하는, 방법.
According to claim 1,
Storing the first data in the first slave DB further comprises storing in a relay log file of the first slave DB.
제1항에 있어서,
상기 제1 레플리카 세트를 사용할 수 없는 경우, 상기 제1 데이터는 상기 제2 레플리카 세트 내에서 처리되고, 및
상기 제2 레플리카 세트를 사용할 수 없는 경우, 상기 제2 데이터는 상기 제1 레플리카세트 내에서 처리되는 것을 특징으로 하는, 방법.
According to claim 1,
if the first set of replicas is not available, the first data is processed in the second set of replicas, and
and if the second set of replicas is not available, the second data is processed within the first set of replicas.
제1항에 있어서,
상기 제1 마스터 DB, 상기 제1 슬레이브 DB, 상기 제2 마스터 DB, 및 상기 제2 슬레이브 DB는 같은 서버에 구성되지 않도록 구성되는 것을 특징으로 하는, 방법.
According to claim 1,
The method, characterized in that the first master DB, the first slave DB, the second master DB, and the second slave DB are configured not to be configured in the same server.
제1항에 있어서,
N-1번째 레플리카 세트와 N번째 레플리카 세트를 상보적으로 구성하는 것을 더 포함하되,
상기 N-1번째 레플리카 세트와 상기 N번째 레플리카 세트를 상보적으로 구성하는 것은:
상기 N번째 레플리카 세트의 마스터 DB 또는 슬레이브 DB와 상기 N-1번째 레플리카 세트의 매니저는 같은 서버에 포함되도록 구성하거나, 또는
상기 N-1번째 레플리카 세트의 마스터 DB 또는 슬레이브 DB와 상기 N번째 레플리카 세트의 매니저는 같은 서버에 포함되도록 구성하는 것을 포함하는 것을 특징으로 하는, 방법.
According to claim 1,
Complementarily configuring the N-1 th replica set and the N th replica set,
Complementarily configuring the N-1 th replica set and the N th replica set comprises:
The master DB or slave DB of the Nth replica set and the manager of the N-1th replica set are configured to be included in the same server, or
and configuring the master DB or slave DB of the N-1 th replica set and the manager of the N th replica set to be included in the same server.
삭제delete 제2항에 있어서,
상기 제1 데이터를 상기 제1 마스터 DB에 저장하고;
상기 제1 슬레이브 DB로부터 상기 제1 데이터를 로딩하고;
상기 제2 데이터를 상기 제2 마스터 DB에 저장하고; 및
상기 제2 슬레이브 DB로부터 상기 제2 데이터를 로딩하는 것이 상기 DB 커넥터를 통해 수행되는 것을 더 특징으로 하는, 방법.
3. The method of claim 2,
storing the first data in the first master DB;
loading the first data from the first slave DB;
storing the second data in the second master DB; and
The method further characterized in that the loading of the second data from the second slave DB is performed through the DB connector.
복수 개의 데이터베이스(database, DB)들을 포함하는 장치에 있어서,
데이터를 저장하도록 구성된 메모리; 및
상기 메모리와 연결된 하나 이상의 프로세서를 포함하고,
상기 하나 이상의 프로세서는:
획득한 데이터를 분산하여 제1 데이터 및 제2 데이터를 생성하고;
상기 제1 데이터를 제1 레플리카 세트의 제1 마스터 DB에 저장하고;
상기 제1 마스터 DB는 상기 제1 데이터를 복제하여 상기 제1 레플리카 세트의 제1 슬레이브 DB에 전송하고;
상기 제1 슬레이브 DB는 상기 제1 데이터를 저장하고;
상기 제1 슬레이브 DB로부터 상기 제1 데이터를 로딩하고;
상기 제2 데이터를 제2 레플리카 세트의 제2 마스터 DB에 저장하고;
상기 제2 마스터 DB는 상기 제2 데이터를 복제하여 상기 제2 레플리카 세트의 제2 슬레이브 DB에 전송하고;
상기 제2 슬레이브 DB는 상기 제2 데이터를 저장하고; 및
상기 제2 슬레이브 DB로부터 상기 복제된 제2 데이터를 로딩하도록 구성되며,
상기 제1 레플리카 세트는 상기 제1 마스터 DB, 상기 제1 슬레이브 DB, 및 제1 매니저를 포함하고,
상기 제2 레플리카 세트는 상기 제2 마스터 DB, 상기 제2 슬레이브 DB, 및 제2 매니저를 포함하고,
상기 제1 매니저가 상기 제2 마스터 DB 또는 상기 제2 슬레이브 DB와 같은 서버에 형성되어 상기 제1 레플리카 세트와 상기 제2 레플리카 세트가 상보적으로 구성되고, 또는
상기 제2 매니저가 상기 제1 마스터 DB 또는 상기 제1 슬레이브 DB와 같은 서버에 형성되어 상기 제1 레플리카 세트와 상기 제2 레플리카 세트가 상보적으로 구성되며,
레플리카 세트를 증설하는 것을 더 포함하되,
상기 레플리카 세트를 증설하는 것은 2개의 레플리카 세트 당 4개의 서버가 할당되도록 2의 배수 단위의 개수로 레플리카 세트를 증설하는 것을 특징으로 하는, 장치.
In the device including a plurality of databases (database, DB),
a memory configured to store data; and
one or more processors coupled to the memory;
The one or more processors include:
distributing the acquired data to generate first data and second data;
storing the first data in a first master DB of a first replica set;
the first master DB duplicates the first data and transmits it to a first slave DB of the first replica set;
the first slave DB stores the first data;
loading the first data from the first slave DB;
store the second data in a second master DB of a second replica set;
the second master DB duplicates the second data and transmits it to a second slave DB of the second replica set;
the second slave DB stores the second data; and
configured to load the duplicated second data from the second slave DB,
The first replica set includes the first master DB, the first slave DB, and a first manager,
The second replica set includes the second master DB, the second slave DB, and a second manager,
The first manager is formed in the same server as the second master DB or the second slave DB, so that the first replica set and the second replica set are complementary; or
the second manager is formed in the same server as the first master DB or the first slave DB, so that the first replica set and the second replica set are complementary;
Further comprising adding a replica set,
The extension of the replica set is characterized in that the extension of the replica set in a number of multiples of 2 so that four servers are allocated per two replica sets.
KR1020210133618A 2021-10-08 2021-10-08 Database duplexing method for efficient server load distribution when processing large amounts of data and apparatus thereof KR102351220B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020210133618A KR102351220B1 (en) 2021-10-08 2021-10-08 Database duplexing method for efficient server load distribution when processing large amounts of data and apparatus thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020210133618A KR102351220B1 (en) 2021-10-08 2021-10-08 Database duplexing method for efficient server load distribution when processing large amounts of data and apparatus thereof

Publications (1)

Publication Number Publication Date
KR102351220B1 true KR102351220B1 (en) 2022-01-14

Family

ID=79342747

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020210133618A KR102351220B1 (en) 2021-10-08 2021-10-08 Database duplexing method for efficient server load distribution when processing large amounts of data and apparatus thereof

Country Status (1)

Country Link
KR (1) KR102351220B1 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20080102622A (en) * 2007-05-21 2008-11-26 엔에이치엔(주) Data replication method and systme for database management system
US20170206260A1 (en) * 2014-03-11 2017-07-20 Amazon Technologies, Inc. Reducing data volume durability state for block-based storage
KR20180076172A (en) * 2016-12-27 2018-07-05 주식회사 씨에스리 Apparatus and method for detecting anomaly of database system
WO2019088334A1 (en) * 2017-11-01 2019-05-09 (주)데이터스트림즈 System for storing and searching big data in real-time
KR20200057409A (en) * 2018-11-16 2020-05-26 네이버 주식회사 Distributed file system and data processing method for live service
KR20200100173A (en) 2018-07-06 2020-08-25 스노우플레이크 인코포레이티드 Data replication and data failover within the database system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20080102622A (en) * 2007-05-21 2008-11-26 엔에이치엔(주) Data replication method and systme for database management system
US20170206260A1 (en) * 2014-03-11 2017-07-20 Amazon Technologies, Inc. Reducing data volume durability state for block-based storage
KR20180076172A (en) * 2016-12-27 2018-07-05 주식회사 씨에스리 Apparatus and method for detecting anomaly of database system
WO2019088334A1 (en) * 2017-11-01 2019-05-09 (주)데이터스트림즈 System for storing and searching big data in real-time
KR20200100173A (en) 2018-07-06 2020-08-25 스노우플레이크 인코포레이티드 Data replication and data failover within the database system
KR20200057409A (en) * 2018-11-16 2020-05-26 네이버 주식회사 Distributed file system and data processing method for live service

Similar Documents

Publication Publication Date Title
US11853283B2 (en) Dynamic aggregate generation and updating for high performance querying of large datasets
JP7009455B2 (en) Data serialization in a distributed event processing system
CN109074362B (en) Splitting and range of motion in distributed systems
US9037677B2 (en) Update protocol for client-side routing information
KR100961739B1 (en) Maintaining consistency for remote copy using virtualization
CN101184106A (en) Associated transaction processing method of mobile database
US20180218019A1 (en) Processing messages of a plurality of devices
US11503149B2 (en) Device-cloud collaboration method, platform, and apparatus
US20230085750A1 (en) Code generator platform for data transformation
AU2020256331B2 (en) Table-per-partition
US9569519B2 (en) Client-side directed commands to a loosely coupled database
US20220121677A1 (en) Method for automated query language expansion and indexing
KR101989074B1 (en) Migration based on replication log in database sharding environment
KR102351220B1 (en) Database duplexing method for efficient server load distribution when processing large amounts of data and apparatus thereof
US20200409972A1 (en) Method for synchronization of repository data using data criteria
US20220309063A1 (en) Query rewrite using materialized views with logical partition change tracking
US11200208B2 (en) Removing non-deterministic behavior in a change data capture merge
JP6924898B2 (en) Transaction processing methods, devices and devices
KR102338653B1 (en) Method of performing distributed grouping processing for each node to minimize shuffling in cluster environment of large data and apparatus thereof
CN117785887A (en) Method and device for virtually entering lake by using motion data of flying saucer shooting project

Legal Events

Date Code Title Description
E701 Decision to grant or registration of patent right
GRNT Written decision to grant