Live data from Hacker News

REST is the new SOAP

medium.com

101–110 of 351 posts

Re: REST is the new SOAP

#101
post #97
post #87

I did REST for years and now people are all about CQRS/ES. "Make CRUD with REST, keep it simple!" "No app is CRUD, it's an illusion! Model your events all the way!" Well, guess the pendulum will someday stay somewhere in the middle?

I think "the middle" is chopping it the "sourcing" part, which is like 90% of the tricky overhead and philosophical purity. Just have CQRS with events as a short-term communication mechanism.

Tricky overhead?

Isn't the ES part what makes these systems superior in the first place, because you can restore any state of the past?

Re: REST is the new SOAP

#102

Lots of comments here arguing REST is popular because it's easy, but there's another higher level reason too: it forces you to think about the network. In far too many RPC protocols, calling functions that operate over a network are treated like normal functions. A function call, almost by definition, fails to take into account network errors, and race conditions where multiple events overlap. Network calls are not f…

If a network (or endpoint) fails you usually only few options during runtime, retry, skip, stop. That is pretty much all you want to know. Everything else is specific to the endpoint, which is more about contracts and constraints then about networking. You either use the endpoint correctly of not. I.e. using a database like MySQL has similar constraints. And decent engineers know how to work with it and where it is happening.

Re: REST is the new SOAP

#103

Earlier quoted context omitted.

How exactly do you think REST is easier to debug and what alternatives are you comparing it to?

Crafting REST request with JSON payload is significantly easier than doing that with SOAP (or, rest it in peace, CORBA).

I don't mind a loose JSON REST-ish API, where everything is a GET, POST or (maybe) a PUT, with explicit endpoints to resolve ambiguities.

Once people start exhibiting excruciating pedantry in designing their APIs, I'll switch off somewhat.

Re: REST is the new SOAP

#104
post #101
post #97

Earlier quoted context omitted.

I think "the middle" is chopping it the "sourcing" part, which is like 90% of the tricky overhead and philosophical purity. Just have CQRS with events as a short-term communication mechanism.

Tricky overhead? Isn't the ES part what makes these systems superior in the first place, because you can restore any state of the past?

It's only easy if the system is built once and never changes.

For example, does an "item sold" event from 8 years ago has the same data fields and fundamentally mean the same thing with the same outcomes, compared to the ones recorded today?

If not, you've got to start talking about stuff like writing multiple versions of code to play-back multiple versions of events slightly differently. Or at least have two versions in place, while some background process "upgrades" the old events.

And that's assuming you can even imagine a good way to re-express old obsolete behavior into a direct modern equivalent.

In contrast, I'm suggesting a mutable model which emits events. The events are used for triggering current logic, and are kept primarily for auditing/data-mining proposes.

Re: REST is the new SOAP

#105
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…

I happen to have worked with the system author coded/maintained. We're not in touch and I'm not here to defend him, but he's no hipster. Rather, he had to integrate a lot of heterogeneous services, as that system was acting like a hub between many departments in the company, with various tech skills and resources. If anything, I suspect he's more kind of unsatisfied by changes that he deemed unnecessary.

As a note aside, the xmlrpc endpoints of the aforementioned system worked fine and saved us time.

Re: REST is the new SOAP

#106
post #8

I agree 100% with this article. A simple RPC API spec takes minutes to define. 'Rest'ifying takes much longer, there are a million little gotchas, no real standard. Everyone has a different opinion of how it should be done. Data is spread across verbs, urls, query params, headers, and payloads. Everyone thinks everyone else doesn't 'get' REST. If you try to suggest something other than REST in the office you become t…

Reading the article I wondered why we even integrate services so deeply with HTTP. The things I care about is the ability to cache at HTTP layer and the option to move endpoints. Which can be added indepentendly of the actual protocol. Moving a service to another protocol than HTTP could be an interesting option.

Re: REST is the new SOAP

#107
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…

And REST is easier to debug. This make a huge difference when you have a big and complex system.

GET / POST RPC is just as easy to debug, IMO, and with less righteous orthodoxy.

Re: REST is the new SOAP

#108
post #93

Earlier quoted context omitted.

Programming Paradigm Becomes Popular B/C it gets stuff done --> left: it gets stuff done because it's smarter right: it's bad for you, it's actually getting less done middle: didn't read all that stuff, busy getting stuff done.

didn't read all that stuff, busy getting stuff done. I agree with this. When I end up on a new project and I'm not the lead, and there is a lead who is pedantic regarding how they want their URLs crafted (or wants to implement a complicated query pattern, or introduce an extra layer of objects to satisfy an abstract notion of purity), I'll just go with the flow. Accidental complexity, pattern seeking and cargo-cultin…

Couldn’t agree more. I guess this is one of these insights that come with experience ;-)

Re: REST is the new SOAP

#109

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…

Yup. It's the mechanism behind programming as a pop culture. Kids without a lot of experience are sick of the old way because it's too hairy and complicated, they come out with a fresh new approach that isn't nearly as broadly applicable, then it gets improved until it's fit for general purpose, at which point it's hairy and complicated and the cycle starts again.

I don't think that everything is standing still, though. Usually each successive generation has an edge on the previous one; either the previous generation was constrained by memory or CPU or bandwidth and had self-limiting architecture because of it, or the next generation needs to solve a problem involving an order of magnitude more data or compute and it needs a different approach.

But, of course, not everyone (or, realistically, not many people at all) is constrained by the thing that causes the revolution; people usually just get on the bandwagon because you must, if you don't you won't be as employable, won't be as hip, you'll find it harder to employ engineers to work on your project, etc.

Re: REST is the new SOAP

#110

Earlier quoted context omitted.

I think “hipsteresque opinions looking to sound smarter and more insightful than they actually are” is a very good definition for much of Medium’s content. It may have to do with the platform being used by individuals trying to create a brand of themselves, resulting in a high percentage of sensationalist and controversial posts. Along with the necessity to write on a regular basis.

Programming Paradigm Becomes Popular B/C it gets stuff done --> left: it gets stuff done because it's smarter right: it's bad for you, it's actually getting less done middle: didn't read all that stuff, busy getting stuff done.

left: optimist right: sceptic middle: opportunist

Having shitty paradigm is certainly better than having none at all. But at some point we have to evolve.

Post reply on HN