Magento – How to Speed Up Magento SOAP v1

apiperformance

I have multiple questions for experienced magento developers:

  1. Is it possible to improve the speed of the magento v1 soap api?
    When requesting data it quickly costs 1.5 seconds for magento to compile simple information like customer adress etc…

    To request multiple possible relevant data nodes can quickly costs about 5-7 seconds.

    Now am I already doing those requests via AJAX requests so the page interface loads quickly, but a speed improvement would be nice.

  2. Or would it be better to write my own application to give me the relevant information directly from the magento db? It's not that complicated of a db and if I do a direct query it loads within a 100th of a second with the results…

    The only consideration I have with that option is:

    1. What if magento updates and changes it's database scheme?
    2. Or is the database setup of magento relatively upgrade safe/downwards compatible?

Does anyone have any experience with this and their success or faillure stories? I need to make an informed descision to be able to know how to proceed.

Best Answer

I've encountered exactly this issue extensively, and I've worked around it by just working with Magento objects directly. I think there is the concern of code changes and whatnot that you describe, but much of my code is in single-use scripts to load old data, things like that, so it was a minor concern. Working with the Magento objects directly also did have the side benefit of making me learn the internals a little more than I would with just the SOAP API, too - steeper learning curve for sure, but I do feel a little more knowledgeable about what's going on in there than if I had stuck to only ever using the SOAP API.

Another option we tried was caching the data using Memcached (Or something like Redis would work, too), though you now have to worry about how often to update the cache, from where, and things like that. But, it does achieve the goal of retrieving data much, much faster. I think whether or not this is a good option will depend on exactly what you're trying to do.

Related Topic