책책책 책을 읽읍시다/프로그래밍
-
함께 자라기 : 애자일로 가는 길책책책 책을 읽읍시다/프로그래밍 2023. 6. 19. 22:05
저자 : 김창준 들어가며 성장에 관심 많은 개발자라면(이렇게 말하는 이유는 성장에 관심 없는 개발자도 많기 때문이다) 꼭 읽어볼만한 책이다. 현재까지의 자기 성장을 돌아보고 앞으로 동료들과 어떻게 더 성장할 지에 대해 도움받을 수 있기 때문이다. 보는 내내 전 직장인 이랜드에서 후배들 온보딩할 때 참 안좋은 방식으로 했다는 미안함이 들었고, 그에 맞게 나도 실력적으로건 인격적으로건 성장을 잘 못했다는 후회가 들었다. 한 가지 아쉬운 건 중간중간 논리를 뒷받침할 저자 본인의 재미있는 블로그 글이 주석으로 실렸는데, 2023년 6월 16일 이후로 egloos가 서비스를 종료함에 따라 더 볼 수 없게 된다는 점이다. 김창준님 블로그는 찾아봤는데 egloos 외에는 안나온다. 아무튼 이제 8년차에 접어든 나에게..
-
카프카 핵심 가이드 5 : 멱등성책책책 책을 읽읍시다/프로그래밍 2023. 6. 12. 23:07
8. '정확히 한 번' 의미 구조 멱등적 프로듀서 멱등성 의미 구조가 아닌 '최소 한 번' 의미 구조를 가지도록 프로듀서를 설정한다면, 프로듀서가 메세지 전송을 재시도함으로써 메세지가 최소 한 번 이상 도착할 수 있는 불확실성이 존재하게 된다. 이렇게 재시도는 메세지 중복으 발생시킬 수 있다. 가장 고전적인 경우리면, 이런 경우가 있겠다. 파티션 리더가 프로듀서로부터 레코드를 받아서 팔로워들에게 성공적으로 복제한다. 프로듀서에게 응답을 보내기 전, 파티션 리더가 있는 브로커에 크래시가 발생한다. 프로듀서 입장에서는 응답을 받지 못한 채 타임아웃이 발생하고, 메세지를 재전송한다. 재전송된 메세지가 새 리더에 도착한다. 하지만 이 메세지는 이미 저장되어 있다(결과적으로, 중복이 발생한다). 어떤 애플리케..
-
카프카 핵심 가이드 4 : 내부 메커니즘책책책 책을 읽읍시다/프로그래밍 2023. 6. 11. 15:47
6. 내부 메커니즘복제 복제는 카프카 아키텍처의 핵심이다. 실제로 카프카는 '분산되고, 분할되고, 복제된 커밋 로그 서비스'로 표현되기도 한다. 복제가 중요한 이유는 개별적인 노드에 필연적으로 장애가 발생할 수밖에 없는 상황에서 카프카가 신뢰성과 지속성을 보장하는 방식이기 때문이다. 카프카에 저장되는 데이터는 토픽을 단위로 해서 조직화한다. 각 토픽은 1개 이상의 파티션으로 분할되며, 각 파티션으 다시 다수의 레플리카를 가질 수 있다. 각각의 레플리카는 브로커에 저장되는데, 대개 하나의 브로커는 (서로 다른 토픽과 파티션에 속하는) 수백 개에서 심지어 수천 개의 레플리카를 저장한다. 레플리카에는 두 종류가 있다.리더 레플리카 : 각 파티션에는 리더 역할을 하는 레플리카가 하나씩 있다. 일관성을 보장하기 ..
-
카프카 핵심 가이드 2 : 프로듀서책책책 책을 읽읍시다/프로그래밍 2023. 6. 9. 21:35
3. 카프카 프로듀서: 카프카에 메세지 쓰기카프카 프로듀서 생성하기 카프카에 메세지를 쓰려면 우선 원하는 속성을 지정해서 프로듀서 객체를 생성해야 한다. 카프카 프로듀서는 아래의 3개의 필수 속성값을 갖는다.bootstrap.servers 카프카 클러스터와 첫 연결을 생성하기 위해 프로듀서가 사용할 브로커의 host:port 목록이다. 이 값은 모든 브로커를 포함할 필요는 없는데, 프로듀서가 첫 연결을 생성한 뒤 추가 정보를 받아오게 되어 있기 때문이다. 다만 브로커 중 하나가 작동을 정지하는 경우에도 프로듀서가 클러스터에 연결할 수 있도록 최소 2개 이상을 지정할 것을 권장한다.key.serializer 카프카에 쓸 레코드의 키의 값을 직렬화하기 위해 사용하는 시리얼라이저(serializer) 클래스의..
-
카프카 핵심 가이드 1 - 카프카 입문책책책 책을 읽읍시다/프로그래밍 2023. 6. 6. 15:53
저자 : 그웬 샤피라(Gwen Shapira), 토드 팔리노(Todd Palino), 라지니 시바람(Rajini Sivaram), 크레트 페티(Krit Petty) 옮긴이 : 이동진 들어가며 아파치 카프카 관련 다른 책들은 안 읽어봤는데, 이 책만으로도 카프카 기반 지식은 꽤 많이 얻어갈 수 있었다. Real MySQL처럼 각 기능에 대해 세세하고 적용점 예시까지는 안나와있지만, 기본 원리와 주의사항들은 잘 나와있는 편이다. 더 깊게 공부하려면 공식 문서와 코드레벨을 봐야할 것 같다. 초중반부가 카프카를 메세지 브로커로 사용하는 개발자에게 유용한 토픽, 파티션, API 등에 대해 나와있고, 후반부는 모니터링과 클러스터링 등 인프라적인 내용이 많이 서술되어 있다. 발췌 내용 정리 1. 발행/구독 메세지 전..
-
Redis 운영 관리책책책 책을 읽읍시다/프로그래밍 2023. 5. 6. 23:50
저자 : 강대명 들어가며 레디스 구조에 대해 얇은 지식이라도 알고 싶은데 블로그도 검색하기 귀찮은데 11,900원 정도는 지불할 용의가 있는 사람들에게 추천하는 책이다. 혹은 배민같이 도서 구입비가 무제한인 회사에 다니면서 휴가가서 가볍게(70쪽) 뭐라도 읽고 싶은 개발자에게 추천한다. 나도 회사 복지인 반기 도서 구입비 10만원으로 구매해서 보아서 그나마 다행이었다. ebook 무료로 풀려도 될 것 같다... 그나마 RDB, AOF와 같은 이전에 몰랐던 내용들을 알게 되어서 의미가 있었다. 원했던 싱글스레드 동작 방식과 같이 구조적으로 자세한 지식(Real MySQL처럼)은 못 가져갔지만 말이다.. 발췌 내용 정리 레디스 이해 Remote Dictionary Server의 약자로 주요 특성은 아래와 같..
-
Real MySQL 8.0 6 - 데이터 타입책책책 책을 읽읍시다/프로그래밍 2023. 5. 5. 00:52
문자열(CHAR와 VARCHAR)저장 공간 우선 CHAR와 VARCHAR의 공통점은 문자열을 저장할 수 있는 데이터 타입이라는 점이고, 가장 큰 차이는 고정 길이냐 가변 길이냐다.고정 길이는 실제 입력되는 컬럼값의 길이에 따라 사용하는 저장 공간의 크기가 변하지 않는다. CHAR 타입은 이미 저장 공간의 크기가 고정적이다. 실제 저장된 값의 유효 크기가 얼마인지 별도로 저장할 필요가 없으므로 추가로 공간이 필요하지 않다.가변 길이는 최대로 저장할 수 있는 값의 길이는 제한돼 있지만, 그 이하 크기의 값이 저장되면 그만큼 저장 공간이 줄어든다. 하지만 VARCHAR 타입은 저장된 값의 유효 크기가 얼마인지를 별도로 저장해 둬야 하므로 1~2바이트의 저장 공간이 추가로 더 필요하다. 하나의 글자를 저장하기 ..
-
Real MySQL 8.0 5 - 파티션책책책 책을 읽읍시다/프로그래밍 2023. 5. 3. 07:11
개요파티션을 사용하는 이유 테이블의 데이터가 많아진다고 해서 무조건 파티션을 적용하는 것이 효율적인 것은 아니다. 하나의 테이블이 너무 커서 인덱스의 크기가 물리적인 메모리보다 훨씬 크거나 데이터 특성상 주기적인 삭제 작업이 필요한 경우 등이 파티션이 필요한 대표적인 예라고 할 수 있다. 각 경우에 대해 지금부터 하나씩 자세히 살펴보자.단일 INSERT와 단일 또는 범위 SELECT의 빠른 처리 데이터베이스에서 인덱스는 일반적으로 SELECT를 위한 것으로 보이지만 UPDATE나 DELETE 쿼리를 위해 필요한 때도 많다. 물론 레코드를 변경하는 쿼리를 실행하면 인덱스의 변경을 위한 부가적인 작업이 발생하긴 하지만 UPDATE나 DELETE 처리를 위해 대상 레코드를 검색하려면 인덱스가 필수적이다. 하지..