php redis function method

Redis 2016. 1. 21. 12:01

https://github.com/phpredis/phpredis

'Redis' 카테고리의 다른 글

레디스 값 지우는법  (0) 2016.01.20
redis get list 하는 방법  (0) 2016.01.20
[Redis] auth operation not permitted  (0) 2016.01.19
redis type 데이터 타입 확인 메서드  (0) 2016.01.19
Redis 데이터 타입  (0) 2016.01.19
Posted by 이상욱1
,

레디스 값 지우는법

Redis 2016. 1. 20. 13:06

http://redis.io/commands/lrem


LREM 키  1  value 


리스트 조회하는 법 

lrange 키 0 -1    - 전부 조회한다라는 의미 

'Redis' 카테고리의 다른 글

php redis function method  (0) 2016.01.21
redis get list 하는 방법  (0) 2016.01.20
[Redis] auth operation not permitted  (0) 2016.01.19
redis type 데이터 타입 확인 메서드  (0) 2016.01.19
Redis 데이터 타입  (0) 2016.01.19
Posted by 이상욱1
,

redis get list 하는 방법

Redis 2016. 1. 20. 11:38

redis> RPUSH mylist "one"

(integer) 1

redis> RPUSH mylist "two"

(integer) 2

redis> RPUSH mylist "three"

(integer) 3

redis> LRANGE mylist 0 0

1) "one"

redis> LRANGE mylist -3 2

1) "one"
2) "two"
3) "three"

redis> LRANGE mylist -100 100

1) "one"
2) "two"
3) "three"

redis> LRANGE mylist 5 10

(empty list or set)
redis> 

http://redis.io/commands/lrange

'Redis' 카테고리의 다른 글

php redis function method  (0) 2016.01.21
레디스 값 지우는법  (0) 2016.01.20
[Redis] auth operation not permitted  (0) 2016.01.19
redis type 데이터 타입 확인 메서드  (0) 2016.01.19
Redis 데이터 타입  (0) 2016.01.19
Posted by 이상욱1
,

[Redis] auth

Big Data2012.10.22 10:32

auth command
- 암호를 설정함으로써 redis server를 보호할 수 있다. redis는 클라이언트로부터 날아온 명령어를 수행하기 전에 암호를 요청할 수 있다. 이는 configuration file의 requirepass 항목을 설정함으로써 동작이 가능하다.

redis> get mykey
(error) ERR operation not permitted
redis> auth 1111
OK
redis> get mykey
"12345678"

http://yujuwon.tistory.com/entry/auth

'Redis' 카테고리의 다른 글

레디스 값 지우는법  (0) 2016.01.20
redis get list 하는 방법  (0) 2016.01.20
redis type 데이터 타입 확인 메서드  (0) 2016.01.19
Redis 데이터 타입  (0) 2016.01.19
key hkey(filed) value 시 ttl 값 체크 hexists  (0) 2015.11.03
Posted by 이상욱1
,

TYPE key

Returns the string representation of the type of the value stored at key. The different types that can be returned are: stringlistsetzset and hash.

Return value

Simple string reply: type of key, or none when key does not exist.

Examples

redis> SET key1 "value"
OK
redis> LPUSH key2 "value"
(integer) 1
redis> SADD key3 "value"
(integer) 1
redis> TYPE key1
string
redis> TYPE key2
list
redis> TYPE key3
set
redis> 

http://redis.io/commands/type

'Redis' 카테고리의 다른 글

레디스 값 지우는법  (0) 2016.01.20
redis get list 하는 방법  (0) 2016.01.20
[Redis] auth operation not permitted  (0) 2016.01.19
Redis 데이터 타입  (0) 2016.01.19
key hkey(filed) value 시 ttl 값 체크 hexists  (0) 2015.11.03
Posted by 이상욱1
,

Redis 데이터 타입

Redis 2016. 1. 19. 10:36

Redis에는 5가지의 데이터 타입이 존재한다. (Strings, Lists, Sets, Sorted sets, Hashes)


Strings (일반적인 key-value)

  - String이라고 해서 문자열만 저장할 수 있는게 아니라, 이진 데이터도 저장 가능 (정수, 실수형이 따로 없다.)

  - key에 넣을 수 있는 데이터의 최대 크기는 512MB 이다.


Lists (Array 형태로 key 1개에 n개의 값을 가짐, 중복 값 가능)

  - 배열이라고 생각해도 된다.

  - 한 key에 넣을 수 있는 요소의 최대 개수는 4,294,967,295 개이다.

  - 데이터 형의 값은 설정파일에서 정해준 조건보다 큰 경우 linkedlist 아니면 ziplist로 encoding 된다.


Sets (Group 형태로 key 1개에 n개의 중복되지 않는 값을 가짐)

  - 정렬되지 않은 집합형으로 key에 중복된 데이터는 존재하지 않는다.

  - 추가, 제거 및 존재 체크 시 소모되는 시간이, sets에 포함된 요소의 수와 관계없이 일정하다.

  - 한 key에 넣을 수 있는 요소의 최대 개수는 4,294,967,295 개이다.

  - 데이터 형의 값은 설정파일에 정해준 조건보다 큰 경우 hashtable 아니면 intset으로 encoding 된다.


Sorted sets (Group 형태이나 각 member에 score 값을 가짐, key-member-score)

  - Sorted sets는 가장 진보한 Redis 데이터 형이라고 한다.

  - 요소의 추가, 제거, 업데이트는 매우 빠른 방법으로 진행되는데 이는 "요소의 개수의 로그"에 비례하는 

    시간이 사용된다.

  - 랭킹 시스템 등에서 사용되기 좋다.

  - sets의 각 요소마다 score라는 실수 값을 가지고 있는 형태로 score 값으로 오름차순 정렬된다.

  - key에 종복된 데이터는 존재하지 않지만 score 값은 중복 가능하다.


Hashes (Object 형태의 key-field-value)

  - list와 비슷한데 "필드명", "필드값"의 연속으로 이루어져 있다.

  - 한 key에 포함할 수 있는 field-value 쌍의 최대 개수는 4,294, 967,295 개이다.

  - 데이터 형의 값은 설정파일에서 정해준 조건보다 큰 경우는 hashtable 아니면 zipmap으로 encoding 된다

http://lovedb.tistory.com/151

'Redis' 카테고리의 다른 글

레디스 값 지우는법  (0) 2016.01.20
redis get list 하는 방법  (0) 2016.01.20
[Redis] auth operation not permitted  (0) 2016.01.19
redis type 데이터 타입 확인 메서드  (0) 2016.01.19
key hkey(filed) value 시 ttl 값 체크 hexists  (0) 2015.11.03
Posted by 이상욱1
,


http://redis.io/commands/hexists

'Redis' 카테고리의 다른 글

레디스 값 지우는법  (0) 2016.01.20
redis get list 하는 방법  (0) 2016.01.20
[Redis] auth operation not permitted  (0) 2016.01.19
redis type 데이터 타입 확인 메서드  (0) 2016.01.19
Redis 데이터 타입  (0) 2016.01.19
Posted by 이상욱1
,