I am starting out on a new web project. I have had to use databases in previous projects and have always coded the database connection etc every time. Now i am thinking of creating an abstract layer to connect to a database and also some abstract classe(s) to do the common queries (insert, delete, update, select).
I am doing this using PHP and everything is working out fine. However, i have read some articles saying that these layers in web applications will slow things down and reduce performance and speed of execution of queries. Is this true?
Has anyone used DA [Database Abstraction] or any other layers in their applications [whether web or not] has this resulted in a reduction in speed and performance?
[Wasn't sure where to put this thread - relates both to PHP, DB Concepts and MySQL]
I would say as a general rule any extra code will ALWAYS slow your execution time, but it's SOOOOOOOOOOOOOOOOO minimal, their arguments about it a moot. Thus, feel free to attempt an abstraction layer, they are exceptionally useful, and I can heartily recommend that you check out PDO (installed by default with php5 now) and Zend_DB (part of the Zend Framework). You will find them particularly useful in the future being able to drop it into/out-of projects at will and reusability is key to such things.