网站的存储引擎选择 - Myisam 还是 Innodb?
作为 Craiglist 类型站点的存储引擎,什么是显而易见的选择 - MyIsam 或 InnoDb,为什么?
请解释您偏好的具体原因
Craigslist 类型的网站会有很多读取和写入,但可能会有更多读取,因为很多人来这里寻找他们想要的信息(通过搜索引擎)并且没有太多可发布的信息。 ..但刚刚找到了他们正在寻找的东西...
在这种情况下你会怎么做 Innodb 或 Myisam ?既然有读和写..?
What would be an obvious choice as a storage engine for a Craiglist type site - MyIsam or InnoDb and Why?
Please explain with specific reasons for your preference
A Craigslist type of site would have many reads as well as writes but probably more reads since lots of people came there looking for the info they wanted(through search engines)and do not have much to post ... but just found what they were looking for...
What would you do in such a case Innodb or Myisam ? Since there are both reads and writes..?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在 v.high level 术语中:
InnoDb
MySQL
对于我现在从事的任何新项目,我几乎肯定会选择 InnoDb。你的数据库崩溃的可能性较小,你可以利用事务并假设你在托管它的服务器上有相当大的RAM(现在RAM非常便宜),那么你应该获得非常好的性能它的。 InnoDb 在性能调整方面更为复杂,但幸运的是,它开箱即用,可以愉快地工作。
In v.high level terms:
InnoDb
MySQL
For any new project I work on now I would almost definitely choose InnoDb. There's less chance of your db crashing, you can take advantage of transactions and assuming you've got a decent chunk of RAM on the server you're hosting it on (RAM is so cheap these days) then you should get really good performance out of it. InnoDb is more complicated in terms of performance tuning but with luck it'll just work happily for you out of the box.
我更喜欢InnoDB,因为它更像是一个“真正的”数据库。此链接提供了更多详细信息:
http://www.mikebernat.com/blog/MySQL__InnoDB_vs_MyISAM
Choice quote:
“InnoDB 是事务安全的,这意味着在整个查询过程中保持数据完整性。InnoDB 还提供行锁定,而不是表锁定,这意味着当一个查询忙于更新或插入一行时,另一个查询则忙于更新或插入行。查询可以同时更新不同的行,这些功能提高了多用户并发性和性能。”
InnoDB 的大部分功能都归结为数据完整性,这总是一件好事:)
I prefer InnoDB because it is more of a "real" database. This link provides more detail:
http://www.mikebernat.com/blog/MySQL_-_InnoDB_vs_MyISAM
Choice quote:
"InnoDB is transaction-safe meaning data-integrity is maintained throughout the entire query process. InnoDB also provides row-locking, as opposed to table-locking, meaning while one query is busy updating or inserting a row, another query can update a different row at the same time. These features increase multi-user concurrency and performance."
Most of the features of InnoDB come down to data integrity, always a good thing :)
简而言之,总结一下:
* MyISAM(如果您正在寻找性能)。
* InnoDB 如果您正在寻找稳健性(事务、外键)。
我总是更看重稳健性而不是性能,在项目开始时更是如此。那么就从InnoDB开始吧。一旦您的网站足够成功,您可能会考虑 MyISAM。
In short, and to summarize :
* MyISAM if you're looking for performance.
* InnoDB if you're looking for robustness (Transactions, foreign keys).
I would always favor robustness over performance, even more so at the beginning of a project. So start with InnoDB. Once your website is successful enough, you might consider MyISAM.