当前位置:网站首页>Mongodb redis differences
Mongodb redis differences
2022-07-02 12:37:00 【Squat in the corner and count the ants】
One 、 summary
MongoDB More like MySQL, Support field index 、where Etc , Its advantage lies in the powerful query function , Good at query JSON data , And can store massive amounts of data , But it doesn't support transactions .
Redis It's open source (BSD The license ) Of , Data structure storage system in memory , Support multiple types of data structures , It can be used as a database , Caching and message queuing agents .
Two 、 Specific differences
1、 Memory management mechanism
Redis All data is in memory , Write to disk regularly , When there is not enough memory , You can choose the specified LRU Algorithm delete data .
MongoDB Data exists in memory , from linux System mmap Realization , When there is not enough memory , Just put the hotspot data in memory , Other data is on disk .
2、 Supported data structures
Redis The data structure supported is rich , Include hash、set、list etc. .
MongoDB The data structure is relatively simple , But support rich data expression 、 Indexes , It is very similar to relational database , The supported query statements are very rich .
3、 Data volume and performance
When there is enough physical memory ,Redis>Mongodb>MySQL.
When physical memory is not enough ,Redis and Mongodb Will use virtual memory . however ,Mongodb Dissimilarity , As long as the read-write ratio of hot and cold data can be guaranteed in business , Make the hot data in physical memory ,mmap Less exchange ,mongodb Still guaranteed performance .
4、 performance
Mongodb Dependent on memory ,TPS Higher ;
Redis Dependent on memory ,TPS Very high . On the performance Redis be better than MongoDB.
5、 reliability
mongodb from 1.8 After version , use binlog The way ( And MySQL In the same way ) Support persistence , Increase reliability ;
Redis Depend on snapshot for persistence ;AOF Enhance reliability ; While enhancing reliability , Impact access performance .
Reliability MongoDB be better than Redis.
6、 Data analysis
mongodb Built in data analysis function (mapreduce); and Redis I won't support it .
7、 Transaction support
Redis Transaction support is weak , It can only guarantee the continuous execution of each operation in the transaction ;mongodb Unsupported transaction .
8、 colony
MongoDB Cluster technology is relatively mature ,Redis from 3.0 Start to support clusters .
边栏推荐
- 线性DP AcWing 898. 数字三角形
- Lekao: 22 year first-class fire engineer "technical practice" knowledge points
- In development, why do you find someone who is paid more than you but doesn't write any code?
- Sort---
- High performance erasure code coding
- 浏览器node事件循环
- drools执行完某个规则后终止别的规则执行
- [ybtoj advanced training guide] similar string [string] [simulation]
- drools执行指定的规则
- Day12 control flow if switch while do While guessing numbers game
猜你喜欢
线性DP AcWing 896. 最长上升子序列 II
drools中then部分的写法
[C language] convert decimal numbers to binary numbers
Less than three months after the programmer was hired, the boss wanted to launch the app within one month. If he was dissatisfied, he was dismissed immediately
bellman-ford AcWing 853. 有边数限制的最短路
Sparkcontext: error initializing sparkcontext solution
China traffic sign detection data set
AAAI 2022 | Peking University & Ali Dharma Institute: pruning and compression of pre training language model based on comparative learning
Mysql database foundation
CDH存在隐患 : 该角色的进程使用的交换内存为xx兆字节。警告阈值:200字节
随机推荐
[ybtoj advanced training guidance] judgment overflow [error]
Shutter encapsulated button
Simple understanding of ThreadLocal
Openssh remote enumeration username vulnerability (cve-2018-15473)
Leetcode14 longest public prefix
Sub thread get request
async/await 异步函数
线性DP AcWing 902. 最短编辑距离
Deep understanding of P-R curve, ROC and AUC
BOM DOM
js 迭代器 生成器 异步代码处理 promise+生成器 -> await/async
Leetcode - Sword finger offer 59 - I, 59 - II
Addition, deletion, modification and query of MySQL table (Advanced)
"As a junior college student, I found out how difficult it is to counter attack after graduation."
LeetCode—剑指 Offer 59 - I、59 - II
Jenkins user rights management
BOM DOM
2.6 using recursion and stack - [tower of Hanoi problem]
Find the factorial of a positive integer within 16, that is, the class of n (0= < n < =16). Enter 1111 to exit.
1380. Lucky numbers in the matrix [two-dimensional array, matrix]