`
liuxinglanyue
  • 浏览: 557175 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

Redis, from the Ground Up(1)

阅读更多

A deep dive into Redis' origins, design decisions, feature set, and a look at a few potential applications.

Redis Logo

Redis (“REmote DIctionary Service”) is an open-source (BSD-licensed) database server.

History

The Redis project was started in early 2009 by an Italian developer named Salvatore Sanfilippo. Redis was initially written to improve the performance of LLOOGG, a real-time web analytics product out of Salvatore’s startup.

By June of 2009, Redis was stable enough, and had enough of a base feature set, to serve production traffic at LLOOGG. On June 19, 2009, an important milestone was hit:Salvatore deployed Redis to LLOOGG’s production environment and retired the MySQL installation.

Over the next months, Redis rapidly grew in popularity. Salvatore fostered a great community, added features at a very rapid pace, and dealt with any and all reports of database corruption, instability, etc. with the utmost severity.

In March of 2010 VMWare hired Salvatore to work full-time on Redis. (Redis itself remains BSD licensed.) Shortly thereafter, VMWare hired Pieter Noordhuis, a key Redis contributor, to give the project an additional momentum boost.

The rest, as they say, is history.

Data Structure Server

The most apt description of Redis is that it is a “data structure server”. This is a very natural label for the database, because Redis natively supports many of the foundational data types of computer science, and provides a rich set of familiar primitives for manipulating these types.

The supported data types are:

  • Strings
  • Lists
  • Sets
  • Sorted Sets
  • Hashes

Key Advantages

Performance

Redis can perform >100k+ SETs per second, and >80k+ GETs per second.

The redis-benchmark utility included with the project can be used to reproduce these findings. (More on benchmarks here and here.)

Atomicity

Every operation that Redis exposes via the available command primitives is atomic. (And, as we’ll see later, there are ways to combine multiple primitive commands into larger atomic units.) This makes application-level code easier to build and reason about.

Atomic guarantees are a direct consequence of Redis' single-threaded core; as a result, Redis' internals are simpler (no complex locking and synchronization code complicating the codebase, introducing bugs, and burning up CPU cycles).

Foundational Data Types

The data types that Redis offers are foundational. All computer scientists are very familiar with these data types and have already used them to solve countless problems.Lists, sets, etc. are more fundamental to computer scientists than relational database tables, columns, and rows.

The documentation for all Redis commands includes complexity measurements, in big O notation. This makes it very straightforward for computer scientists and software engineers to visualize, reason about, optimize, and understand the performance of Redis queries. Is it this straightforward to understand query performance in a relational database?

Polyglot Persistence

This is not specifically an advantage inherent to Redis, but is worth noting. Using Redis does not require a commitment to use it exclusively. Use Redis to solve problems that can be naturally modelled using its primitives, and embrace polyglot persistence for everything else.

Client Protocol

The client protocol is very straightforward. This makes it simple to build client libraries.

Getting Started

It is very easy to get started. Redis has no external dependencies, and getting up and running only involves the following steps:

  1. Clone the git repository or unpack the tarball
  2. Run make
  3. Run ./src/redis-server

Then, from another terminal, start the interactive command line interface by running./src/redis-cli.

Feel free to issue a few commands:

    redis> PING
    PONG
    redis> INFO
    redis_version:2.1.1
    ...

(Alternatively, to try Redis from your browser, visit try.redis-db.com.)

分享到:
评论

相关推荐

    Redis-Essentials.pdf

    Chapter 1, Getting Started (The Baby Steps), shows you how to install Redis and how to use redis-cli, the default Redis command-line interface. It also shows you how to install Node.js and goes ...

    windows版Redis1

    标题“windows版Redis1”表明我们讨论的是一个适用于Windows操作系统的Redis安装包。这个压缩包包含了运行和管理Windows上的Redis所需的所有基本组件。 描述中提到,这个Windows版本的Redis可以直接解压后使用,这...

    Redis Essentials

    Redis Essentials is a fast-paced guide that teaches the fundamentals on data types, explains how to manage data through commands, and shares experiences from big players in the industry. We start off...

    基于C#的NewLife.Redis高性能Redis协议封装设计源码

    本项目是基于C#的NewLife.Redis高性能Redis协议封装设计源码,包含119个文件,其中包括95个C#源文件、6个csproj文件、3个YAML文件、2个PNG图片文件、2个pubxml文件、1个Editorconfig文件、1个gitignore文件、1个eddx...

    mac m1芯片 redis客户端RedisDesktopManager

    mac m1 redis可视化客户端 安装完成无法打开,提示移到废纸篓,在终端执行: sudo xattr -rd com.apple.quarantine /Applications/Another\ Redis\ Desktop\ Manager.app 即可

    分布式实现redis锁 出现错误Could not get a resource from the pool

    NULL 博文链接:https://sichen84.iteye.com/blog/2419876

    A SpringBoot project based on Redis from nowcoder..zip

    A SpringBoot project based on Redis from nowcoder.

    Mac m1版本Redis可视化管理工具Redis-Desktop-Manager

    解决github上下载慢Another-Redis-Desktop-Manager-M1-arm64-1.5.6文件安装验证通过Mac m1芯片可安装

    Redis in Action

    You'll begin by getting Redis set up properly and then exploring the key-value model. Then, you'll dive into real use cases including simple caching, distributed ad targeting, and more. You'll learn ...

    redis-5.0.14-1.el7.remi.x86-64.rpm安装包(含有部署手册)

    redis-5.0.14-1.el7.remi.x86_64.rpm安装包(含有部署手册) redis-5.0.14-1.el7.remi.x86_64.rpm安装包(含有部署手册) redis-5.0.14-1.el7.remi.x86_64.rpm安装包(含有部署手册) redis-5.0.14-1.el7.remi.x86_64.rpm...

    Windows版 Redis 5.0.14

    1. **Redis 5.0.14 版本特点**: - Redis 5.0.14是Redis的一个稳定版本,包含了前一版本的错误修复和性能优化。 - 引入了Stream数据类型,提供了一种新的结构化数据存储方式,适用于时间序列数据或其他需要记录...

    redis-5.0.3 redis-5.0.4 redis-5.0.5

    redis-5.0.3 redis-5.0.4 redis-5.0.5

    redis客户端连接工具 RedisDesktopManager

    1. **什么是Redis**:Redis是一个开源的、基于键值对的数据存储系统,支持多种数据结构,如字符串、哈希、列表、集合、有序集合等。它以内存中的数据作为主要存储方式,同时提供了持久化功能,确保数据在断电后不会...

    StackExchange.Redis Redis客户端

    最近需要在C#中使用Redis,在Redis的官网找到了ServiceStack.Redis,最后在测试的时候发现这是个坑,4.0已上已经收费,后面只好找到3系列的最终版本,最后测试发现还是有BUG或者是我不会用。没有办法,最好找到了...

    redis_4.0.10-1_arm64.deb 银河麒麟v4+飞腾

    1、redis_4.0.10-1_arm64.deb 银河麒麟v4+飞腾 安装包 2、自带服务启动 3、目录树 /opt/redis-4.0.10/ ├── bin │ ├── redis-benchmark │ ├── redis-check-aof │ ├── redis-check-rdb │ ├── ...

    Ubuntu安装redis和redis-php扩展

    1. 首先,需要下载 Redis 软件包,使用以下命令下载最新版本的 Redis: ``` sudo wget http://download.redis.io/releases/redis-4.0.9.tar.gz ``` 2. 解压缩下载的软件包: ``` sudo tar -zxvf redis-4.0.9.tar.gz ...

    MacOS M1处理器 redis可视化工具

    MacOS M1处理器 redis可视化工具

    Redis实战Redis实战

    《Redis实战》这本书深入浅出地探讨了Redis这一高性能、键值存储系统在实际应用中的各种技巧和策略。Redis作为一款内存数据结构存储系统,因其快速的数据读写能力,广泛应用于缓存、消息队列、计数器以及分布式锁等...

    redis 6.2.5 for windows

    Redis binaries are built with the original source Redis and have been compiled with free Visual Studio 2019 (VC16,Community Edition, version 16.2.5) to obtain higher performance and better stability ...

Global site tag (gtag.js) - Google Analytics