简体   繁体   English

Mongo和Mysql(MyIsam)之间有很大的速度差异吗?

[英]Is there a big speed difference between Mongo and Mysql(MyIsam)?

Giving the following situation: 给出以下情况:

  • over 10 million rows of data 超过1000万行数据
  • using a single collection in Mongo, with no embedded relations just a simple document but with many fields 在Mongo中使用单个集合,没有嵌入关系只是一个简单的文档,但有很多字段
  • using a Mysql(MyIsam Engine) table with the same fields. 使用具有相同字段的Mysql(MyIsam Engine)表。

-- -

  • Is the select speed better in any of them ? 选择速度是否更好?
  • Are updates/inserts faster in any of them ? 更新/插入更快吗?
  • Are there any significantly advantages in any of them ? 它们中的任何一个都有明显的优势吗?

Assuming that you are running benchmarks on the same kind of operating system, everything will come down to your data structure. 假设您在同一种操作系统上运行基准测试,一切都将归结为您的数据结构。 For instance, in both Mongo & Mysql, you have indexes, but if you do not use an index, mysql will beat mongo, if you index mongo properly, they would be close. 例如,在Mongo和Mysql中,你有索引,但如果你不使用索引,mysql将击败mongo,如果你正确地索引mongo,它们就会接近。 Mongo is better for unstructured data, where Mysql is better for structured and will typically out perform an unstructured/NoSQL type data store. Mongo对于非结构化数据更好,其中Mysql更适合结构化,并且通常会执行非结构化/ NoSQL类型的数据存储。 DML (updates/inserts/deletes) may be faster by index with Mysql depending upon good data design. 根据良好的数据设计,使用Mysql索引可以更快地更新DML(更新/插入/删除)。

Advantages are based on the architecture. 优点基于架构。 For instance Mysql is traditional row based transaction type (OLTP). 例如,Mysql是传统的基于行的事务类型(OLTP)。 Mongo is a for unstructured data, No schema is necessary. Mongo是非结构化数据,不需要架构。 Usually systems like this use key/value pairs to identify their objects which gives speedy access to the data on disk. 通常,像这样的系统使用键/值对来标识它们的对象,从而可以快速访问磁盘上的数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM