Tuesday, November 24, 2015

REST vs RPC

This is taken from: http://apihandyman.io/do-you-really-know-why-you-prefer-rest-over-rpc/
And the author has done a simple and fair evaluation of the two.

Conclusion:

ITEMWHO WINS?
BeautyDraw
DesignabilityDraw
API definition languageDraw
Predictability and semanticREST
HypermediabilityDraw
CachabilityDraw
UsabilityDraw

Do REST really wins?

REST wins thanks to the predictability and semantic item.
So, is the resource approach better than the operation one?
No.
RPC and REST are only different approaches with pros and cons and both are valueabledepending on the context. You can even mix these two approaches in a single API.
The context, that’s the key. There are no panacea solution, don’t follow fashion blindly, you always have to think within a context and must be pragmatic when choosing a solution.
At least, I know now why I like the resource approach: its predictability and the frame given by the full use of HTTP protocol. What about you?
One last word to leave you with food for thought: in this time of advent of functionnal programming, having operation request style could make sense…

No comments:

Post a Comment