Software Engineering Note

kafka 소개 본문

솔루션/kafka

kafka 소개

devmoons 2015. 9. 6. 01:13

apache kafka


home: http://kafka.apache.org/

github: https://github.com/apache/kafka


kafka 홈에 가보면 "A high-throughput distributed messaging system." 이렇게 소개하고 있다.


처음에는 큐라고 생각하고 접근했는데 큐보다는 훨씬 더 광범위한 기능을 가진, 그야말로 분산 메시징 시스템이다.


kafka에는 몇가지 개념이 있는데 대략 이런 것들이 나온다.


원문

First let's review some basic messaging terminology:


- Kafka maintains feeds of messages in categories called topics.

- We'll call processes that publish messages to a Kafka topic producers.

- We'll call processes that subscribe to topics and process the feed of published messages consumers..

- Kafka is run as a cluster comprised of one or more servers each of which is called a broker.



topic

말 그대로 주제. topic을 만들면 topic에 관심이 있는 consumer 들이 메시지를 가져갈 수 있다.

또, 하나의 토픽은 파티션이라는 단위로 나누어 분산 시킬 수 있고, 복제까지 해둘 수 있다.


producer

메시지를 넣어주는 애들


consumer

메시지를 소비하는 애들


broker

메시지를 저장하고 분산하고.. 해주는 서버들. 얘들이 모여 kafka cluster를 구성한다.


consumer group

consumer 들을 그룹핑한 개념이다.

같은 consumer group에 들어있는 consumer들은 같은 메시지 모음을 처리하게 된다.

그러니까 consumer group이 다르면, 같은 topic에 대해서 독립적으로 처리가 가능하다는 말이다.


kafka는 메시지를 메모리에 들고 있지않고 디스크에 저장한다. 그리고 offset 이라는 단위를 통해 읽어갈 위치를 지정한다.

한국어로 잘 설명된 블로그가 있다. 여기부터 읽어가면 된다.


http://epicdevs.com/17



'솔루션 > kafka' 카테고리의 다른 글

kafka send large message  (0) 2020.05.07
kafka simple consumer  (0) 2015.09.06