redis 的实用特性


redis 的实用特性

1.  安全性
    用户名, 密码

conf_file     #requirepass  foo
then connect with   > auth foo
   redis-cli -a foo

2. 主从复制
     1)master -> slave  (1:n)
     2)多个slave 可以连接同一个master, slave 可连接其他slave
     3)
     4) 系统的伸缩性
 原理:  slave  ask master for   replication
        master spawn a child  process sync  write to disk
        slave  get the sync file

slaveof  172.16.1.141 6379 #specify  master port
masterauth   lamp   # specify password
> info role
3. 事务处理
    multi

    set hello world
    set hello ev
    exec
    get hello
    discard
乐观锁

   版本控制 version
   watch hello


4. 持久化机制
1>  snapshotting   快照
   save  binary file dump.rdb
   
2>  Append-only file
appendonly yes


5. 发布,订阅信息
pub/ sub

6. 虚拟内存的使用
  LRU
  vm-enabled
  vm-page-size 32 byte
  vm-max-threads 4

你可能感兴趣的:(redis 的实用特性)