Write once-run anywhere
Write Once-run anywhere
This is a marketing slogan of Java, but it is also one of the key features of PHP. Many business models rely on Operating System independence to ensure that products can be sold to a wide range of customers. Therefore, why do you need to tie yourself to a database vendor? The database abstraction layer allows you to develop your applications independently from the database. However, in general, their impact on performance exceeds what you want, or they are not abstract enough to eliminate all Code related to a specific database.
What will this article teach me?
This article will give a good introduction to the database abstraction package pear mdb. The focus of this article will be on more advanced features provided by MDB over similar packages, such as data type abstraction and XML-Based schema Management. The basic understanding of PHP and SQL is recommended.
Why another database class?
Generally, a web project is added to an existing IT infrastructure after the customer determines that the RDBMS (relational database management system) is used. Even if it is not because different budgets may affect the data you choose for deployment. In the end, as a developer, you may simply prefer not to bind yourself to a vendor. Since then, it means to maintain the version of each supported data or sacrifice more performance, but more usability than is required: Go to pear mdb.
MDB is a database abstraction layer designed to make PHP programs unrelated to RDBMS become simple processes. Most of the other PHP's so-called database abstraction layers provide a public API and very limited abstraction for all supported databases (most of which are only for sequences ). MDB can also be used to abstract the data sent and received by all databases. Even the database schema can be defined as an RDBMS-independent format. However, it provides these features while maintaining high performance and ease of use. This is achieved through in-depth observation of two popular database abstraction layers, pear db and Metabase, which are then integrated. In addition, this opportunity is taken advantage of the convergence process to clear their integrated APIs and any design that affects performance.
How does MDB appear?
As early as the fall of 2001, I was looking for an abstract package that could make my company's program framework separate from RDBMS. This goal is to reduce the number of Code related to a specific database to zero. I found that the only package providing such a feature is Metabase. However, some Metabase APIs are designed to be compatible with PHP3 to make it uncomfortable. However, we decided that Metabase was our only choice. However, even after a performance improvement patch is added to Metabase, we still feel that we have given up too much performance. We met the author of Metabase at the PHP International Conference in 2001 and talked about the benefits of making something like Metabase part of the PEAR project. Soon afterwards, we started a discussion on the possible advantages of pear db and Metabase integration on the PEAR mail list. After much discussion in our company, we decided to undertake this task. After months of hard work, we now have MDB's first stable release.