How To Use Mysql And Mongodb As Database In The Yii At Same Time

In my project, we are in the place of storing lot of files(pdf,odt,doc). We started coding in yii latest version with mysql as backend. Initially we stored all files in the Database, due to use of backup and restoration.

But, our application handled large data. With-in the month, data size crossed 1GB and Mysql responses slow. Even, we used some tuning it doesn’t help. So, we planned to use NoSQL MongoDB as file storage DB and rest is in MySQL.

But, we don’t find any wiki/tutorials in yii framework forum on this matter. Plz shed some lights on “How to use MySQL and MongoDB as database in the yii at same time?

Thanking you.

You just need to configure two different CDbConnection components. There’s a good wiki article here.

Thanks for your quick reply. @ Last, I used directmongodb extension and now it works fine.

Thank you for your answer. In wiki, you could use this article :

Best regards,