Redis Preview

-- Redis 2013. 10. 21. 13:27
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

현재 회사에서 Cache Server로 사용하고 있는 것이 바로 Redis (Remote Dictionary System) 이다.
이 NoSQL의 기술로 각광받고 있으며 In-memory 기술이어서 빠르며 여러 곳에서 쓰임이 다양하다.
설치는 http://redis.io에서 할 수 있으며, redis.io에서는 Redis를 다음과 같이 소개하고 있다.

(설치방법은 비교적 간단하여 생략한다)


Redis is an open source, BSD licensed, advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets.

You can run atomic operations on these types, like appending to a string; incrementing the value in a hash; pushing to a list; computing set intersection, union and difference; or getting the member with highest ranking in a sorted set.

In order to achieve its outstanding performance, Redis works with an in-memory dataset. Depending on your use case, you can persist it either by dumping the dataset to disk every once in a while, or by appending each command to a log.

Redis also supports trivial-to-setup master-slave replication, with very fast non-blocking first synchronization, auto-reconnection on net split and so forth. Other features include Transactions, Pub/Sub, Lua scripting, Keys with a limited time-to-live, and configuration settings to make Redis behave like a cache.

You can use Redis from most programming languages out there.

Redis is written in ANSI C and works in most POSIX systems like Linux, *BSD, OS X without external dependencies. Linux and OSX are the two operating systems where Redis is developed and more tested, and we recommend using Linux for deploying. Redis may work in Solaris-derived systems like SmartOS, but the support is best effort. There is no official support for Windows builds, but Microsoft develops and maintains a Win32-64 experimental version of Redis.


1. Redis 특징

- Memory에서 동작하는 Key/Value Store
- Memory의 데이터는 전원차단 시 유실
- 데이터의 영속성을 위해 HDD에 파일로 데이터 싱크
- HDD 파일을 Memory로 불러 읽기 가능
- Memory에서 동작하므로 Cache Server에 적합
- Redis끼리 Cluster 가능


2. Redis 자료형

Strings
문자열, 이진데이터를 저장하는 데이터형 (max 512MB)

Hashes
Key에 field, value로 이루어진 Map데이터형

Lists
문자열의 List형 (LPUSH, RPUSH)

Sets
문자열 테이블로 RDBMS의 테이블과 유사 (중복된 데이터는 보장하지 않음)

Sorted sets
문자열 테이블로 인덱스화된 순서 보장 테이블 (중복된 데이터는 보장하지 않음)

명령어는 http://redis.io/commands에서 확인하기 바란다.

posted by 어린왕자악꿍