Redis开源代码读书笔记二(源代码及工程结构)

Redis是一款采用C语言开发的<Key, Value>内存数据存储系统。今天主要3.0.7版本的的源代码和工程结构,并初步分解一下Redis内部开发模块及组成。

从Makefile文件和其执行过程及输出日志,可以分析出如下相关内容:

a)Redis程序组成

==》redis-benchmark:性能测试程序
==》redis-check-aof:日志检查程序
==》redis-check-dump:本地数据库检查程序
==》redis-cli:客户端程序
==》redis-server redis-sentinel(redis-server副本) :服务端程序


b)Redis组件组成

==》Redis C接口hiredis
==》jemalloc组件(支持tcmalloc,jemalloc,libc内存管理)
==》linenoise组件(readline的替代,详见https://github.com/antirez/linenoise/)
==》lua组件


c)Redis程序模块大致切分


d)Redis基本模块对应的简单描述


==》adlist:A generic doubly linked list implementation
==》ae:A simple event-driven programming library
==》anet:Basic TCP socket stuff library
==》aof:AOF rewrite buffer implementation
==》bio:Background I/O service for Redis
==》bitops:Bit operations.
==》blocked:generic support for blocking operations like BLPOP & WAIT.
==》cluster:Redis Cluster implementation.
==》config:Configuration file parsing and CONFIG GET/SET commands implementation.
==》crc16:CRC16 implementation according to CCITT standards.
==》crc64:CRC64 variant with "Jones" coefficients and init value of 0.
==》db:db operations
==》debug:debug operations
==》dict:Hash Tables Implementation.
==》endianconv:Endian conversions utilities.
==》hyperloglog:Redis HyperLogLog probabilistic cardinality approximation.
==》intset:int set operations
==》latency:The latency monitor allows to easily observe the sources of latency
==》lzf_c:LZF compression implementation
==》lzf_d:LZF decompression implementation
==》memtest:memtest like memtest86: http://www.memtest86.com/
==》multi:transaction operations
==》networking:redis network protocls
==》notify:implements keyspace events notification via Pub/Sub
==》object:Redis Object implementation.
==》pqsort:the NetBSD libc qsort implementation modified in order to support partial sorting of ranges for Redis.
==》pubsub:publish and subscribe implementation
==》rand:Pseudo random number generation functions derived from the drand48() function obtained from pysam source code.
==》rdb:redis database operations
==》release:Redis Git SHA1, Dirty status changes, Build version controls
==》replication:Asynchronous replication implementation.
==》rio:a simple stream-oriented I/O abstraction.
==》scripting:lua script support implementation
==》sds:A C dynamic strings library
==》sentinel:Redis Sentinel implementation
==》setproctitle:Linux/Darwin setproctitle.
==》sha1:SHA-1 algorithm
==》slowlog:remember the latest N queries
==》sort:SORT command and helper functions
==》sparkline:ASCII Sparklines
==》syncio:Synchronous socket and file I/O operations useful across the core.
==》t_hash:hash operations
==》t_list:list operations
==》t_set:set operations
==》t_string:string operations
==》t_zset:zset operations
==》util:utility functions
==》ziplist:The ziplist is a specially encoded dually linked list that is designed to be very memory efficient.
==》zipmap:String Map data structure optimized for size, implementing an O(n) lookup data structure, very memory efficient.
==》zmalloc:total amount of allocated memory aware version of malloc()

你可能感兴趣的:(Redis开源代码读书笔记二(源代码及工程结构))