We’re working on a PHP project, which has been in development for more than 2 years, and now the team is ready and feel the willingness to switch the development on to an ORM. Because it really speeds up the development and allow you to operate by Objects and not think in terms of SQL code and database tables most of the time.
We have decided to choose the Doctrine ORM, because it has YAML data fixtures load – we need it very much for our unit-tests.
The main fear I have, is that using of a new ORM framework can slow the site’s performance. We can’t make a shared connection between current database abstraction layer (which uses pg_connect syntax, not PDO-compatible). The database connection mechanism can’t be switched to PDO-compatible, because there are lots of SQL code incompatible with PDO_SQLITE syntax.
So, as I understand it, if we will start using it, it will double the number of database connections. I’m not sure database server will be able to handle this.
What would you recommend us to do in this circumstance?
Of what relevance is PDO_SQLITE?
Unless you actually plan on using the SQLite driver then compatibility is not mandated by PDO.
If you aren’t going to use SQLite then I would make the legacy database layer PDO compatible and re-use the connections until you can fully migrate to Doctrine.
That said, the level of connections is not going to be your only performance concern moving to an ORM. They are inherently inefficient so I’d expect slower queries, higher bandwidth use between application servers and the database servers and higher memory use at the application level due to redundant data inevitably getting selected. Depending on your current setup, the above may or may not be issues.
You should probably take that last paragraph with a pinch of salt though because they are just traits of ORMs in general and not Doctrine in particular, with which I’ve had no experience.