본문 바로가기

분류 전체보기

(24)
Spring Webflux 동작 원리 및 Spring MVC와의 비교 Spring WebFlux는 비동기(Async) 및 논블로킹(Non-Blocking) 기반의 리액티브 프로그래밍을 지원하는 Spring의 웹 프레임워크이다. 다만, 하지만, 요청마다 Dispatcher Servlet에서 스레드를 하나씩 할당하여 처리하는 비교적 직관적인 Spring MVC와 비교했을 때 Webflux는 조금 어렵다! 적어도 나에게는 그랬다. 그래서 이번 글에서는 Spring Webflux가 어떻게 동작하는지, 그리고 왜 높은 처리량과 확장성에서 강점을 가지는지 알아보고자 한다. Spring MVC vs Webflux특징Spring MVCSpring Webflux프로그래밍 모델Sync / BlockingAsync / Non-Blocking기반 기술Servlet APIReactor, Reac..
CKAD(Certified Kubernetes Application Developer) 합격 후기 및 팁 / 시험 환경 설명 CKAD(Certified Kubernetes Application Developer) 자격증은 쿠버네티스를 운영하는 CNCF(Cloud Native Computing Foundation)와 Linux Foundation에서 주관하는 쿠버네티스 자격 시험이다. 작년에 Linux Foundation에서 할인 이벤트가 있을 때 신청해두었었는데, 신청만 해두고 잊고 살다가 최근에 시험을 보게 되었다. 작년 기준, 신청 이후 1년 내에만 시험을 보면 되고, 응시료는 300불로 꽤 비싼 편이다. 다만, 불합격하게 될 경우 한 번 재시험을 볼 수 있다. 비슷하지만 조금 더 다루는 범위가 넓은 시험으로는 CKA(certified-kubernetes-administrator) 자격증이 있다. 간략하게 나누어보자면, C..
Leetcode: Sliding Window Maximum You are given an array of integers nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time the sliding window moves right by one position. Return the max sliding window. Example 1: Input: nums = [1,3,-1,-3,5,3,6,7], k = 3 Output: [3,3,5,5,6,7] Explanation: Window position Max ------------..
MySQL Transaction Isolation level: REPEATABLE_READ Mode에서의 Lock 이해 Transaction Isolation level에는 READ_UNCOMMITTED, READ_COMMITED, REPEATABLE_READ, SERIALIZABLE 네 가지 종류가 있다. 왼쪽에서 오른쪽으로 갈 수록 강력한 isolation 효과를 볼 수 있지만, 그만큼 동시성이 떨어지게 된다. MySQL에서, 현재의 isolation level은 아래와 같은 SQL로 확인할 수 있다 . mysql> SELECT @@global.tx_isolation; -Global Level +-----------------------+ | @@global.tx_isolation | +-----------------------+ | REPEATABLE-READ | +-----------------------+ 1 r..
Leetcode: Evaluate Division You are given an array of variable pairs equations and an array of real numbers values, where equations[i] = [Ai, Bi] and values[i] represent the equation Ai / Bi = values[i]. Each Ai or Bi is a string that represents a single variable. You are also given some queries, where queries[j] = [Cj, Dj] represents the jth query where you must find the answer for Cj / Dj = ?. Return the answers to all q..
Apache Kafka 기본 개념 (Partition / Consumer / Consumer Group/ Offset Management) Kafka는 가장 널리 쓰이는 메세지 큐 솔루션 중 하나이다. 다른 메세지 큐와 마찬가지로, Producer가 메세지를 publish하면 Consumer가 큐를 susbscribe하며 메세지를 가져가게 된다. 다만, 이 사이에 Topic / Partition / Consumer Group과 같은 개념이 등장하게 된다. How Messages are storedKafka Message는 Disk에 저장이 되고, 일정 기간동안 / 또는 일정 용량에 다다를 때까지 저장할 수 있다. 이 값은 각각 토픽의 아래 property들로 설정이 된다. `retention.ms`: 메세지가 설정된 값 이상으로 오래 되었으면 삭제한다. (default: 604800000 ms = 7일)`retention.bytes`: 해당..
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..
Leetcode: Longest Increasing Subsequence (LIS: 최장 증가 부분 수열) Given an integer array nums, return the length of the longest strictly increasing subsequence. A subsequence is a sequence that can be derived from an array by deleting some or no elements without changing the order of the remaining elements. For example, [3,6,2,7] is a subsequence of the array [0,3,1,6,2,2,7]. Example 1: Input: nums = [10,9,2,5,3,7,101,18] Output: 4 Explanation: The longest inc..