โ Redis ?
Remote Dictionary Server์ ์ฝ์
* Remote : Redis๊ฐ ๊ฐ๊ฐ์ ์๋ฒ ์์ ๋ก์ปฌํ๊ฒ ์กด์ฌํ์ง ์๊ณ , ๋ค์์ ์๋ฒ์์ ๊ณตํต์ ์ผ๋ก ์ฌ์ฉํ ์ ์๋๋ก ์๊ฒฉ์ ์กด์ฌ
* Dictionary : ํด์๋งต๊ณผ ๊ฐ์ด key-value ํํ๋ก ์์์ ์๊ฐ ๋ณต์ก๋๋ก ์ฌ์ฉ์ด ๊ฐ๋ฅ
Redis๋ ํ์ค C๋ก ์์ฑ๋ ์คํ์์ค ์ธ๋ฉ๋ชจ๋ฆฌ ๋ฐ์ดํฐ ์ ์ฅ์์ด๋ค.
* ์ธ๋ฉ๋ชจ๋ฆฌ ๋ฐ์ดํฐ ์ ์ฅ์ : ๋ฐฑ์ ์ ์ ์ธํ ๋ชจ๋ ๋ฐ์ดํฐ๋ฅผ ๋จ์ ์ ์ฅํ๋ค. ์ผ๋ฐ์ ์ผ๋ก ๋จ์ ๋์คํฌ์ ๋นํด ๋งค์ฐ ๋น ๋ฅด๊ธฐ ๋๋ฌธ์ Redis๋ ๊ธฐ๋ณธ์ ์ธ ๊ด๊ณํ ๋ฐ์ดํฐ ๋ฒ ์ด์ค์ ๋ค๋ฅธ ๊ตฌ์กฐ๋ฅผ ๊ฐ์ง๊ณ ์๋ค.
โ ํน์ง
1. In-Memory : ๋ชจ๋ ๋ฐ์ดํฐ๋ฅผ ๋จ์ ์ ์ฅ
2. Single Thread
3. Cluster Mode : ๋ค์ค ๋ ธ๋์ ๋ฐ์ดํฐ๋ฅผ ๋ถ์ฐ ์ ์ฅ → ์์ ์ฑ, ๊ณ ๊ฐ์ฉ์ฑ
4. Persistence
- ์ธ๋ฉ๋ชจ๋ฆฌ ๋ฐ์ดํฐ๋ฒ ์ด์ค์ฌ์ ํ๋ฐ์ฑ ๋ฐ์ดํฐ๋ฅผ ์ ์ฅํ์ง๋ง RDB(Redis Database)์AOF(Append only file) ์ต์ ์ ํตํด ๋ฐ์ดํฐ๋ฅผ ์์ ํ๊ฒ ์์์ ์ผ๋ก ๊ด๋ฆฌ
- SSD์ ๊ฐ์ ์๊ตฌ์ ์ธ ์ ์ฅ ์ฅ์น์ ๋ฐ์ดํฐ ์ ์ฅ
- RDB (Redis Database) : ํน์ ์๊ฐ์ ์ค๋ ์ท์ ์์ฑํ๋ ๊ธฐ์ , ์ฅ์ ๊ฐ ๋ฐ์ํ์ ๋ ํน์ ์์ ์ ์ค๋ ์ท์ผ๋ก ๋น ๋ฅด๊ฒ ์บ์๋ฅผ ๋๋๋ฆฌ๊ฑฐ๋ ๋์ผํ ๋ฐ์ดํฐ๋ฅผ ๊ฐ์ง ์บ์๋ฅผ ๋ณต์ ํ ๋ ์ฃผ๋ก ์ฐ์
- AOF (Append only file) : Redis์ ์ ์ฉ๋๋ ๋ชจ๋ write ์์ ์ ๋ชจ๋ ๋ก๊ทธ๋ก ์ ์ฅํ๋ ๊ธฐ์
5. Pub/Sub : ์ฑํ ์ด๋ ์๋ฆผ ์๋น์ค์ ๊ฐ์ ์ดํ๋ฆฌ์ผ์ด์ ๊ฐ๋ฐ
โ Redis ์ฌ์ฉ ์ฌ๋ก
1. Caching : ์์ ๋ฐ์ดํฐ(์์ ๋น๋ฐ๋ฒํธ, ๋ก๊ทธ์ธ ์ธ์ )๋ฅผ ์บ์ฑ
2. Rate Limit : ์๋ฒ์์ ํน์ API์ ๋ํ ์์ฒญ ํ์๋ฅผ ์ ํํ๊ธฐ ์ํด ์ฌ์ฉ
3. Message Broker
4. ์ค์๊ฐ ๋ถ์ / ๊ณ์ฐ
5. ์ค์๊ฐ ์ฑํ
์๋์ ์ธํฐ๋ท ๊ฐ์๋ฅผ ์๊ฐํ๋ฉฐ ์ ๋ฆฌํ ๋ด์ฉ์ ๋๋ค.
์ค์ ! Redis ํ์ฉ - ์ธํ๋ฐ | ๊ฐ์
๋ฐฐ์์ ๋ฐ๋ก ์ฌ์ฉํ ์ ์๋ Redis ๊ฐ์ข์ ๋๋ค!, ํํ ๋ฆฌ์ผ ์์ค์ ๊ฐ์๋ ๊ทธ๋ง ๐ โ๏ธ๋ค์ํ ์์ ๋ฅผ ํตํด ์ค๋ฌด์ ๋ฐ๋ก ์ ์ฉํ ์ ์๋ Redis ๊ฐ์์ ๋๋ค! [์๋ฒ ๋ฉ ์์] Key-Value NoSQL ๋ถ๋์ 1์, Re
www.inflearn.com
'๐ฉ๐ปโ๐ป > celery + redis' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
Redis and Celery (0) | 2025.02.12 |
---|---|
Celery๋ฅผ ์ด์ฉํ ํฌ๋กค๋ง ์์ (1) | 2025.02.05 |
[Flower] Monitoring Celery Tasks using Flower (1) | 2022.06.20 |
[Celery] Celery with Redis (python) : ๋น๋๊ธฐ ์์ queue (0) | 2022.06.06 |
[Redis] redis๋ฅผ ์์ํ๋ ๊ฐ๋จํ ๋ฐฉ๋ฒ 2๊ฐ์ง (docker/source download) (0) | 2022.06.06 |