Comments

MongoDB 是NoSQL 数据库,适合存JSON格式数据,MySQL是关系型数据库,适合存table格式数据

MongoDB扩展性更好,MySQL支持主从和cluster但是感觉不咋样

mongodb 没有事务、联表(join)查询的支持,其实有inlook 简单的联表查询支持的

mongodb 插入更新大量数据比较快,mysql 查询大量相关数据比较快

MongoDB有很好的HA和恢复支持

some important quotes:

  • MongoDB is an ideal choice if you have unstructured and/or structured data with the potential for rapid growth while MYSQL is a great choice if you have structured data and need a traditional relational database.
  • In general, a project with frequently updated data will benefit more from a relational database than a nonrelational one. An example of such a project would be any kind of transactional system, like an ecommerce platform, a workflow application, or a payment processor.

    On the other hand, a project that rarely updates information, such as an analytics application where data doesn't change after it has been collected, will benefit more from a nonrelational database.

可以考慮使用 NoSQL (譬如 MongoDB),如果

  1. 想快速啟動小專案測試 idea
  2. 資料格式不確定 (unstable schema),而未來很有可能調整
  3. 資料之間沒有複雜的關聯、或未來讀取資料時不需要使用 JOIN 的功能
  4. 著重在快速讀取資料與可用性,而非 ACID

可以考慮使用 RDBMS  (譬如 MySQL),如果

  1. 已經有明確的資料格式,未來不會大幅的變動
  2. 資料之間的關聯很重要
  3. 想要更有效率的讀取資料,未來會大量使用到 JOIN 的功能
  4. 更著重在資料操作的準確性與一致性 (ACID)

上述的情境主要是在個人專案上,如果實際在業界開發,還需要考量到

  1. 商業邏輯的設計
  2. 目前使用的系統(如何加入,需不需要做調整或轉移)
  3. 部署方式
  4. 成本計算
  5. 維護與營運考量
  6. 未來的擴充性
MongoDB MYSQL
MongoDB represents data
as JSON documents.
MySQL represents data
in tables and rows.
In MongoDB, you don’t need to define the schema. Instead, you just drop in documents don’t even need to have the same fields. MySQL requires you to define your tables and columns before you can store anything, and every row in a table must have the same columns.
MongoDB has a pre-defined structure that can be defined and adhered to, but also, if you need different documents in a collection, it can have different structures. MySQL uses Structured Query Language (SQL) for database access. You can’t change the schema.
Supported languages are C++, C Supported languages are C++, C and JavaScript
Ongoing development is done by MongoDB, Inc. Constant development is done by the Oracle Corporation.
MongoDB supports built-in replication, sharding, and auto-elections. MySQL supports master-slave replication and master replication.
If an index is not found, every document within a collection must be scanned to select the documents which offer a match to the query statement. If an index is not defined, then the database engine needs to scan the complete table to find all relevant rows.
GPL v2/ Commercial license available OD GNU AGPL v3.0/ Commercial licenses available OD
If most of your services are cloud based MongoDB is the best suited for you. If data security is your priority then MYSQL is the best option for you.
MongoDB places no restrictions on schema design. MySQL requires you to define your tables and columns before you can store anything. Every row in a table must have the same columns.
MongoDB uses JavaScript as query language. MySQL uses the Structured Query Language (SQL).
MongoDB doesn’t support JOIN. MySQL supports JOIN operations.
It has the ability to handle large unstructured data MySQL is quite slow in comparison to MongoDB while dealing with large databases.
Real-time analytics, content management, internet of things, mobile apps Structured data with clear schema
No schema definition required so lesser risk of attack due to design Risk of SQL injection attacks
An ideal choice if you have unstructured and/or structured data with the potential for rapid growth. A great choice if you have structured data and need a traditional relational database.

Ref:

https://www.bmc.com/blogs/mongodb-vs-mysql/#Disadvantages_of_both

https://blog.panoply.io/mongodb-and-mysql

https://www.guru99.com/mongodb-vs-mysql.html

mysql vs mongodb的更多相关文章

  1. MySQL、MongoDB、Redis数据库Docker镜像制作

    MySQL.MongoDB.Redis数据库Docker镜像制作 在多台主机上进行数据库部署时,如果使用传统的MySQL的交互式的安装方式将会重复很多遍.如果做成镜像,那么我们只需要make once ...

  2. MySQL与MongoDB的操作对比,以及区别

    MySQL与MongoDB都是开源的常用数据库,但是MySQL是传统的关系型数据库,MongoDB则是非关系型数据库,也叫文档型数据库,是一种NoSQL的数据库.它们各有各的优点,关键是看用在什么地方 ...

  3. MySQL vs. MongoDB: Choosing a Data Management Solution

    原文地址:http://www.javacodegeeks.com/2015/07/mysql-vs-mongodb.html 1. Introduction It would be fair to ...

  4. [转]MySQL与MongoDB的操作对比

    MySQL与MongoDB都是开源的常用数据库,但是MySQL是传统的关系型数据库,MongoDB则是非关系型数据库,也叫文档型数据库,是一种NoSQL的数据库.它们各有各的优点,关键是看用在什么地方 ...

  5. 转:视觉中国的NoSQL之路:从MySQL到MongoDB

    起因 视觉中国网站(www.chinavisual.com)是国内最大的创意人群的专业网站.2009年以前,同很多公司一样,我们的CMS和社区产品都构建于PHP+Nginx+MySQL之上:MySQL ...

  6. 阿里云下Linux服务器安装Mysql、mongodb

    阿里云下Linux服务器安装Mysql.mongodb 一.MySQL的安装和配置 1.安装rpm包 rpm -Uvh http://dev.mysql.com/get/mysql-community ...

  7. MySQL、MongoDB、Redis 数据库之间的区别

    NoSQL 的全称是 Not Only SQL,也可以理解非关系型的数据库,是一种新型的革命式的数据库设计方式,不过它不是为了取代传统的关系型数据库而被设计的,它们分别代表了不同的数据库设计思路. M ...

  8. MySQL和Mongodb的区别与应用场景对比

    MySQL是关系型数据库 优势: 在不同的引擎上有不同 的存储方式. 查询语句是使用传统的sql语句,拥有较为成熟的体系,成熟度很高. 开源数据库的份额在不断增加,mysql的份额页在持续增长. 缺点 ...

  9. python mysql redis mongodb selneium requests二次封装为什么大都是使用类的原因,一点见解

    1.python mysql  redis mongodb selneium requests举得这5个库里面的主要被用户使用的东西全都是面向对象的,包括requests.get函数是里面每次都是实例 ...

  10. 从MySQL和MongoDB的对比,看SQL与NoSQL的较量

    张家江,网易乐得高级工程师. 贵金属(注:贵金属为笔者部门业务)的行情系统提供的接口通过Redis获取数据,目前使用Redis最多只存储了大概8000条左右的分钟k的行情数据,考虑到将来可能会有更大数 ...

随机推荐

  1. Nginx常用操作

    Nginx Nginx的最重要的几个使用场景 静态资源服务,通过本地文件提供服务 反向代理服务,延伸出包括缓存,负载均衡等 API服务,OpenResty 相关概念 简单请求和非简单请求 请求方法是H ...

  2. java后端解决请求跨域

    跨域 跨域:指的是浏览器不能执行其他网站的脚本.它是由浏览器的同源策略造成的,是浏览器对javascript施加的安全限制. 例如:a页面想获取b页面资源,如果a.b页面的协议.域名.端口.子域名不同 ...

  3. Mysql密码安全策略修改

    Mysql5.7默认有密码安全策略,密码安全级别要求比较高,在测试环境中使用起来不方便,本经验将介绍如何修改Mysql的密码安全策略,解决ERROR 1819错误. 1:首先使用root用户连接mys ...

  4. [oeasy]python0129_unicode_中文字符序号_十三道大辙_字符编码解码_eval_火星文

    unicode 中文字符分类 回忆上次内容 字符集 从博多码 到 ascii 再到 iso-8859 系列 各自割据   如何把世界上各种字符统进行编码 unicode顺势而生不断进化 不过字符总量超 ...

  5. oeasy 教您玩转 linux 之 010302 火狐浏览器 firefox

    我们来回顾一下 上一部分我们都讲了什么? oneko xeyes 这次看看这个火狐 火狐 看看当前版本 看看是否可以更新 如果需要更新就更新    firefox -v    apt search f ...

  6. oeasy教您玩转vim - 29 - # 垂直翻页

    ​ 垂直翻页 回忆上节课内容 我们上次了解了横向滚动的相关信息 横滚幅度 - sidescroll 横滚留位 - sidescrolloff 自动换行 - wrap g j.g k 可以逐行上下移动 ...

  7. C语言基础要点

    C语言基础 C语言基础 C程序编译过程 C程序编译步骤 汇编语言 32关键字 数据类型 常量 size程序 类型限定 goto语句 指针 指针和字符串 作用域 函数 内存 进程内存结构 可执行文件结构 ...

  8. JavaWeb编写登录注册案例并把数据插入MySQL数据库中

    小白学习了这么久的java,第一次上手编写一个完整的登录以及注册案例,麻雀虽小五脏俱全!!!! 案例: 登录和注册 第一:所需创建的包以及相关类 1,domain包(也就是平时所说的Javabean) ...

  9. Java 线程池之ThreadPoolExecutor学习总结

    前提 java version "1.8.0_25" 池简述 软件开发活动中,我们经常会听到数据库连接池.内存池.线程池等各种"池"概念,这些"池&q ...

  10. 华为matebook 14s笔记本,Chrome浏览器开启硬件加速,屏幕闪屏,黑框,页面屏幕卡死,解决办法

    解决办法使用了 https://zhuanlan.zhihu.com/p/644296061 这个连接下的最后一个折中办法解决! 一.现象 Chrome开启"硬件加速模式"后,在观 ...