当前位置:网站首页>Redis1:Redis介绍、Redis基本特性、关系型数据库、非关系型数据库、数据库发展阶段
Redis1:Redis介绍、Redis基本特性、关系型数据库、非关系型数据库、数据库发展阶段
2022-08-05 03:26:00 【郝开】
Redis介绍
Remote Dictionary Service:翻译过来就是远程字典服务,简称redis。
为什么使用redis,需要先弄明白关系型数据库和非关系型数据库的区别,也就是SQL和NoSQL的区别和使用场景。
关系型数据库
俗称的SQL数据库,主流的MySQL、Oracle。
关系型数据库的特点
- 基于行存储数据,二维的模式(用表格的方式存储,有行有列)
- 存储结构化的数据,数据存储有固定的模式(schema)
- 表与表之间存在关联(Relationship)
- 大都支持SQL(结构化查询语言)的操作,支持复杂的关联查询
- 通过支持事务ACID(酸)来提供严格或者实时的数据一致性
关系型数据库的不足
- 要实现扩容难,只能向上(垂直)扩展,不支持动态的扩缩容,如果要实现水平扩容的话,需要引进一些复杂的技术,比如分库分表
- 表结构修改困难,因此存储的数据格式也受到限制
- 高并发情况下,基于磁盘的读写压力比较大
非关系型数据库
non relational,或者NoSQL,主流的Redis、MongoDB。
开始的时候,之所以叫NoSQL,刚开始是因为它不支持结构化查询语言(SQL)的操作,后来演变成not only SQL,不仅仅是SQL。
非关系型数据库特点
- 存储非结构化的数据,比如文本、图片、音频、视频
- 表与表之间没有关联,可扩展性强
- 保证数据的最终一致性,遵循BASE(碱)理论
- 支持海量数据的存储和高并发的高效读写
- 支持分布式,能够对数据进行分片存储,扩缩容简单
NoSQL的类型
- KV存储:Redis和Memcached
- 文档存储:MongoDB
- 列存储:HBase
- 图存储:Neo4j
- 对象存储
- XML存储
- ······
数据库发展阶段
特性 | SQL | NoSQL | NewSQL(比如TiDB) |
---|---|---|---|
关系模型 | √ | × | √ |
SQL语法 | √ | × | √ |
ACID | √ | × | √ |
水平扩展 | × | √ | √ |
海量数据 | × | √ | √ |
无结构化 | × | √ | √ |
Redis基本特性
- 速度快,放在了内存当中
- 支持多种数据类型(Memcached只支持KV)
- 支持多种编程语言
- 持久化、内存淘汰(Memcached没有持久化的机制)
- 功能丰富:事务、发布订阅、pipeline、lua
- 集群、分布式(Memcached不支持集群的主从设置,Memcached设计是多线程的)
边栏推荐
猜你喜欢
token、jwt、oauth2、session解析
冰蝎V4.0攻击来袭,安全狗产品可全面检测
Static method to get configuration file data
Simple description of linked list and simple implementation of code
presto启动成功后出现2022-08-04T17:50:58.296+0800 ERROR Announcer-3 io.airlift.discovery.client.Announcer
21 Days Learning Challenge (2) Use of Graphical Device Trees
静态方法获取配置文件数据
Step by step how to perform data risk assessment
Question about #sql shell#, how to solve it?
Use Unity to publish APP to Hololens2 without pit tutorial
随机推荐
Step by step how to perform data risk assessment
2022-08-04 The sixth group, hidden from spring, study notes
burp安装及代理设置
毕设-基于SSM房屋租赁管理系统
Object.defineProperty monitors data changes in real time and updates the page
Mathematics - Properties of Summation Symbols
龙蜥社区第二届理事大会圆满召开!理事换届选举、4 位特约顾问加入
In 2022, you still can't "low code"?Data science can also play with Low-Code!
IJCAI2022 | DictBert: Pre-trained Language Models with Contrastive Learning for Dictionary Description Knowledge Augmentation
2022 Hangzhou Electric Multi-School 1st Game
Ice Scorpion V4.0 attack, security dog products can be fully detected
From "useable" to "easy to use", domestic software is self-controllable and continues to advance
905. 区间选点
.NET Application -- Helloworld (C#)
Confessing the era of digital transformation, Speed Cloud engraves a new starting point for value
[Software testing] unittest framework for automated testing
如何在WordPress中添加特定类别的小工具
Simple description of linked list and simple implementation of code
Static method to get configuration file data
leetcode-每日一题1403. 非递增顺序的最小子序列(贪心)