当前位置:网站首页>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 .
边栏推荐
- In development, why do you find someone who is paid more than you but doesn't write any code?
- Docker-compose配置Mysql,Redis,MongoDB
- What data types does redis have and their application scenarios
- AI mid stage technology research
- 怎样写一篇赏心悦目的英文数学论文
- 刷题---二叉树--2
- 线性DP AcWing 895. 最长上升子序列
- Intel internal instructions - AVX and avx2 learning notes
- Lekao.com: experience sharing of junior economists and previous candidates in customs clearance
- Writing method of then part in drools
猜你喜欢

浏览器存储方案

ThreadLocal的简单理解

线性DP AcWing 897. 最长公共子序列

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

async/await 异步函数
![[old horse of industrial control] detailed explanation of Siemens PLC TCP protocol](/img/13/9002244555ebe8a61660c2506993fa.png)
[old horse of industrial control] detailed explanation of Siemens PLC TCP protocol

Addition, deletion, modification and query of MySQL table (Advanced)

Interview with meituan, a 34 year old programmer, was rejected: only those under the age of 30 who work hard and earn little overtime

CDA数据分析——AARRR增长模型的介绍、使用

CDH存在隐患 : 该角色的进程使用的交换内存为xx兆字节。警告阈值:200字节
随机推荐
IPhone 6 plus is listed in Apple's "retro products" list
CDA data analysis -- common knowledge points induction of Excel data processing
Drools executes the specified rule
Mysql database foundation
What data types does redis have and their application scenarios
(C language) input a line of characters and count the number of English letters, spaces, numbers and other characters.
VLAN experiment
线性DP AcWing 899. 编辑距离
单指令多数据SIMD的SSE/AVX指令集和API
Jenkins voucher management
[FFH] little bear driver calling process (take calling LED light driver as an example)
How to write a pleasing English mathematical paper
Simple understanding of ThreadLocal
Error in kubeadm join: [error port-10250]: port 10250 is in use [error fileavailable--etc kubernetes PKI
Floyd AcWing 854. Floyd求最短路
Docker compose configuration mysql, redis, mongodb
Go学习笔记—基于Go的进程间通信
MySQL indexes and transactions
drools决策表的简单使用
Programmers can't find jobs after the age of 35? After reading this article, you may be able to find the answer