Skip to content

Commit

Permalink
Add new etcd pods
Browse files Browse the repository at this point in the history
  • Loading branch information
hhhyunwoo committed Jun 26, 2023
1 parent c62fb1f commit d00a7d8
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions _posts/2023-06-26-etcd-learning-key-value-stores.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
layout: post
title: "[etcd] [Docs Learning] etcd versus other key-value stores"
date: 2023-06-26
categories:
- etcd
- docs
tags: [
etcd,
docs,
learning,
kv,
api,
keyvalue,
]
---
> [etcd ๊ณต์‹ Docs](https://etcd.io/docs/v3.5/learning/) ์˜ Learning ๋ฌธ์„œ๋ฅผ ๋ณด๊ณ  ๊ณต๋ถ€ ๋ฐ ํ•ด์„ํ•œ ๋‚ด์šฉ์„ ๊ธฐ๋กํ•ฉ๋‹ˆ๋‹ค.
>
[Docs](https://etcd.io/docs/v3.5/learning/why/)

**etcd** ๋Š” `/etc` + `distritubed system` ์—์„œ ์œ ๋ž˜ํ–ˆ์œผ๋ฉฐ, configuration ๋ฐ์ดํ„ฐ๋ฅผ ์ €์žฅํ•˜๊ธฐ ์œ„ํ•ด์„œ ๋งŒ๋“ค์–ด์กŒ๋Š”๋ฐ ์—ฌ๊ธฐ๋‹ค๊ฐ€ ๋ถ„์‚ฐ์‹œ์Šคํ…œ์„ ๋”ํ•ด์„œ etcd๊ฐ€ ๋˜์—ˆ๋‹ค!

**network partition ์„ ์ ˆ๋Œ€ ํ—ˆ์šฉํ•˜์ง€ ์•Š์œผ๋ฉฐ, ๊ฐ€์šฉ์„ฑ์„ ๊ธฐ๊บผ์ด ํฌ์ƒํ•จ**

## Use cases

- Container Linux by CoreOS
- Locksmith ์—์„œ etcd ๋ฅผ ์‚ฌ์šฉํ•ด์„œ `๋ถ„์‚ฐ ์„ธ๋งˆํฌ`๋ฅผ ๊ตฌํ˜„ํ•ด์„œ ํด๋Ÿฌ์Šคํ„ฐ์˜ ํ•˜์œ„ ์ง‘ํ•ฉ๋งŒ ๋ฆฌ๋ถ“๋˜๋„๋ก ํ•จ
- Kuberentes ์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ ์ €์žฅํ•˜๊ธฐ ์œ„ํ•ด ์‚ฌ์šฉ๋จ

## Comparison chart

<img width="1624" alt="image" src="https://github.com/hhhyunwoo/hhhyunwoo/assets/37402136/a8909558-e45b-410f-81e1-e0bb97a5db97">

### ZooKeeper

- `distributed system coordination` and `metadata storage` ๋ฅผ ํ•ด๊ฒฐ
- etcd๊ฐ€ **zookeeper** ์—์„œ ๊ตฌํ˜„๋œ ์ข‹์€ ์ ๋“ค์„ ๋งŽ์ด ์‚ฌ์šฉํ•จ
- `์ž์ฒด RPC ํ”„๋กœํ† ์ฝœ`์„ ์‚ฌ์šฉํ•˜๋Š”๋ฐ, ์–ธ์–ด ๋“ฑ๋“ฑ **๋ถˆํŽธํ•œ ๋ถ€๋ถ„**์ด ๋งŽ์Œ
- zookeeper ๊ณ ๋ คํ•˜๋Š” ์‚ฌ๋žŒ๋“ค! **etcd ์จ๋ผ**

### Consul

- **Service Discovery**๋ž€?
- MSA ํ™˜๊ฒฝ์—์„œ ์„œ๋น„์Šค ๊ฐ„ ํ˜ธ์ถœ์ด ์žฆ์Œ. ๊ทผ๋ฐ ํด๋ผ์šฐ๋“œ ํ™˜๊ฒฝ์—์„œ๋Š” ์ปจํ…Œ์ด๋„ˆ ๊ธฐ๋ฐ˜์ด๊ธฐ ๋•Œ๋ฌธ์— ์„œ๋น„์Šค์˜ IP๊ฐ€ ๋™์ ์œผ๋กœ ๋ณ€๊ฒฝ๋˜๋Š” ์ผ์ด ๋งŽ๋‹ค.
- ์ด๋•Œ ์„œ๋น„์Šค ํด๋ผ์ด์–ธํŠธ๊ฐ€ ์„œ๋น„์Šค๋ฅผ ํ˜ธ์ถœํ•  ๋•Œ ์„œ๋น„์Šค์˜ ์œ„์น˜ (์ฆ‰, IP์ฃผ์†Œ์™€ ํฌํŠธ) ๋ฅผ ์•Œ์•„๋‚ผ ์ˆ˜ ์žˆ๋Š” ๊ธฐ๋Šฅ์ด ํ•„์š”ํ•œ๋ฐ, ์ด๊ฒƒ์ด `Service Discovery` ์ž„.
- e2e service discovery framework
- consul 1.0 ์—์„œ scale out ์ด ์•ˆ๋จ
- **etcd ์™€๋Š” ๋‹ค๋ฅธ ๋ฌธ์ œ๋ฅผ ํ‘ธ๋Š” ํ”Œ๋žซํผ์ธ๋ฐ, e2e cluseter service discovery ๋ฅผ ์ฐพ๋Š”๋‹ค๋ฉด consul ๋„ ๊ดœ์ฐฎ์€ ์„ ํƒ!**

### NewSQL (Cloud Spanner, CockroachDB, TiDB)

- data center ๋ผ๋ฆฌ์˜ horizontally scale out ์„ ์˜๋„ํ•œ DB ๋“ค
- ๋ช‡ GB ์ด์ƒ์˜ ๋ฐ์ดํ„ฐ๋ฅผ ์ €์žฅํ•˜๊ฑฐ๋‚˜, full SQL ์ฟผ๋ฆฌ๊ฐ€ ํ•„์š”ํ•˜๋ฉด NewSQL ์จ๋ผ

## Using etcd for metadata

์‘์šฉํ”„๋กœ๊ทธ๋žจ์ด ํ”„๋กœ์„ธ์Šค๋ฅผ ์กฐ์ •ํ•˜๋Š” ๊ฒƒ๊ณผ ๊ฐ™์ด ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ ๋˜๋Š” ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ ์ˆœ์„œ๋ฅผ ์ฃผ๋กœ ๊ณ ๋ คํ•˜๋Š” ๊ฒฝ์šฐ ๋“ฑ์„ ์„ ํƒ.

์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์— ์—ฌ๋Ÿฌ ๋ฐ์ดํ„ฐ ์„ผํ„ฐ์— ๊ฑธ์ณ ๋Œ€๊ทœ๋ชจ ๋ฐ์ดํ„ฐ ์ €์žฅ์†Œ๊ฐ€ ํ•„์š”ํ•˜๊ณ  ๊ฐ•๋ ฅํ•œ ๊ธ€๋กœ๋ฒŒ ์ฃผ๋ฌธ ์†์„ฑ์— ํฌ๊ฒŒ ์˜์กดํ•˜์ง€ ์•Š๋Š” ๊ฒฝ์šฐ `NewSQL ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค`๋ฅผ ์„ ํƒ

## Using etcd for distributed coordination

์ด๋ก ์ ์œผ๋กœ, ๊ฐ•๋ ฅํ•œ ์ผ๊ด€์„ฑ์„ ์ œ๊ณตํ•˜๋Š” ๋ชจ๋“  ์Šคํ† ๋ฆฌ์ง€ ์‹œ์Šคํ…œ ์œ„์— ์ด๋Ÿฌํ•œ ๊ธฐ๋ณธ ์š”์†Œ๋ฅผ ๊ตฌ์ถ•ํ•  ์ˆ˜ ์žˆ์ง€๋งŒ, ์•Œ๊ณ ๋ฆฌ์ฆ˜์€ ์กฐ๊ธˆ ๋ฏธ๋ฌ˜ํ•˜๋‹ค. ์ž‘๋™ํ•˜๋Š” ๊ฒƒ์ฒ˜๋Ÿผ ๋ณด์ด๋Š” Lock ์•Œ๊ณ ๋ฆฌ์ฆ˜์„ ๊ฐœ๋ฐœํ•˜๋Š” ๊ฒƒ์€ ์‰ฝ์ง€๋งŒ ๊ฐ‘์ž‘์Šค๋Ÿฝ๊ฒŒ ์ค‘๋‹จ๋  ์ˆ˜ ์žˆ์Œ.

๊ฒŒ๋‹ค๊ฐ€, ํŠธ๋žœ์žญ์…˜ ๋ฉ”๋ชจ๋ฆฌ์™€ ๊ฐ™์€ etcd์— ์˜ํ•ด ์ง€์›๋˜๋Š” ๋‹ค๋ฅธ ๊ธฐ๋ณธ ์š”์†Œ๋“ค์€ etcd์˜ MVCC ๋ฐ์ดํ„ฐ ๋ชจ๋ธ์— ์˜์กดํ•œ๋‹ค. ์ฆ‰, ๋‹จ์ˆœํ•œ ๊ฐ•ํ•œ ์ผ๊ด€์„ฑ์œผ๋กœ๋Š” ์ถฉ๋ถ„ํ•˜์ง€ ์•Š์Œ

`Distributed Coordination` ์˜ ๊ฒฝ์šฐ etcd๋ฅผ ์„ ํƒํ•˜๋ฉด ์šด์˜์ƒ์˜ ๋ฌธ์ œ๋ฅผ ์˜ˆ๋ฐฉํ•˜๊ณ  ์—”์ง€๋‹ˆ์–ด๋ง ์ž‘์—…์„ ์ ˆ์•ฝํ•  ์ˆ˜ ์žˆ์Œ!

0 comments on commit d00a7d8

Please sign in to comment.