Redis初学笔记

一、官网概述html

Redis is an open source (BSD licensed), in-memory data structure store, used as database, cache and message broker. It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs and geospatial indexes with radius queries. Redis has built-in replication, Lua scripting, LRU eviction, transactions and different levels of on-disk persistence, and provides high availability via Redis Sentinel and automatic partitioning with Redis Cluster.git

Redis 是一个开源(BSD许可)的,内存中的数据结构存储系统,它能够用做数据库、缓存和消息中间件。 它支持多种类型的数据结构,如 字符串(strings)散列(hashes)列表(lists)集合(sets)有序集合(sorted sets) 与范围查询, bitmapshyperloglogs地理空间(geospatial) 索引半径查询。 Redis 内置了 复制(replication)LUA脚本(Lua scripting)LRU驱动事件(LRU eviction)事务(transactions) 和不一样级别的 磁盘持久化(persistence), 并经过 Redis哨兵(Sentinel)和自动 分区(Cluster)提供高可用性(high availability)。github

 

redis与memcached的区别redis

  • memcached只提供数据内存缓存服务,如服务器宕机,则数据丢失
  • memcached在集群服务时,有多台服务器一块儿提供统一内存存储,数据是分散在不一样服务器上,经过键名hash方式去寻址,一旦某服务器宕机,则丢失其上数据
  • memcached没有提供任何形式的数据持久化功能,而redis提供支持
  • redis支持主从复制模式,保证了数据可靠
  • redis提供了更为丰富的数据存储结构

二、redis文件说明数据库

  • redis-benchmark.exe:Redis性能测试工具,测试Redis在你的系统及你的配置下的读写性能
  • redis-check-aof.exe:更新日志检查
  • redis-check-dump.exe:本地数据库检查
  • redis-cli:Redis命令行操做工具。固然,你也能够用telnet根据其纯文本协议来操做
  • redis-server:Redis服务器的daemon启动程序,主服务程序
  • redis.windows.conf:运行配置文件
  • dump.rdb:数据持久化至硬盘的默认文件

三、运行windows

  • 启动服务守护程序, cmd下运行 redis-server.exe  redis.windows.conf 或 redis-server.exe (注意:此方式命令窗口须保持打开状态,如关闭则redis服务也会被关闭

2016-3-23 14-48-16    2016-3-23 14-53-51

  • redis-server --service-start (启动redis服务) / redis-server --service-stop (中止redis服务)

2016-3-23 14-57-39

三、客户端链接缓存

  • 自带的redis-cli.exe,cmd下运行

2016-3-23 15-17-59

  • 可视化图形客户端RedisDesktopManager

http://redisdesktop.com/服务器

https://github.com/uglide/RedisDesktopManager数据结构

四、其余说明ide

Redis中的数据库是经过数字来进行命名的,缺省状况下打开的数据库为0。若是程序在运行过程当中打算切换数据库,可使用Redis的select命令来打开其余数据库,如select 1,若是此后还想再切换回缺省数据库,只需执行select 0便可。

 

五、参考资料

http://redis.io/

http://www.redis.cn/

http://www.cnblogs.com/huangxincheng/category/755864.html

http://www.cnblogs.com/caokai520/p/4409712.html

http://www.cnblogs.com/yangecnu/p/Introduct-Redis-in-DotNET.html

http://blog.csdn.net/joyhen/article/details/47358999

相关文章
相关标签/搜索