【Redis - 0】Introduction to Redis
Introduction to Redis
Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache and message broker. It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs(超重对数), geospatial(n. 地理空间) indexes with radius(n. 半径,半径范围;) queries and streams. Redis has built-in replication(n. 复制;回答;反响), Lua scripting, LRU eviction(n. 逐出;赶出;收回), transactions and different levels of on-disk persistence, and provides high availability via Redis Sentinel(n. 哨兵 vt. 守卫,放哨) and automatic partitioning with Redis Cluster.
You can run atomic operations on these types, like appending(vt. 附加;贴上;盖章) to a string; incrementing(n. [数] 增量;增加;增额;盈余) 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(n. 倾销;倾泻) the dataset to disk every once in a while, or by appending each command to a log. Persistence can be optionally disabled, if you just need a feature-rich, networked, in-memory cache.
Redis also supports trivial(adj. 不重要的,琐碎的;琐细的)-to-setup master-slave(n. 奴隶;从动装置;vi. 苦干;拼命工作) asynchronous replication, with very fast non-blocking first synchronization, auto-reconnection with partial resynchronization on net split.
Other features include:
- Transactions
- Pub/Sub(发布/订阅)
- Lua scripting
- Keys with a limited time-to-live
- LRU eviction of keys
- Automatic failover(n. 失效备援(为系统备援能力的一种,当系统中其中一项设备失效而无法运作时,另一项设备即可自动接手原失效系统所执行的工作))
You can use Redis from most programming languages out there.
Redis is written in ANSI C and works in most POSIX(n. 可移植性操作系统接口) systems like Linux, *BSD, OS X without external dependencies. 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(n. 努力;成就). There is no official support for Windows builds, but Microsoft develops and maintains a Win-64 port of Redis.
浙公网安备 33010602011771号