Remote Dictionary Server overview key value string set

  • Slides: 16
Download presentation
Remote Dictionary Server

Remote Dictionary Server

overview • key – value 메모리 저장소 • string, set & sorted set, list,

overview • key – value 메모리 저장소 • string, set & sorted set, list, hash ) – – – key: key: String String -> -> -> value: value: String set sorted set list hash (다양한 data type 지원 (score를 줄 수있다)

data structure • (string) 하나의 key에는 하나의 data type만~!! mykey Hello World

data structure • (string) 하나의 key에는 하나의 data type만~!! mykey Hello World

data structure (list) mylist Hello World

data structure (list) mylist Hello World

data structure 최악의 경우 모든 value header를 변경 해야 하므로 – SO? • list-max-ziplist-entries

data structure 최악의 경우 모든 value header를 변경 해야 하므로 – SO? • list-max-ziplist-entries (default: 1024개) • list-max-ziplist-value (default: 32 byte) – max를 넘으면 어떻게하냐? • ziplist였던 구조가 일반적인 linked-list구조로 변환

cluster • 예제 mykey slot의 개수=10 CRC 16(“mykey”) / number_slot 3

cluster • 예제 mykey slot의 개수=10 CRC 16(“mykey”) / number_slot 3

cluster(gossip) 출처 : http: //justsimplesomethings. blogspot. com/2011/02/its-bummer-to-get-old. html

cluster(gossip) 출처 : http: //justsimplesomethings. blogspot. com/2011/02/its-bummer-to-get-old. html

replication redis 127. 0. 0. 1: 6379> (integer) 1 redis 127. 0. 0. 1:

replication redis 127. 0. 0. 1: 6379> (integer) 1 redis 127. 0. 0. 1: 6379> (integer) 2 redis 127. 0. 0. 1: 6379> (integer) 3 redis 127. 0. 0. 1: 6379> (integer) 4 redis 127. 0. 0. 1: 6379> 1) "Hello hongkong" 2) "Hello tokyo" 3) "Hello seoul" 4) "Hello sydney" redis 127. 0. 0. 1: 6379> (empty list or set) redis 127. 0. 0. 1: 6379> OK redis 127. 0. 0. 1: 6379> 1) "Hello hongkong" 2) "Hello tokyo" 3) "Hello seoul" 4) "Hello sydney" redis 127. 0. 0. 1: 6379> lpush mylist "Hello sydney" lpush mylist "Hello seoul" lpush mylist "Hello tokyo" lpush mylist "Hello hongkong" lrange mylist 0 -1 connect 127. 0. 0. 1 6380 lrange mylist 0 -1 • slave에서도 query 가능 • replication 주기는 master의 save config로 조정 • 또는 ‘sync’ query 로 조정 • 마스터의 rdb 파일을 slave 로 복사하고 slave에서는 그 파일을 load slaveof 127. 0. 0. 1 6379 lrange mylist 0 -1 참조 : http: //redis. io/topics/replication

persistence • AOF? RDB? – snapshot 을 기록하느냐, query log를 기록하느냐 차이 – RDB

persistence • AOF? RDB? – snapshot 을 기록하느냐, query log를 기록하느냐 차이 – RDB 설정 • config 파일 [save] [changes] - 여러 개 설정 가능 – AOF 설정 • • appendonly yes appendfsync always appendfsync everysec (default) appendfsync no option

client • dummy client – 하나의 client는 하나의 서버와 연결. 1. 2. 3. 4.

client • dummy client – 하나의 client는 하나의 서버와 연결. 1. 2. 3. 4. Client => A: GET foo A => Client: -MOVED 8 192. 168. 5. 21: 6391 Client => B: GET foo B => Client: "bar" – default • smart client 출처 : http: //cdmanii. com/721 – client가 일정 간격으로 서버의 hash slot 정보를 가져옴 – 하나의 client가 모든 server와 connection이 이루어져있음

reference • http: //redis. io/presentation/Redis_Cluster. pdf • http: //redis. io/presentation/Pnoordhuis_whats_ne w_in_2_2. pdf • http:

reference • http: //redis. io/presentation/Redis_Cluster. pdf • http: //redis. io/presentation/Pnoordhuis_whats_ne w_in_2_2. pdf • http: //pauladamsmith. com/blog/2011/03/redis_ge t_set. html • http: //www. searchtb. com/2011/05/redisstorage. html • http: //edisonlz. iteye. com/blog/1143851 • http: //speakerdeck. com/u/peterc/p/redis-steadygo • http: //antirez. com