Apache kafka performance(throughput) - without data loss and guaranteeing dat...SANG WON PARK
Apache Kafak의 성능이 특정환경(데이터 유실일 발생하지 않고, 데이터 전송순서를 반드시 보장)에서 어느정도 제공하는지 확인하기 위한 테스트 결과 공유
데이터 전송순서를 보장하기 위해서는 Apache Kafka cluster로 partition을 분산할 수 없게되므로, 성능향상을 위한 장점을 사용하지 못하게 된다.
이번 테스트에서는 Apache Kafka의 단위 성능, 즉 partition 1개에 대한 성능만을 측정하게 된다.
향후, partition을 증가할 경우 본 테스트의 1개 partition 단위 성능을 기준으로 예측이 가능할 것 같다.
cassandra overview & spark to cassandra SuseongPark
For the presentation, Cassandra's behavior and structure are compressed. A light example is attached to help readers understand easily. Therefore, it is not 100% consistent with Cassandra's behavior.
A notable part of this article is Cassandra's Batch tuning using by SSTable.
- cassandra overview.
- spark to cassandra using by sstable.
Apache kafka performance(throughput) - without data loss and guaranteeing dat...SANG WON PARK
Apache Kafak의 성능이 특정환경(데이터 유실일 발생하지 않고, 데이터 전송순서를 반드시 보장)에서 어느정도 제공하는지 확인하기 위한 테스트 결과 공유
데이터 전송순서를 보장하기 위해서는 Apache Kafka cluster로 partition을 분산할 수 없게되므로, 성능향상을 위한 장점을 사용하지 못하게 된다.
이번 테스트에서는 Apache Kafka의 단위 성능, 즉 partition 1개에 대한 성능만을 측정하게 된다.
향후, partition을 증가할 경우 본 테스트의 1개 partition 단위 성능을 기준으로 예측이 가능할 것 같다.
cassandra overview & spark to cassandra SuseongPark
For the presentation, Cassandra's behavior and structure are compressed. A light example is attached to help readers understand easily. Therefore, it is not 100% consistent with Cassandra's behavior.
A notable part of this article is Cassandra's Batch tuning using by SSTable.
- cassandra overview.
- spark to cassandra using by sstable.
4. 왜 쓰나?
- 데이터를 하나로 모을수 있다.
- 비동기적으로 실시간 처리 액세스
- Low Latency
- VS HDFS
- 똑같이 데이터를 하나로 모을 수
있다
- 실시간 처리능력은 떨어진다
5. 특징은?
- Publish / Subscribe
- Producer (메시지 생산) / Consumer (메시지 소비)
- Publish and subscribe to streams of records, similar to a message queue
or enterprise messaging system.
- Process
- 실시간 스트림을 처리 가능 (Kafka Streams)
- Process streams of records as they occur.
- Store
- 메시지를 파일시스템에 저장 (보관주기만큼 저장가능)
- Store streams of records in a fault-tolerant durable way.
6. Core API
메시지 생산
publish a stream of records to one or more Kafka
topics.
메시지 소비
subscribe to one or more topics and process the
stream of records produced to them.
메시지 스트림 처리
act as a stream processor,
consuming an input stream from
one or more topics and producing
an output stream to one or
more output topics, effectively
transforming the input streams to
output streams.
다른 데이터 소스를 카프카에
연결
For example, a
connector to a
relational database might
capture every change to
a table.
7. 카프카 들여다 보기
Kafka Queue 토픽(topic)
- 프로듀서와 컨슈머들이 카프카로 보낸 자신들의
메시지를 구분하기 위한 네임으로 사용
- 0..N개의 토픽이 사용될 수 있다.
파티션(partition)
- 병렬처리가 가능하도록 토픽을 나눌수 있고,
많은 양의 메시지 처리를 위해 파티션의
수를 늘려줄 수 있습니다.
8. 토픽 들여다 보기
토픽은 1~N개 까지의 파티션을 가질 수
있다.
특정 토픽에 프로듀서가 쓴
메시지들이 각 파티션에 골고루 쌓이게
된다.
9. 파티션 들여다 보기
메시지를 한번 쓰고 여러번 읽을 수 있다.(Consume
할 수 있다)
Offset = 어디까지 읽었는지(Consume 했는지) 위
치
Offset은 주키퍼나 카프카 내부에 저장된다.
어떻게 하면 여러번 읽을 수 있나?
-> 컨슈머 그룹을 별도로 주면 된다.
10. 컨슈머 들여다 보기
컨슈머 - 토픽 내 파티션에서 메시지를 하나
씩 꺼내서 소비하는 어플리케이션
마지막으로 사용한 메시지의 오프셋을 저장함으로
써 컨슈머는는 장소를 잃지 않고 중지하고 다
시 시작할 수 있다.
하나의 컨슈머는 하나의 파티션만 읽을 수 있
다. (1:1)
왼쪽과 같이 파티션 3개면..
컨슈머1은..
파티션0과 파티션1을 번갈아 소비한다.
컨슈머는 컨슈머그룹으로 묶일수 있다.
11. 컨슈머그룹 들여다 보기
컨슈머 그룹은..
각 파티션이 컨슈머 그룹 중 하나의 구성원에
의해서만 사용된다는 것을 보장한다.
12. 컨슈머와 프로듀서의 상관관계
c : consumer
p : producer
컨슈머가 파티션보다 많다고 해서 처리가 빨라지는것은
아니다.