Programming/Computer Science

Redis 입문용 정리

_heyna 2022. 4. 19. 17:48

서버쪽은 정말 문외한인데... 개발을 하다보니 데이터베이스쪽도 봐야하는 날이 오고 말았습니다.

 

Redis를 써보자고 하셔서 한창 공부중인 상황입니다...

 

윈도우에서 사용하는 redis로는 cpp_redis, Hiredis 등 있는데, 저희는 Hiredis를 쓰기로 결정했어요(비교적 업데이트가 잘 되고있어서)

 

윈도우즈에서 빌드방법은 잘 나와있는 블로그들이 있어서 넘어가고,

 

 

 

일단 Redis에 대해 차근차근 정리해보겠습니다.

 

Redis : Remote Dictionary Server

빠른 속도가 장점이라고 함.

 

-> 유튜브 NHN이나 우아한테크의 영상으로 공부했습니다.

 

예제코드

Hiredis Complie and Connection (redisgate.kr)

 

Hiredis Complie and Connection

hiredis_connection Hiredis Connection Connection Sample program 연결과 간단한 명령 실행     (vi :set paste) #include int main(int argc, char **argv) { redisReply *reply; // Connecting redisContext *c = redisConnect("127.0.0.1", 6001); if (c ==

redisgate.kr

 

redis key value로 간단하게 테스트 가능합니다.

->set age 20

->get age

출력 : 20

이런식으로 사용합니다.

 

그러나 레디스 홈페이지에 가보면 단순히 key value data가 아니라 data structure를 지원한다고 되어있습니다.

Data types tutorial | Redis

 

Data types tutorial

Learning the basic Redis data types and how to use them

redis.io

 

 

 

일단 모듈 사용전에 data type을 먼저 봐주고,

 

STREAMS Introduction Redis (redisgate.kr)

 

STREAMS Introduction Redis

streams_intro STREAMS Introduction 소개 Introduction 스트림 Streams 스트림(Stream)은 로그 데이터를 처리하기 위해서 5.0에서 새로 도입된 데이터 타입입니다. 여러 산업(industry)에서는 많은 경우 데이터가 연

redisgate.kr

 

이 사이트에 한국어로 설명이 잘 되있어서 입문용 공부에 도움이 될 듯 합니다.