Database
-
[ClickHouse] Compact Wide Parts 알아보기 ( part_type )Database/Clickhouse 2024. 1. 16. 21:17
- 목차 들어가며. 이번 글에서는 ClickHouse MergeTree 의 part_type 에 대해서 알아보려고 합니다. 먼저 Parts 에 대한 자세한 설명은 아래 링크로 대신하도록 하겠습니다. https://westlife0615.tistory.com/737 [ClickHouse] Parts & Partition 알아보기 - 목차 들어가며. 이번 글에서는 ClickHouse 의 MergeTree 엔진에서 사용되는 Parts 와 Partition 에 대해서 알아보려고 합니다. Partition 은 MergeTree Table 에 생성되는 데이터의 물리적인 단위입니다. Table 은 P westlife0615.tistory.com https://westlife0615.tistory.com/565 [Cl..
-
RocksDB Leveled Compaction 알아보기Database/RocksDB 2024. 1. 10. 17:11
- 목차 들어가며. Leveled Compaction 은 RocksDB 의 Compaction 종류 중의 하나입니다. RocksDB 는 LSM-Tree 파일 구조를 취하기 때문에 SSTable 의 Compaction 은 중요한 기능 중의 하나입니다. 이번 글에서는 Leveled Compaction 에 대해서 알아보는 시간을 가지려고 합니다. Level 이란 ? RocksDB 는 MemTable 과 SSTable 이라는 In-Memory Structure 와 On-Disk Structure 를 가집니다. Level 이라는 개념은 SSTable 에 적용되는데요. Level 은 SSTable 에 대하여 Merge 가 수행된 정도를 의미합니다. Level 0 부터 시작하여 Level n 까지 Level 의 범위..
-
RocksDB WAL (Write-Ahead Log) 알아보기Database/RocksDB 2024. 1. 10. 16:56
- 목차 들어가며. RocksDB 는 스토리지 엔진으로써 LSM-Tree 를 사용합니다. LSM-tree 는 구조적으로 Write-Ahead log 를 취하게 되는데, Write-Ahead Log (WAL log) 에 의해서 Recovery 가 가능해집니다. 먼저 Write-Ahead Log (WAL log) 에 대해서 간단하게 알아보도록 하겠습니다. 클라이언트는 RocksDB API 를 통해서 데이터를 삽입합니다. ( 참고로 RocksDB 에서 취급하는 데이터의 형태는 Key-Value Pair 모양을 따릅니다. ) 클라이언트의 데이터 생성 요청을 WAL log 에 로그 형태로 삽입됩니다. 그리고 MemTable 과 SSTable 로 생성 요청이 전달되죠. 아래의 이미지처럼 Write Log 가 먼저 ..
-
RocksDB Column Family 알아보기Database/RocksDB 2024. 1. 10. 09:19
- 목차 들어가며. RocksDB 의 Column Family 는 SQL 의 Table, NoSQL 의 Collection 과 유사합니다. 즉, Key-Value Pair 들을 저장하는 논리적인 단위입니다. 즉, RocksDB 의 데이터베이스는 Column Family 라는 단위로 데이터들이 저장될 파티션을 나누게 되구요. 만약 명시적으로 Column Family 를 생성하지 않는다면 default Column Family 를 사용하게 됩니다. Column Family 는 여러가지 장점을 가집니다. 장점들은 SQL Table 과 같이 데이터의 저장 단위를 분리하였기 때문에 파생되는 장점입니다. 첫번째 장점은 Column Family 단위로 MemTable 과 SSTable 그리고 Bloom Filter ..
-
RocksDB Architecture 알아보기 (LSM-tree)Database/RocksDB 2024. 1. 10. 07:45
- 목차 관련된 글. https://westlife0615.tistory.com/566 RocksDB Architecture 알아보기 (LSM-tree) - 목차 들어가며. RocksDB 는 LSM-Tree 형식의 구조를 취합니다. LSM-Tree 를 설명하기 위해서 MemTable, SSTable, WAL Log, Compaction 등의 배경지식이 필요한데요. 이번 글에서 RocksDB 를 구성하는 요소들에 대해 westlife0615.tistory.com https://westlife0615.tistory.com/567 RocksDB Column Family 알아보기 - 목차 들어가며. RocksDB 의 Column Family 는 SQL 의 Table, NoSQL 의 Collection 과 유사합..
-
[ClickHouse] Block 알아보기Database/Clickhouse 2024. 1. 10. 06:46
- 목차 들어가며. 이번 글에서는 ClickHouse 의 Block 의 개념에 대해서 알아보려고 합니다. ClickHouse MergeTree 엔진의 Table 을 생성하고, 해당 테이블에 데이터를 추가하게 되면 Parts 가 생성됩니다. ClickHouse Parts 의 개념은 아래의 페이지에서 알 수 있는데요. Parts 에 대해서 간단한 설명을 해보려고 합니다. https://clickhouse.com/docs/en/operations/system-tables/parts parts | ClickHouse Docs system_tables-parts} clickhouse.com Parts 란 ? https://westlife0615.tistory.com/737 [ClickHouse] Parts & P..
-
[Vitess] Etcd 알아보기Database/Vitess 2023. 12. 30. 23:39
- 목차 소개. Vitess 는 내부적으로 etcd 를 사용합니다. etcd 는 ZooKeeper 처럼 분산 시스템의 상태 정보와 메타데이터를 저장하는데요. Vitess 의 여러 Topology 들의 상태와 정보를 저장합니다. etcd 를 통해서 Keyspace, Cell, Shard, Tablet 의 상태와 정보가 관리된다고 생각하시면 됩니다. 이번 글을 통해서 Vitess 는 Etcd 에 어떤 정보를 저장하고, Etcd 를 활용하는 Orchestration 에 대해 알아보려고 합니다. Vitess Cluster 구현하기. 아래 예시는 Kubernetes 위에서 Vitess 를 실행하는 간단한 예시입니다. Kubernetes 와 Vitess 환경에서 Etcd 가 어떻게 동작하는지 알아보려고 합니다. h..
-
[Vitess] Topology Service 알아보기Database/Vitess 2023. 12. 30. 21:50
- 목차 소개. Vitess 의 Topology 는 Vitess 의 여러 구성요소들의 구조와 관계를 설정하는 논리적인 개념입니다. Vitess 의 구성요소들은 다음과 같습니다. Server, Cell, Keyspace, Shard, Tablet 등으로 구성됩니다. 이번 글에서는 각각의 요소들이 무엇인지 알아보고 Topology 를 구성하는 방법에 대해서 알아보려고 합니다. 구성요소. Vitess 의 구성요소들을 알아봅니다. 구성요소들은 Server, Cell, Keyspace, Shard, Tablet 등이 존재합니다. Server. Vitess 에서 지칭하는 Server 는 실제 물리적인 서버를 의미합니다. Vitess 는 MySQL 을 관리하는 클러스터인데요. 여러 개의 MySQL 서버 또는 프로세스..
-
[Vitess & Kubernetes] Cell 알아보기Database/Vitess 2023. 12. 30. 16:36
- 목차 함께 보면 좋은 자료. https://westlife0615.tistory.com/232 KinD 로 Vitess 구현하기. - 목차 함께 보면 좋은 글. https://westlife0615.tistory.com/407 KinD 알아보기. - 목차 소개. KinD 는 "카인드" 라고 발음되며, 로컬 머신에서 쿠버네티스를 간편하게 실행할 수 있는 도구입니다. KinD 는 Kuberne westlife0615.tistory.com 소개. Cell 은 Vitess 가 관리하는 데이터베이스들을 논리적으로 묶는 단위입니다. "논리적 단위" 라는 표현이 좀 애매한데요. 이를 잘 표현하는 다른 사례들을 먼저 얘기하고자 합니다. 쿠버네티스를 예로 들면, ReplicaSet 이나 Service 를 이야기할 수..
-
MySQL User, Grant 생성하기.Database 2023. 12. 15. 06:40
- 목차 소개. MySQL 에서 사용자를 생성하는 방식에 대해서 알아보려고 합니다. 가장 간단한 방법은 아래와 같습니다. CREATE USER 'username'@'host' IDENTIFIED BY 'password'; 위 쿼리에서 3가지 정보가 사용되는데요. 1. 사용자 이름 2. 사용자의 접속 IP 3. 사용자의 비밀번호 입니다. 그리고 사용자의 권한에 대한 설정 또한 필요합니다. GRANT SELECT, INSERT, UPDATE, DELETE ON mysql.* TO 'developer'@'localhost'; 위 쿼리의 내용은 "developer 라는 사용자는 localhost IP 에서 mysql Database 의 모든 테이블에 SELECT, INSERT, UPDATE, DELETE" 가 ..