Question

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.

Was it helpful?

Solution

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.

Edit

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

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top