We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Using Phalcon ORM and Doctrine ORM together


We are developing a multi-module web application using Phalcon. The first module is finished and uses Phalcon's built-in ORM and MySQL.

The second module is a bit complicated and we need schema flexibility. Our client has reservations using a NoSQL database. So, I'm now looking at a Phalcon + PostgreSQL 9.3 (for its JSON-type column) + Doctrine (for mapping JSON column to PHP arrays).

My question is: Is there a need to migrate our first module from Phalcon + Phalcon ORM + MySQL to Phalcon + PostgreSQL 9.3 + Doctrine ORM?

If the answer is yes, how difficult would such a migration be? (I hate to think of writing set-ters and get-ters for each existing model when Phalcon has "magically" solved that for me.)

If the answer is no, what are the implications of using different configurations or technology stack for different modules within the same web application?


It is hard to say without looking at your architechture, but it sounds like a dramatic headache to work with both Phalcon ORM + MySQL and Doctrine ORM + PostreSQL at the same time. I suppose you should think about following the one and only stack of technologies in the single project, not both. However, you could think about PhalconORM + Mysql for all relational data and Phalcon Adapter + (for example) MongoDB for NoSQL part of stuff.