전체 글
-
레디스 정리SQL 공부 2024. 3. 4. 06:41
레디스의 중요 포인트 정리 싱글 스레드 레디스에서 클라이언트 커맨드를 처리하는 부분은 이벤트 루프를 이용한 싱글 스레드로 동작한다. 싱글 스레드로 동작하는 것은 다른 사용자가 오래 걸리는 커맨드를 수행하면, 다른 사용자는 그 쿼리가 완료될 때 까지 대기할 수 밖에 없으므로 느린 커맨드 사용에 주의를 해야한다. 다만 모든 작업에서 싱글 스레드로 처리되는 것은 아니고,일부 비동기 작업에 대해서 백그라운드 스레드가 작동한다. (EX: UNLINK, FLUSHALL ASYNC, FLUSHDB ASYNC) 네트워크 I/O 병목 현상을 해결하기 위해서 I/O스레딩이라고 하는 핵심 네트워크 모델에 멀티스레딩을 6.0버전에서부터 도입하였는데 설정파일을 통해 멀티스레딩을 사용할 수 있다. (이전보다 2배정도의 성능 향..
-
MANIFEST.MFJAVA공부/JAVA 2024. 2. 5. 02:01
Java Archive(JAR)은 메니페스트 파일로 설명할 수 있는데, JAR파일 형식은 Java클래스 파일과 리소스 및 메타데이터를 단일 파일로 패키지하는 데 사용되는 압축 파일 형식이다. 매니페스트 파일은 JAR파일 자체에 대한 메타 데이터를 제공하는데 사용된다. 매니페스트 파일은 다음과 같은 정보가 포함되어있다. 1. Main-class: JAR 파일 실행시 애플리케이션 진입 메인 클래스 지정 2.Class-Path: JAR파일에 대한 클래스 경로 종속성 지정 (애플리케이션에 필요한 클래스가 포함된 다른 JAR혹은 디렉토리를 포함할 수 있음) 3. Manifest-Version: 매니페스트 파일 형식의 버전 4. 작성자: JAR 파일을 생성하는데 사용된 도구, 버전, 작성자 , 시스템 식별 해당 파..
-
Apache Kafka - 부분 내용 정리 ③JAVA공부/JAVA 2024. 1. 22. 02:47
카프카 커넥트카프카 커넥트는 데이터 파이프라인 생성 시 반복 작업을 줄이고 효율적인 전송을 이루기 위한 애플리케이션이다.카프카 프로듀서-컨슈머 애플리케이션과 유사하지만 해당 애플리케이션은 세밀한 제어, 고유한 요구 사항의 경우 사용하고 커넥트의 경우 표준화된 접근방식에 대해 사용하게 된다. (템플릿) 파이프 라인 생성시 자주 반복되는 값(토픽 이름, 파일 이름, 테이블 이름)등을 파라미터로 받는 커넥터를 코드로 작성후에 파이프라인을 실행할 때는 코드 작성할 필요가 없기 때문이다. 카프카 커넥터는 프로듀서 역할을 하는 '소스 커넥터' 와 컨슈머 역할을 하는 '싱크 커넥터' 로 나뉜다.일정한 프로토콜을 가진 소스 애플리케이션이나 싱크 애플리케이션이 있다면 커넥터를 통해 카프카로 데이터를 보내거나데이터를 가져..
-
Apache Kafka - 부분 내용 정리 ②JAVA공부/JAVA 2024. 1. 15. 02:31
카프카 클라이언트 카프카 클러스터에 명령을 내리거나 데이터를 송수신 하기 위해 카프카 프로듀서, 컨슈머, 어드민 클라이언트를 제공하는 카프카 클라이언트를 사용하여 애플리케이션을 개발한다. 카프카 클라이언트는 라이브러리이기 때문에 자체 라이프사이클을 가진 프레임워크 혹은 애플리케이션 위에서 구현 및 실행해야 한다. 프로듀서 API 프로듀서 애플리케이션은 카프카에 필요한 데이터 선언 및 브로커 특정 토픽 파티션에 전송한다. 이때, 리더 파티션을 가지고 있는 카프카 브로커와 통신한다. 프로듀서는 데이터를 직렬화하여 카프카 브로커로 전송한다. 직렬화를 사용하면 자바 기본형, 참조형 뿐 아니라, 동영상 이미지 같은 바이너리 데이터도 전송가능하다. 카프카 공식 자바 라이브러리를 사용하여 프로듀서를 개발해본다. 의존..
-
Apache Kafka - 부분 내용 정리 ①JAVA공부 2024. 1. 8. 02:24
Kafka - Consumer - Groups.sh Kafka 컨슈머 호출 및 옵션으로 지정한 쉘 컨슈머그룹을 생성할 수 있는데, 이를 kafka-consumer-groups.sh 스크립트로 확인가능하다. 목록을 확인하고자 하면 윈도우 기준으로 아래 명령어로 확인하면 된다. .\kafka-consumer-groups.bat --bootstrap-server wsl.kafka:9092 --list 확인하게 되면 어떠한 컨슈머 그룹이 존재하는지 확인할 수 있다. ※ wsl.kafka는 vim C:\Windows\System32\drivers\etc\hosts 을 통해 등록할 수 있는데 나는 WSL을 사용했기 때문에 WSL에서 ip addr show eth0 | grep 'inet ' | awk '{print..
-
스프링 캐시SPRING 공부 2023. 11. 5. 11:10
캐시 미래 요청 혹은 반복되는 요청을 위해 데이터를 일시적으로 저장해놓고 원본 소스 접근 없이 엑세스할 수 있도록 도와주는 하드웨어 혹은 소프트웨어 구성 요소를 가리킨다. 데이터 요청을 할 때 원하는 데이터 캐시 저장소에 있다면 해당 데이터로 빠르게 반환되는데, 이를 캐시 히트라고 하며 캐시에 없는 경우는 캐시 미스라고 한다. 캐시 사용 유의점 ● 캐시 설계 데이터 결과가 빈번하게 변경되거나 저장공간이 제한적인 경우 캐시를 사용하지 않는것이 좋다. 반복적이고 데이터 결과가 변경없는 요청에 대해서 사용하는 것이 좋다. 시스템의 요구 사항과 성능 목표를 고려해야한다. ● 캐시 키 키값에 의해서 캐시가 처리되는데, 해당 키가 정말 유일한 키인지 확인이 필요하다. 중복된 키값에 의해서 원하지 않는 다른 결과를 ..
-
Real My SQL 8.0 읽고 공부하기 - ⑨ 옵티마이저와 힌트SQL 공부/MySQL 8.0 2023. 10. 28. 19:25
1) 개요 ● 실행 순서 MySQL에서 쿼리가 실행되는 과정은 다음과 같은 3단계이다. 1. SQL문장을 잘게 쪼개서 MySQL서버가 이해할 수 있는 수준으로 분리(파스 트리)한다. 2. 파싱정보 확인하면서 어떤 테이블로부터 읽고 어떤 인덱스를 이용해 테이블을 읽을지 선택한다. 3. 결정된 테이블의 읽기 순서나 선택된 인덱스를 이용해 스토리지 엔진으로부터 데이터를 가져온다. 1의 단계를 SQL 파싱이라고 하는데, 이 때 'SQL파서' 모듈로 처리한다. 문법적으로 잘못된 SQL문인 경우 해당 단계에서 걸러진다. 해당 단계에서 SQL 파스 트리가 만들어지며 SQL문을 해당 SQL 파스트리를 실행하는 것이다. 2의 단계는 최적화 및 실행 계획 수립이며, '옵티마이저' 에서 처리를 한다. 완료되면 실행계획이 만..
-
JWT(JsonWebToken)카테고리 없음 2023. 10. 23. 05:14
JWT를 사용자 정보 인증을 하는 수단으로 얕게 알고 있었으나 구체적으로 파악해보려 한다. JWT에 대한 공식 RFC문서는 RFC 8725 - JSON Web Token Best Current Practices (ietf.org) 이며 7519로부터 업데이트 되었다. 정의는 다음과 같다. JSON 웹 토큰은 서명 또는 암호화 할 수 있는 일련의 클레임 이 포함된 JSON 보안 토큰이다. 디지털 신원 영역, 애플리케이션 영역 모두에서 수많은 프로토콜, 애플리케이션에서 간단한 보안 토큰 형식으로 사용되고 있다. 1. 용어 JWT Claims Set JWT 가 전달하는 클레임이 포함된 JSON 객체 Claim 주제에 대한 정보를 주장하거나 나타내는 것으로 페이로드(Payload)부분의 요소로 사용된다. 이름(..