本人一直是C语言走过来的,最近闲来无事,学习和研究下Redis开源代码,并计划随着代码的深入理解做个简单的读书笔记,希望和大家一起学习和探讨。

当然第一篇仅仅是做个介绍啦,可能更多的是翻译,这里以目前最新的V3.0.7代码为例。。

Redis is an open source (BSD licensed), in-memory data structure store, used as database, cache and message broker.
Redis是一个BSD约束的开源代码,主要用于内存数据库存储,可以作为缓存和消息中间件。

It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs and geospatial indexes with radius queries.
其支持的主要数据类型
==》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.
Redis内嵌复制,Lua脚本,LRU回收机制,事务机制和不同级别的磁盘存储机制,并且提供了基于Sentinel和集群自动分区的高可靠性机制。

You can run atomic operations on these types, like appending to a string; incrementing the value in a hash; pushing an element 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将数据存储在内存里面。根据使用场景,可以选择过一段时间同步到磁盘,或者每次操作同步到磁盘,或者每次操作追加一个日志记录。

Persistence can be optionally disabled, if you just need a feature-rich, networked, in-memory cache.
如果只需要采用Redis功能的多样性,网络集群和内存数据库的高效性,磁盘固化保存功能可以选择性的关闭。

Redis also supports trivial-to-setup master-slave asynchronous replication, with very fast non-blocking first synchronization, auto-reconnection with partial resynchronization on net split.
Redis也同样支持主从异步复制机制(第一次进行快速非阻塞式同步,随后进行自动分块同步机制)

Other features include:
其他特性包含

==》Transactions
==》Pub/Sub
==》Lua scripting
==》Keys with a limited time-to-live
==》LRU eviction of keys
==》Automatic failover

==》事务处理机制
==》发布订阅机制
==》Lua脚本支持
==》键值TTL机制
==》LRU回收机制
==》自动故障转移机制

You can use Redis from most programming languages out there.
Redis支持绝大多数开发语言。


--- 以下并非翻译,请大家结合着看吧,呵呵

Redis is written in ANSI C and works in most POSIX systems like Linux, *BSD, OS X without external dependencies.
Redis是用C语言写的,并且在大部分POSIX标准的系统上都能使用,而不需要额外的外部依赖。这也是为什么想研究下其代码的主要原因。

Linux and OS X 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.
Linux和OS X等POSIX标准系统部署Redis的比较多,并且经过长期的测试,相对来说更加可靠和安全。当然作为开源系统,其主要的技术支持都是Best effort了。

There is no official support for Windows builds, but Microsoft develops and maintains a Win-64 port of Redis.
微软的系统当然也有移植,当然作为读者可以学习使用,本人并不推荐啦。


Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐