I am from python background. I have been assigned to analyzed to integrate only product catalog part to MongoDB and all other functionality will be remain in MySQL. As I am very new to magento(even php), please let me know bellow few question.

  1. Is it possible to do it?
  2. If yes (as per my homework), what is the best suitable ORM/ODM for this task?
  3. Do we need to change lots of code in-built mogento code to integrate it?
  4. Please let me know any other things, I need to concern.

Here is some link I got from google.

Please try to understand, I may be asking very silly question but I have no idea about this. Please don't downvote it. Please fell free to have a discussion type answer.

Thanks in advance.

  • That Smile.eu article is very interesting.. no doubt it was a massive undertaking
    – Erfan
    Commented Sep 1, 2015 at 7:13
  • @Erfan , Thanks for comment. So what do you think about it, is it a good idea to implement.
    – Swagat
    Commented Sep 1, 2015 at 7:27

1 Answer 1


This is not possible in default Magento. I mean you can make Magento works as you are desiring, but it will be a tough job. The reason is :

"Magento is using a single file for it's db configuration (app\etc\local.xml). There you can specify only one db instance."

So basically, in order to achieve this, you need to use two such xml files. One for mySql and another one for MongoDB. Then you really need to edit the core file Mage.php which treats as very bad practice.

For more information, you can refer this thread, where @pronto's answer is relevant in your case, which I am quoting below :

Database information comes from a single xml file: app/etc/local.xml This file is being loaded from app/Mage.php so if you change that file you can theoretically decide which configuration file you're going to load (based on desired condition, such as domain name). Voila, different domain, different database. Now comes the Bad News Part(tm).

  1. You're overwriting core code and so called "god class" at that. This is considered a VERY BAD practice in Magento world! Every time you upgrade your changes will be overwritten.

  2. Content overlapping. Not all your content is stored in database, there's also media folder and there's session folder (var/session) you either need to find a workaround for (for example custom paths based on database) or store both images and sessions in the database (before you ask: yeah, this is possible).

  3. Cache. You most certainly don't want you different stores share cache folder (var/cache). Fortunately it's possible to use external caches, such as memcached instead of storing files to that folder. Still you must make sure that your cache ID-s won't overlap, because if they do, you're going to be in the world of hurt.

  4. You can't use compilation (the feature is deprecated anyway).

  5. Maybe something else I'm forgetting. Anyone?

My recommendation is go on with one database. That will be the most reliable and performance wise better approach. Most of the cases, the changes that you need to make to achieve this will affect the performance badly.


There is an extension which you can be used as a starting point. I never used this before. But I believe this one can provide you a starting point

  • thanks for your answer. Its really help me a lot. One question, which ORM do you suggest, if we go for mongo?
    – Swagat
    Commented Sep 1, 2015 at 7:34
  • @Swagat sorry I never work with mongodb before. Honestly, I didnt get your question. I believe php has in-built driver for mongodb. There are extensions available with which you can configure mongodb with magento. So you should look for such extensions if you are a newbee. Commented Sep 1, 2015 at 7:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.