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

相關文章
相關標籤/搜索