Rest vs. Soap. Has REST a better performance?

Performance is broad topic.

If you mean the load of the server, REST has a bit better performance because it bears minimal overhead on top of HTTP. Usually SOAP brings with it a stack of different (generated) handlers and parsers. Anyway, the performance difference itself is not that big, but RESTful service is more easy to scale up since you don’t have any server side sessions.

If you mean the performance of the network (i.e. bandwidth), REST has much better performance. Basically, it’s just HTTP. No overhead. So, if your service runs on top of HTTP anyway, you can’t get much leaner than REST. Furthermore if you encode your representations in JSON (as opposed to XML), you’ll save many more bytes.

In short, I would say ‘yes’, you’ll be more performant with REST. Also, it (in my opinion) will make your interface easier to consume for your clients. So, not only your server becomes leaner but the client too.

However, couple of things to consider (since you asked ‘what will you lose?’):

RESTful interfaces tend to be a bit more “chatty”, so depending on your domain and how you design your resources, you may end up doing more HTTP requests.

SOAP has a very wide tool support. For example, consultants love it because they can use tools to define the interface and generate the wsdl file and developers love it because they can use another set of tools to generate all the networking code from that wsdl file. Moreover, XML as representation has schemas and validators, which in some cases may be a key issue. (JSON and REST do have similar stuff coming but the tool support is far behind)

Leave a Comment