what type of engine (InnoDB or MyISAM) should i use for my database for a website?

北城余情 提交于 2019-12-23 05:19:29

问题


I have a detabase ERD which have gen/spec (inheritance) and a lot of use of primary and foreign keys.i am going to develop my site in PHP ,So Please help me out.i wl b waiting for ur good replies.

tanx


回答1:


If you have an ERD (Relational Database modelling term) then you won't have "gen spec", you will have Relationallly modelled Supertype-Subtype tables. If you have "gen spec" then you don't have a Relational database, you have a filing system that you persist your objects to. So, which one do you have ?

If you have a Relational Database, then definitely, go with InnoDB. MyISAM isn't "relational" since there are no Declarative Referential Integrity, etc.

If you have "gen-spec", since it isn't Relational, you don't need Relational capability or a Relational engine, MyISAM is fine. In fact your C: drive is fine.




回答2:


Personal opinion: You shouldn't use MyISAM for anything new. InnoDB supports a ton of features which MyISAM doesn't, the most important being transactions, followed by referential integrity and bunch of other items.

Many people will try to argue that MyISAM is faster and so it still has a place, but a) that gap has closed considerably, and speedups can be done outside of the database (ie, memcached, etc), and b) a fast database with bad data isn't all that useful.




回答3:


You should use InnoDB if you plan to enforce your primary keys and foreign key relationships (which I would recommend). MyISAM does not support such features to enforce referential integrity.




回答4:


As of MySQL 5.5 InnoDB will be the default storage engine. If you plan on using MySQL then this should be your choice. http://dev.mysql.com/doc/refman/5.5/en/innodb-default-se.html



来源:https://stackoverflow.com/questions/4514762/what-type-of-engine-innodb-or-myisam-should-i-use-for-my-database-for-a-websit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!