当前位置:网站首页>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 .
边栏推荐
- drools决策表的简单使用
- Sub thread get request
- Simple understanding of ThreadLocal
- 染色法判定二分图 AcWing 860. 染色法判定二分图
- MySQL and PostgreSQL methods to grab slow SQL
- js 迭代器 生成器 异步代码处理 promise+生成器 -> await/async
- [ybtoj advanced training guidance] cross the river [BFS]
- 分布式机器学习框架与高维实时推荐系统
- CDH6之Sqoop添加数据库驱动
- (C language) octal conversion decimal
猜你喜欢

模块化 CommonJS ES Module

Distributed machine learning framework and high-dimensional real-time recommendation system

VLAN experiment

MySQL与PostgreSQL抓取慢sql的方法

Performance tuning project case

Map and set

Docker-compose配置Mysql,Redis,MongoDB

Brush questions --- binary tree --2

Drools dynamically add, modify, and delete rules

CDA data analysis -- Introduction and use of aarrr growth model
随机推荐
线性DP AcWing 899. 编辑距离
Initial JDBC programming
Anxiety of a 211 programmer: working for 3 years with a monthly salary of less than 30000, worried about being replaced by fresh students
CPU指令集介绍
arcgis js 4.x 地图中加入图片
spfa AcWing 852. spfa判断负环
High performance erasure code coding
Day12 control flow if switch while do While guessing numbers game
VLAN experiment
spfa AcWing 851. spfa求最短路
Openssh remote enumeration username vulnerability (cve-2018-15473)
Use sqoop to export ads layer data to MySQL
IPhone 6 plus is listed in Apple's "retro products" list
[I'm a mound pytorch tutorial] learning notes
Intel internal instructions - AVX and avx2 learning notes
Anti shake throttle
MySQL and PostgreSQL methods to grab slow SQL
ThreadLocal的简单理解
PR 2021 quick start tutorial, learn about the and functions of the timeline panel
Go学习笔记—多线程