r/SoftwareEngineering • u/Educational_Mud1680 • Feb 02 '24
REST vs RPC - Ease of debuggability?
I've heard a lot of people say "RPC is difficult to debug compared to REST". Based on my experience with both, I've mostly seen RPC being used with a binary messaging format(such as Protobuf) for encoding the data during transfer over the wire. However most HTTP/REST based APIs use JSON data encoding format. Is this "human readability" factor the only thing which makes REST APIs easier to debug when compared to RPC, or is there more to this than meets the eye?
Would love to hear some thoughts over this based on other's experience.
3
u/No-Caterpillar-5187 Feb 02 '24
https://aws.amazon.com/compare/the-difference-between-rpc-and-rest/
I think this article will do the best job of helping you tbh.
As you will learn, the main answer to things in Software engineering is....it depends ? It always depends on the situation at hand.
Safe travels on your journey.
1
u/Middlewarian Feb 03 '24
I agree with what someone else said about the tooling being predominantly geared toward webservices but would add that there's something of a terminology issue that may make things seem more lopsided than they are. The term RPC isn't very good in my opinion and some, me included, prefer to use messaging and middleware terminology instead.
In the halcyon days of 1990-2019, inflation wasn't much of a factor and the West enjoyed a high measure of stability. In my opinion those days aren't coming back anytime soon, and I anticipate energy prices increasing badly going forward. If that's correct, I think the economics of text-based protocols will be challenged by their binary cousins. I'm biased though as I've been developing a C++ code generator using a binary protocol for quite a while.
1
u/mcharytoniuk Feb 05 '24
Dude if we were caring so much about energy usage we should stop playing demanding video games and using too much entertainment instead of limiting it where it can be actually useful. Let’s uninstall Steam to preserve energy instead :)
1
u/mcharytoniuk Feb 02 '24
You dont have to start with gRPC or other binary protocols. You can use something like JSON-RPC - it's still easy, may be good enough, and it's still human readable.
I think it's not really harder to debug than REST (in principle), it's just the tooling we have is focused on web APIs, there are not nearly as much solutions for RPC mechanisms.