Live data from Hacker News

REST is the new SOAP

medium.com

201–210 of 351 posts

Re: REST is the new SOAP

#201
I author REST APIs and try to do them properly, with mediatypes, link relations, and all the good hypermedia stuff most people avoid. Nonetheless, the author's post reflects the sort of rant I've had to coworkers at the watercooler, or anyone who'd listen.

The author nicely preempts the debate about HATEOAS and "most RESTful APIs aren't REST" and shows that the debate is part of the problem. It is. It's not a spec but an architectural style, and people are bad at design (and quite honestly, they have better things to do with their time), so broad-stroke ideas about how to lay out your system aren't as useful as a framework or codegen. So the least-effort solution wins, where you half-ass implement first three three characteristics of REST-as-seemingly-observed-in-the-wild (HTTP, JSON, templated URLs), and call it a day. If it's good enough for Stripe and Twitter, it's good enough for you.

No wonder we're in this boat; one upon a time REST was just architectural and intellectual wankery, specified in an obtuse and hard-to-read thesis by a guy who's smarter than most of us combined. It sat unknown for years, until AJAX became all the rage, and people began making API calls from jQuery to load-and-splice parts of a page for rich interactivity. Here, a public, HTTP endpoint that served easily-parseable JSON made sense. Some prominent companies released public APIs in this style, and then the blogspam began.

Within a short amount of time, REST and "RESTful" was cool and forward-looking, and SOAP was old and crufty, and any kind of ad-hoc RPC was bad. Implementing a REST API wasn't solely about usability, but also signalling that your company was forward-looking too, rationality be damned, which is why most implementations cargo-cult look the same: HTTP, schemaless JSON, templated URLs. Endless debates about HATEOAS begin, and come to an unsatisfying conclusion, because real developers' concerns about architectural purity are dwarfed by their desire to build a mostly-working API that looks recognizable to the public, and move on.

Serious players looking for reliable internal RPC develop stuff like Thrift and gRPC, which are thoughtful reimplementations of the ideas behind 80s and 90s RPC, but with the added advantage of coming from a single vendor and not committee hell. Meanwhile, Facebook also reinvents SQL in JSON and gives it to the client, what could go wrong?

Maybe the reason "REST" won is because it was easy to glean and misunderstand well enough to put out something simple and good enough. This dominance of the low-end is going to be hard to undo.

Re: REST is the new SOAP

#202
SOAP also has other stuff : proper handling of binary (MTOM), WSDL/XSD contracts are enforced and XSD is a very powerful, standardized language to express contract which in turn allow you to share the contract. When you're working across organisation/institution borders that's very helpful. REST is not there yet. If I had to communicate each little gotchas of my REST API each time, that'd be really tough.

So for me the power of SOAP is how it helps me to share interface contracts in clear, precise ways.

Moreover, SOAP also have the WS-I profiles for security related stuff and that is quite advanced too.

SOAP is nice in enterprise setting I guess.

Re: REST is the new SOAP

#203

Earlier quoted context omitted.

Xmlrpc is incredibly underappreciated.

Xmlrpc is simple and it works. Xmlrpc is soap without the bullshit. I built lots of personal apps that were flash/flex front ends that talked to python backends over xmlrpc to quickly whip up his for my python aps

It lacks conventions thoug so every api is more quirky and even sloppier than a bad REST api. At least with REST there’s some existing structure and it’s not completely up to the imagination of someone in a hurry.

Re: REST is the new SOAP

#204
Personally, I don't care about REST, I never did. However this made me giggle:

> "REST offers better compatibility. How so? Why do so many REST webservices have “/v2/” or “/v3/” in their base URLs then? Backwards and forward compatible APIs are not hard to achieve, with high level languages, as long as simple rules are followed when adding/deprecating parameters. As far as I know, REST doesn’t bring anything new on the subject."

The author has a serious misunderstanding about what backwards compatibility or lack thereof means.

That APIs end up with "/v2" and "/v3" in their endpoints, that's absolutely the right approach for backwards compatibility, as long as the previous version of the API stays online and continues to be supported.

Backwards incompatible evolution means breakage. No matter what features you like to add or change, by introducing backwards incompatible changes you're going to break people's software and that's never a good thing.

The author is also naive in thinking that there can exist "simple rules for deprecating parameters". There's no such thing. Nobody pays attention to your service announcements or policies unless their software breaks.

Also "high level programming languages" have absolutely nothing to say on this matter. Yes, it's simpler to update a library that breaks compatibility within a statically typed language, but that will still come after the software breaks due to the network protocol being changed, implies active maintenance with associated costs and mainstream languages have no facilities to efficiently describe network level protocols.

Re: REST is the new SOAP

#205
post #117

I think there’s a tendency in software for people to start out without understanding all the complexities they’re going to encounter. I think this is just human nature. When you start out doing RPC you think, I don’t want to bother with schemas, I don’t want to bother with hierarchical error codes, I don’t foresee the need to set the user’s password but not retrieve it. So you don’t want to bother with a technology w…

This is consistent with my experience. One element of it is also that in many cases the path to "becoming big" starts with bootstrapping and experimental projects that you may not know if it is going to survive and exist in a few years or if you are going to throw it away in 3 months. So in those cases you may still choose to be scrappy, knowing that it will come back to bite you, but at that stage that is thought of…

It occurs to me that young people may be better at bootstrapping in a scrappy way, because they don't yet have the knowledge and experience to immediately consider all the things that would be required in a mature implementation. Speaking for myself, now that I'm approaching middle age (37), if I contemplate developing a new product from scratch, I risk paralysis by analysis, overthinking every aspect of it. I certainly didn't do that when I was 21.

Scrappy bootstrapping is a double-edged sword. On the one hand, it brings us great new products. On the other hand, ignoring some real-world concerns can be a major problem for users. As just one example, consider the impact for people with disabilities (e.g. blind, mobility impaired) who need to use an app that was developed with no regard for accessibility. And I've blissfully ignored other real-world concerns myself. For instance, the first desktop app that I worked on (in my 20s) had no support for HTTP proxies (as often found in corporate networks back then).

Re: REST is the new SOAP

#206
post #62

Maybe REST was the best protocol for the great public API explosion of the past decade, where startups wanted to expose a public API to anyone on the internet. The most important requisite was that the most developers could access the API with a minimum of technical knowledge and tools, and the APIs were simple. I am less and less sure that REST is the best solution for communicating between internal services, which…

What do you think is a better solution?

GraphQL.

http://graphql.org/

Re: REST is the new SOAP

#207
REST is like Agile. Almost everyone who claims to do it only kind of do it, and those who really do it get all wrapped up in the theology of it and turn it into an unworkable mess.

Re: REST is the new SOAP

#209
post #13

Why is REST so popular? Because it's easy to implement and works for lots of use cases. I'm sorry that you found places it doesn't, but in the real world, having been through that SOAP pain it's being compared to, I'd say there's not even a comparison. Everyone seems to want to find a reason to dislike product/technology/feature X but in this case, X is just better than anything we've had for a 90% adoption case. Wha…

REST allows you to make decisions about the http interaction out-of-band, where SOAP provides (and often requires) the ability to describe all decisions about types and parameterization and exception cases in-band.

The REST way allowed one to get started with something small and simple that people could agree to just by talking it over together. With SOAP you had to make all those decisions up front and put it in the specification. I believe SOAP is so complex that it's an analog to CORBA/IDL.

REST is (at least initially) simpler and less specific than SOAP. That's its strength.

Post reply on HN