What DB extension PHP has (mysqli, PDO etc) is the best for enterprise level application?
What DB extension PHP has (mysqli, PDO etc开发者_JS百科) is the best for enterprise level application? The important features that comes to my mind are:
- under active maintenance
- A lot of documentation and examples.
- Probably endorsed by the Mysql people themselves.
- Robust
- scalable
1. under active maintenance
mysqli and PDO. if you end up using a framework, it will probably be using mysqli anyway.
2. A lot of documentation and examples.
mysqli and PDO.
3. Probably endorsed by the Mysql people themselves.
mysqli. see http://dev.mysql.com/doc/refman/5.0/en/apis-php.html
4. Robust
if i had to point to 1 single PHP extension that answers the question "which one is used most often and has the most number of people scrutinizing it for bugs?", i would have to vote for mysqli. if you have a different definition of robust, you'll have to elaborate.
5. scalable
it depends what you mean by scalable. in the mysqli vs. PDO shootout, mysqli has the tightest codebase and is therefore more scalable simply because the code is lighter. YMMV. IANAL.
but if you want something that helps you to scale (such as distributing load across a couple of mysql servers) you'll need something to wrap mysqli/PDO because nothing at the mysqli/PDO/whatever level will do this for you.
Real enterprise applications require not only a database extension, but ORM. I've heard sth about Doctrine, but can't tell you if it's stable, because I haven't used it.
I've looked at the features that it offers and it seems that this project is there for a while, because it has support for lazy loading, many-to-many relationships, inheritance, which are features that most of new ORMs don't have.
精彩评论