当前位置:网站首页>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 .
边栏推荐
- Sort---
- Does C language srand need to reseed? Should srand be placed in the loop? Pseudo random function Rand
- drools执行String规则或执行某个规则文件
- 趣味 面试题
- Openssh remote enumeration username vulnerability (cve-2018-15473)
- Sparkcontext: error initializing sparkcontext solution
- Simple use of drools decision table
- AI mid stage technology research
- Leetcode14 longest public prefix
- 线性DP AcWing 896. 最长上升子序列 II
猜你喜欢

染色法判定二分图 AcWing 860. 染色法判定二分图

Sort---
![[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

Sweetheart leader: Wang Xinling

AI mid stage technology research

PR 2021 quick start tutorial, learn about the and functions of the timeline panel

防抖 节流

China traffic sign detection data set

Anxiety of a 211 programmer: working for 3 years with a monthly salary of less than 30000, worried about being replaced by fresh students

BOM DOM
随机推荐
drools执行完某个规则后终止别的规则执行
IPhone 6 plus is listed in Apple's "retro products" list
Drools dynamically add, modify, and delete rules
China traffic sign detection data set
LeetCode—剑指 Offer 59 - I、59 - II
LeetCode—剑指 Offer 51. 数组中的逆序对
How to write a pleasing English mathematical paper
包管理工具
SparkContext: Error initializing SparkContext解决方法
Sub thread get request
计数类DP AcWing 900. 整数划分
The programmer and the female nurse went on a blind date and spent 360. He packed leftovers and was stunned when he received wechat at night
CDA数据分析——AARRR增长模型的介绍、使用
drools执行String规则或执行某个规则文件
Does C language srand need to reseed? Should srand be placed in the loop? Pseudo random function Rand
AI mid stage technology research
Leetcode - < dynamic planning special> Jianzhi offer 19, 49, 60
CPU指令集介绍
Differences between nodes and sharding in ES cluster
(C language) input a line of characters and count the number of English letters, spaces, numbers and other characters.