Write Once-run Anywhere
Write once-run anywhere
This is a marketing slogan for 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 customer groups. So why tie yourself to some kind of database vendor? The database abstraction layer enables you to develop your application independently from the database. However, they typically have more impact on performance than you want, or they are not sufficiently abstract to eliminate all code related to a particular database.
What will this article teach me?
This article will have a good introduction to the database Abstraction package PEAR MDB. The focus of the article will be on the more advanced features provided by the MDB beyond similar packages, such as data type abstraction and XML-based schema management. The basic understanding of PHP and SQL is recommended.
Why do you want another database class?
Typically, Web engineering is added to an existing IT infrastructure after customers have determined that they want to use that RDBMS (relational database management system). Even if that's not the case with different budgets that might affect what data you choose for deployment. In the end, you as a developer may simply prefer not to tie yourself to a vendor. Since then, it means keeping versions of each supported data or sacrificing more performance but gaining more ease of use: go to the PEAR MDB.
The MDB is a database abstraction layer that focuses on making an RDBMS-independent PHP program a simple process. Most of the other PHP's so-called database abstraction layers provide a common API and a very limited abstraction (mostly for sequences only) for all supported databases. The MDB can be used to abstract data sent and received by all databases on the other. Even the database schema can be defined as an RDBMS-independent format. But it provides these features while still maintaining a high level of performance as well as ease of use. This is achieved by deeply observing the two popular database abstraction layers, PEAR DB and Metabase, and then merging them. And in the fusion process, taking advantage of this opportunity to clean up their fusion API and any impact on the performance of the design.
How does an MDB appear?
As early as the fall of 2001, I was looking for a database abstraction package that might allow my company's program framework to be independent of the RDBMS. The goal is to reduce the number of code related to a particular database to zero. I found that the only package that provides such a feature is Metabase. But metabase has some parts because of the uncomfortable API to be compatible with PHP3. Nonetheless, we decided that Metabase was our only option. But even after adding a patch of performance improvement to Metabase, we still feel that we are giving up too much performance. We met Metabase's author at the 2001 PHP International Conference, and we talked about the benefits of making something like Metabase a part of the PEAR project. Shortly thereafter, a discussion began on the possible benefits of PEAR DB and Metabase convergence on the PEAR mailing list. After a lot of discussion in our company, we decided to take on the task. After a few months of hard work, we now have the first stable release of the MDB.
http://www.bkjia.com/PHPjc/631070.html www.bkjia.com true http://www.bkjia.com/PHPjc/631070.html techarticle write Once-run anywhere run anywhere this is a marketing slogan for Java, but it is also one of the key features of PHP. Many business models rely on OS independence to ...