# Redis를 사용한 캐싱 (Node.js / NestJS) > Cache manager, Redis 통합, 캐시 전략, TTL, 무효화, 분산 캐시 - 20 면접 질문 - Mid-Level - [면접 질문: Node.js / NestJS](https://sharpskill.dev/ko/technologies/node-nestjs/interview-questions.md) ## 1. 캐싱의 맥락에서 Redis란 무엇입니까? **답변** Redis(Remote Dictionary Server)는 주로 분산 캐시로 사용되는 인메모리 키-값 NoSQL 데이터베이스입니다. 기존의 디스크 기반 데이터베이스와 달리 Redis는 데이터를 RAM에 저장하므로 밀리초 단위의 응답 시간을 제공합니다. strings, hashes, lists, sets, sorted sets와 같은 고급 데이터 구조를 지원하여 다양한 캐싱 패턴에 매우 유연하게 대응할 수 있습니다. ## 2. NestJS에 Redis를 통합하려면 어떤 npm 패키지를 설치해야 합니까? **답변** NestJS에 Redis를 통합하려면 @nestjs/cache-manager와 cache-manager-redis-store(최신 버전에서는 cache-manager-redis-yet)를 설치해야 합니다. @nestjs/cache-manager 패키지는 NestJS의 dependency injection 시스템과 통합되는 공식 CacheModule을 제공합니다. cache-manager-redis-store 패키지는 기본 인메모리 캐시 대신 Redis를 캐시 백엔드로 사용할 수 있게 해줍니다. ## 3. CacheModule을 Redis로 전역적으로 구성하려면 어떤 메서드를 사용합니까? **답변** CacheModule.register() 메서드는 모듈에 대해 로컬로 캐시를 구성하는 반면, isGlobal: true를 지정한 CacheModule.registerAsync()는 애플리케이션 전체에서 전역적으로 사용할 수 있게 합니다. async 방식은 ConfigService를 주입하여 환경 변수에서 Redis URL을 동적으로 가져올 수 있게 해줍니다. isGlobal을 사용하면 애플리케이션의 모든 모듈에서 CacheModule을 다시 import할 필요가 없습니다. ## 17개 추가 질문 이용 가능 - Redis 캐시 맥락에서 TTL(Time To Live)이란 무엇입니까? - NestJS에서 @UseInterceptors(CacheInterceptor) 데코레이터의 목적은 무엇입니까? 무료로 가입하기: https://sharpskill.dev/ko/login ## 기타 Node.js / NestJS 면접 주제 - [Node.js 기초](https://sharpskill.dev/ko/technologies/node-nestjs/interview-questions/nodejs-fundamentals.md): 20개 질문, Junior - [Node.js 코어 API](https://sharpskill.dev/ko/technologies/node-nestjs/interview-questions/nodejs-core-apis.md): 25개 질문, Junior - [비동기 프로그래밍](https://sharpskill.dev/ko/technologies/node-nestjs/interview-questions/asynchronous-programming.md): 25개 질문, Junior - [Express.js 기초](https://sharpskill.dev/ko/technologies/node-nestjs/interview-questions/express-basics.md): 20개 질문, Junior - [NestJS 기초](https://sharpskill.dev/ko/technologies/node-nestjs/interview-questions/nestjs-fundamentals.md): 23개 질문, Junior - [REST API 설계](https://sharpskill.dev/ko/technologies/node-nestjs/interview-questions/rest-api-design.md): 20개 질문, Junior - [검증과 DTO](https://sharpskill.dev/ko/technologies/node-nestjs/interview-questions/validation-dto.md): 20개 질문, Junior - [API 문서화 및 계약](https://sharpskill.dev/ko/technologies/node-nestjs/interview-questions/api-documentation.md): 20개 질문, Junior - [에러 처리](https://sharpskill.dev/ko/technologies/node-nestjs/interview-questions/error-handling.md): 20개 질문, Junior - [단위 테스트](https://sharpskill.dev/ko/technologies/node-nestjs/interview-questions/testing-unit.md): 20개 질문, Junior - [작업 스케줄링](https://sharpskill.dev/ko/technologies/node-nestjs/interview-questions/scheduling-cron.md): 15개 질문, Junior - [NestJS 모듈과 DI](https://sharpskill.dev/ko/technologies/node-nestjs/interview-questions/nestjs-modules-di.md): 20개 질문, Mid-Level - [구성 및 환경 관리](https://sharpskill.dev/ko/technologies/node-nestjs/interview-questions/configuration-environment.md): 20개 질문, Mid-Level - [JWT 인증](https://sharpskill.dev/ko/technologies/node-nestjs/interview-questions/authentication-jwt.md): 25개 질문, Mid-Level - [인가 및 RBAC](https://sharpskill.dev/ko/technologies/node-nestjs/interview-questions/authorization-rbac.md): 20개 질문, Mid-Level - [TypeORM을 사용한 데이터베이스](https://sharpskill.dev/ko/technologies/node-nestjs/interview-questions/database-typeorm.md): 30개 질문, Mid-Level - [Prisma ORM](https://sharpskill.dev/ko/technologies/node-nestjs/interview-questions/prisma-orm.md): 25개 질문, Mid-Level - [미들웨어와 인터셉터](https://sharpskill.dev/ko/technologies/node-nestjs/interview-questions/middleware-interceptors.md): 20개 질문, Mid-Level - [파일 업로드](https://sharpskill.dev/ko/technologies/node-nestjs/interview-questions/file-upload.md): 15개 질문, Mid-Level - [WebSockets](https://sharpskill.dev/ko/technologies/node-nestjs/interview-questions/websockets.md): 20개 질문, Mid-Level - [NestJS를 사용한 GraphQL](https://sharpskill.dev/ko/technologies/node-nestjs/interview-questions/graphql-basics.md): 25개 질문, Mid-Level - [엔드투엔드 테스트](https://sharpskill.dev/ko/technologies/node-nestjs/interview-questions/testing-e2e.md): 20개 질문, Mid-Level - [Bull을 사용한 큐](https://sharpskill.dev/ko/technologies/node-nestjs/interview-questions/queues-bull.md): 20개 질문, Mid-Level - [DevOps, Logging, CI/CD](https://sharpskill.dev/ko/technologies/node-nestjs/interview-questions/logging-monitoring.md): 25개 질문, Mid-Level - [Docker 및 컨테이너화](https://sharpskill.dev/ko/technologies/node-nestjs/interview-questions/docker-containerization.md): 25개 질문, Mid-Level - [마이크로서비스](https://sharpskill.dev/ko/technologies/node-nestjs/interview-questions/microservices.md): 30개 질문, Senior - [보안 모범 사례](https://sharpskill.dev/ko/technologies/node-nestjs/interview-questions/security-best-practices.md): 25개 질문, Senior - [성능 및 클라우드 배포](https://sharpskill.dev/ko/technologies/node-nestjs/interview-questions/performance-optimization.md): 30개 질문, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/ko/technologies/node-nestjs/interview-questions/caching-redis