본문 바로가기

전체 글

(23)
Apache Kafka 기본 개념 (Partition / Consumer / Consumer Group/ Offset Management) Kafka는 가장 널리 쓰이는 메세지 큐 솔루션 중 하나이다. 다른 메세지 큐와 마찬가지로, Producer가 메세지를 publish하면 Consumer가 큐를 susbscribe하며 메세지를 가져가게 된다. 다만, 이 사이에 Topic / Partition / Consumer Group과 같은 개념이 등장하게 된다. Message Order within Topic / Partition Kafka에서 Producer는 Topic에 메세지를 보내고, 하나의 Topic은 한 개 이상의 Partition으로 나뉘어지게 된다. 이는 topic을 생성하는 시점에 명시할 수 있다. $ /usr/local/kafka/bin/kakfa-topic.sh \ --zookeeper $LIST_OF_ZK_NODES --top..
Leetcode: Minimum Operations to Reduce X to Zero You are given an integer array nums and an integer x. In one operation, you can either remove the leftmost or the rightmost element from the array nums and subtract its value from x. Note that this modifies the array for future operations. Return the minimum number of operations to reduce x to exactly 0 if it's possible, otherwise, return -1. Example 1: Input: nums = [1,1,4,2,3], x = 5 Output: 2..
Kubernetes Architecture (Master Node / Worker Node) 쿠버네티스 클러스터는 Control plane이라고도 불리는 마스터노드와 Worker 노드로 구성된다. 간략하게 구조를 그려보자면, 아래와 같다. 이제부터는 master node와 worker node를 이루는 쿠버네티스의 각 component에 대해 설명해보려 한다. Master Node API Server: 쿠버네티스 API를 노출하는 컴포넌트(REST)로, Kubenretes의 Frontend와 같다. 흔히 사용하는 kubectl과 같은 user interface는 모두 쿠버네티스와 interact하기 위해 API server를 통하게 된다. REST API이기 때문에, 어플리케이션에서도 클라이언트 라이브러리를 통해 호출할 수 있다. etcd: 분산 Key-Value store로, 모든 클러스터 데..
JVM은 어떻게 동작하는가? Introduction JVM(Java Virtual Machine)은 JRE(Java Runtime Environment)의 한 부분으로, Java 어플리케이션을 실행시키는 런타임 엔진이다. JVM은 소스코드 상의 main() 메소드를 호출하여 프로그램을 실행시킨다. 처음 자바를 접해본 사람이라면 JVM, JRE, JDK 등의 용어가 혼동이 되는 경우가 많다. 이를 위해 짧게 정리를 해보자면 아래와 같다. - JVM (Java Virtual Machine): 자바 클래스파일들을 로딩하여 어플리케이션을 수행시키는 가상 머신 - JRE (Java Runtime Environment): 자바 구동 환경. JVM + 시스템 라이브러리 - JDK (Java Development Kit): 자바 개발 키트, JR..