OLAP 5

๋ฐ์ดํ„ฐ ๋ถ„์„ ํ™˜๊ฒฝ ๊ตฌ์ถ• - 08. Clickhouse ํด๋Ÿฌ์Šคํ„ฐ ํ™˜๊ฒฝ์—์„œ ๋ฐ์ดํ„ฐ ์‚ฝ์ž… ๋ฐ ์—…๋ฐ์ดํŠธ ์ฒ˜๋ฆฌ ๋ฐฉ์‹ ๐Ÿš€(part. 2)

์ด์ „ clickhouse ํด๋Ÿฌ์Šคํ„ฐ ํ™˜๊ฒฝ์—์„œ ๋ฐ์ดํ„ฐ ์ฒ˜๋ฆฌ ๋ฐฉ์‹(Clickhouse ํด๋Ÿฌ์Šคํ„ฐ ํ™˜๊ฒฝ์—์„œ ๋ฐ์ดํ„ฐ ์‚ฝ์ž… ๋ฐ ์—…๋ฐ์ดํŠธ ์ฒ˜๋ฆฌ ๋ฐฉ์‹ ๐Ÿš€(part. 1)) ์„ค๋ช…์— ์ด์–ด ReplicatedMergetree ํ…Œ์ด๋ธ”์—์„œ ๋ฐ์ดํ„ฐ๊ฐ€ ์ฒ˜๋ฆฌ๋˜๋Š” ๋ฐฉ์‹์— ๋Œ€ํ•ด ์„ค๋ช…ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.1. ClickHouse Kubernetes ์•„ํ‚คํ…์ฒ˜ ๊ฐœ์š” ๐Ÿ› ๏ธ์ด๋ฒˆ ์‹ค์Šต์—์„œ๋Š” replica๋ฅผ ์ถ”๊ฐ€ํ•˜์—ฌ ๋ฐ์ดํ„ฐ๊ฐ€ ๋ณต์ œ๋˜๋„๋ก ์„ค์ •ํ–ˆ์Šต๋‹ˆ๋‹ค. ๊ธฐ์กด clickhouse helm ๋ฐฐํฌ์šฉ yaml ํŒŒ์ผ์—์„œ replicaCount๋ฅผ 2๋กœ ์„ค์ •ํ–ˆ์Šต๋‹ˆ๋‹ค.(Clickhouse ์„ค์น˜ ๋ฐฉ๋ฒ•)NAME READY STATUS RESTARTSclickhouse-shard0-0 1/1 Running 0 ..

๋ฐ์ดํ„ฐ ๋ถ„์„ ํ™˜๊ฒฝ ๊ตฌ์ถ• - 05. Clickhouse ์‹ค์‹œ๊ฐ„ ๋ฐ์ดํ„ฐ ๋ถ„์„ ํ…Œ์ด๋ธ” ์ƒ์„ฑํ•˜๊ธฐ

๐Ÿš€ ์ด ๊ธ€์—์„œ ๋‹ค๋ฃฐ ๋‚ด์šฉ1๏ธโƒฃ Kafka์™€ ์—ฐ๊ฒฐ๋œ ClickHouse ํ…Œ์ด๋ธ” ์ƒ์„ฑ (ํ™˜๊ฒฝ์„ค์ • ํฌํ•จ)2๏ธโƒฃ ์‹ค์Šต์šฉ ๋ฐ์ดํ„ฐ์…‹ kafka produce3๏ธโƒฃ Kafka ํ…Œ์ด๋ธ”์—์„œ ๋ฐ์ดํ„ฐ ์…‹ ํ™•์ธ ๋ฐฉ๋ฒ•1. Kafka์™€ ์—ฐ๊ฒฐ๋œ ClickHouse ํ…Œ์ด๋ธ” ์ƒ์„ฑ๐Ÿ”น Kafka ๋ฐ์ดํ„ฐ๋ฅผ ClickHouse์—์„œ ์ฒ˜๋ฆฌํ•˜๋Š” ๋ฐฉ์‹ClickHouse๋Š” Kafka์™€ ์ง์ ‘ ์—ฐ๊ฒฐํ•˜์—ฌ ์‹ค์‹œ๊ฐ„์œผ๋กœ ๋ฐ์ดํ„ฐ๋ฅผ ๊ฐ€์ ธ์˜ฌ ์ˆ˜ ์žˆ๋Š” Kafka ์—”์ง„์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.๊ธฐ๋ณธ์ ์œผ๋กœ Kafka → Buffer ํ…Œ์ด๋ธ” → MergeTree ํ…Œ์ด๋ธ”์˜ ๊ตฌ์กฐ๋กœ ์šด์˜๋ฉ๋‹ˆ๋‹ค.๐Ÿ”น ClickHouse ์„ค์ • ๋ณ€๊ฒฝ (Kafka ์‚ฌ์šฉ์„ ์œ„ํ•œ ์„ค์ •)๋จผ์ €, clickhouse-server์˜ ํ™˜๊ฒฝ์„ค์ •์„ ์ˆ˜์ •ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.ClickHouse ์„ค์ • ํŒŒ์ผ (config.xml)์—์„œ Ka..

๋ฐ์ดํ„ฐ ๋ถ„์„ ํ™˜๊ฒฝ ๊ตฌ์ถ• - 03. Kafka ์„ค์น˜ ๋ฐ ์‹ค์‹œ๊ฐ„ ๋ฐ์ดํ„ฐ ์ŠคํŠธ๋ฆฌ๋ฐ ๊ตฌ์„ฑ

Kafka๋ฅผ ๊ตฌ์„ฑํ•˜์—ฌ ์‹ค์‹œ๊ฐ„ ์ŠคํŠธ๋ฆฌ๋ฐ ๋ฐ์ดํ„ฐ๋ฅผ Clickhouse๋กœ ์ฒ˜๋ฆฌํ•˜๋Š” ๋ถ„์„ ํ™˜๊ฒฝ์„ ๊ตฌ์ถ•ํ•ฉ๋‹ˆ๋‹ค. ๐Ÿ’ก ์ด ๊ธ€์—์„œ ๋‹ค๋ฃฐ ๋‚ด์šฉ:Kubernetes ํ™˜๊ฒฝ์—์„œ Kafka ์„ค์น˜ ๋ฐ ์„ค์ •Helm ์ฐจํŠธ๋ฅผ ํ™œ์šฉํ•œ Kafka ๋ฐฐํฌKafka ํ† ํ”ฝ ์ƒ์„ฑ ๋ฐ ๋ฐ์ดํ„ฐ ์ŠคํŠธ๋ฆฌ๋ฐ ํ…Œ์ŠคํŠธ1. Kafka๋ž€?Kafka๋Š” ๋Œ€์šฉ๋Ÿ‰ ์‹ค์‹œ๊ฐ„ ๋ฐ์ดํ„ฐ ์ŠคํŠธ๋ฆฌ๋ฐ์„ ์œ„ํ•œ ๋ถ„์‚ฐ ๋ฉ”์‹œ์ง• ํ”Œ๋žซํผ์ž…๋‹ˆ๋‹ค.ClickHouse์™€ ํ•จ๊ป˜ ์‚ฌ์šฉํ•˜๋ฉด ์‹ค์‹œ๊ฐ„ ๋ฐ์ดํ„ฐ ์ˆ˜์ง‘ ๋ฐ ๋ถ„์„์ด ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.๐Ÿ“Œ Kafka ์ฃผ์š” ๊ฐœ๋…๊ฐœ๋… ์„ค๋ช…Producer๋ฐ์ดํ„ฐ๋ฅผ Kafka์— ๋ณด๋‚ด๋Š” ์—ญํ• ConsumerKafka์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ ์ฝ๋Š” ์—ญํ• Topic๋ฐ์ดํ„ฐ๊ฐ€ ์ €์žฅ๋˜๋Š” ๋…ผ๋ฆฌ์  ๊ณต๊ฐ„BrokerKafka ์„œ๋ฒ„ (๋ฐ์ดํ„ฐ๋ฅผ ์ €์žฅํ•˜๊ณ  ๊ด€๋ฆฌ)*ZookeeperKafka์˜ ํด๋Ÿฌ์Šคํ„ฐ ์ƒํƒœ ๊ด€๋ฆฌKafka 4..

๋ฐ์ดํ„ฐ ๋ถ„์„ ํ™˜๊ฒฝ ๊ตฌ์ถ• - 02. ์ฟ ๋ฒ„๋„คํ‹ฐ์Šค์— Clickhouse ์„ค์น˜ ๋ฐ ํด๋Ÿฌ์Šคํ„ฐ ๊ตฌ์„ฑ

์ด๋ฒˆ ๊ธ€์—์„œ๋Š” Kubernetes ํ™˜๊ฒฝ์—์„œ ClickHouse๋ฅผ ๋ฐฐํฌ ๋ฐ ์‹คํ–‰ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์„ค๋ช…ํ•ฉ๋‹ˆ๋‹ค.Docker Desktop์˜ ๋‚ด์žฅ Kubernetes๋ฅผ ํ™œ์šฉํ•˜๊ณ , Helm ๋ฐ Bitnami Helm ์ฐจํŠธ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๊ฐ„ํŽธํ•˜๊ฒŒ ClickHouse๋ฅผ ๋ฐฐํฌํ•ฉ๋‹ˆ๋‹ค.1. ์‚ฌ์ „ ์ค€๋น„1) kubectl ์„ค์น˜ (Kubernetes CLI)kubectl์€ Kubernetes ํด๋Ÿฌ์Šคํ„ฐ๋ฅผ ๊ด€๋ฆฌํ•˜๋Š” ๋ช…๋ น์ค„ ๋„๊ตฌ์ž…๋‹ˆ๋‹ค.๐Ÿ”น macOSbrew install kubectl๐Ÿ”น Windows (PowerShell)choco install kubernetes-cliโœ… ์„ค์น˜ ํ™•์ธ:kubectl version --client2) Docker Desktop์—์„œ Kubernetes ํ™œ์„ฑํ™”Docker Desktop์—๋Š” Kubernetes๊ฐ€ ..

๋ฐ์ดํ„ฐ ๋ถ„์„ ํ™˜๊ฒฝ ๊ตฌ์ถ• - 01. Clickhouse๋ž€?

๋ฐ์ดํ„ฐ ๋ถ„์„์„ ์œ„ํ•œ ๊ฐ•๋ ฅํ•œ OLAP ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๋ฅผ ์ฐพ๊ณ  ๊ณ„์‹ ๊ฐ€์š”?ClickHouse๋Š” ๋น ๋ฅธ ์†๋„์™€ ํ™•์žฅ์„ฑ์„ ์ž๋ž‘ํ•˜๋Š” ์ปฌ๋Ÿผํ˜• ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๋กœ, ๋Œ€๊ทœ๋ชจ ๋ฐ์ดํ„ฐ ๋ถ„์„์— ์ตœ์ ํ™”๋œ ์†”๋ฃจ์…˜์ž…๋‹ˆ๋‹ค.์ด ๊ธ€์—์„œ๋Š” ClickHouse์˜ ๊ฐœ๋…์„ ์ดํ•ดํ•˜๊ณ , ์ง์ ‘ ์‹ค์Šต์„ ํ†ตํ•ด ๊ธฐ๋ณธ์ ์ธ ์‚ฌ์šฉ๋ฒ•์„ ์ตํ˜€๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค.1. ClickHouse๋ž€?ClickHouse๋Š” Yandex์—์„œ ๊ฐœ๋ฐœํ•œ ์˜คํ”ˆ์†Œ์Šค ์ปฌ๋Ÿผํ˜• ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๋กœ, ํŠนํžˆ ๋Œ€๊ทœ๋ชจ ๋ฐ์ดํ„ฐ ๋ถ„์„(OLAP)์— ์ตœ์ ํ™”๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.๋‹ค๋ฅธ RDBMS์™€ ๋‹ฌ๋ฆฌ ์ปฌ๋Ÿผ ๋‹จ์œ„ ์ €์žฅ ๋ฐฉ์‹์„ ์ฑ„ํƒํ•˜์—ฌ ๋น ๋ฅธ ์ฟผ๋ฆฌ ์„ฑ๋Šฅ๊ณผ ํšจ์œจ์ ์ธ ๋ฐ์ดํ„ฐ ์••์ถ•์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.ClickHouse์˜ ์ฃผ์š” ํŠน์ง•โœ… ์ปฌ๋Ÿผ ๊ธฐ๋ฐ˜ ์ €์žฅ(Columnar Storage) → ๋น ๋ฅธ ๋ถ„์„ ์ฟผ๋ฆฌ ์†๋„โœ… ๋ถ„์‚ฐ ์•„ํ‚คํ…์ฒ˜(Distributed Architec..