以前从来没听说过有Redis这么个玩意,无意间看到一位仁兄的博客,才对其有所了解,所以决定对其深入了解下。有不对的地方还请各位指正。
下面是官方的介绍,不喜欢english的直接绕到中文的介绍区域。
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.
由于本人平时开发都在Windows上,所以一下的介绍及后续的文章都是基于Windows 7 32bits的机子上,还请各位选择性的参考。目前Redis对Windows没有官方支持,但是开源的力量是无穷的,Microsoft 开发并维护 Win32-64 experimental version of Redis.当时觉得不可思议,像Microsoft这样“注重隐私“的公司也开始进行开源项目的开发了。下载结束之后将其解压,然后找到目录”bin/release/“下的redisbin文件(同时也包含64bits的文件,根据自己的环境进行选择),我的是32bits的,所以直接解压的redisbin。详细见下图 。
接下来就是启动redis-server和redis-cli了。doc命令进入到上面的目录下,直接双击redis-server.exe就会启动redis-server了,详细解下图。
然后直接双击redis-cli.exe就会启动redis-cli了,详细解下图。
以上安装过程比较简单,对入门可能会有所帮助,接下来会介绍redis的相关配置。