I have a task to make an api for Magento using it's SOAP or REST implementation.
I've read a lot about both services, also have experience with them. But not in high-loaded projects
.
The task of this service will give some extra information to client via SOAP or REST. I've configured both and everything is ok.
BUT, the questions is what would be better if I have 100 clients calling my service per second, 200, 500 and so on?
I know about SOAP overhead, but also if I use REST I need to use also oAuth, so what will fall down first?
Any experience in that?
Best Answer
You will need to define a clear use-case to get a specific answer to your question. Unless we have a detailled use-case here, I'd like to answer with general advice on that:
SOAP vs REST SOAP and REST are two ways of accessing web-services. SOAP uses XML for its requests. REST relies on HTTP requests via URL and is therefore really lightweight compared to SOAP.
(Dis-)Advantages of SOAP:
(Dis-)Advantages of REST:
Magento SOAP API vs REST API
Be aware that not all features are implemented for the REST API.
I created a small performance test-script which does nothing more than 10x10 login and endSession requests via SOAP API v1. No specific action was performed. 1 request took between 0,9 and 1,4 seconds with my local webserver.
To compare with rest: Once your application is authorized (where you need to authorize your application once via clicking "authorize"), it takes only a few miliseconds to be ready to perform your request after you have obtained a token and a secret: 2.0-3.0 * 10^-5 seconds locally.
Performance testing
For conducting a performance test which could finally answer you question, you need to define the requirements.
The following would be interesting:
Resources
This might be also interesting for you: