简体   繁体   English

哪个MySQL数据库引擎(MyISAM与InnoDB)用于繁忙的表?

[英]Which MySQL DB engine (MyISAM vs InnoDB) for very busy tables?

I have doubts about which DB engine choose to few of my tables. 我怀疑哪个数据库引擎选择了我的几个表。 I've already studied several articles, books and similar databases construction, but still not sure. 我已经研究了几篇文章,书籍和类似的数据库构造,但仍不确定。

Website characteristics - place for young music producers to share their work(music) with others. 网站特征 -年轻音乐制作人与他人分享他们的作品(音乐)的地方。 As you my guess, there will be a lot of queries when uploading and downloading music. 如您所料,上传和下载音乐时会有很多查询。

Here are two main tables in my DB: 'Users' - 27 Columns and 'Files' - 22 Columns 这是我数据库中的两个主表: “用户” -27列和“文件” -22列

Here is my question which engine will be better MyISAM vs InnoDB for both tables ? 这是我的问题,对于两个表,哪种引擎将比MyISAM和InnoDB更好?

MyISAM lock whole table so if I understand correctly when somebody uploading files MySQL locks table to write file data and then if in the same time somebody requesting to download even other file this request have to wait until Mysql unlock table right? MyISAM锁定整个表,所以如果有人上载文件时我能正确理解MySQL锁定表以写入文件数据,然后同时有人请求下载甚至其他文件,则此请求必须等到Mysql解锁表才对吗?

As you yourself said that MyISAM tables use table-level locking. 就像您自己说的那样,MyISAM表使用表级锁定。 So if the traffic is high InnoDB will be the right choice. 因此,如果流量很高,InnoDB将是正确的选择。 With MyISAM, only one user can interact at a time. 使用MyISAM,一次只能有一个用户进行交互。 You have to make sure that your hardware can keep up with these traffic to avoid being overrun. 您必须确保您的硬件可以跟上这些流量,以避免被超载。

That suggests to me you would need a storage engine which supports row-level locking, ie, InnoDB. 对我来说,这建议您需要一个支持行级锁定的存储引擎,即InnoDB。

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

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