Tatiana McGarry
Sep 8, 2018 · 2 min read

I agree that RPC is easier — for the server. The client, on the other hand, needs to have more information and do more work. That’s kind of the point of the entire HATEOAS specification (which I used to find nonsensical, until I actually used it). I’m a long way from having drunk the rest Koolaid, but I can have come to see the benefits of the “magic” HATEOAS.

I heard an analogy once about something else, but I think a similar one is applicable here as well. Here is the difference between RPC and a HATEOAS-driven RESTful server, in human terms.

Client: Hello, business office? I need to make an appointment to see one of your accountants. Is Mr. Weber available for an appointment at 9:00 am on Monday?

RPC Server: No. [Server hangs up.]

Client calls back: Hello again, what about Ms. Brenner? Is she available at 9:00 am on Monday?

RPC server: No. [Server hangs up again.]

Client calls back: Hello, I see that Mr. Weber and Ms. Brenner are no longer employed with your firm, but my housekeeper told me she used someone there named Mr. Sherman, but that he only works Wednesday afternoons. May I make an appointment for this Wednesday at 3:00?

RPC Server: Yes, fine. [End]

And the HATEOAS version:

Client: Hello, business office? I would like to make an appointment with Mr. Brenner for 9:00 am on Monday, please.

Server: Sorry, but Mr. Brenner is not found. However, we do have several more accountants available to meet. I am currently sending you their profiles and credentials.

Client: Great! Mr. McDonald sounds good. Is he available at 9:00 am?

Server: No, but he is available at 10:00.

Client: That’s perfect. Please schedule it.

Server: Certainly. That appointment has opened several more available resources for you to choose from, if you like. Would you care to see a list of parking lots nearby, or get a summary of the forms you should bring to our office?

Client: Sure! Please give me both.

[Etc.]

Whether one chooses to do the former or the latter, I think, in some part comes down to whether you want to spend more time developing your front or your back end.