简体   繁体   中英

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

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

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.

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.

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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