当前位置:网站首页>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 .
边栏推荐
- Sparkcontext: error initializing sparkcontext solution
- 线性DP AcWing 898. 数字三角形
- Bom Dom
- 1380. Lucky numbers in the matrix [two-dimensional array, matrix]
- Is the neural network (pinn) with embedded physical knowledge a pit?
- drools中then部分的写法
- kubenetes中port、targetPort、nodePort、containerPort的区别与联系
- Why do programmers have the idea that code can run without moving? Is it poisonous? Or what?
- 线性DP AcWing 899. 编辑距离
- Go learning notes - go based interprocess communication
猜你喜欢

Win10 system OmniPeek wireless packet capturing network card driver failed to install due to digital signature problem solution

区间DP AcWing 282. 石子合并

Rust search server, rust quick service finding tutorial

(C language) 3 small Codes: 1+2+3+ · · +100=? And judge whether a year is a leap year or a normal year? And calculate the circumference and area of the circle?

async/await 异步函数

In development, why do you find someone who is paid more than you but doesn't write any code?

刷题---二叉树--2

使用Sqoop把ADS层数据导出到MySQL

Discrimination of the interval of dichotomy question brushing record (Luogu question sheet)

spfa AcWing 852. spfa判断负环
随机推荐
Leetcode739 daily temperature
CDA数据分析——AARRR增长模型的介绍、使用
Sweetheart leader: Wang Xinling
The blink code based on Arduino and esp8266 runs successfully (including error analysis)
[ybtoj advanced training guide] similar string [string] [simulation]
[C language] Yang Hui triangle, customize the number of lines of the triangle
染色法判定二分图 AcWing 860. 染色法判定二分图
Calculate the maximum path sum of binary tree
甜心教主:王心凌
arcgis js 4. Add pictures to x map
寻找二叉树中任意两个数的公共祖先
Map和Set
arcgis js 4.x 地图中加入图片
深拷贝 事件总线
CPU指令集介绍
Post request body content cannot be retrieved repeatedly
Input a three digit number and output its single digit, ten digit and hundred digit.
Error in kubeadm join: [error port-10250]: port 10250 is in use [error fileavailable--etc kubernetes PKI
kubenetes中port、targetPort、nodePort、containerPort的区别与联系
Find the common ancestor of any two numbers in a binary tree