전체 글
-
MySQL - 데이터 추가(INSERT), 수정(UPDATE), 삭제(DELETE)Database/MySQL 2023. 2. 22. 10:24
데이터 추가(INSERT), 수정(UPDATE), 삭제(DELETE) 데이터 추가 - INSERT 예제 01 INSERT INTO 테이블명(필드명01, 필드명02, 필드명03, ...) VALUES (데이터값01, 데이터값02, 데이터값03, ...); - INSERT INTO 문과 함께 VALUES 절을 사용하여 특정 테이블에 새로운 레코드를 추가할 수 있다. - 테이블 내 필드명과 데이터값을 순서대로 명시하여, 레코드를 삽입할 수 있다. INSERT INTO MEMBER(NAME, AGE) VALUES ('홍길동', '20'); - 위 예제는 MEMBER 테이블의 NAME 필드와 AGE 필드에 '홍길동'과 '20'이라는 값을 삽입하는 예제이다. 예제 02 INSERT INTO 테이블명 VALUES (..
-
Oracle - JOIN 사용 시 ON과 WHERE의 차이Database/Oracle 2023. 2. 21. 14:14
JOIN 사용 시 ON과 WHERE의 차이 쿼리문 01 SELECT * FROM TBLD_01 a LEFT JOIN TBLD_02 b ON (a.aa == b.aa) WHERE b.cc = 7; 위 쿼리문의 경우 TBLD_01과 TBLD_02 테이블에 대해서 OUTER JOIN을 수행한 후 b.cc = 7인 데이터들을 추출한다. 위 쿼리문의 작업 순서는 아래와 같다. 1. TBLD_01과 TBLD_02 테이블의 OUTER JOIN 수행 2. OUTER JOIN 결과들 중 b.cc = 7인 데이터들을 추출 쿼리문 02 SELECT * FROM TBLD_01 a LEFT JOIN TBLD_02 b ON (a.aa = b.aa AND b.cc = 7); 하지만, 위 쿼리문의 경우 TBLD_01과 cc 속성 값..
-
Kafka - In-Sync-ReplicasFramework & Library/Kafka 2023. 2. 20. 15:48
In-Sync-Replicas ISR(In-Sync-Replicas)이란? - In-Sync-Replicas(ISR)은 Follower가 잘 복사해 가고 있는지 판단하는 지표이다. - ISR은 High Water Mark라고 하는 지점까지 동일한 Replicas(Leader와 Follwer)의 목록이다. - Leader에 장애가 발생하면, ISR 중에서 새로운 Leader를 선출한다. - replica.lag.max.messages 옵션을 통해서 ISR을 판단하여 ISR 중에서 Leader를 선정한다. replica.lag.max.messages란? - replica.lag.max.messages는 Follower와 Leader 간의 지연된 메시지의 개수를 판단하는 기준이 된다. - 예를 들어서, rep..
-
Kafka - ReplicationFramework & Library/Kafka 2023. 2. 20. 10:45
Replication Broker의 장애 발생 - Broker에 장애가 발생하면, 장애가 발생한 Broker의 Partition들은 모두 사용할 수 없게 된다. - Partition을 사용할 수 없기 때문에, Producer는 메시지를 보낼 수 없게 되고 Consumer는 메시지를 받아갈 수 없는 상황이 발생한다. - Broker에서 장애가 발생하면 장애가 발생한 Partition을 대신해서 기존의 Broker 내에 새로운 Partition을 만들어 장애를 해결하는 것은 어떨까? - Partition을 새로 생성한다는 것은 기존의 메시지와 Offset 정보를 버린다는 의미이기 때문에, 큰 문제가 발생한다. - 위와 같은 문제를 해결하기 위해 나온 것이 Replication이다. Replication - ..
-
Kafka 기초 - ConsumerFramework & Library/Kafka 2023. 2. 18. 19:38
Consumer Consumer의 동작 방식 - Consumer는 각각 고유의 속도로 Partition으로부터 순서대로 Read를 수행한다. - 다른 Consumer Group에 속한 Consumer들은 서로 관련이 없으며, Partition에 있는 Event를 동시에 다른 위치에서 Read 할 수 있다. Consumer Offset - Consumer Offset은 Consumer Group이 읽은 위치를 표시하는 역할을 한다. - Consumer가 자동이나 수동으로 데이터를 읽은 위치를 commit 하여 다시 읽음을 방지한다. - __consumer_offsets라는 Internal Topic에서 Consumer Offset을 저장하여 관리한다. Partition과 Consumer 1. Multi-P..
-
Kafka 기초 - ProducerFramework & Library/Kafka 2023. 2. 18. 18:32
Producer Producer와 Consumer의 기본 동작 방식 - Producer와 Concumer는 서로 알지 못하며, Producer와 Consumer는 각각 고유의 속도로 Commit Log에 Write 및 Read를 수행한다. - 다른 Consumer Group에 속한 Consumer들은 서로 관련이 없으며, Commit Log에 있는 Event(Message)를 동시에 다른 위치에서 Read 할 수 있다. Record(Message)의 구조 - Record는 위 사진과 같이 Header, Key, Value로 구성된다. Serializer / Deserializer - Kafka는 Record를 Byte Array로 저장한다. - 위 사진과 같이, Key와 Value 용 Serializer..