KR20210085993A - Message storing method based on distributed storage and appratus therefor - Google Patents

Message storing method based on distributed storage and appratus therefor Download PDF

Info

Publication number
KR20210085993A
KR20210085993A KR1020190179626A KR20190179626A KR20210085993A KR 20210085993 A KR20210085993 A KR 20210085993A KR 1020190179626 A KR1020190179626 A KR 1020190179626A KR 20190179626 A KR20190179626 A KR 20190179626A KR 20210085993 A KR20210085993 A KR 20210085993A
Authority
KR
South Korea
Prior art keywords
data
message
storage
distributed storage
index data
Prior art date
Application number
KR1020190179626A
Other languages
Korean (ko)
Other versions
KR102285759B1 (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 KR1020190179626A priority Critical patent/KR102285759B1/en
Publication of KR20210085993A publication Critical patent/KR20210085993A/en
Application granted granted Critical
Publication of KR102285759B1 publication Critical patent/KR102285759B1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/288Distributed intermediate devices, i.e. intermediate devices for interaction with other intermediate devices on the same level
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • H04L67/2804
    • H04L67/2809
    • H04L67/2842
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/561Adding application-functional data or data for application control, e.g. adding metadata
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/562Brokering proxy services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Library & Information Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

According to an embodiment of the present invention, provided are a distributed storage based message storing method and a device therefor. According to the embodiment of the present invention, the distributed storage based message storing method comprises the steps of: receiving a message based on a publish-subscribe based message protocol from a client device; converting the received message into data based on a distributed storage based message protocol and storing it in a cluster server; generating index data including identification information of data stored in the cluster server and a storage location, in which the data is stored, by using an offset assigned to the message; and storing the generated index data in the cluster server.

Description

분산 스토리지 기반 메시지 저장 방법 및 이를 위한 장치{MESSAGE STORING METHOD BASED ON DISTRIBUTED STORAGE AND APPRATUS THEREFOR}Distributed storage-based message storage method and device therefor {MESSAGE STORING METHOD BASED ON DISTRIBUTED STORAGE AND APPRATUS THEREFOR}

본 발명은 분산 스토리지 기반 메시지 저장 방법 및 이를 위한 장치에 관한 것이다.The present invention relates to a distributed storage-based message storage method and an apparatus therefor.

일반적으로 메시지 브로커(Message Broker)는 송신자로부터 메시지를 수신하고, 수신된 메시지를 수신자에게 전달하는 인터페이스 장치이다. 이러한 메시지 브로커는 많은 양의 데이터를 처리하고 있으나, 인터넷의 다양한 서비스를 통해 수많은 데이터가 계속적으로 생성되고 있어 일반적인 메시지 브로커로는 대규모 데이터를 처리하는데 있어 한계가 발생되고 있다. In general, a message broker is an interface device that receives a message from a sender and delivers the received message to a receiver. Although these message brokers process a large amount of data, a large amount of data is continuously generated through various Internet services, so that a general message broker has limitations in processing large-scale data.

이러한 문제점을 해결하기 위해 더 많은 데이터를 처리 및 저장할 수 있는 스토리지 기반 메시지 브로커가 이용되고 있다. 스토리지 기반 메시지 브로커는 대규모 데이터를 주고받는 구조를 가지는 데이터 허브로서 구현된다. 이러한 스토리지 기반 메시지 브로커는 트래픽이나 용량 등을 고려하여 상황에 맞도록 구조를 변경하여 이용될 수 있다.To solve this problem, a storage-based message broker that can process and store more data is being used. A storage-based message broker is implemented as a data hub with a structure for exchanging large-scale data. Such a storage-based message broker can be used by changing the structure to suit the situation in consideration of traffic or capacity.

이와 같이 상황에 맞는 메시지 브로커를 구현하기 위해서는 메시지를 처리 및 저장하는 브로커의 수를 조절할 필요가 있다.In order to implement a message broker suitable for this situation, it is necessary to adjust the number of brokers that process and store messages.

그러나, 브로커의 수를 조절하기 위해 트래픽을 정확하게 미리 예측하고, 트래픽의 변화를 최대한 빠르게 대응하기 위해 빠른 속도로 브로커의 수를 변화시켜야 한다는 어려움이 있다. 또한 브로커의 수를 변화시키는 경우 브로커가 축소 또는 추가됨에 따라 대규모 데이터를 이동시키기 위해 소요되는 비용 및 시간이 많이 든다.However, there is a difficulty in accurately predicting traffic in advance in order to control the number of brokers and changing the number of brokers rapidly in order to respond to changes in traffic as quickly as possible. Also, changing the number of brokers is expensive and time-consuming to move large amounts of data as brokers are reduced or added.

따라서, 기존의 메시지 브로커가 대규모 데이터를 저장하지 않고, 분산 스토리지에 대규모 데이터를 저장하며, 메시지 브로커가 이러한 분산 스토리지에 접근하기 위한 인터페이스를 제공하고, 캐시 역할을 수행하기 위한 방법이 요구된다.Therefore, there is a need for a method in which the existing message broker does not store large-scale data, stores large-scale data in distributed storage, provides an interface for the message broker to access such distributed storage, and serves as a cache.

본 발명이 해결하고자 하는 과제는 분산 스토리지 기반 메시지 저장 방법 및 이를 위한 장치를 제공하는 것이다.An object of the present invention is to provide a distributed storage-based message storage method and an apparatus therefor.

구체적으로, 본 발명이 해결하고자 하는 과제는 대규모 데이터를 저장하지 않고, 분산 스토리지에 대규모 데이터를 저장하며, 이러한 분산 스토리지에 접근하기 위한 인터페이스를 제공하고, 캐시 역할을 수행하기 위한 분산 스토리지 기반 메시지 저장 방법 및 이를 위한 장치를 제공하는 것이다.Specifically, the problem to be solved by the present invention is not to store large-scale data, but to store large-scale data in distributed storage, to provide an interface for accessing such distributed storage, and to store distributed storage-based messages to serve as a cache To provide a method and an apparatus therefor.

본 발명의 과제들은 이상에서 언급한 과제들로 제한되지 않으며, 언급되지 않은 또 다른 과제들은 아래의 기재로부터 당업자에게 명확하게 이해될 수 있을 것이다.The problems of 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.

전술한 바와 같은 과제를 해결하기 위하여 본 발명의 실시예에 따른 분산 스토리지 기반 메시지 저장 방법 및 이를 위한 장치가 제공된다. 본 발명의 실시예에 따른 분산 스토리지 기반 메시지 저장 장치의 제어부에 의해서 수행되는 분산 스토리지 기반 메시지 저장 방법은, 클라이언트 장치로부터 발행-구독 기반 메시지 프로토콜을 기반으로 하는 메시지를 수신하는 단계; 상기 수신된 메시지를 분산 스토리지 기반 메시지 프로토콜을 기반으로 하는 데이터로 변환하여 클러스터 서버에 저장하는 단계; 상기 메시지에 할당된 오프셋(offset)을 이용하여 상기 클러스터 서버에 저장된 데이터의 식별 정보 및 상기 데이터가 저장된 저장 위치를 포함하는 인덱스 데이터를 생성하는 단계; 및 상기 생성된 인덱스 데이터를 상기 클러스터 서버에 저장하는 단계를 포함한다.Distributed storage-based message storage method and apparatus therefor are provided according to an embodiment of the present invention in order to solve the above problems. A distributed storage-based message storage method performed by a control unit of a distributed storage-based message storage device according to an embodiment of the present invention includes: receiving a message based on a publish-subscribe-based message protocol from a client device; converting the received message into data based on a distributed storage-based message protocol and storing it in a cluster server; generating index data including identification information of data stored in the cluster server and a storage location in which the data is stored using an offset assigned to the message; and storing the generated index data in the cluster server.

본 발명의 실시예에 따른 분산 스토리지 기반 메시지 저장 장치는, 통신부; 및 상기 통신부와 연결하도록 구성된 제어부를 포함하고, 상기 제어부는, 클라이언트 장치로부터 발행-구독 기반 메시지 프로토콜을 기반으로 하는 메시지를 수신하고, 상기 수신된 메시지를 분산 스토리지 기반 메시지 프로토콜을 기반으로 하는 데이터로 변환하여 클러스터 서버에 저장하고, 상기 메시지에 할당된 오프셋(offset)을 이용하여 상기 클러스터 서버에 저장된 데이터의 식별 정보 및 상기 데이터가 저장된 저장 위치를 포함하는 인덱스 데이터를 생성하고, 상기 생성된 인덱스 데이터를 상기 클러스터 서버에 저장한다.A distributed storage-based message storage device according to an embodiment of the present invention includes: a communication unit; and a control unit configured to connect with the communication unit, wherein the control unit receives a message based on a publish-subscribe based message protocol from a client device, and converts the received message to data based on a distributed storage based message protocol. converted and stored in the cluster server, and using an offset assigned to the message to generate index data including identification information of data stored in the cluster server and a storage location in which the data is stored, and the generated index data is stored in the cluster server.

기타 실시예의 구체적인 사항들은 상세한 설명 및 도면들에 포함되어 있다.The details of other embodiments are included in the detailed description and drawings.

본 발명은 대규모 메시지를 분산 스토리지에 저장하고, 분산 스토리지에 저장된 메시지에 접근하기 위한 인터페이스를 제공하고, 캐시 역할을 수행하는 분산 스토리지 기반 메시지 저장 방법 및 이를 위한 장치를 제공할 수 있다.The present invention can provide a distributed storage-based message storage method and apparatus for storing large-scale messages in distributed storage, providing an interface for accessing messages stored in distributed storage, and performing a cache role.

또한, 본 발명은 브로커의 수를 조절하기 위해 소비되는 비용 및 시간을 절감하고, 고속 마이그레이션이 가능한 메시지 저장 서비스를 제공할 수 있다.In addition, the present invention can reduce the cost and time consumed for adjusting the number of brokers, and provide a message storage service capable of high-speed migration.

또한, 본 발명은 트래픽이 적어지는 경우 다른 브로커로 고속 마이그레이션을 수행하고, 대기 상태의 브로커를 종료함으로써, 컴퓨팅 리소스를 절감시킬 수 있다.In addition, the present invention can reduce computing resources by performing high-speed migration to another broker when traffic is low and terminating the broker in a standby state.

또한, 본 발명은 메시지 저장 시 복제 메시지의 개수를 필요 이상으로 생성하지 않음으로써, 분산 스토리지의 용량 및 네트워크 트래픽을 절감시킬 수 있다.In addition, the present invention can reduce the capacity and network traffic of the distributed storage by not generating more than necessary the number of duplicate messages when storing messages.

본 발명에 따른 효과는 이상에서 예시된 내용에 의해 제한되지 않으며, 더욱 다양한 효과들이 본 발명 내에 포함되어 있다.The effect according to the present invention is not limited by the contents exemplified above, and more various effects are included in the present invention.

도 1은 본 발명의 실시예에 따른 분산 스토리지 기반 메시지 저장 시스템의 개략도이다.
도 2는 본 발명의 실시예에 따른 브로커 장치에 대한 개략도이다.
도 3은 본 발명의 실시예에 따른 브로커의 내부 구성을 나타내는 블록도이다.
도 4a 및 도 4b는 본 발명의 실시예에 따른 브로커가 메시지 묶음을 저장하고, 이에 대한 인덱스 데이터를 생성하는 방법을 설명하기 위한 예시도들이다.
도 5는 본 발명의 실시예에 따른 브로커 장치에서 메시지 저장 및 메시지의 인덱스 데이터를 생성 및 저장하는 방법을 설명하기 위한 흐름도이다.
도 6은 본 발명의 실시예에 따른 분산 스토리지 기반 메시지 저장 시스템에서의 메시지 발행/구독 방법을 설명하기 위한 흐름도이다.
1 is a schematic diagram of a distributed storage-based message storage system according to an embodiment of the present invention.
2 is a schematic diagram of a broker apparatus according to an embodiment of the present invention.
3 is a block diagram showing the internal configuration of a broker according to an embodiment of the present invention.
4A and 4B are exemplary diagrams for explaining a method for a broker to store a message bundle and to generate index data for it according to an embodiment of the present invention.
5 is a flowchart illustrating a method of storing a message and generating and storing index data of a message in a broker apparatus according to an embodiment of the present invention.
6 is a flowchart illustrating a message publication/subscription method in a distributed storage-based message storage system according to an embodiment of the present invention.

본 발명의 이점 및 특징, 그리고 그것들을 달성하는 방법은 첨부되는 도면과 함께 상세하게 후술되어 있는 실시예들을 참조하면 명확해질 것이다. 그러나, 본 발명은 이하에서 개시되는 실시예들에 한정되는 것이 아니라 서로 다른 다양한 형태로 구현될 것이며, 단지 본 실시예들은 본 발명의 개시가 완전하도록 하며, 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에게 발명의 범주를 완전하게 알려주기 위해 제공되는 것이며, 본 발명은 청구항의 범주에 의해 정의될 뿐이다. 도면의 설명과 관련하여, 유사한 구성요소에 대해서는 유사한 참조부호가 사용될 수 있다.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 will be implemented in various different forms, and only these embodiments allow the disclosure of the present invention to be complete, and common knowledge in the art to which the present invention pertains It is provided to fully inform those who have the scope of the invention, and the present invention is only defined by the scope of the claims. In connection with the description of the drawings, like reference numerals may be used for like components.

본 문서에서, "가진다," "가질 수 있다," "포함한다," 또는 "포함할 수 있다" 등의 표현은 해당 특징(예: 수치, 기능, 동작, 또는 부품 등의 구성요소)의 존재를 가리키며, 추가적인 특징의 존재를 배제하지 않는다.In this document, expressions such as "has," "may have," "includes," or "may include" refer to the presence of a corresponding characteristic (eg, a numerical value, function, operation, or component such as a part). and does not exclude the presence of additional features.

본 문서에서, "A 또는 B," "A 또는/및 B 중 적어도 하나," 또는 "A 또는/및 B 중 하나 또는 그 이상" 등의 표현은 함께 나열된 항목들의 모든 가능한 조합을 포함할 수 있다. 예를 들면, "A 또는 B," "A 및 B 중 적어도 하나," 또는 "A 또는 B 중 적어도 하나"는, (1) 적어도 하나의 A를 포함, (2) 적어도 하나의 B를 포함, 또는(3) 적어도 하나의 A 및 적어도 하나의 B 모두를 포함하는 경우를 모두 지칭할 수 있다.In this document, expressions such as "A or B," "at least one of A and/and B," or "one or more of A or/and B" may include all possible combinations of the items listed together. . For example, "A or B," "at least one of A and B," or "at least one of A or B" means (1) includes at least one A, (2) includes at least one B; Or (3) it may refer to all cases including both at least one A and at least one B.

본 문서에서 사용된 "제1," "제2," "첫째," 또는 "둘째," 등의 표현들은 다양한 구성요소들을, 순서 및/또는 중요도에 상관없이 수식할 수 있고, 한 구성요소를 다른 구성요소와 구분하기 위해 사용될 뿐 해당 구성요소들을 한정하지 않는다. 예를 들면, 제1 사용자 기기와 제2 사용자 기기는, 순서 또는 중요도와 무관하게, 서로 다른 사용자 기기를 나타낼 수 있다. 예를 들면, 본 문서에 기재된 권리범위를 벗어나지 않으면서 제1 구성요소는 제2 구성요소로 명명될 수 있고, 유사하게 제 2 구성요소도 제1 구성요소로 바꾸어 명명될 수 있다.As used herein, expressions such as "first," "second," "first," or "second," may modify various elements, regardless of order and/or importance, and refer to one element. It is used only to distinguish it from other components, and does not limit the components. For example, the first user equipment and the second user equipment may represent different user equipment regardless of order or importance. For example, without departing from the scope of rights described in this document, the first component may be named as the second component, and similarly, the second component may also be renamed as the first component.

어떤 구성요소(예: 제1 구성요소)가 다른 구성요소(예: 제2 구성요소)에 "(기능적으로 또는 통신적으로) 연결되어((operatively or communicatively) coupled with/to)" 있다거나 "접속되어(connected to)" 있다고 언급된 때에는, 상기 어떤 구성요소가 상기 다른 구성요소에 직접적으로 연결되거나, 다른 구성요소(예: 제3 구성요소)를 통하여 연결될 수 있다고 이해되어야 할 것이다. 반면에, 어떤 구성요소(예: 제1 구성요소)가 다른 구성요소(예: 제2 구성요소)에 "직접 연결되어" 있다거나 "직접 접속되어" 있다고 언급된 때에는, 상기 어떤 구성요소와 상기 다른 구성요소 사이에 다른 구성요소(예: 제3 구성요소)가 존재하지 않는 것으로 이해될 수 있다.A component (eg, a first component) is "coupled with/to (operatively or communicatively)" to another component (eg, a second component) When referring to "connected to", it will be understood that the certain element may be directly connected to the other element or may be connected through another element (eg, a third element). On the other hand, when it is said that a component (eg, a first component) is "directly connected" or "directly connected" to another component (eg, a second component), the component and the It may be understood that other components (eg, a third component) do not exist between other components.

본 문서에서 사용된 표현 "~하도록 구성된(또는 설정된)(configured to)"은 상황에 따라, 예를 들면, "~에 적합한(suitable for)," "~하는 능력을 가지는(having the capacity to)," "~하도록 설계된(designed to)," "~하도록 변경된(adapted to)," "~하도록 만들어진(made to)," 또는 "~ 를 할 수 있는(capable of)"과 바꾸어 사용될 수 있다. 용어 "~하도록 구성된(또는 설정된)"은 하드웨어적으로 "특별히 설계된(specifically designed to)" 것만을 반드시 의미하지 않을 수 있다. 대신, 어떤 상황에서는, "~하도록 구성된 장치"라는 표현은, 그 장치가 다른 장치 또는 부품들과 함께 "~할 수 있는" 것을 의미할 수 있다. 예를 들면, 문구 "A, B, 및 C를 수행하도록 구성된(또는 설정된)프로세서"는 해당 동작을 수행하기 위한 전용 프로세서(예: 임베디드 프로세서), 또는 메모리 장치에 저장된 하나 이상의 소프트웨어 프로그램들을 실행함으로써, 해당 동작들을 수행할 수 있는 범용 프로세서(generic-purpose processor)(예: CPU 또는 application processor)를 의미할 수 있다.As used herein, the expression "configured to (or configured to)" depends on the context, for example, "suitable for," "having the capacity to ," "designed to," "adapted to," "made to," or "capable of." The term “configured (or configured to)” may not necessarily mean only “specifically designed to” in hardware. Instead, in some circumstances, the expression “a device configured to” may mean that the device is “capable of” with other devices or parts. For example, the phrase “a processor configured (or configured to perform) A, B, and C” refers to a dedicated processor (eg, an embedded processor) for performing the operations, or by executing one or more software programs stored in a memory device. , may mean a generic-purpose processor (eg, a CPU or an application processor) capable of performing corresponding operations.

본 문서에서 사용된 용어들은 단지 특정한 실시 예를 설명하기 위해 사용된 것으로, 다른 실시예의 범위를 한정하려는 의도가 아닐 수 있다. 단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수의 표현을 포함할 수 있다. 기술적이거나 과학적인 용어를 포함해서 여기서 사용되는 용어들은 본 문서에 기재된 기술분야에서 통상의 지식을 가진 자에 의해 일반적으로 이해되는 것과 동일한 의미를 가질 수 있다. 본 문서에 사용된 용어들 중 일반적인 사전에 정의된 용어들은, 관련 기술의 문맥상 가지는 의미와 동일 또는 유사한 의미로 해석될 수 있으며, 본 문서에서 명백하게 정의되지 않는 한, 이상적이거나 과도하게 형식적인 의미로 해석되지 않는다. 경우에 따라서, 본 문서에서 정의된 용어일지라도 본 문서의 실시 예들을 배제하도록 해석될 수 없다.Terms used in this document are only used to describe specific embodiments, and may not be intended to limit the scope of other embodiments. The singular expression may include the plural expression unless the context clearly dictates otherwise. Terms used herein, including technical or scientific terms, may have the same meanings as commonly understood by one of ordinary skill in the art described in this document. Among the terms used in this document, terms defined in a general dictionary may be interpreted with the same or similar meaning as the meaning in the context of the related art, and unless explicitly defined in this document, ideal or excessively formal meanings is not interpreted as In some cases, even terms defined in this document cannot be construed to exclude embodiments of this document.

본 발명의 여러 실시예들의 각각 특징들이 부분적으로 또는 전체적으로 서로 결합 또는 조합 가능하며, 당업자가 충분히 이해할 수 있듯이 기술적으로 다양한 연동 및 구동이 가능하며, 각 실시예들이 서로에 대하여 독립적으로 실시 가능할 수도 있고 연관 관계로 함께 실시 가능할 수도 있다.Each feature of the various embodiments of the present invention may be partially or wholly combined or combined with each other, and technically various interlocking and driving are possible, as will be fully understood by those skilled in the art, and each embodiment may be independently implemented with respect to each other, It may be possible to implement together in a related relationship.

본 명세서에서, 메시지 큐(Message Queue)는 메시지 지향 미들웨어(Message Oriented Middleware, MOM)를 구현한 시스템을 의미할 수 있다.In the present specification, a message queue may refer to a system in which a message-oriented middleware (MOM) is implemented.

본 명세서에서, 프로듀서(producer)는 메시지를 작성하여 전달하는 송신자일 수 있다.In this specification, a producer may be a sender who composes and delivers a message.

본 명세서에서, 컨슈머(consumer)는 작성된 메시지를 가져오는 수신자일 수 있다.In the present specification, a consumer may be a receiver who brings a written message.

본 명세서에서, 토픽(topic)은 주고받는 메시지를 분류하기 위한 메시지 큐 ID를 의미할 수 있다. 프로듀서는 특정 토픽을 지정하여 토픽에 메시지를 작성하고, 컨슈머는 작성된 메시지를 읽음으로서, 프로듀서 및 컨슈머는 메시지를 서로 주고받을 수 있다.In the present specification, a topic may mean a message queue ID for classifying messages sent and received. The producer designates a specific topic and writes a message to the topic, and the consumer reads the written message, so that the producer and the consumer can exchange messages with each other.

본 명세서에서, 파티션(partition)은 토픽 내에 하나 이상으로 구성되는 스케일 아웃(Scale-out)의 기본 단위로서, 파티션 내에 메시지별로 메시지의 상대적 위치를 나타내는 오프셋(offset)이 존재할 수 있다.In the present specification, a partition is a basic unit of scale-out composed of one or more within a topic, and an offset indicating a relative position of a message for each message in the partition may exist.

이하, 첨부된 도면을 참조하여 본 발명의 다양한 실시예들을 상세히 설명한다.Hereinafter, various embodiments of the present invention will be described in detail with reference to the accompanying drawings.

도 1은 본 발명의 실시예에 따른 분산 스토리지 기반 메시지 저장 시스템의 개략도이다.1 is a schematic diagram of a distributed storage-based message storage system according to an embodiment of the present invention.

도 1을 참조하면, 분산 스토리지 기반 메시지 저장 시스템(100)은 메시지 매개자(예: 브로커(broker))를 통해 송신자가 메시지를 발행하고, 수신자가 이를 구독하는 방식의 발행-구독 기반의 메시지 큐잉 시스템(Message Queuing System)으로서, 클라이언트 장치(120)로부터 전달된 메시지를 클러스터 서버(cluster server)(130)에 분산 저장하는 브로커 장치(110), 메시지를 전달하거나, 가져오는 클라이언트 장치(120) 및 메시지를 분산 저장하는 클러스터 서버(130)를 포함한다.Referring to FIG. 1 , the distributed storage-based message storage system 100 is a publish-subscribe-based message queuing system in which a sender publishes a message through a message intermediary (eg, a broker) and a receiver subscribes to it. As (Message Queuing System), the broker device 110 that distributes and stores the message delivered from the client device 120 to the cluster server 130, the client device 120 that delivers or gets the message, and the message It includes a cluster server 130 for distributed storage.

먼저, 브로커 장치(110)는 송신자와 수신자 사이의 메시지를 중계하는 적어도 하나의 메시지 브로커가 설치된 서버로서, 아파치 카프카(Apache KAFKA), 아마존 웹 서비스 심플 큐 서비스(Amazon Web Service Simple Queue Service), 아파치 ActiveMQ, Comverse Message Broker, 오픈 메시지 큐, RabbitMQ 등과 같은 다양한 메시지 브로커가 이용될 수 있으나, 이에 한정되지 않는다.First, the broker device 110 is a server in which at least one message broker for relaying messages between a sender and a receiver is installed, Apache KAFKA, Amazon Web Service Simple Queue Service (Amazon Web Service Simple Queue Service), Apache Various message brokers such as ActiveMQ, Comverse Message Broker, Open Message Queue, RabbitMQ, etc. may be used, but are not limited thereto.

구체적으로, 브로커 장치(110)는 송신자에 해당하는 프로듀서(122)에 의해서 발행된 메시지 묶음(예: 레코드 세트(record set), 뱃치(batch))을 클러스터 서버(130)에 저장하고, 컨슈머(124)의 요청에 따라 메시지 묶음을 컨슈머(124)로 전달할 수 있다. 이러한 브로커 장치(110)는 복수 개의 브로커가 포함되는 클러스터로서 구현될 수 있으나, 이에 한정되지 않는다.Specifically, the broker device 110 stores the message bundle (eg, record set, batch) issued by the producer 122 corresponding to the sender in the cluster server 130, and the consumer ( At the request of 124 , the message bundle may be delivered to the consumer 124 . Such a broker device 110 may be implemented as a cluster including a plurality of brokers, but is not limited thereto.

클라이언트 장치(120)와의 메시지 송수신을 위해 브로커 장치(110)는 발행-구독 기반 메시지 프로토콜을 이용할 수 있고, 클러스터 서버(130)와의 통신을 위해 분산 스토리지 기반 메시지 프로토콜을 이용할 수 있다. 예를 들어, 발행-구독 기반 메시지 프로토콜은 카프카 프로토콜일 수 있고, 분산 스토리지 기반 메시지 프로토콜은 Ceph 프로토콜일 수 있으나, 이에 한정되지 않는다. For sending and receiving messages to and from the client device 120 , the broker device 110 may use a publish-subscribe based message protocol, and may use a distributed storage based message protocol for communication with the cluster server 130 . For example, the publish-subscribe based message protocol may be the Kafka protocol, and the distributed storage based message protocol may be the Ceph protocol, but is not limited thereto.

메시지 발행 시 프로듀서(122)는 특정 토픽을 지정하며, 지정된 토픽에 해당하는 메시지를 작성하고, 작성된 메시지를 메시지 브로커인 브로커 장치(110)에 전달한다. 메시지를 수신한 브로커 장치(110)는 수신된 메시지에 대한 인덱스 데이터를 생성하고, 생성된 인덱스 데이터 및 메시지의 실제 데이터를 클러스터 서버(130)에 저장할 수 있다. 여기서, 인덱스 데이터는 클러스터 서버(130)에 저장되는 실제 데이터의 ID 및 저장 위치를 포함할 수 있다.When issuing a message, the producer 122 designates a specific topic, writes a message corresponding to the specified topic, and delivers the created message to the broker device 110 as a message broker. The broker device 110 receiving the message may generate index data for the received message, and store the generated index data and actual data of the message in the cluster server 130 . Here, the index data may include an ID and a storage location of actual data stored in the cluster server 130 .

클러스터 서버(130)에 저장되는 인덱스 데이터 및 실제 데이터는 토픽으로 분류되고, 토픽은 여러 개의 파티션으로 구분될 수 있다. 파티션 내에는 메시지의 상대적 위치를 나타내는 오프셋이 존재하며, 이 오프셋을 이용하여 실제 데이터의 인덱스 데이터를 생성할 수 있다.Index data and actual data stored in the cluster server 130 may be classified into topics, and topics may be divided into several partitions. An offset indicating the relative position of a message exists in the partition, and index data of actual data can be created using this offset.

파티션은 저장될 시 세그먼트(segment) 단위로 저장되며, 각 세그먼트의 파일명은 세그먼트 내에 존재하는 첫번째 메시지의 오프셋으로 지정될 수 있다. 해당 파티션이 생성될 시 0번 세그먼트가 생성되며, 세그먼트별로 메시지가 기록되다가 기 설정된 세그먼트의 최대 용량에 도달하면 새로운 세그먼트가 생성되어 해당 세그먼트에 메시지가 다시 기록될 수 있다.When a partition is saved, it is saved in units of segments, and the file name of each segment may be designated as an offset of the first message existing in the segment. When a corresponding partition is created, segment 0 is created, and messages are recorded for each segment, and when the maximum capacity of a preset segment is reached, a new segment is created and a message can be recorded again in the corresponding segment.

상술한 방식으로 메시지를 저장하기 위해 브로커 장치(110)는 메시지별로 할당된 오프셋을 이용하여 인덱스 데이터를 생성하고, 클러스터 서버(130)에 저장된 실제 데이터의 ID 및 저장 위치를 생성된 인덱스 데이터에 기록할 수 있다.In order to store the message in the above manner, the broker device 110 generates index data using the offset allocated for each message, and records the ID and storage location of the actual data stored in the cluster server 130 in the created index data. can do.

브로커 장치(110)는 캐시를 가지며, 클러스터 서버(130)에 저장된 인덱스 데이터 묶음 및 실제 데이터 묶음의 일부를 캐시에 저장할 수 있다. The broker device 110 has a cache, and may store a part of the index data bundle and the actual data bundle stored in the cluster server 130 in the cache.

이를 통해 본 발명은 원하는 메시지가 클러스터 서버의 어느 위치에 기록되어 있는지 상수 시간으로 확인할 수 있다.Through this, according to the present invention, it is possible to check in a constant time where a desired message is recorded in the cluster server.

이어서, 클라이언트 장치(120)는 메시지를 발행하는 프로듀서(122) 및 메시지를 구독하는 컨슈머(124)를 포함한다.The client device 120 then includes a producer 122 that publishes the message and a consumer 124 that subscribes to the message.

클라이언트 장치(120)는 각 파티션을 담당하는 브로커 장치의 정보를 획득하고, 획득된 정보를 이용하여 메시지 발행/구독을 수행할 수 있다. 이를 위해 클라이언트 장치(120)는 처음 지정해둔 브로커의 주소를 이용하여 해당 브로커에 접속하고, 접속한 브로커로 특정 토픽의 메타 데이터에 대한 조회를 요청할 수 있다. 요청에 대한 응답으로 브로커는 특정 토픽의 파티션 개수, 각 파티션이 어느 브로커에 존재하는지에 대한 정보 및 각 브로커의 주소 등을 포함하는 메타 데이터를 클라이언트 장치(120)로 전달할 수 있다.The client device 120 may obtain information on a broker device in charge of each partition, and use the obtained information to publish/subscribe a message. To this end, the client device 120 may access the corresponding broker by using the address of the first designated broker, and may request an inquiry for metadata of a specific topic from the connected broker. In response to the request, the broker may transmit metadata including the number of partitions of a specific topic, information on which broker each partition exists in, and the address of each broker, to the client device 120 .

이러한 응답을 이용하여 클라이언트 장치(120)는 각 파티션을 담당하는 브로커에 접속하여 파티션 관련 작업(예: write/read)을 수행할 수 있다.Using this response, the client device 120 may access a broker in charge of each partition and perform partition-related operations (eg, write/read).

다음으로, 클러스터 서버(130)는 분산 스토리지 기반 저장 서버로서, 메시지 및 메시지의 메타 데이터를 저장하고, 저장된 메시지 및 메타 데이터를 읽기/쓰기 가능한 인터페이스를 제공할 수 있다. 예를 들어, 클러스터 서버(130)는 Ceph 기반의 클러스터 서버일 수 있으나, 이에 한정되지 않는다.Next, as a distributed storage-based storage server, the cluster server 130 may store messages and meta data of messages and provide an interface capable of reading/writing the stored messages and meta data. For example, the cluster server 130 may be a Ceph-based cluster server, but is not limited thereto.

구체적으로, 클러스터 서버(130)는 브로커 장치(110)에 의해 인덱스 데이터 묶음 및 메시지(즉, 실제 데이터) 묶음을 데이터 오브젝트 형태로 저장할 수 있다. 예를 들어, 인덱스 데이터는 인덱스 오브젝트로, 메시지 묶음은 데이터 오브젝트로서 저장될 수 있다. 이러한 경우 인덱스 오브젝트는 인덱스 오브젝트 ID를 가지고, 데이터 오브젝트는 데이터 오브젝트 ID를 가질 수 있다. 또한, 인덱스 오브젝트는 데이터 오브젝트의 ID 및 해당 데이터 오브젝트가 저장되는 위치가 기록될 수 있다.Specifically, the cluster server 130 may store the index data bundle and the message (ie, real data) bundle in the form of a data object by the broker device 110 . For example, index data may be stored as an index object, and message bundles may be stored as a data object. In this case, the index object may have an index object ID, and the data object may have a data object ID. Also, in the index object, the ID of the data object and the location where the corresponding data object is stored may be recorded.

클러스터 서버(130)는 적어도 하나의 오브젝트 저장부를 포함하고, 적어도 하나의 오브젝트 저장부 중 인덱스 오브젝트 및 데이터 오브젝트를 저장하고자 하는 오브젝트 저장부를 결정하고, 결정된 오브젝트 저장부에 인덱스 오브젝트 및 데이터 오브젝트를 저장할 수 있다. 예를 들어, 오브젝트 저장부는 OSD(Object Storage Daemon)일 수 있으나, 이에 한정되지 않는다. The cluster server 130 may include at least one object storage unit, determine an object storage unit to store an index object and a data object among the at least one object storage unit, and store the index object and data object in the determined object storage unit. have. For example, the object storage unit may be an object storage daemon (OSD), but is not limited thereto.

다양한 실시예에서 클러스터 서버(130)는 인덱스 오브젝트 및 데이터 오브젝트의 복제 데이터를 저장할 수 있다. 예를 들어, 복제 데이터의 개수가 3개로 설정된 경우 클러스터 서버(130)는 각 오브젝트에 따라 3개의 오브젝트 저장부를 할당하고, 할당된 3개의 오브젝트 저장부에 원본 오브젝트(예: 원본 인덱스 오브젝트 및 원본 데이터 오브젝트)와, 2개의 복제 오브젝트(예: 복제 인덱스 오브젝트 및 복제 데이터 오브젝트)를 각각 저장할 수 있다. In various embodiments, the cluster server 130 may store duplicate data of the index object and the data object. For example, when the number of duplicate data is set to 3, the cluster server 130 allocates three object storage units according to each object, and allocates original objects (eg, an original index object and original data to the three allocated object storage units). object) and two duplicate objects (eg, a duplicate index object and a duplicate data object).

이를 통해 본 발명은 데이터의 물리적 근접성을 조정함으로써, 장애에 대비할 수 있다. Through this, the present invention can prepare for failure by adjusting the physical proximity of data.

또한, 본 발명은 클러스터 서버를 통해 복제 데이터를 저장함으로써, 필요 이상의 복제 데이터를 생성하지 않으므로, 복제 데이터를 저장하기 위한 용량을 줄이면서, 네트워크 트래픽을 감소시킬 수 있다.In addition, since the present invention does not generate duplicate data more than necessary by storing duplicate data through the cluster server, it is possible to reduce network traffic while reducing the capacity for storing duplicate data.

하기에서는 브로커 장치(110)에 대해서 도 2를 참조하여 상세하게 살펴보도록 한다.Hereinafter, the broker apparatus 110 will be described in detail with reference to FIG. 2 .

도 2는 본 발명의 실시예에 따른 브로커 장치에 대한 개략도이다.2 is a schematic diagram of a broker apparatus according to an embodiment of the present invention.

도 2를 참조하면, 브로커 장치(200)는 통신부(210), 저장부(220) 및 제어부(230)를 포함한다. 제시된 실시예에서 브로커 장치(200)는 도 1의 브로커 장치(110)를 의미할 수 있다.Referring to FIG. 2 , the broker apparatus 200 includes a communication unit 210 , a storage unit 220 , and a control unit 230 . In the presented embodiment, the broker apparatus 200 may refer to the broker apparatus 110 of FIG. 1 .

통신부(210)는 브로커 장치(200)가 외부 장치와 통시 가능하도록 연결한다. 통신부(210)는 유선 또는 무선 통신을 이용하여 클라이언트 장치(120) 및 클러스터 서버(130)와 연결될 수 있다. 구체적으로, 통신부(210)는 프로듀서(122)로부터 발행된 메시지 묶음을 수신하고, 컨슈머(124)에 의해서 요청된 메시지가 포함된 메시지 묶음을 컨슈머(124)로 전달할 수 있다. 또한 통신부(210)는 인덱스 데이터 및 수신된 메시지 묶음을 클러스터 서버(130)로 전달할 수 있다. 예를 들어, 통신부(210)는 클라이언트 장치(120)와 발행-구독 기반 프로토콜을 이용하여 통신을 수행하고, 클러스터 서버(130)와 분산 스토리지 기반 프로토콜을 이용하여 통신을 수행할 수 있다.The communication unit 210 connects the broker device 200 to communicate with an external device. The communication unit 210 may be connected to the client device 120 and the cluster server 130 using wired or wireless communication. Specifically, the communication unit 210 may receive the message bundle issued from the producer 122 and deliver the message bundle including the message requested by the consumer 124 to the consumer 124 . Also, the communication unit 210 may transmit the index data and the received message bundle to the cluster server 130 . For example, the communication unit 210 may communicate with the client device 120 using a publish-subscribe-based protocol, and may communicate with the cluster server 130 using a distributed storage-based protocol.

저장부(220)는 프로듀서(122)에 의해서 발행된 메시지를 클러스터 서버(130)에 저장하고, 컨슈머(124)의 요청에 따라 메시지를 컨슈머(124)로 전달하기 위해 사용되는 다양한 데이터를 저장할 수 있다. The storage unit 220 stores the message issued by the producer 122 in the cluster server 130, and can store various data used to deliver the message to the consumer 124 according to the request of the consumer 124. have.

다양한 실시예에서 저장부(220)는 플래시 메모리 타입(flash memory type), 하드디스크 타입(hard disk type), 멀티미디어 카드 마이크로 타입(multimedia card micro type), 카드 타입의 메모리(예를 들어 SD 또는 XD 메모리 등), 램(Random Access Memory, RAM), SRAM(Static Random Access Memory), 롬(Read-Only Memory, ROM), EEPROM(Electrically Erasable Programmable Read-Only Memory), PROM(Programmable Read-Only Memory), 자기 메모리, 자기 디스크, 광디스크 중 적어도 하나의 타입의 저장매체를 포함할 수 있다. 브로커 장치(200)는 인터넷(internet)상에서 상기 저장부(220)의 저장 기능을 수행하는 웹 스토리지(web storage)와 관련되어 동작할 수도 있다.In various embodiments, the storage unit 220 may include a flash memory type, a hard disk type, a multimedia card micro type, and a card type memory (eg, SD or XD). memory, etc.), Random Access Memory (RAM), Static Random Access Memory (SRAM), Read-Only Memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Programmable Read-Only Memory (PROM) , a magnetic memory, a magnetic disk, and an optical disk may include at least one type of storage medium. The broker device 200 may operate in relation to a web storage that performs a storage function of the storage unit 220 on the Internet.

제어부(230)는 통신부(210) 및 저장부(220)와 동작 가능하게 연결되며, 프로듀서(122)에 의해서 발행된 메시지를 클러스터 서버(130)에 저장하고, 컨슈머(124)의 요청에 따라 메시지를 컨슈머(124)로 전달하기 위한 다양한 명령들을 수행할 수 있다.The control unit 230 is operatively connected to the communication unit 210 and the storage unit 220 , and stores the message issued by the producer 122 in the cluster server 130 , and according to the request of the consumer 124 , the message It is possible to perform various commands to transmit to the consumer 124 .

구체적으로, 프로듀서(122)에 의해서 발행된 메시지가 전달되면 제어부(230)는 해당 메시지에 대응하여 할당된 오프셋을 이용하여 해당 메시지에 대한 인덱스 데이터를 생성하고, 생성된 인덱스 데이터 및 해당 메시지를 클러스터 서버(130)에 저장할 수 있다. 여기서, 인덱스 데이터 생성은 메시지 저장 이후에 수행될 수 있으나, 이에 한정되지 않으며, 거의 동시에 이루어질 수도 있다. Specifically, when the message issued by the producer 122 is delivered, the control unit 230 generates index data for the corresponding message by using the offset allocated to the corresponding message, and clusters the generated index data and the corresponding message. It may be stored in the server 130 . Here, the index data generation may be performed after message storage, but is not limited thereto, and may be performed almost simultaneously.

인덱스 데이터를 생성하기 위해 제어부(230)는 메시지에 할당된 오프셋 중 일부 오프셋 값을 이용하여 인덱스 데이터의 식별 정보(즉, ID)를 생성하고, 오프셋 중 나머지 오프셋 값을 실제 데이터의 식별 정보 및 실제 데이터가 저장된 저장 위치를 기록하기 위한 인덱스 데이터의 저장 위치로서 이용할 수 있다.In order to generate the index data, the controller 230 generates identification information (ie, ID) of the index data by using some of the offset values of the offsets allocated to the message, and sets the remaining offset values of the offsets to the identification information of the actual data and the actual value. It can be used as a storage location of index data for recording a storage location where data is stored.

예를 들어, 메시지에 대응하여 할당된 오프셋이 64bit로 이루어진 경우 제어부(230)는 64bit 중 44bit에 해당하는 오프셋 값을 이용하여 인덱스 오브젝트 ID를 생성하고, 나머지 20bit에 해당하는 오프셋 값을 실제 데이터의 ID 및 저장 위치를 기록하는 인덱스 오브젝트의 위치로서 이용할 수 있다. 다시 말해서, 해당 인덱스 오브젝트 ID를 가지는 인덱스 오브젝트의 위치에는 실제 데이터에 해당하는 데이터 오브젝트의 ID와 해당 데이터 오브젝트가 저장된 위치가 기록될 수 있다. 이와 같이 생성된 인덱스 오브젝트 및 데이터 오브젝트는 클러스터 서버(130)에 저장될 수 있다.For example, if the offset allocated in response to the message consists of 64 bits, the controller 230 generates an index object ID using an offset value corresponding to 44 bits among 64 bits, and sets the offset value corresponding to the remaining 20 bits to the actual data. It can be used as the location of the index object that records the ID and storage location. In other words, the ID of the data object corresponding to the actual data and the location where the corresponding data object is stored may be recorded in the position of the index object having the corresponding index object ID. The index object and data object generated in this way may be stored in the cluster server 130 .

다양한 실시예에서 제어부(230)는 클러스터 서버(130)에 저장된 인덱스 데이터 및 메시지 중 일부를 캐시에 저장할 수 있다. 여기서, 캐시는 인덱스 데이터 묶음 및 실제 데이터 묶음에 대한 적어도 일부를 저장하는데, 제어부(230)에 포함되거나, 제어부(230)와 메모리(220) 사이에 위치하도록 구현될 수 있으나, 이에 한정되지 않는다.In various embodiments, the controller 230 may store some of the index data and messages stored in the cluster server 130 in the cache. Here, the cache stores at least a portion of the index data bundle and the actual data bundle, and may be implemented to be included in the control unit 230 or located between the control unit 230 and the memory 220 , but is not limited thereto.

컨슈머(124)에 의해 메시지에 대한 구독이 요청되면 제어부(230)는 오프셋을 이용하여 구독 요청된 메시지를 확인하고, 확인된 메시지를 컨슈머(124)로 전달할 수 있다. When a subscription to a message is requested by the consumer 124 , the controller 230 may check the subscription-requested message using the offset, and transmit the confirmed message to the consumer 124 .

일반적으로, 오프셋은 컨슈머 그룹 단위로 파티션을 어디까지 읽었는지에 대한 정보를 포함하고, 브로커(200)에 저장된다. 다시 말해서, 오프셋은 특정 컨슈머 그룹이 특정 파티션의 몇 번째 메시지까지 읽었는지를 나타낼 수 있다. 이에 따라, 구독 요청된 메시지는 컨슈머(124)가 속하는 컨슈머 그룹이 읽어야 하는 특정 파티션 내의 메시지일 수 있다.In general, the offset includes information on how far the partition has been read in units of consumer groups, and is stored in the broker 200 . In other words, the offset may indicate how many messages of a specific partition have been read by a specific group of consumers. Accordingly, the subscription-requested message may be a message within a specific partition to be read by the consumer group to which the consumer 124 belongs.

제어부(230)는 저장된 오프셋을 이용하여 컨슈머(124)가 읽어야 하는 메시지가 캐시에 저장되어 있는지를 확인하거나, 클러스터 서버(130)에 저장되어 있는지를 확인할 수 있다.The controller 230 may check whether a message to be read by the consumer 124 is stored in the cache or stored in the cluster server 130 using the stored offset.

해당 메시지가 캐시에 저장된 경우 제어부(230)는 해당 메시지를 컨슈머(124)로 전달할 수 있다. 다시 말해서, 구독 요청된 메시지가 캐시에 저장된 경우 컨슈머(124)는 브로커 장치(200)에 접근하여 브로커 장치(200)의 캐시에 저장된 메시지에 대한 읽기를 수행할 수 있다.When the corresponding message is stored in the cache, the controller 230 may deliver the corresponding message to the consumer 124 . In other words, when the subscription-requested message is stored in the cache, the consumer 124 may access the broker device 200 to read the message stored in the cache of the broker device 200 .

해당 메시지가 클러스터 서버(130)에 저장된 경우 제어부(230)는 해당 메시지를 클러스터 서버(130)로 요청하고, 클러스터 서버(130)로부터 메시지가 수신되면 수신된 메시지를 컨슈머(124)로 전달할 수 있다. 다시 말해서, 구독 요청된 메시지가 클러스터 서버(130)에 저장된 경우 컨슈머(124)는 브로커 장치(200)에 접근하여 클러스터 서버(130)에 저장된 메시지에 대한 읽기를 수행할 수 있다.When the corresponding message is stored in the cluster server 130, the control unit 230 requests the corresponding message to the cluster server 130, and when the message is received from the cluster server 130, the received message can be delivered to the consumer 124. . In other words, when the subscription-requested message is stored in the cluster server 130 , the consumer 124 may access the broker device 200 to read the message stored in the cluster server 130 .

다양한 실시예에서 제어부(230)는 파티션 관련 작업(예: 메시지 쓰기/읽기) 및 메타 데이터 관련 작업(예: 토픽 조회, 파티션에 할당된 브로커 정보 조회, 컨슈머 그룹 코디네이터 브로커 조회, 컨슈머 그룹 가입, 컨슈머 그룹 동기화, 브로커가 지원하는 API 버전 목록 등)을 수행할 수 있다. 이러한 작업을 수행하기 위해 제어부(230)는 클라이언트 장치(120)의 요청에 의한 동작 및 타이머 등과 같은 내부 스케줄러에 의한 동작을 수행할 수 있다.In various embodiments, the control unit 230 controls partition-related operations (eg, message writing/reading) and metadata-related operations (eg, topic inquiry, broker information inquiry assigned to a partition, consumer group coordinator broker inquiry, consumer group subscription, consumer group synchronization, list of API versions supported by the broker, etc.). In order to perform such a task, the controller 230 may perform an operation according to a request of the client device 120 and an operation by an internal scheduler such as a timer.

예를 들어, 제어부(230)는 클라이언트 장치(120)로부터 메시지 발행을 위해 각 파티션에 할당된 브로커에 대한 정보를 요청하는 메시지를 수신하고, 이에 따라 파티션별 할당된 브로커에 대한 정보를 클라이언트 장치(120)로 전달할 수 있다. 이러한 브로커 정보는 특정 토픽의 파티션 개수, 각 파티션이 존재하는 브로커, 및 각 브로커의 주소 등 중 적어도 하나를 포함할 수 있다.For example, the control unit 230 receives a message requesting information on a broker assigned to each partition for issuing a message from the client device 120, and accordingly transmits information on the broker assigned for each partition to the client device ( 120) can be transferred. Such broker information may include at least one of the number of partitions of a specific topic, a broker in which each partition exists, and an address of each broker.

이를 통해 본 발명은 대규모의 메시지를 클러스터 서버에 저장하고, 브로커 장치가 클러스터 서버에 저장된 메시지에 접근하기 위한 인터페이스를 제공함으로써, 메시지 처리 및 저장을 위해 소모되는 시간 및 비용을 줄일 수 있다. Through this, the present invention stores a large-scale message in the cluster server and provides an interface for the broker device to access the message stored in the cluster server, thereby reducing the time and cost consumed for message processing and storage.

하기에서는 클라이언트 장치(120)의 요청에 의한 브로커의 동작 및 타이머 등과 같은 내부 스케줄러에 의한 브로커의 동작에 대해서 도 3을 참조하여 구체적으로 설명하도록 한다. Hereinafter, the operation of the broker at the request of the client device 120 and the operation of the broker by the internal scheduler such as a timer will be described in detail with reference to FIG. 3 .

도 3은 본 발명의 실시예에 따른 브로커의 내부 구성을 나타내는 블록도이다.3 is a block diagram showing the internal configuration of a broker according to an embodiment of the present invention.

브로커(300)는 클라이언트 장치(120)로부터 메시지를 수신하거나, 클라이언트 장치(120)로 메시지를 전달하고, 클러스터 서버(130)에 접근하여 메시지를 가져오거나, 메시지를 저장하는 인터페이스 역할을 수행한다. 이러한 브로커(300)는 복수개로 구현되어 클러스터를 형성할 수 있다.The broker 300 receives a message from the client device 120 , or transmits the message to the client device 120 , accesses the cluster server 130 to retrieve the message, or serves as an interface for storing the message. A plurality of such brokers 300 may be implemented to form a cluster.

도 3을 참조하면, 브로커(300)는 리액터 레이어(reactor layer)(302) 및 태스크 레이어(task layer)(304)를 포함한다. 여기서, 리액터는 일종의 이벤트 루프 스레드(event loop thread)로서, 기본적으로 CPU 개수만큼 생성될 수 있다. 이러한 리액터는 개별 CPU 코어(core)에 고정되어 코어별로 1개씩 존재할 수 있다. Referring to FIG. 3 , the broker 300 includes a reactor layer 302 and a task layer 304 . Here, the reactor is a kind of event loop thread, and may be basically created as many as the number of CPUs. Such a reactor may be fixed to an individual CPU core, and there may be one for each core.

리액터 레이어(302)는 CPU 코어별로 고정된 리액터(306), 및 리액터(306) 간의 통신을 위해 리액터 태스크 큐(Reactor Task Queue)(308)를 포함할 수 있다. 이러한 리액터 레이어(302) 위에 브로커에 의해서 정의되는 모든 태스크가 수행될 수 있다.The reactor layer 302 may include a fixed reactor 306 per CPU core, and a Reactor Task Queue 308 for communication between the reactors 306 . All tasks defined by the broker on this reactor layer 302 can be performed.

태스크 레이어(304)는 클러스터 서버(130)와의 통신을 위해 사용되는 분산 객체 저장소 라이브러리(LIBRADOS)(310), 및 분산 객체 저장소 라이브러리(310)와의 메시지 패싱(passing)을 위한 입출력 스레드(IO Thread)(312)를 포함할 수 있다. The task layer 304 includes a distributed object storage library (LIBRADOS) 310 used for communication with the cluster server 130 , and an input/output thread (IO Thread) for message passing with the distributed object storage library 310 . 312 may be included.

브로커(300)는 분산 객체 저장소 라이브러리(LIBRADOS)(310)를 통해 클러스터 서버(130)에 접근하여 인덱스 데이터 및/또는 메시지를 저장하거나, 가져올 수 있다.The broker 300 may access the cluster server 130 through the distributed object storage library (LIBRADOS) 310 to store or retrieve index data and/or messages.

입출력 스레드(312)는 입출력 작업을 처리하는 분산 객체 저장소 라이브러리(310)와 리액터 간의 연동을 위한 동작을 수행할 수 있다. 구체적으로, 입출력 작업을 위해 파티션 관리부(322)는 각 파티션 내에 존재하는 파티션 로컬 입출력 큐(Partition Local IO Queue)에 입출력 작업을 삽입한다. 이를 통해 입출력 스레드(312)는 파티션 간의 작업을 클러스터 서버(130)에서 수행 가능한 작업으로 만들어 클러스터 서버(130)로 전달할 수 있다.The input/output thread 312 may perform an operation for interworking between the distributed object storage library 310 that processes input/output operations and the reactor. Specifically, for the I/O operation, the partition manager 322 inserts the I/O operation into a Partition Local IO Queue existing in each partition. Through this, the input/output thread 312 may make a task between partitions into a task that can be performed by the cluster server 130 and transmit it to the cluster server 130 .

상술한 작업을 통해 각 파티션에는 현재 트리거 큐에 자신이 등록되어 있는지를 나타내는 플래그(flag) 값이 존재할 수 있다. 이 플래그 값이 비활성화된 경우 각 파티션은 파티션 입출력 트리거 큐(Partition IO Trigger Queue)에 자신을 등록하고 io_wait_flag를 활성화시킨다. Through the above-described operation, each partition may have a flag value indicating whether it is currently registered in the trigger queue. If this flag value is disabled, each partition registers itself in the Partition IO Trigger Queue and activates io_wait_flag.

각 코어에는 특정 시간마다 동작하는 코어 입출력 스케줄러(Core IO Scheduler)가 존재한다. 이 스케줄러는 파티션 입출력 트리거 큐에 기록된 내용을 상수 시간 복잡도로 변환(swap)하여 자신이 파티션에 대한 소유권을 가진 후 기존 큐를 비운다.Each core has a Core IO Scheduler that operates at specific times. This scheduler swaps the contents written to the partition I/O trigger queue to a constant time complexity, and after it takes ownership of the partition, it flushes the existing queue.

코어 입출력 스케줄러는 파티션 입출력 트리거 큐의 내용에 접근하여 파티션의 io_wait_flag를 비활성화시키고, 파티션 로컬 입출력 큐의 내용을 변환하여 새로 만든 메모리 영역에 보관한다. 파티션 입출력 트리거 큐에 등록된 모든 파티션에 대한 상술한 작업이 수행되면 코어 입출력 스케줄러는 입출력 작업을 하나로 묶어 록 프리 큐(Lock-free Queue)로 전달한다.The core I/O scheduler accesses the contents of the partition I/O trigger queue, deactivates the io_wait_flag of the partition, converts the contents of the partition local I/O queue, and stores it in the newly created memory area. When the above-described tasks for all partitions registered in the partition I/O trigger queue are performed, the core I/O scheduler bundles I/O tasks and delivers them to the lock-free queue.

이러한 경우 입출력 스레드(312)는 특정 시간마다 록 프리 큐에 접근하여 입출력 작업 리스트를 받아서 오브젝트 단위의 입출력 명령으로 변환하여 입출력 명령을 클러스터 서버(130)로 전달함으로써, 실질적인 입출력 작업을 수행할 수 있다.In this case, the input/output thread 312 accesses the lock-free queue at specific times, receives the input/output work list, converts it into an object unit input/output command, and transmits the input/output command to the cluster server 130, thereby performing actual input/output work .

한편, 태스크 레이어(304)는 각 리액터에 대응하는 브로커 태스크들이 존재한다. 특히, 0번 리액터에 대응하는 브로커 태스크(314)는 프로토콜 관리부(316), 메타 데이터 관리부(318), 그룹 코디네이터(320) 및 파티션 관리부(322)를 포함한다.Meanwhile, in the task layer 304, broker tasks corresponding to each reactor exist. In particular, the broker task 314 corresponding to reactor 0 includes a protocol manager 316 , a metadata manager 318 , a group coordinator 320 , and a partition manager 322 .

프로토콜 관리부(316)는 클라이언트 장치(120)에 관련된 다양한 동작을 수행한다. 클라이언트 장치(120)의 요청을 처리하기 위해 브로커(300)는 클라이언트 장치(120)의 요청을 처리할 프로토콜 관리부를 호출할 수 있다. 예를 들어, 새로운 클라이언트 장치가 접근하면 브로커(300)는 연결 작업을 통해 새로운 클라이언트 장치와의 연결을 수행한다. 연결된 클라이언트 장치로부터 요청이 수신되면 브로커(300)는 요청에 해당하는 데이터를 파싱(parsing)하고, 파싱된 데이터에 기반하여 클라이언트 장치의 요청을 수행할 프로토콜 관리부(316)를 호출할 수 있다.The protocol manager 316 performs various operations related to the client device 120 . In order to process the request of the client device 120 , the broker 300 may call the protocol manager to process the request of the client device 120 . For example, when a new client device approaches, the broker 300 performs a connection with the new client device through a connection operation. When a request is received from a connected client device, the broker 300 parses data corresponding to the request, and calls the protocol manager 316 to perform the request of the client device based on the parsed data.

이러한 프로토콜 관리부(316)는 클라이언트 장치(120)의 요청에 따라 메타 데이터 관련 작업을 수행하기 위해 메타 데이터 관리부(318)를 호출하거나, 파티션 내부 작업을 수행하기 위해 파티션 관리부(322)를 호출할 수 있다. 예를 들어, 메타 데이터 관리부(318)는 파티션에 할당된 브로커 정보를 조회하는 등과 같은 작업을 수행하고, 파티션 관리부(322)는 메시지 읽기/쓰기 작업을 수행할 수 있다. 여기서, 메타 데이터 관련 작업은 클라이언트 장치(130)의 요청을 처리하는 리액터에서 처리하며, 파티션 관련 작업은 같은 파티션에 대한 명령이 동일한 리액터로 라우팅(routing)되어 처리된다. 이와 같이 같은 파티션에 대한 명령은 항상 동일한 리액터, 즉 CPU 코어에서 처리되므로, 파티션에 대해서 잠금을 하지 않고 처리하여 잠금 비용을 절감할 수 있다.The protocol management unit 316 may call the metadata management unit 318 to perform metadata-related operations according to the request of the client device 120 or the partition management unit 322 to perform partition internal operations. have. For example, the metadata manager 318 may perform an operation such as inquiring information about a broker allocated to a partition, and the partition management unit 322 may perform a message read/write operation. Here, metadata-related tasks are processed by a reactor that processes a request from the client device 130 , and partition-related tasks are processed by routing commands for the same partition to the same reactor. As such, commands for the same partition are always processed in the same reactor, that is, the CPU core, so the lock cost can be reduced by processing without locking the partition.

그룹 코디네이터(320)는 컨슈머 그룹의 균형을 조정하기 위한 동작을 수행할 수 있다. 구체적으로, 그룹 코디네이터(320)는 컨슈머 그룹에 속하는 컨슈머들로부터 자신의 상태를 나타내는 알림을 수신하고, 수신된 알림에 따라 컨슈머 그룹에 대한 리밸런싱(rebalancing)을 수행할 수 있다. 여기서, 리밸런싱은 컨슈머 그룹에 새로운 컨슈머가 추가되거나, 장애로 인해 컨슈머를 사용하지 못하게 된 경우 파티션의 소유권을 분배하는 작업을 의미한다.The group coordinator 320 may perform an operation for adjusting the balance of the consumer group. Specifically, the group coordinator 320 may receive a notification indicating its status from consumers belonging to the consumer group, and perform rebalancing on the consumer group according to the received notification. Here, rebalancing refers to a task of distributing ownership of a partition when a new consumer is added to a consumer group or when a consumer cannot be used due to a failure.

파티션 관리부(322)는 각 메시지에 할당된 오프셋을 이용하여 메시지에 대한 실제 데이터의 ID 및 실제 저장 위치를 포함하는 인덱스 데이터를 생성하고, 생성된 인덱스 데이터 및 실제 데이터를 클러스터 서버(130)에 저장하기 위해 호출될 수 있다. 또한, 파티션 관리부(322)는 컨슈머에 의한 요청에 따라 특정 메시지에 대한 오프셋을 이용하여 특정 메시지의 실제 데이터에 접근하기 위해 호출될 수 있다. 여기서, 특정 메시지는 컨슈머가 속하는 컨슈머 그룹이 읽어야 하는 특정 파티션 내의 메시지일 수 있다.The partition manager 322 generates index data including the ID and actual storage location of the actual data for the message by using the offset assigned to each message, and stores the generated index data and the actual data in the cluster server 130 . can be called to Also, the partition manager 322 may be called to access actual data of a specific message by using an offset for the specific message according to a request by a consumer. Here, the specific message may be a message within a specific partition to be read by the consumer group to which the consumer belongs.

한편, 파티션 관리부(322)는 캐시(324) 및 입출력 관리부(326)를 포함한다. 캐시(324)는 클라이언트 장치(120)로부터 전달된 메시지 묶음 및 이에 대한 인덱스 데이터의 적어도 일부를 저장할 수 있다. 예를 들어, 캐시(324)는 저장 공간이 부족할 경우 가장 최근에 사용하지 않은 항목을 제거하는 LRU 캐시(Least Recently Used Cache)일 수 있으나, 이에 한정되지 않는다. Meanwhile, the partition manager 322 includes a cache 324 and an input/output manager 326 . The cache 324 may store at least a portion of the message bundle delivered from the client device 120 and index data therefor. For example, the cache 324 may be an LRU cache (Least Recently Used Cache) that removes the most recently unused items when the storage space is insufficient, but is not limited thereto.

입출력 관리부(326)는 대량의 입출력 요청을 효율적으로 처리하기 위해 이용될 수 있다. 이를 위해 입출력 관리부(326)는 타이머를 구비할 수 있다. The input/output management unit 326 may be used to efficiently process a large amount of input/output requests. To this end, the input/output management unit 326 may include a timer.

클라이언트 장치(120)의 요청에 따른 작업 이외에 타이머 등과 같은 내부 스케줄러에 의한 동작은 브로커 태스크들 중 하나인 브로커 조정 태스크(328)에 포함된 브로커 상태 관리부(330)를 통해 수행될 수 있다. 이러한 브로커 조정 태스크(328)는 0번 리액터에 의해 수행될 수 있다.In addition to the operation according to the request of the client device 120 , an operation by the internal scheduler such as a timer may be performed through the broker state management unit 330 included in the broker adjustment task 328 , which is one of the broker tasks. This broker coordination task 328 may be performed by Reactor 0.

브로커 상태 관리부(330)는 타이머를 포함하고, 타이머에 의해 0번 CPU에서 자신과 다른 브로커들의 상태 정보를 동기화하는 작업을 수행한다. 구체적으로, 브로커 상태 관리부(330)는 자신의 상태 정보를 입출력 스레드(312) 및 분산 객체 저장소 라이브러리(310)를 통해 클러스터 서버(130)로 전달하고, 다른 브로커로부터 다른 브로커의 상태 정보를 수신할 수 있다. 상태 정보를 전달하는 동작이 특정 횟수 이상 실패하는 경우 브로커 상태 관리부(330)는 브로커(300)에 장애가 발생되었다고 판단하여 모든 작업을 중단할 수 있다. The broker state management unit 330 includes a timer, and performs a task of synchronizing state information of itself and other brokers in CPU 0 by the timer. Specifically, the broker state management unit 330 transmits its state information to the cluster server 130 through the input/output thread 312 and the distributed object storage library 310, and receives the state information of other brokers from other brokers. can When the operation of transmitting the status information fails a certain number of times or more, the broker status management unit 330 may determine that a failure has occurred in the broker 300 and stop all operations.

또한, 다른 브로커로부터 수신되는 다른 브로커의 상태 정보는 마지막 정보 갱신 시간을 포함하는데, 브로커 상태 관리부(330)는 이 시간을 현재 시간과 비교하여 특정 시간 이상 차이가 나면 해당 브로커를 이용할 수 없다고 판단할 수 있다. In addition, the status information of other brokers received from other brokers includes the last information update time, and the broker status management unit 330 compares this time with the current time and determines that the corresponding broker cannot be used if there is a difference of more than a specific time. can

이를 통해 사용 가능한 브로커 정보를 나타내는 클러스터 맵(332)이 생성될 수 있다. 이와 같이 생성된 클러스터 맵(332)은 코어 개수만큼 복사되어 각 코어에 전달되며, 각 코어에서 해당 클러스터 맵이 사용될 수 있다.Through this, a cluster map 332 indicating available broker information may be generated. The cluster map 332 generated in this way is copied as many as the number of cores and transmitted to each core, and the corresponding cluster map may be used in each core.

다양한 실시예에서 브로커(300)는 자원 공유를 최소화하기 위해 파티션별로 담당하는 코어를 할당하고, 담당 코어를 통해 해당 파티션에 대한 작업을 수행할 수 있다. 이와 같이 담당 코어를 결정하는 로직은 “CRC32(PROJECT_ID + TOPIC_NAME + PARTITION_ID) % CPU_COUNT)”일 수 있으나, 이에 한정되지 않는다.In various embodiments, the broker 300 may allocate a responsible core for each partition in order to minimize resource sharing, and perform an operation on the corresponding partition through the responsible core. The logic for determining the core in charge as described above may be “CRC32(PROJECT_ID + TOPIC_NAME + PARTITION_ID) % CPU_COUNT)”, but is not limited thereto.

클라이언트 연결에 대응하여 담당 코어가 지정되어 담당 코어를 통해 클라이언트 장치의 요청을 파싱하는 동작이 수행되므로, 한 클라이언트 장치로부터 동시에 여러 파티션 작업이 요청되면 파티션 관리부(322)는 클라이언트 장치로부터 수신된 요청을 파싱한 후 요청된 여러 파티션 작업들을 파티션별로 분리하여 해당 코어로 라우팅할 수 있다.Since a responsible core is designated in response to a client connection and an operation of parsing a request from a client device is performed through the in charge core, when multiple partition operations are requested from one client device at the same time, the partition manager 322 processes the request received from the client device. After parsing, the requested multiple partition operations can be separated by partition and routed to the corresponding core.

다양한 실시예에서 브로커(300)는 주가적으로 또는 종료 시 특정 파티션에 할당된 담당 브로커에 대한 데이터 포함하는 파티션 메타 데이터를 클러스터 서버(130)로 전달할 수 있다. 이때, 파티션 메타 데이터는 last_ping, start_offset, 및 append_offset 등과 같은 데이터를 저장한다. 이때, 브로커(300)는 파티션 갱신 조건으로 파티션에 대한 소유권이 자신에게 있는지 확인하여 파티션에 대한 소유권이 자신에게 있지 않거나, 다른 브로커에게 있는 경우 장애로 판단하여 파티션에 대한 작업을 중단할 수 있다.In various embodiments, the broker 300 may transmit partition metadata including data for a broker in charge assigned to a specific partition to the cluster server 130 either on a stock price or upon termination. In this case, the partition metadata stores data such as last_ping, start_offset, and append_offset. At this time, the broker 300 may determine whether the ownership of the partition belongs to itself as a partition update condition, and if the ownership of the partition does not belong to itself or to another broker, it may be determined as a failure and the work on the partition may be stopped.

또한, 브로커(300)가 클라이언트 장치(120)로부터 자신의 메모리에 존재하지 않은 파티션에 대한 요청을 수신하면 메타 데이터 관리부(318)는 파티션 부트스트랩(partition bootstrap) 동작을 수행할 수 있다. 예를 들어, 브로커(300)가 다시 시작되면 클라이언트 장치(120)의 첫 요청에 의해 특정 파티션에 할당된 브로커가 존재하더라도 실제 브로커의 메모리 상에 특정 파티션에 대한 정보가 없을 수 있다. Also, when the broker 300 receives a request for a partition that does not exist in its memory from the client device 120 , the metadata manager 318 may perform a partition bootstrap operation. For example, when the broker 300 is restarted, even if a broker allocated to a specific partition by the first request of the client device 120 exists, there may be no information on the specific partition in the actual broker's memory.

이러한 경우 메타 데이터 관리부(318)는 요청된 특정 파티션이 브로커(300)에 할당된 파티션인지를 확인하고, 브로커(300)에 할당된 파티션이 아니면 에러를 반환한다. 이후 브로커(300)에 할당된 파티션의 개수가 최대 개수를 초과하면 메타 데이터 관리부(318)는 메타 데이터의 할당 정보를 삭제하고, 에러를 반환한다. 여기서, 할당 정보는 각 파티션에 할당된 브로커에 대한 정보를 의미한다.In this case, the metadata management unit 318 checks whether the requested specific partition is the partition allocated to the broker 300 , and returns an error if it is not the partition allocated to the broker 300 . Thereafter, when the number of partitions allocated to the broker 300 exceeds the maximum number, the metadata management unit 318 deletes metadata allocation information and returns an error. Here, the allocation information means information on a broker allocated to each partition.

메타 데이터 관리부(318)는 파티션 인스턴스를 생성하여 생성된 파티션 인스턴스 내에 메타 데이터를 기록할 수 있다. 이러한 경우 브로커(300)는 파티션 관련 메타 데이터를 주기적으로 클러스터 서버(130)로 전달할 수 있다.The metadata management unit 318 may create a partition instance and record metadata in the created partition instance. In this case, the broker 300 may periodically deliver partition-related metadata to the cluster server 130 .

이후 파티션 관리부(322)는 append_offset 기준의 인덱스 오브젝트를 불러올 수 있다. 이때, append_offset 기준의 인덱스 오브젝트 이후의 인덱스 오브젝트가 존재하면 파티션 관리부(322)는 기존 파티션을 담당하는 브로커가 비정상으로 종료된 것으로 판단할 수 있다. 이러한 경우 파티션 관리부(322)는 인덱스 오브젝트 전체를 불러와서 실제 append_offset을 획득하고, 획득된 실제 append_offset을 기반으로 자신이 가지고 있던 append_offset을 갱신할 수 있다. Thereafter, the partition manager 322 may call an index object based on append_offset. In this case, if an index object after the append_offset index object exists, the partition manager 322 may determine that the broker in charge of the existing partition is abnormally terminated. In this case, the partition manager 322 may obtain the actual append_offset by calling the entire index object, and update the append_offset it has based on the obtained actual append_offset.

메타 데이터 관리부(318)는 마지막 인덱스 오브젝트의 소유권 메타 데이터를 변경하여 특정 파티션에 대한 소유권을 브로커(300)로 변경할 수 있다. 이러한 동작들이 완료되면 브로커(300)는 클라이언트 장치(120)와의 메시지 관련 작업을 수행할 수 있다.The metadata management unit 318 may change ownership of a specific partition to the broker 300 by changing ownership metadata of the last index object. When these operations are completed, the broker 300 may perform a message related operation with the client device 120 .

다양한 실시예에서 파티션 메타 데이터는 담당 브로커의 ID가 기록될 수 있다. 담당 브로커의 ID가 기록되는 파티션 메타 데이터는 assigned_broker 메타 데이터일 수 있다. 브로커(300)는 파티션 메타 데이터를 이용하여 해당 담당 브로커가 자신인지를 확인한 후 파티션 작업을 수행할 수 있다. 담당 브로커가 자신이 아닌 경우 브로커(300)는 비정상으로 판단하여 파티션 작업을 중단할 수 있다.In various embodiments, the partition metadata may record the ID of the broker in charge. The partition metadata in which the ID of the broker in charge is recorded may be assigned_broker metadata. The broker 300 may perform the partition operation after confirming whether the corresponding broker is itself by using the partition metadata. If the broker in charge is not its own, the broker 300 may determine that it is abnormal and stop the partition operation.

이에 대해서 구체적으로, 파티션의 다음 할당 브로커에 대한 ID는 next_assign_broker 메타 데이터에 기록될 수 있다. 브로커(300)는 next_assign_broker 메타 데이터가 존재하는지를 주기적으로 확인하여 next_assign_broker 메타 데이터가 존재하면 파티션 마이그레이션(partition migration) 동작을 수행할 수 있다.Specifically, the ID for the next allocation broker of the partition may be recorded in next_assign_broker metadata. The broker 300 may periodically check whether the next_assign_broker metadata exists, and when the next_assign_broker metadata exists, a partition migration operation may be performed.

파티션 마이그레이션 동작을 위해 브로커(300)는 쓰기 작업에 대한 요청을 차단하고, 인덱스 오브젝트 및 데이터 오브젝트에 대한 쓰기 입출력 작업이 모두 완료될 때까지 대기할 수 있다. 이후 쓰기 입출력 작업이 완료되면 브로커(300)는 next_assign_broker 메타 데이터에 기록된 브로커 ID를 assigned_broker 메타 데이터에 삽입하고, next_assign_broker 메타 데이터를 삭제할 수 있다. 이후 assigned_broker 메타 데이터에 기록된 브로커 ID를 갖는 브로커에서 파티션 부트스트랩 동작이 수행되면서 파티션 마이그레이션 동작이 종료될 수 있다.For the partition migration operation, the broker 300 may block a request for a write operation and wait until all write input/output operations for the index object and data object are completed. After the write input/output operation is completed, the broker 300 may insert the broker ID recorded in the next_assign_broker metadata into the assigned_broker metadata and delete the next_assign_broker metadata. Thereafter, the partition migration operation may be terminated while the partition bootstrap operation is performed in the broker having the broker ID recorded in the assigned_broker metadata.

특정 파티션에 대하여 담당 브로커가 지정되지 않거나, 특정 파티션의 담당 브로커가 클러스터 맵에 존재하지 않은 경우 브로커(300)는 클라이언트 장치(120)로부터 특정 파티션에 대한 메타 데이터가 요청되면 특정 파티션에, 클러스터 맵에 존재하는 임의의 브로커를 할당하고, 임의의 브로커의 ID를 기록한 메타 데이터를 클라이언트 장치(120)로 제공할 수 있다. 다시 말해서, 브로커(300)는 파티션 부트스트랩 동작을 수행하여 임의의 브로커를 특정 파티션에 할당할 수 있다.If a broker in charge for a specific partition is not specified or a broker in charge of a specific partition does not exist in the cluster map, the broker 300 requests metadata for a specific partition from the client device 120 to the specific partition and the cluster map. It is possible to allocate an arbitrary broker existing in , and provide the client device 120 with metadata recording the ID of the arbitrary broker. In other words, the broker 300 may allocate an arbitrary broker to a specific partition by performing a partition bootstrap operation.

이를 통해 본 발명은 고속 마이그레이션이 가능한 메시지 저장 서비스를 제공할 수 있고, 브로커의 수를 조절하기 위해 소비되는 비용 및 시간을 절감할 수 있다. 또한, 본 발명은 트래픽이 적어지는 경우 다른 브로커로 고속 마이그레이션을 수행하고, 대기 상태의 브로커를 종료함으로써, 컴퓨팅 리소스를 절감시킬 수 있다.Through this, the present invention can provide a message storage service capable of high-speed migration, and can reduce the cost and time consumed for adjusting the number of brokers. In addition, the present invention can reduce computing resources by performing high-speed migration to another broker when traffic is low and terminating the broker in a standby state.

하기에서는 브로커(300)가 메시지 묶음을 클러스터 서버(130)에 저장하고, 이에 대한 인덱스 데이터를 생성하는 방법에 대해서 도 4a 및 도 4b를 참조하여 상세하게 설명하도록 한다.Hereinafter, a method in which the broker 300 stores a message bundle in the cluster server 130 and generates index data therefor will be described in detail with reference to FIGS. 4A and 4B .

도 4a 및 도 4b는 본 발명의 실시예에 따른 브로커가 메시지 묶음을 저장하고, 이에 대한 인덱스 데이터를 생성하는 방법을 설명하기 위한 예시도들이다. 하기에서 설명하는 동작들은 도 3에서 설명한 브로커(300)의 파티션 관리부(322)에 의해서 수행될 수 있다.4A and 4B are exemplary views for explaining a method for a broker to store a message bundle and to generate index data for it according to an embodiment of the present invention. The operations described below may be performed by the partition manager 322 of the broker 300 described with reference to FIG. 3 .

먼저, 프로듀서(122)로부터 메시지 묶음이 전달되면 각 메시지에 오프셋이 할당된다. 각 메시지에 대응하여 할당된 오프셋(record offset)은 64bit의 오프셋 값을 가질 수 있다. 파티션 관리부(322)는 이와 같이 할당된 오프셋을 이용하여 메시지 저장 작업을 수행할 수 있다.First, when a message bundle is delivered from the producer 122, an offset is assigned to each message. An offset (record offset) allocated to each message may have an offset value of 64 bits. The partition manager 322 may perform a message storage operation using the allocated offset as described above.

이를 위해 인덱스 오브젝트 및 데이터 오브젝트와 같은 2가지의 오브젝트 타입이 이용될 수 있다. 여기서, 인덱스 오브젝트는 각 메시지의 실제 데이터가 저장된 위치가 기록되는 오브젝트로서, 16MB의 고정 사이즈를 가지나, 이에 한정되지 않는다. 데이터 오브젝트는 실제 데이터를 의미한다. For this purpose, two object types can be used: an index object and a data object. Here, the index object is an object in which the actual data of each message is stored, and has a fixed size of 16 MB, but is not limited thereto. Data object means actual data.

인덱스 오브젝트 및 데이터 오브젝트는 각각 오브젝트 ID를 가진다. 예를 들어, 인덱스 오브젝트의 ID는 partition.index.[project].[topic].[partition].[base_offset]와 같은 포맷으로 이루어지고, 데이터 오브젝트의 ID는 partition.data.[project].[topic].[partition].[base_offset]와 같은 포맷으로 이루어질 수 있다.The index object and data object each have an object ID. For example, the ID of the index object is in the format partition.index.[project].[topic].[partition].[base_offset], and the ID of the data object is partition.data.[project].[topic ].[partition].[base_offset].

도 3 및 도 4a를 참조하면, 특정 메시지에 대응하여 오프셋(400)이 할당된 경우 파티션 관리부(322)는 64bit의 오프셋 값 중 44bit의 오프셋 값을 인덱스 오브젝트의 base_offset로 이용할 수 있다. 예를 들어, 파티션 관리부(322)는 오프셋 “0000002A10223094” 중 “0000002A102”를 인덱스 오브젝트의 base_offset로 이용할 수 있다. 이러한 경우 인덱스 오브젝트의 ID는 partition.index.[project].[topic].[partition].0000002A102로 결정될 수 있다.Referring to FIGS. 3 and 4A , when an offset 400 is allocated in response to a specific message, the partition manager 322 may use a 44-bit offset value among 64-bit offset values as the base_offset of the index object. For example, the partition manager 322 may use “0000002A102” among the offset “0000002A10223094” as the base_offset of the index object. In this case, the ID of the index object may be determined as partition.index.[project].[topic].[partition].0000002A102.

파티션 관리부(322)는 64bit의 오프셋 값 중 20bit의 오프셋 값을 4비트 왼쪽 시프트 연산(4bit left shift)을 통해 변환하고, 변환된 값을 실제 데이터에 해당하는 데이터 오브젝트의 ID 및 저장 위치를 기록하기 위한 위치값으로 결정할 수 있다. 예를 들어, 오프셋 “0000002A10223094” 중 “203094”를 4비트 왼쪽 시프트 연산을 통해 “230940”으로 변경하고, “0x230940”을 위치값으로 결정할 수 있다. 다시 말해서, 인덱스 오브젝트 ID “partition.index.[project].[topic].[partition].0000002A102”를 가지는 위치값 “0x230940”에는 실제 데이터의 ID 및 저장 위치를 포함하는 인덱스 오브젝트가 존재할 수 있다.The partition management unit 322 converts a 20-bit offset value among 64-bit offset values through a 4-bit left shift operation, and records the converted value with the ID and storage location of the data object corresponding to the actual data. It can be determined as a position value for For example, “203094” among the offset “0000002A10223094” may be changed to “230940” through a 4-bit left shift operation, and “0x230940” may be determined as a position value. In other words, the position value “0x230940” having the index object ID “partition.index.[project].[topic].[partition].0000002A102” may include an index object including an ID of actual data and a storage location.

도 4b의 (a)는 인덱스 오브젝트 묶음을 나타낸다. 해당 인덱스 오브젝트 묶음은 “partition.index.[project].[topic].[partition].0000002A102”와 같은 인덱스 오브젝트 ID를 가진다. 인덱스 오브젝트 각각은 메시지의 실제 데이터에 해당하는 데이터 오브젝트의 ID(Data Object ID) 및 저장 위치(Record Position)가 기록될 수 있다.4B (a) shows an index object bundle. The corresponding index object bundle has an index object ID such as “partition.index.[project].[topic].[partition].0000002A102”. In each index object, an ID (Data Object ID) and a storage location (Record Position) of a data object corresponding to actual data of a message may be recorded.

예를 들어, 인덱스 오브젝트 ID “partition.index.[project].[topic].[partition].0000002A102”를 가지는 인덱스 오브젝트 묶음 중 위치값 “0x230940”에 해당하는 인덱스 오브젝트는 “00000000001F23AA”와 같은 데이터 오브젝트 ID(410)와 “0000000000000210”과 같은 데이터 오브젝트가 저장된 위치 값(420)을 포함할 수 있다.For example, the index object corresponding to the position value “0x230940” among the index object bundle having the index object ID “partition.index.[project].[topic].[partition].0000002A102” is a data object such as “00000000001F23AA” An ID 410 and a data object such as “0000000000000210” may include a stored location value 420 .

도 4b의 (b)는 실제 데이터에 해당하는 데이터 오브젝트 묶음을 나타낸다. 해당 데이터 오브젝트는 “partition.data.[project].[topic].[partition].00000000001F23AA”와 같은 데이터 오브젝트 ID를 가진다. 데이터 오브젝트 각각은 실제 데이터(Record)가 기록(또는 저장)될 수 있다. 예를 들어, 데이터 오브젝트 ID “partition.data.[project].[topic].[partition].00000000001F23AA”를 가지는 데이터 오브젝트 묶음 중 위치값 “0x0210”에 해당하는 데이터 오브젝트는 메시지의 실제 데이터(430)가 기록될 수 있다.4B (b) shows a data object bundle corresponding to actual data. The corresponding data object has a data object ID such as “partition.data.[project].[topic].[partition].00000000001F23AA”. In each of the data objects, actual data (Record) may be recorded (or stored). For example, the data object corresponding to the position value “0x0210” among the data object bundle having the data object ID “partition.data.[project].[topic].[partition].00000000001F23AA” is the actual data of the message (430) can be recorded.

인덱스 오브젝트의 경우 메시지 오프셋을 기반으로 한 고정 사이즈로 생성되지만, 데이터 오브젝트의 경우 가변 사이즈로 생성될 수 있다. 이러한 경우 데이터 오브젝트에 사용되는 base_offset은 브로커가 특정 파티션을 담당했을 당시 다음으로 사용될 append_offset이 기본값으로 설정될 수 있다. 이후 해당 데이터 오브젝트의 용량이 특정 수준에 도달하면 새로운 append_offset이 base_offset으로 설정될 수 있다. An index object is created with a fixed size based on a message offset, but a data object can be created with a variable size. In this case, the base_offset used for the data object can be set as the default append_offset to be used next when the broker is in charge of a specific partition. Afterwards, when the capacity of the corresponding data object reaches a certain level, a new append_offset may be set as the base_offset.

상기와 같은 방법으로 파티션 관리부(322)는 인덱스 오브젝트를 생성하고, 생성된 인덱스 오브젝트 및 데이터 오브젝트를 클러스터 서버(130)에 저장할 수 있다. 이러한 경우 같은 파티션의 메시지라고 하더라도 여러 데이터 오브젝트로서 클러스터 서버(130)에 분산 저장되므로, 데이터를 스트라이핑(striping)하는 효과를 가질 수 있다.As described above, the partition manager 322 may create an index object and store the created index object and data object in the cluster server 130 . In this case, even messages of the same partition are distributed and stored in the cluster server 130 as multiple data objects, so that the data can be striped.

소켓을 통해 컨슈머(124)로부터 메시지 읽기가 요청되면 프로토콜 관리부(316)는 메시지 읽기/쓰기와 같은 파티션 관련 작업을 수행하는 파티션 관리부(322)를 호출할 수 있다. 여기서, 파티션 관리부(322)는 기 저장된 오프셋을 이용하여 해당 오프셋에 대응하는 메시지에 대한 읽기를 수행할 수 있다.When a message read is requested from the consumer 124 through the socket, the protocol manager 316 may call the partition manager 322 to perform a partition-related operation such as reading/writing a message. Here, the partition manager 322 may read a message corresponding to the offset using a pre-stored offset.

구체적으로, 파티션 관리부(322)는 오프셋을 이용하여 캐시(324) 또는 클러스터 서버(130)에 저장된 인덱스 오브젝트 중 메시지 읽기가 요청된 메시지에 해당하는 인덱스 오브젝트를 검색할 수 있다.Specifically, the partition manager 322 may search for an index object corresponding to a message read-requested message among index objects stored in the cache 324 or the cluster server 130 by using the offset.

예를 들어, 해당 메시지의 오프셋이 “180659302548”인 경우 파티션 관리부(322)는 오프셋의 일부인 “0000002A102”에 해당하는 base_offset을 가지는 인덱스 오브젝트를 검색할 수 있다. 파티션 관리부(322)는 검색된 인덱스 오브젝트 중 오프셋의 다른 일부인 “0x230940”를 위치값으로 갖는 인덱스 오브젝트를 확인할 수 있다. For example, when the offset of the corresponding message is “180659302548”, the partition manager 322 may search for an index object having a base_offset corresponding to “0000002A102” which is a part of the offset. The partition manager 322 may identify an index object having “0x230940”, which is another part of the offset, as a position value among the searched index objects.

인덱스 오브젝트에 포함된 데이터 오브젝트 ID가 “00000000001F23AA”이고, 위치값이 “0x0210”인 경우 파티션 관리부(322)는 캐시(322) 또는 클러스터 서버(130)에 저장된 데이터 오브젝트 중 “00000000001F23AA”에 해당하는 base_offset을 가지는 데이터 오브젝트를 검색할 수 있다. 파티션 관리부(322)는 검색된 데이터 오브젝트 중 “0x0210”를 위치값으로 갖는 데이터 오브젝트를 컨슈머(124)로 전달할 수 있다.When the data object ID included in the index object is “00000000001F23AA” and the location value is “0x0210”, the partition manager 322 sets the base_offset corresponding to “00000000001F23AA” among the data objects stored in the cache 322 or the cluster server 130 . You can search for a data object with . The partition manager 322 may transmit a data object having “0x0210” as a location value among the searched data objects to the consumer 124 .

이를 통해 본 발명은 대규모 데이터를 클러스터 서버에 저장하고, 브로커 장치가 이에 대한 인터페이스를 제공함으로써, 메시지 처리 및 저장을 위해 소비되는 비용 및 시간을 절감할 수 있다. Through this, the present invention stores large-scale data in a cluster server, and the broker device provides an interface therefor, thereby reducing the cost and time consumed for message processing and storage.

하기에서는 브로커 장치(110)에서 메시지 저장 및 메시지의 인덱스 데이터를 생성 및 저장하는 방법에 대해서 도 5를 참조하여 설명하도록 한다.Hereinafter, a method of storing a message and generating and storing index data of a message in the broker apparatus 110 will be described with reference to FIG. 5 .

도 5는 본 발명의 실시예에 따른 브로커 장치에서 메시지 저장 및 메시지의 인덱스 데이터를 생성 및 저장하는 방법을 설명하기 위한 흐름도이다. 제시된 실시예에서 하기의 동작들은 도 2의 브로커 장치(200)의 제어부(230)에 의해서 수행될 수 있다.5 is a flowchart illustrating a method of storing a message and generating and storing index data of a message in a broker apparatus according to an embodiment of the present invention. In the presented embodiment, the following operations may be performed by the controller 230 of the broker apparatus 200 of FIG. 2 .

도 5를 참조하면, 브로커 장치(200)는 클라이언트 장치(120)로부터 발행-구독 기반 메시지 프로토콜을 기반으로 하는 메시지를 수신한다(S500). 다시 말해서, 브로커 장치(200)는 프로듀서(122)에 의해서 발행된 메시지를 수신할 수 있다. 예를 들어, 발행-구독 기반 메시지 프로토콜은 카프카 프로토콜일 수 있으나, 이에 한정되지 않는다.Referring to FIG. 5 , the broker device 200 receives a message based on the publish-subscribe-based message protocol from the client device 120 ( S500 ). In other words, the broker device 200 may receive the message issued by the producer 122 . For example, the publish-subscribe based message protocol may be, but is not limited to, the Kafka protocol.

브로커 장치(200)는 수신된 메시지를 분산 스토리지 기반 메시지 프로토콜을 기반으로 하는 데이터로 변환하여 클라이언트 서버(130)에 저장한다(S510). 예를 들어, 분산 스토리지 기반 메시지 프로토콜은 Ceph 프로토콜일 수 있으나, 이에 한정되지 않는다. 다시 말해서, 수신된 메시지는 데이터 오브젝트로서 클라이언트 서버(130)에 저장될 수 있다.The broker device 200 converts the received message into data based on the distributed storage-based message protocol and stores it in the client server 130 (S510). For example, the distributed storage-based message protocol may be a Ceph protocol, but is not limited thereto. In other words, the received message may be stored in the client server 130 as a data object.

브로커 장치(200)는 수신된 메시지에 할당된 오프셋을 이용하여 클러스터 서버(130)에 저장된 데이터의 식별 정보 및 데이터가 저장된 저장 위치를 포함하는 인덱스 데이터를 생성한다(S520). 각 메시지는 서로 다른 오프셋이 할당되며, 브로커 장치(200)는 해당 메시지에 할당된 오프셋 값 중 일부 오프셋 값을 해당 메시지의 인덱스 오브젝트에 대한 식별 정보로서 결정하고, 할당된 오프셋 값 중 나머지 오프셋 값을, 데이터 오브젝트의 식별 정보 및 저장 위치를 포함하는 인덱스 오브젝트의 저장 위치로서 결정할 수 있다. 이와 같이 결정된 식별 정보를 가지고, 클러스터 서버(130)에 저장된 데이터의 식별 정보 및 데이터가 저장된 저장 위치를 포함하는 인덱스 데이터는 결정된 저장 위치에 생성될 수 있다.The broker apparatus 200 generates index data including identification information of data stored in the cluster server 130 and a storage location in which the data is stored by using the offset assigned to the received message (S520). Each message is assigned a different offset, the broker device 200 determines some of the offset values assigned to the message as identification information for the index object of the message, and the remaining offset values among the assigned offset values. , it can be determined as a storage location of the index object including identification information and storage location of the data object. With the thus determined identification information, index data including identification information of data stored in the cluster server 130 and a storage location in which the data is stored may be generated at the determined storage location.

브로커 장치(200)는 생성된 인덱스 데이터를 클러스터 서버에 저장한다(S530).The broker device 200 stores the generated index data in the cluster server (S530).

하기에서는 분산 스토리지 기반 메시지 저장 시스템(100)에서의 메시지 발행/구독 방법에 대해서 도 6을 참조하여 설명하도록 한다.Hereinafter, a message publication/subscription method in the distributed storage-based message storage system 100 will be described with reference to FIG. 6 .

도 6은 본 발명의 실시예에 따른 분산 스토리지 기반 메시지 저장 시스템에서의 메시지 발행/구독 방법을 설명하기 위한 흐름도이다.6 is a flowchart illustrating a message publication/subscription method in a distributed storage-based message storage system according to an embodiment of the present invention.

도 6을 참조하면, 프로듀서(122)는 메시지를 발행하고(S600), 브로커 장치(110)는 발행된 메시지를 클러스터 서버(130)에 전달하며(S610), 클러스터 서버(130)는 수신된 메시지를 저장한다(S620). 6, the producer 122 issues a message (S600), the broker device 110 delivers the issued message to the cluster server 130 (S610), and the cluster server 130 receives the message is stored (S620).

브로커 장치(110)는 메시지에 할당된 오브셋을 이용하여 메시지의 인덱스 데이터를 생성하여(S630) 생성된 인덱스 데이터를 클러스터 서버(130)에 전달하고(S640), 클러스터 서버(130)는 인덱스 데이터를 저장한다(S650).The broker device 110 generates index data of the message by using the offset assigned to the message (S630) and transmits the generated index data to the cluster server 130 (S640), and the cluster server 130 generates the index data to store (S650).

컨슈머(124)는 브로커 장치(110)로 메시지 구독을 요청하고(S660), 브로커 장치(110)는 구독 가능한 메시지에 관련된 오프셋을 이용하여 구독 요청된 메시지를 확인한다(S670). 브로커 장치(110)는 컨슈머(124)가 파티션 내 어느 메시지까지 읽었는지를 나타내는 오프셋을 저장하고 있기 때문에, 이를 이용하여 컨슈머(124)가 다음으로 읽어야 할 메시지를 확인할 수 있다. The consumer 124 requests a message subscription from the broker device 110 (S660), and the broker device 110 uses an offset related to a subscribing message to confirm the subscription request message (S670). Since the broker device 110 stores an offset indicating which message in the partition the consumer 124 has read, it can check the message to be read next by the consumer 124 using this.

구체적으로, 브로커 장치(110)는 해당 오프셋의 일부 오프셋 값을 인덱스 오브젝트의 식별 정보로서 갖는 인덱스 오브젝트 묶음을 캐시(예: 도 3의 캐시(324)) 또는 클러스터 서버(130)에서 확인하고, 확인된 인덱스 오브젝트 묶음 중 해당 오프셋의 나머지 오프셋 값을 저장 위치로 갖는 인덱스 오브젝트를 확인한다. 확인된 인덱스 오브젝트는 데이터 오브젝트 식별 정보 및 저장 위치를 포함한다. 브로커 장치(110)는 데이터 오브젝트 식별정보를 갖는 데이터 오브젝트 묶음을 확인하고, 확인된 데이터 오브젝트 묶음 중 저장 위치에 해당하는 데이터 오브젝트를 확인한다.Specifically, the broker device 110 checks the index object bundle having a partial offset value of the corresponding offset as identification information of the index object in the cache (eg, the cache 324 in FIG. 3 ) or the cluster server 130, and confirms Check the index object that has the remaining offset value of the corresponding offset as the storage location among the index object bundles. The identified index object includes data object identification information and a storage location. The broker device 110 checks a data object bundle having data object identification information, and identifies a data object corresponding to a storage location among the checked data object bundles.

브로커 장치(110)는 확인된 메시지를 컨슈머(124)로 전달한다(S680). 다시 말해서, 브로커 장치(110)는 캐시 또는 클러스터 서버(130)에서 확인된 데이터 오브젝트를 컨슈머(124)로 전달할 수 있다.The broker device 110 transmits the checked message to the consumer 124 (S680). In other words, the broker device 110 may deliver the data object identified in the cache or cluster server 130 to the consumer 124 .

이를 통해 본 발명은 대규모 메시지를 분산 스토리지(즉, 클러스터 서버)에 저장하고, 분산 스토리지에 저장된 메시지에 접근하기 위한 인터페이스를 제공하고, 캐시 역할을 수행하는 브로커 장치를 제공함으로써, 대규모 데이터를 처리 및 저장하기 위해 소요되는 비용 및 시간을 줄일 수 있다.Through this, the present invention stores large-scale messages in distributed storage (ie, cluster servers), provides an interface for accessing messages stored in distributed storage, and provides a broker device that serves as a cache to process large-scale data and The cost and time required for storage can be reduced.

본 발명의 실시예에 따른 장치 및 방법은 다양한 컴퓨터 수단을 통하여 수행될 수 있는 프로그램 명령 형태로 구현되어 컴퓨터 판독 가능 매체에 기록될 수 있다. 컴퓨터 판독 가능 매체는 프로그램 명령, 데이터 파일, 데이터 구조 등을 단독으로 또는 조합하여 포함할 수 있다.The apparatus and method according to an embodiment of the present invention may be implemented in the form of program instructions 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.

컴퓨터 판독 가능 매체에 기록되는 프로그램 명령은 본 발명을 위하여 특별히 설계되고 구성된 것들이거나 컴퓨터 소프트웨어 분야 당업자에게 공지되어 사용 가능한 것일 수도 있다. 컴퓨터 판독 가능 기록 매체의 예에는 하드 디스크, 플로피 디스크 및 자기 테이프와 같은 자기 매체(magnetic media), CD-ROM, DVD와 같은 광기록 매체(optical media), 플롭티컬 디스크(floptical disk)와 같은 자기-광 매체(magneto-optical media) 및 롬(ROM), 램(RAM), 플래시 메모리 등과 같은 프로그램 명령을 저장하고 수행하도록 특별히 구성된 하드웨어 장치가 포함된다. 프로그램 명령의 예에는 컴파일러에 의해 만들어지는 것과 같은 기계어 코드뿐만 아니라 인터프리터 등을 사용해서 컴퓨터에 의해서 실행될 수 있는 고급 언어 코드를 포함한다.The program instructions recorded on the computer readable medium may be specially designed and configured for the present invention, or may be known and available to those skilled in the computer software field. Examples of the computer-readable recording medium include magnetic media such as hard disks, floppy disks and magnetic tapes, optical media such as CD-ROMs and DVDs, and magnetic such as floppy disks. - Includes magneto-optical media and hardware devices specially configured to store and execute program instructions, such as ROM, RAM, flash memory, and the like. Examples of program instructions include not only machine language codes such as those generated by a compiler, but also high-level language codes 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 present invention, and vice versa.

이상 첨부된 도면을 참조하여 본 발명의 실시예들을 더욱 상세하게 설명하였으나, 본 발명은 반드시 이러한 실시예로 국한되는 것은 아니고, 본 발명의 기술사상을 벗어나지 않는 범위 내에서 다양하게 변형 실시될 수 있다. 따라서, 본 발명에 개시된 실시예들은 본 발명의 기술 사상을 한정하기 위한 것이 아니라 설명하기 위한 것이고, 이러한 실시예에 의하여 본 발명의 기술 사상의 범위가 한정되는 것은 아니다. 그러므로, 이상에서 기술한 실시예들은 모든 면에서 예시적인 것이며 한정적이 아닌 것으로 이해해야만 한다. 본 발명의 보호 범위는 아래의 청구범위에 의하여 해석되어야 하며, 그와 동등한 범위 내에 있는 모든 기술 사상은 본 발명의 권리범위에 포함되는 것으로 해석되어야 할 것이다.Although the embodiments of the present invention have been described in more detail with reference to the accompanying drawings, the present invention is not necessarily limited to these embodiments, and various modifications may be made within the scope without departing from the technical spirit of the present invention. . Therefore, the embodiments disclosed in the present invention are not intended to limit the technical spirit of the present invention, but to explain, and the scope of the technical spirit of the present invention is not limited by these embodiments. Therefore, it should be understood that the embodiments described above are illustrative in all respects and not restrictive. The protection scope of the present invention should be construed by the following claims, and all technical ideas within the equivalent range should be construed as being included in the scope of the present invention.

100: 분산 스토리지 기반 메시지 저장 시스템
110: 브로커 장치
120: 클라이언트 장치
122: 프로듀서
124: 컨슈머
130: 클러스터 서버
100: Distributed storage-based message storage system
110: broker device
120: client device
122: producer
124: consumer
130: cluster server

Claims (18)

분산 스토리지 기반 메시지 저장 장치의 제어부에 의해서 수행되는 분산 스토리지 기반 메시지 저장 방법에 있어서,
클라이언트 장치로부터 발행-구독 기반 메시지 프로토콜을 기반으로 하는 메시지를 수신하는 단계;
상기 수신된 메시지를 분산 스토리지 기반 메시지 프로토콜을 기반으로 하는 데이터로 변환하여 클러스터 서버에 저장하는 단계;
상기 메시지에 할당된 오프셋(offset)을 이용하여 상기 클러스터 서버에 저장된 데이터의 식별 정보 및 상기 데이터가 저장된 저장 위치를 포함하는 인덱스 데이터를 생성하는 단계; 및
상기 생성된 인덱스 데이터를 상기 클러스터 서버에 저장하는 단계를 포함하는, 분산 스토리지 기반 메시지 저장 방법.
In the distributed storage-based message storage method performed by the control unit of the distributed storage-based message storage device,
receiving a message based on a publish-subscribe based message protocol from a client device;
converting the received message into data based on a distributed storage-based message protocol and storing it in a cluster server;
generating index data including identification information of data stored in the cluster server and a storage location in which the data is stored using an offset assigned to the message; and
Distributed storage-based message storage method comprising the step of storing the generated index data in the cluster server.
제1항에 있어서, 상기 클라이언트 장치는,
상기 메시지를 발행하는 프로듀서(Producer)와, 상기 메시지를 구독하는 컨슈머(Consumer)를 포함하는, 분산 스토리지 기반 메시지 저장 방법.
According to claim 1, wherein the client device,
A method for storing messages based on distributed storage, comprising: a producer that issues the message; and a consumer that subscribes to the message.
제1항에 있어서, 상기 데이터는,
오브젝트 형태로 상기 클러스터 서버에 저장되는, 분산 스토리지 기반 메시지 저장 방법.
According to claim 1, wherein the data,
A distributed storage-based message storage method, which is stored in the cluster server in the form of an object.
제1항에 있어서, 상기 인덱스 데이터를 생성하는 단계는,
상기 오프셋의 일부 오프셋 값을 상기 데이터의 식별 정보 및 저장 위치를 포함하는 인덱스 데이터의 식별 정보로 결정하는 단계;
상기 오프셋의 나머지 오프셋 값을 상기 인덱스 데이터의 저장 위치로 결정하는 단계; 및
상기 결정된 식별 정보를 가지는 인덱스 데이터를 상기 결정된 저장 위치에 생성하는 단계를 포함하는, 분산 스토리지 기반 메시지 저장 방법.
The method of claim 1, wherein the generating of the index data comprises:
determining a partial offset value of the offset as identification information of index data including identification information of the data and a storage location;
determining a remaining offset value of the offset as a storage location of the index data; and
Including the step of generating index data having the determined identification information in the determined storage location, distributed storage-based message storage method.
제1항에 있어서, 상기 생성된 인덱스 데이터는,
오브젝트 형태로 상기 클러스터 서버에 저장되는, 분산 스토리지 기반 메시지 저장 방법.
According to claim 1, wherein the generated index data,
A distributed storage-based message storage method, which is stored in the cluster server in the form of an object.
제1항에 있어서,
상기 클라이언트 장치로부터 메시지 구독 요청을 수신하는 단계;
상기 오프셋 중 일부 오프셋 값을 데이터 식별 정보로 갖는 인덱스 데이터 묶음을 확인하는 단계;
상기 확인된 인덱스 데이터 묶음 중 상기 오프셋 중 나머지 오프셋 값에 해당하는 저장 위치로 갖는 인덱스 데이터를 확인하는 단계;
상기 확인된 인덱스 데이터에 포함된 데이터 식별 정보를 갖는 데이터 묶음을 확인하는 단계;
상기 확인된 데이터 묶음 중 상기 확인된 인덱스 데이터에 포함된 저장 위치에 해당하는 데이터를 확인하는 단계; 및
상기 확인된 데이터를 상기 클라이언트 장치로 전달하는 단계를 포함하는, 분산 스토리지 기반 메시지 저장 방법.
According to claim 1,
receiving a message subscription request from the client device;
checking an index data bundle having some of the offsets as data identification information;
checking index data having a storage location corresponding to the remaining offset values among the offsets among the checked index data bundles;
checking a data bundle having data identification information included in the checked index data;
checking data corresponding to a storage location included in the checked index data among the checked data bundles; and
and forwarding the verified data to the client device.
제1항에 있어서,
데이터 묶음 및 인덱스 데이터 묶음의 적어도 일부를 분산 스토리지 기반 메시지 저장 장치의 캐시에 저장하는 단계를 더 포함하는, 분산 스토리지 기반 메시지 저장 방법.
According to claim 1,
The method further comprising the step of storing at least a portion of the data bundle and the index data bundle in a cache of the distributed storage-based message storage device.
제1항에 있어서, 상기 발행-구독 기반 메시지 프로토콜은,
카프카(Kafka) 프로토콜인, 분산 스토리지 기반 메시지 저장 방법.
The method of claim 1, wherein the publish-subscribe based message protocol comprises:
A method for storing messages based on distributed storage, the Kafka protocol.
제1항에 있어서, 상기 분산 스토리지 기반 메시지 프로토콜은,
Ceph 프로토콜인, 분산 스토리지 기반 메시지 저장 방법.
The method of claim 1, wherein the distributed storage-based message protocol comprises:
The Ceph protocol, a distributed storage-based message storage method.
통신부; 및
상기 통신부와 연결하도록 구성된 제어부를 포함하고,
상기 제어부는,
클라이언트 장치로부터 발행-구독 기반 메시지 프로토콜을 기반으로 하는 메시지를 수신하고,
상기 수신된 메시지를 분산 스토리지 기반 메시지 프로토콜을 기반으로 하는 데이터로 변환하여 클러스터 서버에 저장하고,
상기 메시지에 할당된 오프셋(offset)을 이용하여 상기 클러스터 서버에 저장된 데이터의 식별 정보 및 상기 데이터가 저장된 저장 위치를 포함하는 인덱스 데이터를 생성하고,
상기 생성된 인덱스 데이터를 상기 클러스터 서버에 저장하도록 구성되는, 분산 스토리지 기반 메시지 저장 장치.
communication department; and
a control unit configured to connect with the communication unit;
The control unit is
receive a message based on a publish-subscribe based message protocol from a client device;
Converts the received message into data based on a distributed storage-based message protocol and stores it in a cluster server,
generating index data including identification information of data stored in the cluster server and a storage location in which the data is stored using an offset assigned to the message;
A distributed storage-based message storage device, configured to store the generated index data in the cluster server.
제10항에 있어서, 상기 클라이언트 장치는,
상기 메시지를 발행하는 프로듀서(Producer)와, 상기 메시지를 구독하는 컨슈머(Consumer)를 포함하는, 분산 스토리지 기반 메시지 저장 장치.
The method of claim 10, wherein the client device,
A distributed storage-based message storage device comprising a producer that issues the message and a consumer that subscribes to the message.
제10항에 있어서, 상기 데이터는,
오브젝트 형태로 상기 클러스터 서버에 저장되는, 분산 스토리지 기반 메시지 저장 장치.
11. The method of claim 10, wherein the data,
A distributed storage-based message storage device, which is stored in the cluster server in the form of an object.
제10항에 있어서, 상기 제어부는,
상기 오프셋의 일부 오프셋 값을 상기 데이터의 식별 정보 및 저장 위치를 포함하는 인덱스 데이터의 식별 정보로 결정하고,
상기 오프셋의 나머지 오프셋 값을 상기 인덱스 데이터의 저장 위치로 결정하고,
상기 결정된 식별 정보를 가지는 인덱스 데이터를 상기 결정된 저장 위치에 생성하는, 분산 스토리지 기반 메시지 저장 장치.
11. The method of claim 10, wherein the control unit,
determining a partial offset value of the offset as identification information of index data including identification information of the data and a storage location;
determining the remaining offset value of the offset as a storage location of the index data,
A distributed storage-based message storage device for generating index data having the determined identification information in the determined storage location.
제10항에 있어서, 상기 생성된 인덱스 데이터는,
오브젝트 형태로 상기 클러스터 서버에 저장되는, 분산 스토리지 기반 메시지 저장 장치.
The method of claim 10, wherein the generated index data,
A distributed storage-based message storage device, which is stored in the cluster server in the form of an object.
제10항에 있어서, 상기 제어부는,
상기 클라이언트 장치로부터 메시지 구독 요청을 수신하고,
상기 오프셋 중 일부 오프셋 값을 데이터 식별 정보로 갖는 인덱스 데이터 묶음을 확인하고,
상기 확인된 인덱스 데이터 묶음 중 상기 오프셋 중 나머지 오프셋 값에 해당하는 저장 위치로 갖는 인덱스 데이터를 확인하고,
상기 확인된 인덱스 데이터에 포함된 데이터 식별 정보를 갖는 데이터 묶음을 확인하고,
상기 확인된 데이터 묶음 중 상기 확인된 인덱스 데이터에 포함된 저장 위치에 해당하는 데이터를 확인하고,
상기 확인된 데이터를 상기 클라이언트 장치로 전달하는, 분산 스토리지 기반 메시지 저장 장치.
11. The method of claim 10, wherein the control unit,
receiving a message subscription request from the client device;
Check the index data bundle having some offset values of the offsets as data identification information,
Checking the index data having a storage location corresponding to the remaining offset values among the offsets among the checked index data bundle,
Checking a data bundle having data identification information included in the identified index data,
Checking the data corresponding to the storage location included in the identified index data among the confirmed data bundle,
A distributed storage-based message storage device for delivering the confirmed data to the client device.
제10항에 있어서,
데이터 묶음 및 인덱스 데이터 묶음의 적어도 일부를 저장하도록 구성된 캐시를 더 포함하는, 분산 스토리지 기반 메시지 저장 장치.
11. The method of claim 10,
A distributed storage-based message storage device, further comprising a cache configured to store at least a portion of the data bundle and the index data bundle.
제10항에 있어서, 상기 발행-구독 기반 메시지 프로토콜은,
카프카(Kafka) 프로토콜인, 분산 스토리지 기반 메시지 저장 장치.
11. The method of claim 10, wherein the publish-subscribe based message protocol comprises:
Distributed storage-based message storage, a Kafka protocol.
제10에 있어서, 상기 분산 스토리지 기반 메시지 프로토콜은,
Ceph 프로토콜인, 분산 스토리지 기반 메시지 저장 장치.
The method of claim 10, wherein the distributed storage-based message protocol comprises:
A distributed storage-based message storage device that is the Ceph protocol.
KR1020190179626A 2019-12-31 2019-12-31 Message storing method based on distributed storage and appratus therefor KR102285759B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020190179626A KR102285759B1 (en) 2019-12-31 2019-12-31 Message storing method based on distributed storage and appratus therefor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020190179626A KR102285759B1 (en) 2019-12-31 2019-12-31 Message storing method based on distributed storage and appratus therefor

Publications (2)

Publication Number Publication Date
KR20210085993A true KR20210085993A (en) 2021-07-08
KR102285759B1 KR102285759B1 (en) 2021-08-03

Family

ID=76893964

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020190179626A KR102285759B1 (en) 2019-12-31 2019-12-31 Message storing method based on distributed storage and appratus therefor

Country Status (1)

Country Link
KR (1) KR102285759B1 (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20180100893A (en) * 2017-03-02 2018-09-12 고려대학교 산학협력단 System and method for large scale image processing in real-time environments using apache kafka
KR20190139006A (en) * 2018-06-07 2019-12-17 한국과학기술정보연구원 Distributed Messaging System and Method for Dynamic Partitioning in Distributed Messaging System

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20180100893A (en) * 2017-03-02 2018-09-12 고려대학교 산학협력단 System and method for large scale image processing in real-time environments using apache kafka
KR20190139006A (en) * 2018-06-07 2019-12-17 한국과학기술정보연구원 Distributed Messaging System and Method for Dynamic Partitioning in Distributed Messaging System

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
이상혁, CEPH-KAFKA 고속 마이그레이션을 제공하는 분산 스토리지 기반 메시지 브로커, 건국대학교 석사학위논문, 2019.8* *

Also Published As

Publication number Publication date
KR102285759B1 (en) 2021-08-03

Similar Documents

Publication Publication Date Title
US8762480B2 (en) Client, brokerage server and method for providing cloud storage
KR102004160B1 (en) Apparatus and method for logical grouping method of iot connected client nodes using client identifier
US9304815B1 (en) Dynamic replica failure detection and healing
US10841390B2 (en) Method and system for synchronizing publication and subscription of message queues
US9804889B2 (en) Methods and apparatus for state objects in cluster computing
US8103754B1 (en) Reserving a shared volume in a multiple node data storage system
US20150149642A1 (en) Determining computing-related resources to use based on client-specified constraints
JP4748950B2 (en) Storage area management method and system
WO2021057108A1 (en) Data reading method, data writing method, and server
US9900403B2 (en) Method and server for assigning relative order to message by using vector clock and delivering the message based on the assigned relative order under distributed environment
KR101236477B1 (en) Method of processing data in asymetric cluster filesystem
US11922059B2 (en) Method and device for distributed data storage
CN112235405A (en) Distributed storage system and data delivery method
US10776173B1 (en) Local placement of resource instances in a distributed system
KR20190035592A (en) Distributed Broker Coordinator System and Method in a Distributed Cloud Environment
KR102285759B1 (en) Message storing method based on distributed storage and appratus therefor
JP2008544371A (en) How to handle lock-related inconsistencies
US12028269B2 (en) Method for optimal resource selection based on available GPU resource analysis in large-scale container platform
US11635919B1 (en) Safe sharing of hot and cold memory pages
US20160357780A1 (en) Hierarchical file block variant tracker apparatus coupled to a Librarian and to a remote file service
JP4375121B2 (en) Processing agent method in database management system
CN109343928B (en) Virtual memory file redirection method and system for virtual machine in virtualization cluster
JP2007206913A (en) Database access system, application server node, database access method and program
JP2012063832A (en) Distribution processing system, distribution processing method and computer program
KR20170097448A (en) Method and system for managing data geographically distributed

Legal Events

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