Comparison message queue - ruthetum/study GitHub Wiki

apache kafka, rabbitmq, nats ๋Œ€์ƒ์œผ๋กœ ์ง„ํ–‰ํ•ฉ๋‹ˆ๋‹ค.

๋‹ค์–‘ํ•œ message queue๊ฐ€ ์กด์žฌํ•˜์ง€๋งŒ, ํ˜„์žฌ ๊ธฐ์ค€์œผ๋กœ๋Š” ์š”๊ธˆ์ด ๋ฐœ์ƒํ•˜๋Š” ๊ด€๋ฆฌํ˜• ์„œ๋น„์Šค(managed service)๋Š” ์ œ์™ธํ•˜๊ณ  ๋ฌด๋ฃŒ๋กœ ์šด์šฉ ๊ฐ€๋Šฅํ•œ message queue๋ฅผ ๊ณ ๋ คํ•ฉ๋‹ˆ๋‹ค.

์ผ๋ฐ˜์ ์œผ๋กœ ๋งŽ์ด ์‚ฌ์šฉํ•˜๋Š” kafka, rabbitmq์™€ ๋”๋ถˆ์–ด ์ด์ „์— ์ „์ฒด์ ์œผ๋กœ ์‚ฌ์šฉ ๊ฒฝํ—˜์ด ์žˆ์—ˆ๋˜ nats๋ฅผ ํฌํ•จํ•ฉ๋‹ˆ๋‹ค.

ํŠน์ง•

Apache Kafka

์†Œ๊ฐœ

2011๋…„ ๋งํฌ๋“œ์ธ์—์„œ ๊ฐœ๋ฐœ๋œ ๋น…๋ฐ์ดํ„ฐ๋ฅผ ์ฒ˜๋ฆฌํ•˜๊ธฐ ์œ„ํ•œ ์˜คํ”ˆ ์†Œ์Šค ๋ฉ”์‹œ์ง€ ๋ธŒ๋กœ์ปค(๋ถ„์‚ฐ ๋ฉ”์„ธ์ง• ์‹œ์Šคํ…œ, ์ด๋ฒคํŠธ ์ŠคํŠธ๋ฆฌ๋ฐ ํ”Œ๋žซํผ)

์ž‘์„ฑ ์–ธ์–ด

Java, Scala

์ฃผ์š” ํŠน์ง•

High throughput

  • ๋งŽ์€ ์–‘์˜ ๋ฐ์ดํ„ฐ๋ฅผ ๋ฌถ์Œ ๋‹จ์œ„๋กœ ์ฒ˜๋ฆฌํ•˜๋Š” ๋ฐฐ์น˜๋กœ ๋น ๋ฅด๊ฒŒ ์ฒ˜๋ฆฌํ•˜๊ธฐ ๋•Œ๋ฌธ์— ๋†’์€ ์ฒ˜๋ฆฌ๋Ÿ‰์„ ๋ณด์žฅ

Scalable

  • ํด๋Ÿฌ์Šคํ„ฐ ๋‚ด ๋ธŒ๋กœ์ปค ์ˆ˜๋ฅผ ์กฐ์ ˆํ•˜์—ฌ ๊ฐ€๋ณ€์ ์ธ ํ™˜๊ฒฝ์—์„œ ํ™•์žฅ์„ฑ์žˆ๊ฒŒ ์šด์˜ ๊ฐ€๋Šฅ

Persistent Stroage

  • ๋””์Šคํฌ์— ๋ฉ”์‹œ์ง€๋ฅผ ์ €์žฅํ•˜๊ธฐ ๋•Œ๋ฌธ์— ๋ฉ”์‹œ์ง€ ์†์‹ค์ด ์—†์Œ(๋ฐ์ดํ„ฐ๋ฅผ ์ƒ์„ฑํ•œ ํ”„๋กœ๊ทธ๋žจ์ด ์ข…๋ฃŒ๋˜๋”๋ผ๋„ ์‚ฌ๋ผ์ง€์ง€ ์•Š์Œ)

High Availbility

  • ํด๋Ÿฌ์Šคํ„ฐ ๋‚ด ์ผ๋ถ€ ์„œ๋ฒ„์— ์žฅ์• ๊ฐ€ ๋ฐœ์ƒํ•˜๋”๋ผ๋„ ๋ฌด์ค‘๋‹จ์œผ๋กœ ์•ˆ์ „ํ•˜๊ณ  ์ง€์†์ ์œผ๋กœ ๋ฐ์ดํ„ฐ๋ฅผ ์ฒ˜๋ฆฌํ•  ์ˆ˜ ์žˆ์Œ
  • ๋ฐ์ดํ„ฐ ๋ณต์ œ(replication)๋ฅผ ํ†ตํ•ด ๊ณ ๊ฐ€์šฉ์„ฑ ๋ณด์žฅ

์‚ฌ์šฉ ํšŒ์‚ฌ

  • Apple, Netflix, Uber, PayPal, Spotify, Slack ...
  • More than 80% of all Fortune 100 companies trust, and use Kafka.

RabbitMQ

์†Œ๊ฐœ

AMQP(Advanced Message Queuing Protocol)๊ธฐ๋ฐ˜์˜ ์˜คํ”ˆ ์†Œ์Šค ๋ฉ”์‹œ์ง€ ๋ธŒ๋กœ์ปค

  • AMQP: MQ์˜ ์˜คํ”ˆ์†Œ์Šค์— ๊ธฐ๋ฐ˜ํ•œ ํ‘œ์ค€ ํ”„๋กœํ† ์ฝœ (ํŠน์ • ํ”Œ๋žซํผ์— ์ข…์†๋œ ํ”„๋กœํ† ์ฝœ์ด ์•„๋‹˜)

๋ฉ”์„ธ์ง€๋ฅผ ๋งŽ์€ ์‚ฌ์šฉ์ž์—๊ฒŒ ์ „๋‹ฌํ•˜๊ฑฐ๋‚˜, ์š”์ฒญ์— ๋Œ€ํ•œ ์ฒ˜๋ฆฌ ์‹œ๊ฐ„์ด ๊ธธ ๋•Œ, ์š”์ฒญ์„ ๋‹ค๋ฅธ API์—๊ฒŒ ์œ„์ž„ํ•˜๊ณ  ๋น ๋ฅธ ์‘๋‹ต์„ ํ•  ๋•Œ ๋งŽ์ด ์‚ฌ์šฉ

์ž‘์„ฑ ์–ธ์–ด

Erlang

์ฃผ์š” ํŠน์ง•

In-built Clustering

  • ํ•˜๋‚˜์˜ ๋…ธ๋“œ์— ์žฅ์• ๊ฐ€ ๋ฐœ์ƒํ•˜๋”๋ผ๋„ ์†Œ๋น„์ž์™€ ์ƒ์‚ฐ์ž๋Š” ์ด๋ฒคํŠธ์—์„œ ๊ณ„์† ์ž‘๋™ํ•˜๊ณ  ์ถ”๊ฐ€ ๋…ธ๋“œ๋ฅผ ์ถ”๊ฐ€ํ•˜์—ฌ ๋ฉ”์‹œ์ง• ์ฒ˜๋ฆฌ๋Ÿ‰์„ ์„ ํ˜•์ ์œผ๋กœ ํ™•์žฅ ๊ฐ€๋Šฅ

Flexible Routing

  • ์ผ๋ฐ˜์ ์ธ ๋ผ์šฐํŒ…๋ถ€ํ„ฐ ๋ณต์žกํ•œ ๋ผ์šฐํŒ…๊นŒ์ง€ ๋‹ค์–‘ํ•˜๊ณ  ์œ ์—ฐํ•œ ๋ผ์šฐํŒ… ๋ฐฉ๋ฒ•์„ ์ž‘์—…

Reliability

  • Persistence(์ง€์†์„ฑ), delivery feedback, publisher confirms(๋ธŒ๋กœ์ปค์—๊ฒŒ ๋„๋‹ฌ ํ™•์ธ), and high availability(๊ณ ๊ฐ€์šฉ์„ฑ) ์ œ๊ณต

Management & Monitoring

  • ๊ด€๋ฆฌ์™€ ๋ชจ๋‹ˆํ„ฐ๋ง์„ ์œ„ํ•œ ํŽธ์˜ ๊ธฐ๋Šฅ ์ œ๊ณต

์‚ฌ์šฉ ํšŒ์‚ฌ

Raddit, CircleCI, Trivago, Runtastic ...

NATS

์†Œ๊ฐœ

NATS๋Š” ํด๋ผ์šฐ๋“œ ๋„ค์ดํ‹ฐ๋ธŒ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜, IoT ๋ฉ”์‹œ์ง• ๋ฐ ๋งˆ์ดํฌ๋กœ ์„œ๋น„์Šค ์•„ํ‚คํ…์ฒ˜๋ฅผ ์œ„ํ•œ ๋‹จ์ˆœํ•˜๊ณ  ์•ˆ์ „ํ•œ ๊ณ ์„ฑ๋Šฅ ์˜คํ”ˆ ์†Œ์Šค ๋ฉ”์‹œ์ง• ๋ธŒ๋กœ์ปค

Kafka์™€ ๊ฐ™์ด Streaming ๊ธฐ๋ฐ˜์˜ ์ „์†ก์œผ๋กœ Pub/Sub ๊ธฐ๋ฐ˜์˜ ๋ฐ์ดํ„ฐ ์ฒ˜๋ฆฌ๊ฐ€ ๊ฐ€๋Šฅ

์ž‘์„ฑ ์–ธ์–ด

Go

์ฃผ์š” ํŠน์ง•

High throughput

  • ํƒ€ ์˜คํ”ˆ์†Œ์Šค ๋ฉ”์‹œ์ง€ ๋ธŒ๋กœ์ปค์™€ ๋น„๊ต ์‹œ ์šฐ์›”ํ•œ ์„ฑ๋Šฅ ๋ณด์œ 

Deploy anywhere

  • ๊ฐ€๋ณ๊ณ  ๊ฐ„๋‹จํ•˜๊ธฐ ๋•Œ๋ฌธ์— ์–ด๋–ค ํ™˜๊ฒฝ์—์„œ๋“  ๋ฐฐํฌ ๊ฐ€๋Šฅํ•˜๊ณ  ํ™œ์šฉ ๊ฐ€๋Šฅ

Scalable

  • scale out ์— ์šฉ์ดํ•œ ๊ตฌ์กฐ

์‚ฌ์šฉ ํšŒ์‚ฌ

Zenly, Teachable, LaunchDarkly ...

๋น„๊ต

image

๋ฉ”์‹œ์ง€ ํ๋ฅผ ์„ ํƒํ•˜๊ธฐ ์œ„ํ•ด ์•„๋ž˜ 6๊ฐ€์ง€ ํ•ญ๋ชฉ์„ ํ™•์ธ

  • ์–ธ์–ด ์ง€์›
  • ์ฒ˜๋ฆฌ๋Ÿ‰
  • ๋ฉ”์„ธ์ง€ ์ „๋‹ฌ
  • ๊ณ ๊ฐ€์šฉ์„ฑ
  • ๊ด€๋ฆฌ ๋ฐ ๋ชจ๋‹ˆํ„ฐ๋ง
  • ์ฐธ๊ณ ์ž๋ฃŒ

ํด๋Ÿฌ์Šคํ„ฐ ๋‚ด๋ถ€์—์„œ ์—ฐ๊ฒฐ ๋ฐ ํ†ต์‹ ์„ ์ง„ํ–‰ํ•˜๊ธฐ ๋•Œ๋ฌธ์— ๋ณด์•ˆ ๊ด€๋ จ ๋ถ€๋ถ„(AuthN, AuthZ)์€ ๋‹น์žฅ์˜ ์šฐ์„ ์ˆœ์œ„์—์„œ ๋†’๊ฒŒ ์ธก์ •ํ•˜์ง€ ์•Š์Œ

(๊ฐœ๋ณ„์ ์œผ๋กœ ๋ณด์•ˆ ๊ด€๋ จ ๋ถ€๋ถ„์€ ์ง€์›ํ•˜๊ณ  ์žˆ๊ธฐ ๋•Œ๋ฌธ์— ํ•„์š” ์‹œ ํ™œ์šฉ ๊ฐ€๋Šฅํ•  ๊ฒƒ์œผ๋กœ ํŒ๋‹จ)

์–ธ์–ด ์ง€์›

๊ณ ๋ คํ•˜๊ณ  ์žˆ๋Š” ๋ชจ๋“  ๋Œ€์ƒ์— ๋Œ€ํ•ด์„œ ์ง€์›

Project Compatibility Reference
Apache Kafka O https://docs.nestjs.com/microservices/kafka
RabbitMQ O https://docs.nestjs.com/microservices/rabbitmq
NATS O https://docs.nestjs.com/microservices/nats

์ฒ˜๋ฆฌ๋Ÿ‰

image

Project Throughput
Apache Kafka 100K msgs/s
RabbitMQ 20-50K msgs/s
NATS 200K msgs/s

NATS > Apache Kafka > RabbitMQ

์„ฑ๋Šฅ ํ…Œ์ŠคํŠธ ๋ฐฉ๋ฒ•์ด๋‚˜ ๋ฉ”์„ธ์ง€ ํฌ๊ธฐ์— ๋”ฐ๋ผ ์ธก์ •๋œ ์ฒ˜๋ฆฌ๋Ÿ‰ ์ฐจ์ด๊ฐ€ ๋ฐœ์ƒํ•˜์ง€๋งŒ ๋ณดํŽธ์ ์œผ๋กœ ํ™•์ธํ–ˆ์„ ๋•Œ ์œ„์™€ ๊ฐ™์Œ

NATS Streaming(JetStream)์˜ ๊ฒฝ์šฐ Kafka์™€ ๋น„์Šทํ•œ ์ฒ˜๋ฆฌ๋Ÿ‰์„ ๋ณด์ž„

๋‹น์—ฐํ•˜๊ฒ ์ง€๋งŒ ๋ฉ”์‹œ์ง€ ํฌ๊ธฐ๊ฐ€ ํฌ๋ฉด ํด์ˆ˜๋ก ์ „์ฒด์ ์œผ๋กœ ๋ฉ”์„ธ์ง€ ํ์˜ ์„ฑ๋Šฅ์ด ๋–จ์–ด์ง

  • ์ด์— ๋Œ€ํ•œ ํ•ด๋ฒ•์€ ์•„๋‹ˆ๊ฒ ์ง€๋งŒ zero payload ๋ฐฉ์‹ ์ ์šฉ ์‹œ ์ผ์ • ๋ถ€๋ถ„ ์„ฑ๋Šฅ ๊ฐœ์„  ๊ฐ€๋Šฅ (๋ฉ”์‹œ์ง€ ํฌ๊ธฐ ๊ฐ์†Œ)
  • zero payload ๋ฐฉ์‹์˜ ๊ฒฝ์šฐ ๋ณธ๋ž˜ ๋ชฉ์ ์€ ๋ฉ”์„ธ์ง€ ํฌ๊ธฐ๋ฅผ ์ค„์ด๊ธฐ ์œ„ํ•œ ๋ฐฉ๋ฒ•์ด๋ผ๊ธฐ๋ณด๋‹ค๋Š” (ํ์˜ ๋น„์ˆœ์ฐจ์„ฑ ๋˜๋Š” ์ค‘๋ณต ์ „์†ก์œผ๋กœ ์ธํ•œ) ๋ฉฑ๋“ฑ์„ฑ์„ ๋ณด์žฅํ•˜๊ธฐ ์œ„ํ•œ ๋ฐฉ์‹

๋ฉ”์„ธ์ง€ ์ „๋‹ฌ

image

  • At most once(์ตœ๋Œ€ ํ•œ๋ฒˆ): ์ตœ๋Œ€ ํ•œ ๋ฒˆ๋งŒ ์ „์†ก, ๋ฉ”์‹œ์ง€๋ฅผ ํ•œ๋ฒˆ๋งŒ ์ „์†กํ•˜๊ณ  ์ƒ๋Œ€๊ฐ€ ๋ฐ›์•˜๋Š”์ง€ ๋ฐ›์ง€ ๋ชปํ–ˆ๋Š”์ง€๋Š” ํ™•์ธํ•˜์ง€ ์•Š์Œ
  • At least once(์ตœ์†Œ ํ•œ๋ฒˆ): ๋ฉ”์‹œ์ง€๋ฅผ ์ „์†กํ•˜๊ณ  ์ตœ์†Œํ•œ ์ƒ๋Œ€๋ฐฉ์ด ํ•˜๋‚˜์˜ ๋ฉ”์‹œ์ง€๋Š” ๋ฐ›์•˜๋Š”์ง€ ํ™•์ธ
  • Exactly once(์ •ํ™•ํžˆ ํ•œ๋ฒˆ): ๋ฉ”์‹œ์ง€๋ฅผ ์ •ํ™•ํžˆ ํ•œ๋ฒˆ๋งŒ ์ „์†ก
Project QoS / Guarantees
Apache Kafka At least once, Exactly once
RabbitMQ At most once, At least once
NATS (with JetStream) At most once, At least once, Exactly once

๊ณ ๊ฐ€์šฉ์„ฑ

Availability = Uptime / ( Uptime + Downtime )

  • Availability(๊ฐ€์šฉ์„ฑ): ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋˜๋Š” ์‹œ์Šคํ…œ์ด ์ •์ƒ์ ์œผ๋กœ ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ์ •๋„
  • High Availability(๊ณ ๊ฐ€์šฉ์„ฑ): ๊ธด ์‹œ๊ฐ„๋™์•ˆ ์ง€์†์ ์œผ๋กœ ์šด์˜์ด ๊ฐ€๋Šฅํ•œ ์‹œ์Šคํ…œ์ด๋‚˜ ์ปดํฌ๋„ŒํŠธ (available 99.999%)
Project High Availability
Apache Kafka ํด๋Ÿฌ์Šคํ„ฐ์™€ ๋ฆฌํ”Œ๋ฆฌ์ผ€์ด์…˜ ๊ตฌ์„ฑ์œผ๋กœ ๊ฐ€์šฉ์„ฑ ๋ณด์žฅ
RabbitMQ ํด๋Ÿฌ์Šคํ„ฐ๋ฅผ ํ™œ์šฉํ•˜์—ฌ ๊ฐ€์šฉ์„ฑ ๋ณด์žฅ
NATS (with JetStream) ํด๋Ÿฌ์Šคํ„ฐ๋ฅผ ํ™œ์šฉํ•˜์—ฌ ๊ฐ€์šฉ์„ฑ ๋ณด์žฅ

๊ด€๋ฆฌ ๋ฐ ๋ชจ๋‹ˆํ„ฐ๋ง

Project Management tools Reference
Apache Kafka ๊ณต์‹ ๊ด€๋ฆฌ ๋„๊ตฌ๋Š” ์กด์žฌํ•˜์ง€ ์•Š์ง€๋งŒ, ๋‹ค์–‘ํ•œ ์†Œ์Šค๋“ค์ด ์กด์žฌ https://towardsdatascience.com/overview-of-ui-monitoring-tools-for-apache-kafka-clusters-9ca516c165bd
RabbitMQ ๊ด€๋ฆฌ ๋ฐ ๋ชจ๋‹ˆํ„ฐ๋ง์„ ํ•˜๊ธฐ ์œ„ํ•œ ๋Œ€์‹œ๋ณด๋“œ ๊ธฐ๋Šฅ์ด ๋‚ด์žฅ https://www.cloudamqp.com/blog/part3-rabbitmq-for-beginners_the-management-interface.html
NATS (with JetStream) API ํ˜•ํƒœ๋กœ metric์„ ์ œ๊ณตํ•˜์ง€๋งŒ, ๊ด€๋ฆฌ ๋ฐ ๋ชจ๋‹ˆํ„ฐ๋ง์— ์šฉ์ดํ•˜์ง€ ์•Š์Œ https://docs.nats.io/running-a-nats-service/nats_admin/monitoring

์ฐธ๊ณ ์ž๋ฃŒ

Project Github stars Questions of Stackoverflow
Apache Kafka 25.1K 31,257
RabbitMQ 10.8K 14,113
NATS 12.9k 815

์˜ค๋žœ ๊ธฐ๊ฐ„ ์ง€์†์ ์œผ๋กœ ๋งŽ์ด ์‚ฌ์šฉ๋˜์—ˆ๋˜ kafka์™€ rabbitmq๊ฐ€ ๋ž˜ํผ๋Ÿฐ์Šค๋Š” ๋งŽ์Œ

์š”์•ฝ

์„ธ ๊ฐ€์ง€ ๋ฉ”์„ธ์ง€ํ ๋ชจ๋‘ ํ˜„์žฌ ๊ธฐ์ค€์œผ๋กœ ๋„์ž…ํ•˜๋Š”๋ฐ ๋ฌธ์ œ๋Š” ์—†์Œ

  • ๋น„๋™๊ธฐ ๋ฉ”์„ธ์ง€ ์ „์†ก
  • ์ฒ˜๋ฆฌ๋Ÿ‰
  • ...

์ผ๋ฐ˜์ ์œผ๋กœ kafka์™€ rabbitmq๊ฐ€ ์„ฑ์ˆ™(์˜ค๋žœ๊ธฐ๊ฐ„ ์•ˆ์ •์ ์œผ๋กœ ์—ฌ๋Ÿฌ ๊ณณ์—์„œ ์‚ฌ์šฉ)ํ•˜๋‹ค๊ณ  ํ‰๊ฐ€

  • ์ด์— ๋”ฐ๋ฅธ reference๋„ ๋งŽ์ด ์กด์žฌ

kafka์™€ rabbitmq๋ฅผ ๋น„๊ตํ•  ๋•Œ ํŠธ๋ž˜ํ”ฝ์˜ ํฌ๊ธฐ๊ฐ€ ๋งŽ์ด ๋…ผ์˜๋˜์—ˆ๊ณ , ์•ˆ์ •์„ฑ๊ณผ ์„ฑ๋Šฅ์„ ๊ณ ๋ คํ–ˆ์„ ๋•Œ ๋Œ€์šฉ๋Ÿ‰ ์ฒ˜๋ฆฌ๋ฅผ ์œ„ํ•ด์„œ๋Š” ๋Œ€๋ถ€๋ถ„ kafka๋ฅผ ๊ถŒ์žฅ

  • ํŠธ๋ž˜ํ”ฝ์ด ์ฆ๊ฐ€ํ•จ์— ๋”ฐ๋ผ rabbit mq์—์„œ kafka๋กœ ๋ฉ”์„ธ์ง€ํ๋ฅผ ๋ณ€๊ฒฝํ–ˆ๋‹ค๋Š” ๊ฒฝ์šฐ๋„ ์กด์žฌ

์ƒ๋Œ€์ ์œผ๋กœ rabbitmq๊ฐ€ ๊ฐ•์ ์ด ์žˆ๋‹ค๊ณ  ํ•œ ๋‚ด์šฉ์€ ์•„๋ž˜์™€ ๊ฐ™์Œ

  • low latency

    • ๋ฌผ๋ก  ํŠธ๋ž˜ํ”ฝ์ด ๋งŽ์•„์ง€๋ฉด ์ฒ˜๋ฆฌ๋Ÿ‰์ด ๋–จ์–ด์ง€๊ธฐ ๋•Œ๋ฌธ์— latency๊ฐ€ ๊ธ‰์ฆํ•˜์ง€๋งŒ, ํŠธ๋ž˜ํ”ฝ์ด ์ˆ˜์šฉ ๊ฐ€๋Šฅํ•œ ๊ฒฝ์šฐ ์ƒ๋Œ€์ ์œผ๋กœ latency๊ฐ€ ๋‚ฎ์Œ
    • ๋ธŒ๋กœ์ปค/์ปจ์Šˆ๋จธ๊ฐ„ ์ ‘๊ทผ ๋ฐฉ๋ฒ•์˜ ์ฐจ์ด ๋•Œ๋ฌธ์— ๋ฐœ์ƒ
      • kafka: pull-based approach (smart consumer dumb broker)
      • rabbitmq: push-based approach (smart broker, dumb consumer)
  • flexible routing

    • rabbitmq์˜ ๋‹ค์–‘ํ•œ Exchange pattern(consumer๋“ค์„ ๋Œ€์ƒ์œผ๋กœ ๋ฉ”์„ธ์ง€๋ฅผ ๋ฐœํ–‰ํ•˜๋Š” ๋ฐฉ๋ฒ•)์„ ์ œ๊ณต
      • consumer๊ฐ€ topic(subject)๋ฅผ ๊ตฌ๋…ํ–ˆ์„ ๋•Œ ๋‹ค์–‘ํ•œ ํŒจํ„ด ๋ฐ ์กฐํ•ฉ์œผ๋กœ ๋ฉ”์„ธ์ง€๋ฅผ ์ „๋‹ฌํ•  ์ˆ˜ ์žˆ์Œ
    • kafka์˜ ๊ฒฝ์šฐ ๋‹จ์ˆœํ•œ ๋ผ์šฐํŒ… ๋ฐฉ๋ฒ•๋งŒ ์ง€์›ํ•˜๊ธฐ ๋•Œ๋ฌธ์— ๊ฐœ๋ณ„ ๋งˆ์ดํฌ์„œ๋น„์Šค์—์„œ ๋ณต์žกํ•œ ๋ฐฉ์‹์œผ๋กœ topic์„ ๊ตฌ๋…ํ•ด์•ผ ํ•˜๋Š” ๊ฒฝ์šฐ rabbitmq๊ฐ€ kafka๋ณด๋‹ค ์œ ์—ฐํ•˜๊ฒŒ ๋ฉ”์„ธ์ง€๋ฅผ ์ „๋‹ฌํ•  ์ˆ˜ ์žˆ์Œ
  • user-friendly interface for management

    • rabbitmq์˜ ๊ฒฝ์šฐ ๊ด€๋ฆฌ ๋ฐ ๋ชจ๋‹ˆํ„ฐ๋ง์„ ํ•˜๊ธฐ ์œ„ํ•œ ๋Œ€์‹œ๋ณด๋“œ ๊ธฐ๋Šฅ์ด ๋‚ด์žฅ
    • kafka๋Š” ์™ธ๋ถ€ OSS๋ฅผ ํ™œ์šฉํ•˜์—ฌ ์ง€์›
  • ๊ทธ ์™ธ์— kafka๋Š” ์ž์ฒด ํ”„๋กœํ† ์ฝœ, rabbitmq๋Š” AMQP ๊ธฐ๋ฐ˜์ด๊ธฐ ๋•Œ๋ฌธ์— ์ƒ๋Œ€์ ์œผ๋กœ ๋‹ค์–‘ํ•œ ํ”Œ๋žซํผ๊ณผ ํ˜ธํ™˜๋  ์ˆ˜ ์žˆ์Œ

Reference

recommendation

--

https://www.codenary.co.kr/techblog/list?tag=kafka

https://www.codenary.co.kr/techblog/list?tag=rabbitmq

--

Is there any reason to use RabbitMQ over Kafka

I wrote an answer on Stackoverflow a while ago to answer the question, โ€œIs there any reason to use RabbitMQ over Kafka?โ€. The answer is just a few lines, but it has proven to be an answer many people have found helpful.

์ €๋Š” ์–ผ๋งˆ ์ „ ์Šคํƒ ์˜ค๋ฒ„ํ”Œ๋กœ์— "๋ž˜๋น—์„ ์‚ฌ์šฉํ•  ์ด์œ ๊ฐ€ ์žˆ์Šต๋‹ˆ๊นŒ?"๋ผ๋Š” ์งˆ๋ฌธ์— ๋‹ตํ•˜๊ธฐ ์œ„ํ•ด ๋‹ต์„ ์ผ์Šต๋‹ˆ๋‹คMQ over Kafka?" ๋‹ต์€ ๋ช‡ ์ค„์— ๋ถˆ๊ณผํ•˜์ง€๋งŒ, ๋งŽ์€ ์‚ฌ๋žŒ๋“ค์ด ๋„์›€์ด ๋œ๋‹ค๊ณ  ์ƒ๊ฐํ•˜๋Š” ๋‹ต์ž„์ด ์ฆ๋ช…๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

I will try to break down the answer into sub answers and try to explain each part.

๋‹ต์„ ํ•˜์œ„ ๋‹ต์œผ๋กœ ๋‚˜๋ˆ„๊ณ  ๊ฐ ๋ถ€๋ถ„์„ ์„ค๋ช…ํ•˜๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

First of all, I wrote - โ€œRabbitMQ" is a solid, mature, general-purpose message broker that supports several protocols such as AMQP, MQTT, STOMP, and more.

๋จผ์ €, ์ €๋Š” "RabbitMQ"๋Š” AMQP, MQTT, STOMP ๋“ฑ๊ณผ ๊ฐ™์€ ์—ฌ๋Ÿฌ ํ”„๋กœํ† ์ฝœ์„ ์ง€์›ํ•˜๋Š” ๊ฒฌ๊ณ ํ•˜๊ณ  ์„ฑ์ˆ™ํ•œ ๋ฒ”์šฉ ๋ฉ”์‹œ์ง€ ๋ธŒ๋กœ์ปค๋ผ๊ณ  ์ผ์Šต๋‹ˆ๋‹ค.

RabbitMQ can handle high throughput. A common use case for it is to handle background jobs or to act as a message broker between microservices.

RabbitMQ๋Š” ๋†’์€ ์ฒ˜๋ฆฌ๋Ÿ‰์„ ์ฒ˜๋ฆฌํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ผ๋ฐ˜์ ์œผ๋กœ ๋ฐฑ๊ทธ๋ผ์šด๋“œ ์ž‘์—…์„ ์ฒ˜๋ฆฌํ•˜๊ฑฐ๋‚˜ ๋งˆ์ดํฌ๋กœ์„œ๋น„์Šค ๊ฐ„์˜ ๋ฉ”์‹œ์ง€ ๋ธŒ๋กœ์ปค ์—ญํ• ์„ ์ˆ˜ํ–‰ํ•˜๋Š” ๊ฒƒ์ด ์ด ์†”๋ฃจ์…˜์˜ ์ผ๋ฐ˜์ ์ธ ์‚ฌ์šฉ ์‚ฌ๋ก€์ž…๋‹ˆ๋‹ค.

Kafka is a message bus optimized for high-ingress data streams and replay. Kafka can be seen as a durable message broker where applications can process and re-process streamed data on disk."

Kafka๋Š” ๋†’์€ ์ž…๋ ฅ ๋ฐ์ดํ„ฐ ์ŠคํŠธ๋ฆผ ๋ฐ ์žฌ์ƒ์— ์ตœ์ ํ™”๋œ ๋ฉ”์‹œ์ง€ ๋ฒ„์Šค์ž…๋‹ˆ๋‹ค. Kafka๋Š” ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์ด ๋””์Šคํฌ์—์„œ ์ŠคํŠธ๋ฆฌ๋ฐ๋œ ๋ฐ์ดํ„ฐ๋ฅผ ์ฒ˜๋ฆฌํ•˜๊ณ  ๋‹ค์‹œ ์ฒ˜๋ฆฌํ•  ์ˆ˜ ์žˆ๋Š” ๋‚ด๊ตฌ์„ฑ ์žˆ๋Š” ๋ฉ”์‹œ์ง€ ๋ธŒ๋กœ์ปค๋กœ ๊ฐ„์ฃผ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค."

Regarding the term โ€œmatureโ€; RabbitMQ has simply been on the market for a longer time then Kafka (2007 vs 2011, respectively).

"์„ฑ์ˆ™ํ•œ"์ด๋ผ๋Š” ์šฉ์–ด์™€ ๊ด€๋ จํ•˜์—ฌ, ํ† ๋ผMQ๋Š” Kafka(๊ฐ๊ฐ 2007๋…„๊ณผ 2011๋…„)๋ณด๋‹ค ๋” ์˜ค๋žซ๋™์•ˆ ์‹œ์žฅ์— ๋‚˜์™€ ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค.

Both RabbitMQ and Kafka are โ€œmatureโ€, which means they both are considered to be reliable and scalable messaging systems.

RabbitMQ์™€ Kafka๋Š” ๋ชจ๋‘ "์„ฑ์ˆ™ํ•œ" ์ œํ’ˆ์ž…๋‹ˆ๋‹ค. ์ฆ‰, ๋‘˜ ๋‹ค ์•ˆ์ •์ ์ด๊ณ  ํ™•์žฅ ๊ฐ€๋Šฅํ•œ ๋ฉ”์‹œ์ง• ์‹œ์Šคํ…œ์œผ๋กœ ๊ฐ„์ฃผ๋ฉ๋‹ˆ๋‹ค.