KR20210085993A - Message storing method based on distributed storage and appratus therefor - Google Patents
Message storing method based on distributed storage and appratus therefor Download PDFInfo
- 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
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/2866—Architectures; Arrangements
- H04L67/288—Distributed intermediate devices, i.e. intermediate devices for interaction with other intermediate devices on the same level
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1097—Protocols 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—
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/561—Adding application-functional data or data for application control, e.g. adding metadata
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/562—Brokering proxy services
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/568—Storing 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
Description
본 발명은 분산 스토리지 기반 메시지 저장 방법 및 이를 위한 장치에 관한 것이다.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
먼저, 브로커 장치(110)는 송신자와 수신자 사이의 메시지를 중계하는 적어도 하나의 메시지 브로커가 설치된 서버로서, 아파치 카프카(Apache KAFKA), 아마존 웹 서비스 심플 큐 서비스(Amazon Web Service Simple Queue Service), 아파치 ActiveMQ, Comverse Message Broker, 오픈 메시지 큐, RabbitMQ 등과 같은 다양한 메시지 브로커가 이용될 수 있으나, 이에 한정되지 않는다.First, the
구체적으로, 브로커 장치(110)는 송신자에 해당하는 프로듀서(122)에 의해서 발행된 메시지 묶음(예: 레코드 세트(record set), 뱃치(batch))을 클러스터 서버(130)에 저장하고, 컨슈머(124)의 요청에 따라 메시지 묶음을 컨슈머(124)로 전달할 수 있다. 이러한 브로커 장치(110)는 복수 개의 브로커가 포함되는 클러스터로서 구현될 수 있으나, 이에 한정되지 않는다.Specifically, the
클라이언트 장치(120)와의 메시지 송수신을 위해 브로커 장치(110)는 발행-구독 기반 메시지 프로토콜을 이용할 수 있고, 클러스터 서버(130)와의 통신을 위해 분산 스토리지 기반 메시지 프로토콜을 이용할 수 있다. 예를 들어, 발행-구독 기반 메시지 프로토콜은 카프카 프로토콜일 수 있고, 분산 스토리지 기반 메시지 프로토콜은 Ceph 프로토콜일 수 있으나, 이에 한정되지 않는다. For sending and receiving messages to and from the
메시지 발행 시 프로듀서(122)는 특정 토픽을 지정하며, 지정된 토픽에 해당하는 메시지를 작성하고, 작성된 메시지를 메시지 브로커인 브로커 장치(110)에 전달한다. 메시지를 수신한 브로커 장치(110)는 수신된 메시지에 대한 인덱스 데이터를 생성하고, 생성된 인덱스 데이터 및 메시지의 실제 데이터를 클러스터 서버(130)에 저장할 수 있다. 여기서, 인덱스 데이터는 클러스터 서버(130)에 저장되는 실제 데이터의 ID 및 저장 위치를 포함할 수 있다.When issuing a message, the
클러스터 서버(130)에 저장되는 인덱스 데이터 및 실제 데이터는 토픽으로 분류되고, 토픽은 여러 개의 파티션으로 구분될 수 있다. 파티션 내에는 메시지의 상대적 위치를 나타내는 오프셋이 존재하며, 이 오프셋을 이용하여 실제 데이터의 인덱스 데이터를 생성할 수 있다.Index data and actual data stored in the
파티션은 저장될 시 세그먼트(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,
상술한 방식으로 메시지를 저장하기 위해 브로커 장치(110)는 메시지별로 할당된 오프셋을 이용하여 인덱스 데이터를 생성하고, 클러스터 서버(130)에 저장된 실제 데이터의 ID 및 저장 위치를 생성된 인덱스 데이터에 기록할 수 있다.In order to store the message in the above manner, the
브로커 장치(110)는 캐시를 가지며, 클러스터 서버(130)에 저장된 인덱스 데이터 묶음 및 실제 데이터 묶음의 일부를 캐시에 저장할 수 있다. The
이를 통해 본 발명은 원하는 메시지가 클러스터 서버의 어느 위치에 기록되어 있는지 상수 시간으로 확인할 수 있다.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
클라이언트 장치(120)는 각 파티션을 담당하는 브로커 장치의 정보를 획득하고, 획득된 정보를 이용하여 메시지 발행/구독을 수행할 수 있다. 이를 위해 클라이언트 장치(120)는 처음 지정해둔 브로커의 주소를 이용하여 해당 브로커에 접속하고, 접속한 브로커로 특정 토픽의 메타 데이터에 대한 조회를 요청할 수 있다. 요청에 대한 응답으로 브로커는 특정 토픽의 파티션 개수, 각 파티션이 어느 브로커에 존재하는지에 대한 정보 및 각 브로커의 주소 등을 포함하는 메타 데이터를 클라이언트 장치(120)로 전달할 수 있다.The
이러한 응답을 이용하여 클라이언트 장치(120)는 각 파티션을 담당하는 브로커에 접속하여 파티션 관련 작업(예: write/read)을 수행할 수 있다.Using this response, the
다음으로, 클러스터 서버(130)는 분산 스토리지 기반 저장 서버로서, 메시지 및 메시지의 메타 데이터를 저장하고, 저장된 메시지 및 메타 데이터를 읽기/쓰기 가능한 인터페이스를 제공할 수 있다. 예를 들어, 클러스터 서버(130)는 Ceph 기반의 클러스터 서버일 수 있으나, 이에 한정되지 않는다.Next, as a distributed storage-based storage server, the
구체적으로, 클러스터 서버(130)는 브로커 장치(110)에 의해 인덱스 데이터 묶음 및 메시지(즉, 실제 데이터) 묶음을 데이터 오브젝트 형태로 저장할 수 있다. 예를 들어, 인덱스 데이터는 인덱스 오브젝트로, 메시지 묶음은 데이터 오브젝트로서 저장될 수 있다. 이러한 경우 인덱스 오브젝트는 인덱스 오브젝트 ID를 가지고, 데이터 오브젝트는 데이터 오브젝트 ID를 가질 수 있다. 또한, 인덱스 오브젝트는 데이터 오브젝트의 ID 및 해당 데이터 오브젝트가 저장되는 위치가 기록될 수 있다.Specifically, the
클러스터 서버(130)는 적어도 하나의 오브젝트 저장부를 포함하고, 적어도 하나의 오브젝트 저장부 중 인덱스 오브젝트 및 데이터 오브젝트를 저장하고자 하는 오브젝트 저장부를 결정하고, 결정된 오브젝트 저장부에 인덱스 오브젝트 및 데이터 오브젝트를 저장할 수 있다. 예를 들어, 오브젝트 저장부는 OSD(Object Storage Daemon)일 수 있으나, 이에 한정되지 않는다. The
다양한 실시예에서 클러스터 서버(130)는 인덱스 오브젝트 및 데이터 오브젝트의 복제 데이터를 저장할 수 있다. 예를 들어, 복제 데이터의 개수가 3개로 설정된 경우 클러스터 서버(130)는 각 오브젝트에 따라 3개의 오브젝트 저장부를 할당하고, 할당된 3개의 오브젝트 저장부에 원본 오브젝트(예: 원본 인덱스 오브젝트 및 원본 데이터 오브젝트)와, 2개의 복제 오브젝트(예: 복제 인덱스 오브젝트 및 복제 데이터 오브젝트)를 각각 저장할 수 있다. In various embodiments, the
이를 통해 본 발명은 데이터의 물리적 근접성을 조정함으로써, 장애에 대비할 수 있다. 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
도 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
통신부(210)는 브로커 장치(200)가 외부 장치와 통시 가능하도록 연결한다. 통신부(210)는 유선 또는 무선 통신을 이용하여 클라이언트 장치(120) 및 클러스터 서버(130)와 연결될 수 있다. 구체적으로, 통신부(210)는 프로듀서(122)로부터 발행된 메시지 묶음을 수신하고, 컨슈머(124)에 의해서 요청된 메시지가 포함된 메시지 묶음을 컨슈머(124)로 전달할 수 있다. 또한 통신부(210)는 인덱스 데이터 및 수신된 메시지 묶음을 클러스터 서버(130)로 전달할 수 있다. 예를 들어, 통신부(210)는 클라이언트 장치(120)와 발행-구독 기반 프로토콜을 이용하여 통신을 수행하고, 클러스터 서버(130)와 분산 스토리지 기반 프로토콜을 이용하여 통신을 수행할 수 있다.The
저장부(220)는 프로듀서(122)에 의해서 발행된 메시지를 클러스터 서버(130)에 저장하고, 컨슈머(124)의 요청에 따라 메시지를 컨슈머(124)로 전달하기 위해 사용되는 다양한 데이터를 저장할 수 있다. The
다양한 실시예에서 저장부(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
제어부(230)는 통신부(210) 및 저장부(220)와 동작 가능하게 연결되며, 프로듀서(122)에 의해서 발행된 메시지를 클러스터 서버(130)에 저장하고, 컨슈머(124)의 요청에 따라 메시지를 컨슈머(124)로 전달하기 위한 다양한 명령들을 수행할 수 있다.The
구체적으로, 프로듀서(122)에 의해서 발행된 메시지가 전달되면 제어부(230)는 해당 메시지에 대응하여 할당된 오프셋을 이용하여 해당 메시지에 대한 인덱스 데이터를 생성하고, 생성된 인덱스 데이터 및 해당 메시지를 클러스터 서버(130)에 저장할 수 있다. 여기서, 인덱스 데이터 생성은 메시지 저장 이후에 수행될 수 있으나, 이에 한정되지 않으며, 거의 동시에 이루어질 수도 있다. Specifically, when the message issued by the
인덱스 데이터를 생성하기 위해 제어부(230)는 메시지에 할당된 오프셋 중 일부 오프셋 값을 이용하여 인덱스 데이터의 식별 정보(즉, ID)를 생성하고, 오프셋 중 나머지 오프셋 값을 실제 데이터의 식별 정보 및 실제 데이터가 저장된 저장 위치를 기록하기 위한 인덱스 데이터의 저장 위치로서 이용할 수 있다.In order to generate the index data, the
예를 들어, 메시지에 대응하여 할당된 오프셋이 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
다양한 실시예에서 제어부(230)는 클러스터 서버(130)에 저장된 인덱스 데이터 및 메시지 중 일부를 캐시에 저장할 수 있다. 여기서, 캐시는 인덱스 데이터 묶음 및 실제 데이터 묶음에 대한 적어도 일부를 저장하는데, 제어부(230)에 포함되거나, 제어부(230)와 메모리(220) 사이에 위치하도록 구현될 수 있으나, 이에 한정되지 않는다.In various embodiments, the
컨슈머(124)에 의해 메시지에 대한 구독이 요청되면 제어부(230)는 오프셋을 이용하여 구독 요청된 메시지를 확인하고, 확인된 메시지를 컨슈머(124)로 전달할 수 있다. When a subscription to a message is requested by the
일반적으로, 오프셋은 컨슈머 그룹 단위로 파티션을 어디까지 읽었는지에 대한 정보를 포함하고, 브로커(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
제어부(230)는 저장된 오프셋을 이용하여 컨슈머(124)가 읽어야 하는 메시지가 캐시에 저장되어 있는지를 확인하거나, 클러스터 서버(130)에 저장되어 있는지를 확인할 수 있다.The
해당 메시지가 캐시에 저장된 경우 제어부(230)는 해당 메시지를 컨슈머(124)로 전달할 수 있다. 다시 말해서, 구독 요청된 메시지가 캐시에 저장된 경우 컨슈머(124)는 브로커 장치(200)에 접근하여 브로커 장치(200)의 캐시에 저장된 메시지에 대한 읽기를 수행할 수 있다.When the corresponding message is stored in the cache, the
해당 메시지가 클러스터 서버(130)에 저장된 경우 제어부(230)는 해당 메시지를 클러스터 서버(130)로 요청하고, 클러스터 서버(130)로부터 메시지가 수신되면 수신된 메시지를 컨슈머(124)로 전달할 수 있다. 다시 말해서, 구독 요청된 메시지가 클러스터 서버(130)에 저장된 경우 컨슈머(124)는 브로커 장치(200)에 접근하여 클러스터 서버(130)에 저장된 메시지에 대한 읽기를 수행할 수 있다.When the corresponding message is stored in the
다양한 실시예에서 제어부(230)는 파티션 관련 작업(예: 메시지 쓰기/읽기) 및 메타 데이터 관련 작업(예: 토픽 조회, 파티션에 할당된 브로커 정보 조회, 컨슈머 그룹 코디네이터 브로커 조회, 컨슈머 그룹 가입, 컨슈머 그룹 동기화, 브로커가 지원하는 API 버전 목록 등)을 수행할 수 있다. 이러한 작업을 수행하기 위해 제어부(230)는 클라이언트 장치(120)의 요청에 의한 동작 및 타이머 등과 같은 내부 스케줄러에 의한 동작을 수행할 수 있다.In various embodiments, the
예를 들어, 제어부(230)는 클라이언트 장치(120)로부터 메시지 발행을 위해 각 파티션에 할당된 브로커에 대한 정보를 요청하는 메시지를 수신하고, 이에 따라 파티션별 할당된 브로커에 대한 정보를 클라이언트 장치(120)로 전달할 수 있다. 이러한 브로커 정보는 특정 토픽의 파티션 개수, 각 파티션이 존재하는 브로커, 및 각 브로커의 주소 등 중 적어도 하나를 포함할 수 있다.For example, the
이를 통해 본 발명은 대규모의 메시지를 클러스터 서버에 저장하고, 브로커 장치가 클러스터 서버에 저장된 메시지에 접근하기 위한 인터페이스를 제공함으로써, 메시지 처리 및 저장을 위해 소모되는 시간 및 비용을 줄일 수 있다. 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
도 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
도 3을 참조하면, 브로커(300)는 리액터 레이어(reactor layer)(302) 및 태스크 레이어(task layer)(304)를 포함한다. 여기서, 리액터는 일종의 이벤트 루프 스레드(event loop thread)로서, 기본적으로 CPU 개수만큼 생성될 수 있다. 이러한 리액터는 개별 CPU 코어(core)에 고정되어 코어별로 1개씩 존재할 수 있다. Referring to FIG. 3 , the
리액터 레이어(302)는 CPU 코어별로 고정된 리액터(306), 및 리액터(306) 간의 통신을 위해 리액터 태스크 큐(Reactor Task Queue)(308)를 포함할 수 있다. 이러한 리액터 레이어(302) 위에 브로커에 의해서 정의되는 모든 태스크가 수행될 수 있다.The
태스크 레이어(304)는 클러스터 서버(130)와의 통신을 위해 사용되는 분산 객체 저장소 라이브러리(LIBRADOS)(310), 및 분산 객체 저장소 라이브러리(310)와의 메시지 패싱(passing)을 위한 입출력 스레드(IO Thread)(312)를 포함할 수 있다. The
브로커(300)는 분산 객체 저장소 라이브러리(LIBRADOS)(310)를 통해 클러스터 서버(130)에 접근하여 인덱스 데이터 및/또는 메시지를 저장하거나, 가져올 수 있다.The
입출력 스레드(312)는 입출력 작업을 처리하는 분산 객체 저장소 라이브러리(310)와 리액터 간의 연동을 위한 동작을 수행할 수 있다. 구체적으로, 입출력 작업을 위해 파티션 관리부(322)는 각 파티션 내에 존재하는 파티션 로컬 입출력 큐(Partition Local IO Queue)에 입출력 작업을 삽입한다. 이를 통해 입출력 스레드(312)는 파티션 간의 작업을 클러스터 서버(130)에서 수행 가능한 작업으로 만들어 클러스터 서버(130)로 전달할 수 있다.The input/
상술한 작업을 통해 각 파티션에는 현재 트리거 큐에 자신이 등록되어 있는지를 나타내는 플래그(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/
한편, 태스크 레이어(304)는 각 리액터에 대응하는 브로커 태스크들이 존재한다. 특히, 0번 리액터에 대응하는 브로커 태스크(314)는 프로토콜 관리부(316), 메타 데이터 관리부(318), 그룹 코디네이터(320) 및 파티션 관리부(322)를 포함한다.Meanwhile, in the
프로토콜 관리부(316)는 클라이언트 장치(120)에 관련된 다양한 동작을 수행한다. 클라이언트 장치(120)의 요청을 처리하기 위해 브로커(300)는 클라이언트 장치(120)의 요청을 처리할 프로토콜 관리부를 호출할 수 있다. 예를 들어, 새로운 클라이언트 장치가 접근하면 브로커(300)는 연결 작업을 통해 새로운 클라이언트 장치와의 연결을 수행한다. 연결된 클라이언트 장치로부터 요청이 수신되면 브로커(300)는 요청에 해당하는 데이터를 파싱(parsing)하고, 파싱된 데이터에 기반하여 클라이언트 장치의 요청을 수행할 프로토콜 관리부(316)를 호출할 수 있다.The
이러한 프로토콜 관리부(316)는 클라이언트 장치(120)의 요청에 따라 메타 데이터 관련 작업을 수행하기 위해 메타 데이터 관리부(318)를 호출하거나, 파티션 내부 작업을 수행하기 위해 파티션 관리부(322)를 호출할 수 있다. 예를 들어, 메타 데이터 관리부(318)는 파티션에 할당된 브로커 정보를 조회하는 등과 같은 작업을 수행하고, 파티션 관리부(322)는 메시지 읽기/쓰기 작업을 수행할 수 있다. 여기서, 메타 데이터 관련 작업은 클라이언트 장치(130)의 요청을 처리하는 리액터에서 처리하며, 파티션 관련 작업은 같은 파티션에 대한 명령이 동일한 리액터로 라우팅(routing)되어 처리된다. 이와 같이 같은 파티션에 대한 명령은 항상 동일한 리액터, 즉 CPU 코어에서 처리되므로, 파티션에 대해서 잠금을 하지 않고 처리하여 잠금 비용을 절감할 수 있다.The
그룹 코디네이터(320)는 컨슈머 그룹의 균형을 조정하기 위한 동작을 수행할 수 있다. 구체적으로, 그룹 코디네이터(320)는 컨슈머 그룹에 속하는 컨슈머들로부터 자신의 상태를 나타내는 알림을 수신하고, 수신된 알림에 따라 컨슈머 그룹에 대한 리밸런싱(rebalancing)을 수행할 수 있다. 여기서, 리밸런싱은 컨슈머 그룹에 새로운 컨슈머가 추가되거나, 장애로 인해 컨슈머를 사용하지 못하게 된 경우 파티션의 소유권을 분배하는 작업을 의미한다.The
파티션 관리부(322)는 각 메시지에 할당된 오프셋을 이용하여 메시지에 대한 실제 데이터의 ID 및 실제 저장 위치를 포함하는 인덱스 데이터를 생성하고, 생성된 인덱스 데이터 및 실제 데이터를 클러스터 서버(130)에 저장하기 위해 호출될 수 있다. 또한, 파티션 관리부(322)는 컨슈머에 의한 요청에 따라 특정 메시지에 대한 오프셋을 이용하여 특정 메시지의 실제 데이터에 접근하기 위해 호출될 수 있다. 여기서, 특정 메시지는 컨슈머가 속하는 컨슈머 그룹이 읽어야 하는 특정 파티션 내의 메시지일 수 있다.The
한편, 파티션 관리부(322)는 캐시(324) 및 입출력 관리부(326)를 포함한다. 캐시(324)는 클라이언트 장치(120)로부터 전달된 메시지 묶음 및 이에 대한 인덱스 데이터의 적어도 일부를 저장할 수 있다. 예를 들어, 캐시(324)는 저장 공간이 부족할 경우 가장 최근에 사용하지 않은 항목을 제거하는 LRU 캐시(Least Recently Used Cache)일 수 있으나, 이에 한정되지 않는다. Meanwhile, the
입출력 관리부(326)는 대량의 입출력 요청을 효율적으로 처리하기 위해 이용될 수 있다. 이를 위해 입출력 관리부(326)는 타이머를 구비할 수 있다. The input/
클라이언트 장치(120)의 요청에 따른 작업 이외에 타이머 등과 같은 내부 스케줄러에 의한 동작은 브로커 태스크들 중 하나인 브로커 조정 태스크(328)에 포함된 브로커 상태 관리부(330)를 통해 수행될 수 있다. 이러한 브로커 조정 태스크(328)는 0번 리액터에 의해 수행될 수 있다.In addition to the operation according to the request of the
브로커 상태 관리부(330)는 타이머를 포함하고, 타이머에 의해 0번 CPU에서 자신과 다른 브로커들의 상태 정보를 동기화하는 작업을 수행한다. 구체적으로, 브로커 상태 관리부(330)는 자신의 상태 정보를 입출력 스레드(312) 및 분산 객체 저장소 라이브러리(310)를 통해 클러스터 서버(130)로 전달하고, 다른 브로커로부터 다른 브로커의 상태 정보를 수신할 수 있다. 상태 정보를 전달하는 동작이 특정 횟수 이상 실패하는 경우 브로커 상태 관리부(330)는 브로커(300)에 장애가 발생되었다고 판단하여 모든 작업을 중단할 수 있다. The broker
또한, 다른 브로커로부터 수신되는 다른 브로커의 상태 정보는 마지막 정보 갱신 시간을 포함하는데, 브로커 상태 관리부(330)는 이 시간을 현재 시간과 비교하여 특정 시간 이상 차이가 나면 해당 브로커를 이용할 수 없다고 판단할 수 있다. In addition, the status information of other brokers received from other brokers includes the last information update time, and the broker
이를 통해 사용 가능한 브로커 정보를 나타내는 클러스터 맵(332)이 생성될 수 있다. 이와 같이 생성된 클러스터 맵(332)은 코어 개수만큼 복사되어 각 코어에 전달되며, 각 코어에서 해당 클러스터 맵이 사용될 수 있다.Through this, a
다양한 실시예에서 브로커(300)는 자원 공유를 최소화하기 위해 파티션별로 담당하는 코어를 할당하고, 담당 코어를 통해 해당 파티션에 대한 작업을 수행할 수 있다. 이와 같이 담당 코어를 결정하는 로직은 “CRC32(PROJECT_ID + TOPIC_NAME + PARTITION_ID) % CPU_COUNT)”일 수 있으나, 이에 한정되지 않는다.In various embodiments, the
클라이언트 연결에 대응하여 담당 코어가 지정되어 담당 코어를 통해 클라이언트 장치의 요청을 파싱하는 동작이 수행되므로, 한 클라이언트 장치로부터 동시에 여러 파티션 작업이 요청되면 파티션 관리부(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
다양한 실시예에서 브로커(300)는 주가적으로 또는 종료 시 특정 파티션에 할당된 담당 브로커에 대한 데이터 포함하는 파티션 메타 데이터를 클러스터 서버(130)로 전달할 수 있다. 이때, 파티션 메타 데이터는 last_ping, start_offset, 및 append_offset 등과 같은 데이터를 저장한다. 이때, 브로커(300)는 파티션 갱신 조건으로 파티션에 대한 소유권이 자신에게 있는지 확인하여 파티션에 대한 소유권이 자신에게 있지 않거나, 다른 브로커에게 있는 경우 장애로 판단하여 파티션에 대한 작업을 중단할 수 있다.In various embodiments, the
또한, 브로커(300)가 클라이언트 장치(120)로부터 자신의 메모리에 존재하지 않은 파티션에 대한 요청을 수신하면 메타 데이터 관리부(318)는 파티션 부트스트랩(partition bootstrap) 동작을 수행할 수 있다. 예를 들어, 브로커(300)가 다시 시작되면 클라이언트 장치(120)의 첫 요청에 의해 특정 파티션에 할당된 브로커가 존재하더라도 실제 브로커의 메모리 상에 특정 파티션에 대한 정보가 없을 수 있다. Also, when the
이러한 경우 메타 데이터 관리부(318)는 요청된 특정 파티션이 브로커(300)에 할당된 파티션인지를 확인하고, 브로커(300)에 할당된 파티션이 아니면 에러를 반환한다. 이후 브로커(300)에 할당된 파티션의 개수가 최대 개수를 초과하면 메타 데이터 관리부(318)는 메타 데이터의 할당 정보를 삭제하고, 에러를 반환한다. 여기서, 할당 정보는 각 파티션에 할당된 브로커에 대한 정보를 의미한다.In this case, the
메타 데이터 관리부(318)는 파티션 인스턴스를 생성하여 생성된 파티션 인스턴스 내에 메타 데이터를 기록할 수 있다. 이러한 경우 브로커(300)는 파티션 관련 메타 데이터를 주기적으로 클러스터 서버(130)로 전달할 수 있다.The
이후 파티션 관리부(322)는 append_offset 기준의 인덱스 오브젝트를 불러올 수 있다. 이때, append_offset 기준의 인덱스 오브젝트 이후의 인덱스 오브젝트가 존재하면 파티션 관리부(322)는 기존 파티션을 담당하는 브로커가 비정상으로 종료된 것으로 판단할 수 있다. 이러한 경우 파티션 관리부(322)는 인덱스 오브젝트 전체를 불러와서 실제 append_offset을 획득하고, 획득된 실제 append_offset을 기반으로 자신이 가지고 있던 append_offset을 갱신할 수 있다. Thereafter, the
메타 데이터 관리부(318)는 마지막 인덱스 오브젝트의 소유권 메타 데이터를 변경하여 특정 파티션에 대한 소유권을 브로커(300)로 변경할 수 있다. 이러한 동작들이 완료되면 브로커(300)는 클라이언트 장치(120)와의 메시지 관련 작업을 수행할 수 있다.The
다양한 실시예에서 파티션 메타 데이터는 담당 브로커의 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
이에 대해서 구체적으로, 파티션의 다음 할당 브로커에 대한 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
파티션 마이그레이션 동작을 위해 브로커(300)는 쓰기 작업에 대한 요청을 차단하고, 인덱스 오브젝트 및 데이터 오브젝트에 대한 쓰기 입출력 작업이 모두 완료될 때까지 대기할 수 있다. 이후 쓰기 입출력 작업이 완료되면 브로커(300)는 next_assign_broker 메타 데이터에 기록된 브로커 ID를 assigned_broker 메타 데이터에 삽입하고, next_assign_broker 메타 데이터를 삭제할 수 있다. 이후 assigned_broker 메타 데이터에 기록된 브로커 ID를 갖는 브로커에서 파티션 부트스트랩 동작이 수행되면서 파티션 마이그레이션 동작이 종료될 수 있다.For the partition migration operation, the
특정 파티션에 대하여 담당 브로커가 지정되지 않거나, 특정 파티션의 담당 브로커가 클러스터 맵에 존재하지 않은 경우 브로커(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
이를 통해 본 발명은 고속 마이그레이션이 가능한 메시지 저장 서비스를 제공할 수 있고, 브로커의 수를 조절하기 위해 소비되는 비용 및 시간을 절감할 수 있다. 또한, 본 발명은 트래픽이 적어지는 경우 다른 브로커로 고속 마이그레이션을 수행하고, 대기 상태의 브로커를 종료함으로써, 컴퓨팅 리소스를 절감시킬 수 있다.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
도 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
먼저, 프로듀서(122)로부터 메시지 묶음이 전달되면 각 메시지에 오프셋이 할당된다. 각 메시지에 대응하여 할당된 오프셋(record offset)은 64bit의 오프셋 값을 가질 수 있다. 파티션 관리부(322)는 이와 같이 할당된 오프셋을 이용하여 메시지 저장 작업을 수행할 수 있다.First, when a message bundle is delivered from the
이를 위해 인덱스 오브젝트 및 데이터 오브젝트와 같은 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
파티션 관리부(322)는 64bit의 오프셋 값 중 20bit의 오프셋 값을 4비트 왼쪽 시프트 연산(4bit left shift)을 통해 변환하고, 변환된 값을 실제 데이터에 해당하는 데이터 오브젝트의 ID 및 저장 위치를 기록하기 위한 위치값으로 결정할 수 있다. 예를 들어, 오프셋 “0000002A10223094” 중 “203094”를 4비트 왼쪽 시프트 연산을 통해 “230940”으로 변경하고, “0x230940”을 위치값으로 결정할 수 있다. 다시 말해서, 인덱스 오브젝트 ID “partition.index.[project].[topic].[partition].0000002A102”를 가지는 위치값 “0x230940”에는 실제 데이터의 ID 및 저장 위치를 포함하는 인덱스 오브젝트가 존재할 수 있다.The
도 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
도 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
소켓을 통해 컨슈머(124)로부터 메시지 읽기가 요청되면 프로토콜 관리부(316)는 메시지 읽기/쓰기와 같은 파티션 관련 작업을 수행하는 파티션 관리부(322)를 호출할 수 있다. 여기서, 파티션 관리부(322)는 기 저장된 오프셋을 이용하여 해당 오프셋에 대응하는 메시지에 대한 읽기를 수행할 수 있다.When a message read is requested from the
구체적으로, 파티션 관리부(322)는 오프셋을 이용하여 캐시(324) 또는 클러스터 서버(130)에 저장된 인덱스 오브젝트 중 메시지 읽기가 요청된 메시지에 해당하는 인덱스 오브젝트를 검색할 수 있다.Specifically, the
예를 들어, 해당 메시지의 오프셋이 “180659302548”인 경우 파티션 관리부(322)는 오프셋의 일부인 “0000002A102”에 해당하는 base_offset을 가지는 인덱스 오브젝트를 검색할 수 있다. 파티션 관리부(322)는 검색된 인덱스 오브젝트 중 오프셋의 다른 일부인 “0x230940”를 위치값으로 갖는 인덱스 오브젝트를 확인할 수 있다. For example, when the offset of the corresponding message is “180659302548”, the
인덱스 오브젝트에 포함된 데이터 오브젝트 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
이를 통해 본 발명은 대규모 데이터를 클러스터 서버에 저장하고, 브로커 장치가 이에 대한 인터페이스를 제공함으로써, 메시지 처리 및 저장을 위해 소비되는 비용 및 시간을 절감할 수 있다. 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
도 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
도 5를 참조하면, 브로커 장치(200)는 클라이언트 장치(120)로부터 발행-구독 기반 메시지 프로토콜을 기반으로 하는 메시지를 수신한다(S500). 다시 말해서, 브로커 장치(200)는 프로듀서(122)에 의해서 발행된 메시지를 수신할 수 있다. 예를 들어, 발행-구독 기반 메시지 프로토콜은 카프카 프로토콜일 수 있으나, 이에 한정되지 않는다.Referring to FIG. 5 , the
브로커 장치(200)는 수신된 메시지를 분산 스토리지 기반 메시지 프로토콜을 기반으로 하는 데이터로 변환하여 클라이언트 서버(130)에 저장한다(S510). 예를 들어, 분산 스토리지 기반 메시지 프로토콜은 Ceph 프로토콜일 수 있으나, 이에 한정되지 않는다. 다시 말해서, 수신된 메시지는 데이터 오브젝트로서 클라이언트 서버(130)에 저장될 수 있다.The
브로커 장치(200)는 수신된 메시지에 할당된 오프셋을 이용하여 클러스터 서버(130)에 저장된 데이터의 식별 정보 및 데이터가 저장된 저장 위치를 포함하는 인덱스 데이터를 생성한다(S520). 각 메시지는 서로 다른 오프셋이 할당되며, 브로커 장치(200)는 해당 메시지에 할당된 오프셋 값 중 일부 오프셋 값을 해당 메시지의 인덱스 오브젝트에 대한 식별 정보로서 결정하고, 할당된 오프셋 값 중 나머지 오프셋 값을, 데이터 오브젝트의 식별 정보 및 저장 위치를 포함하는 인덱스 오브젝트의 저장 위치로서 결정할 수 있다. 이와 같이 결정된 식별 정보를 가지고, 클러스터 서버(130)에 저장된 데이터의 식별 정보 및 데이터가 저장된 저장 위치를 포함하는 인덱스 데이터는 결정된 저장 위치에 생성될 수 있다.The
브로커 장치(200)는 생성된 인덱스 데이터를 클러스터 서버에 저장한다(S530).The
하기에서는 분산 스토리지 기반 메시지 저장 시스템(100)에서의 메시지 발행/구독 방법에 대해서 도 6을 참조하여 설명하도록 한다.Hereinafter, a message publication/subscription method in the distributed storage-based
도 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
브로커 장치(110)는 메시지에 할당된 오브셋을 이용하여 메시지의 인덱스 데이터를 생성하여(S630) 생성된 인덱스 데이터를 클러스터 서버(130)에 전달하고(S640), 클러스터 서버(130)는 인덱스 데이터를 저장한다(S650).The
컨슈머(124)는 브로커 장치(110)로 메시지 구독을 요청하고(S660), 브로커 장치(110)는 구독 가능한 메시지에 관련된 오프셋을 이용하여 구독 요청된 메시지를 확인한다(S670). 브로커 장치(110)는 컨슈머(124)가 파티션 내 어느 메시지까지 읽었는지를 나타내는 오프셋을 저장하고 있기 때문에, 이를 이용하여 컨슈머(124)가 다음으로 읽어야 할 메시지를 확인할 수 있다. The
구체적으로, 브로커 장치(110)는 해당 오프셋의 일부 오프셋 값을 인덱스 오브젝트의 식별 정보로서 갖는 인덱스 오브젝트 묶음을 캐시(예: 도 3의 캐시(324)) 또는 클러스터 서버(130)에서 확인하고, 확인된 인덱스 오브젝트 묶음 중 해당 오프셋의 나머지 오프셋 값을 저장 위치로 갖는 인덱스 오브젝트를 확인한다. 확인된 인덱스 오브젝트는 데이터 오브젝트 식별 정보 및 저장 위치를 포함한다. 브로커 장치(110)는 데이터 오브젝트 식별정보를 갖는 데이터 오브젝트 묶음을 확인하고, 확인된 데이터 오브젝트 묶음 중 저장 위치에 해당하는 데이터 오브젝트를 확인한다.Specifically, the
브로커 장치(110)는 확인된 메시지를 컨슈머(124)로 전달한다(S680). 다시 말해서, 브로커 장치(110)는 캐시 또는 클러스터 서버(130)에서 확인된 데이터 오브젝트를 컨슈머(124)로 전달할 수 있다.The
이를 통해 본 발명은 대규모 메시지를 분산 스토리지(즉, 클러스터 서버)에 저장하고, 분산 스토리지에 저장된 메시지에 접근하기 위한 인터페이스를 제공하고, 캐시 역할을 수행하는 브로커 장치를 제공함으로써, 대규모 데이터를 처리 및 저장하기 위해 소요되는 비용 및 시간을 줄일 수 있다.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.
상기 메시지를 발행하는 프로듀서(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.
오브젝트 형태로 상기 클러스터 서버에 저장되는, 분산 스토리지 기반 메시지 저장 방법.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.
상기 오프셋의 일부 오프셋 값을 상기 데이터의 식별 정보 및 저장 위치를 포함하는 인덱스 데이터의 식별 정보로 결정하는 단계;
상기 오프셋의 나머지 오프셋 값을 상기 인덱스 데이터의 저장 위치로 결정하는 단계; 및
상기 결정된 식별 정보를 가지는 인덱스 데이터를 상기 결정된 저장 위치에 생성하는 단계를 포함하는, 분산 스토리지 기반 메시지 저장 방법.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.
오브젝트 형태로 상기 클러스터 서버에 저장되는, 분산 스토리지 기반 메시지 저장 방법.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.
상기 클라이언트 장치로부터 메시지 구독 요청을 수신하는 단계;
상기 오프셋 중 일부 오프셋 값을 데이터 식별 정보로 갖는 인덱스 데이터 묶음을 확인하는 단계;
상기 확인된 인덱스 데이터 묶음 중 상기 오프셋 중 나머지 오프셋 값에 해당하는 저장 위치로 갖는 인덱스 데이터를 확인하는 단계;
상기 확인된 인덱스 데이터에 포함된 데이터 식별 정보를 갖는 데이터 묶음을 확인하는 단계;
상기 확인된 데이터 묶음 중 상기 확인된 인덱스 데이터에 포함된 저장 위치에 해당하는 데이터를 확인하는 단계; 및
상기 확인된 데이터를 상기 클라이언트 장치로 전달하는 단계를 포함하는, 분산 스토리지 기반 메시지 저장 방법.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.
데이터 묶음 및 인덱스 데이터 묶음의 적어도 일부를 분산 스토리지 기반 메시지 저장 장치의 캐시에 저장하는 단계를 더 포함하는, 분산 스토리지 기반 메시지 저장 방법.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.
카프카(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.
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.
상기 메시지를 발행하는 프로듀서(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.
오브젝트 형태로 상기 클러스터 서버에 저장되는, 분산 스토리지 기반 메시지 저장 장치.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.
상기 오프셋의 일부 오프셋 값을 상기 데이터의 식별 정보 및 저장 위치를 포함하는 인덱스 데이터의 식별 정보로 결정하고,
상기 오프셋의 나머지 오프셋 값을 상기 인덱스 데이터의 저장 위치로 결정하고,
상기 결정된 식별 정보를 가지는 인덱스 데이터를 상기 결정된 저장 위치에 생성하는, 분산 스토리지 기반 메시지 저장 장치.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.
오브젝트 형태로 상기 클러스터 서버에 저장되는, 분산 스토리지 기반 메시지 저장 장치.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.
상기 클라이언트 장치로부터 메시지 구독 요청을 수신하고,
상기 오프셋 중 일부 오프셋 값을 데이터 식별 정보로 갖는 인덱스 데이터 묶음을 확인하고,
상기 확인된 인덱스 데이터 묶음 중 상기 오프셋 중 나머지 오프셋 값에 해당하는 저장 위치로 갖는 인덱스 데이터를 확인하고,
상기 확인된 인덱스 데이터에 포함된 데이터 식별 정보를 갖는 데이터 묶음을 확인하고,
상기 확인된 데이터 묶음 중 상기 확인된 인덱스 데이터에 포함된 저장 위치에 해당하는 데이터를 확인하고,
상기 확인된 데이터를 상기 클라이언트 장치로 전달하는, 분산 스토리지 기반 메시지 저장 장치.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.
데이터 묶음 및 인덱스 데이터 묶음의 적어도 일부를 저장하도록 구성된 캐시를 더 포함하는, 분산 스토리지 기반 메시지 저장 장치.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.
카프카(Kafka) 프로토콜인, 분산 스토리지 기반 메시지 저장 장치.11. The method of claim 10, wherein the publish-subscribe based message protocol comprises:
Distributed storage-based message storage, a Kafka protocol.
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.
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)
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 |
-
2019
- 2019-12-31 KR KR1020190179626A patent/KR102285759B1/en active IP Right Grant
Patent Citations (2)
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)
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 |