Apache Kafka
Definition
2010년 LinkedIn에서 플랫폼 사용자들의 수 많은 구인구직 정보들을 한 곳에서 효율적으로 관리하기 위해 개발한 Open Source Message Queue System.
Context
개발 배경 스토리는 아래와 같다. (출처: InsideBIGDATA)
- LinkedIn 의 Architecture Migration (from Monolith to Microservice)
- Mid-tier Service의 Data Model/Back-end Service로 API 접근 횟수 증가
- 이를 Service 별로 처리하기 위한 Service 별 여러 Data Pipeline들을 구축
- Site Traffic에 따라 개별 Data Pipeline들이 Autoscaling 하지 못하는 문제 발생
- 이에 Autoscaling이 가능한 단일 Distributed Pub-Sub Platform 개발 필요 발생
- 아래 Design Principles에 입각하여 개발
– 심플한 API (producers & consumers양측 모두)
– 높은 정보처리량(throughput)
– Scale-out 방식 아키텍쳐
Use-case
현재 Kafka를 사용하는 기업 (출처 : Apache Kafka)
LinkedIn, Twitter, NetFlix, Spotify, Uber, Goldman Sachs, PayPal, Airbnb …
*Globally하게 Tech-savvy한 기업들.. Open Source 운용에는 DevOps팀 또는 그에 준하는 인력이 필요하다고 여실히 보여진다.
작동 방식
Kafka 의 작동 방식에 관해서는 DevTimes Blog 에 깔끔하게 잘 설명되어 있으니 참고.
기존 Message Queue System 과의 차이점에 대해 간략히 요약하자면,
- Producer ~ Broker : 개별 메시지 전송 뿐만 아니라 Batch 전달 가능
- Broker : Memory 가 아닌 File System에 메시지 저장
- Broker ~ Consumer : Consumer 메시지 Push 받는 방식이 아닌 Pull 하는 방식
장점
쉽고 빠르고 강력하고 확장성 좋다.
약점
관리가 어렵다.
.
AWS Kinesis

Definition
AWS의 Streaming Data를 위한 Platform
Context
Kinesis = re-brand(Apache Kafka) + service*
AWS Kinesis 는 Apache Kafka 를 reference하여 개발되었다.
위에서 service* 라고 함은 크게 두 부류로 파악된다.
- 관리 서비스 (Kafka 의 약점)
– 서버 집합 모니터링·확장·관리
– 소프트웨어 스택 유지·관리
– 클러스터 보안 관리 - 타 AWS 서비스와 연계 편의성
.
결국 Kafka 나 Kinesis 의 역할은 둘다 마찬가지로 데이터 파이프라인이며 목적은 데이터 이동간 Seamless, Real-time 효익 달성에 초점이 맞추어져 있다.
Kinesis 는 비즈니스 용도에 따라 그에 특화된 서비스 상품을 출시했다.
- AWS Kinesis Video Stream : 영상 처리 및 분석 용도
- AWS Kinesis Data Stream : 범용
- AWS Kinesis Firehose : 저장(to AWS S3, Redshift, Elastic Search) 용도
- AWS Kinesis Data Analytics : 분석 용도
Use case
현재 Kinesis 를 사용하는 기업 (출처 : Stackshare)
Instacart, Lyft, Intuit, Zillow, Tilt, AgoraPulse, Custora, GoGuardian …
기타 참고
주요 개념 비교 (출처 : IT Cheer Up)
Concepts | Apache Kafka | AWS Kinesis Data Streams |
Data Storage | Partitions | Shards |
Data Ordering | In partition level | In shard level |
Data Retention | No maximum (configurable) | 1 to 7 days (default is 24 hours) |
Data Size Per Blob | Default 1MB (but can be configured) | Maximum 1 MB |
Partition/Shard Modification | Increase only and does not repartition existing data | Re-shard by merging or splitting shards |
Partition/Shard Limitation | No limit. Optimal partitions depend on the use case | 500 shards in US East (N. Virginia), US West (Oregon), and EU (Ireland) regions. 200 shards in all other regions. |
Data Replication/DR | Cluster mirroring | Automatically across 3 Availability Zones |
Message Delivery Semantics | Kafka guarantees at-least-once delivery by default. Kafka supports exactly-once delivery in Kafka Streams | Kinesis Data Streams has at least once semantics |
Security | Either SSL or SASL and authentication of connections to Kafka Brokers from clients; authentication of connections from brokers to ZooKeeper; data encryption with SSL/TLS | Data can be secured at-rest by using server-side encryption and AWS KMS master keys on sensitive data within KDS. Access data privately via your Amazon Virtual Private Cloud (VPC) |
Monitoring | Yammer Metrics for metrics reporting in the server | AWS CloudWatch and CloudTrail |
Dependency | ZooKeeper | DynamoDB |
Cost | Requires a lot of human support on installation, set up, configuration and clusters management. Setup in weeks | Pay and use. Setup in a couple Of hours |
Apache Kafa 와 AWS Kinesis Architecture (출처: Cloudurable, AWS)
참고 링크
Amazon Kinesis 홈페이지
Apache Kafka 홈페이지
Epic Developer 블로그
Medium 블로그