Demo
Tech Blog - Related Cache
https://toss.tech/article/cache-traffic-tip
https://blog.hwahae.co.kr/all/tech/14003
Redis as a cache
- 단순한 Key-value 구조
- In-memory 데이터 저장소 (RAM)
- 빠른 성능
- 평균 작업속도 < 1ms
- 초당 수백만 건의 작업 가능
Caching Strategies

- Redis 를 캐시로 쓸 때 가장 일반적으로 사용하는 전략
- Application은 최초에 Redis에서 원하는 데이터를 찾음 (
Cache Hit
)
- Redis 에 원하는 데이터가 없다면 Database 에서 원하는 데이터를 찾음 (
Cache Miss
)
- 다량의 Cache Miss 발생시 갑자기 데이터베이스에 많은 부하가 올 수 있음
- 이를 해결하기 위해 일정 데이터를 캐시로 미리 넣어놓는 Cache warming 작업을 수행할 수 있음

- Write-Around
- 데이터를 무조건 Database에 저장
- Cache Miss 발생 가능성이 높아짐
- Write-Through
- 데이터를 캐시에 먼저 저장후 Database에도 저장
- 자주 사용되지 않는 데이터가 Cache에 적재되어 리소스 낭비가 될 수 있음