Redis(1)—— 基本介绍

发布于:2022-12-21 ⋅ 阅读:(471) ⋅ 点赞:(0)

Redis是什么

一种开源(BSD 许可)的内存数据结构存储,用作数据库、缓存、消息代理和流引擎。

在线思考:redis作为消息代理和流引擎的应用场景有哪些???(手动狗头)

注:以下介绍中使用英文而不翻译不是作者懒(😄),而是希望读者能够结合自己的翻译工具和知识背景做出更适合自己理解的翻译结果。

常用的数据结构

  • strings
  • hashes
  • lists
  • sets
  • sorted sets with range queries
  • bitmaps
  • hyperloglogs
  • geospatial indexes
  • streams

在线思考:以上数据结构的应用场景有哪些???(手动狗头)特别是bitmaps、hyperloglogs、geospatial indexes和steams。

高阶知识

  • built-in replication
  • Lua scripting
  • LRU eviction
  • transactions
  • different levels of on-disk persistence
  • provides high availability via Redis Sentinel and automatic partitioning with Redis Cluster

在线思考:上面高阶知识的使用场景???

常用原子化操作

  • appending to a string
  • incrementing the value in a hash
  • pushing an element to a list
  • computing set intersection,union and difference
  • getting the member with highest ranking in a scored set

内存 vs 持久化

To achieve top performance, Redis works with an in-memory dataset.

Depending on your use case, Redis can persist your data either by periodically dumping the dataset to disk or by appending each command to a disk-based log.

You can also disable persistence if you just need a feature-rich, networked, in-memory cache.

在线思考:持久化方式有哪些?持久化原理?使用场景?使用策略?


网站公告

今日签到

点亮在社区的每一天
去签到