0

I'm assuming here, that it makes sense to create a custom Resource if you have a datasource other than MySQL. Basically, there is an online service which I'm communicating with through http requests. And I want this service to have an accessibility layer like MySQL does by default in Magento.

The plan is to not download anything to the server, but rather download it as needed (eg when ->load($id) is used, just download the data for this one object).

I'm a little lost as to where I need to start, most likely because I don't know Magento all too well yet. I'm figuring I need

  • a new implementation of Mage_Core_Model_Resource_Abstract (which I assume will just be where "normal" resources would be in my module, just extending something different and implementing different stuff)
  • read / write adapters

Am I missing something? Would you kindly point me to the right classes or tell me what I need to reconsider? Pretty lost at the moment...

  • Just a general note, this will cause some serious issues when you use an external data source through HTTP. What if the remote server goes down? Also, it is relatively slow to send out a HTTP request for every page you load. There are reasons why people use MySQL (or any other database) as a data source. – Niels Mar 5 '15 at 15:46
  • @user5972 you're right, but in this case, I don't have an option and I won't access this data source all that often – Yorrd Mar 5 '15 at 16:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.