12 ms·
Roy Fielding's Misappropriated REST Dissertation
- tptacek 6y agoIt's interesting to see the shift on this --- you can just use the search bar at the bottom of this page with the term "HATEOAS" to see people, many of them quite notable, arguing forcefully that HTTP APIs should be hypertextual. One person compared resistance to hypertextuality to resistance to PUT and DELETE.
- deleted 6y ago[deleted]
- WClayFerguson 6y agoI've always been against using true REST API to build the RPC layer of a web browser SPA on top of, for one simple reason: The REST approach is essentially: "Everything is a noun, and you have 4 verbs" Building a good API with everything as a noun and only 4 verbs is quite awkward in my opinion. Lots of API calls might need to pull data from multiple different "things" (nouns) to generate the reply, and in REST you're urged to require multiple calls to accomplish that. Awkward and slow.
- lmilcin 6y agoSQL is mainly four verbs, select, insert, update and delete. Not awkward. Four verbs are enough if your intention is to implement REST. If what you are implementing is RPC I can understand why you get annoyed. REST was never intended as basis of ALL communication, but the IT world seems sometimes bent to exploit an idea well beyond its limits.
- WClayFerguson 6y agoIf your domain is built with all nouns as a core part of what it inherently already is (like a Database being built on "records" or "documents"), then a RESTful interface for it "might" be workable, with the limited CRUD verbs. However, a vast number of web developers (dare I say "most") became convinced the proper way to "think" about their architecture was "as if it were all nouns" (even when it obviously wasn't), because they thought they were having an "epiphany" about how to use REST ...when what they were really doing was conforming to software development "meme" (or trend)
- nordsieck 6y ago> However, a vast number of web developers (dare I say "most") became convinced the proper way to "think" about their architecture was "as if it were all nouns" (even when it obviously wasn't), because they thought they were having an "epiphany" about how to use REST I don't think "developers thinking their architecture was 'as if it were all nouns'" is somehow limited to REST or even web APIs. It's a fundamental part of objected oriented design philosophy. http://steve-yegge.blogspot.com/2006/03/execution-in-kingdom-of-nouns.html http://steve-yegge.blogspot.com/2006/03/execution-in-kingdom...
- WClayFerguson 6y agoI think a conversation between a web browser (SPA RPC) and a back-end server is best thought of as an RPC. Procedure calls are verbs if you ask me. Here's my own code that is such an API: https://github.com/Clay-Ferguson/quantizr/blob/master/src/main/java/org/subnode/AppController.java https://github.com/Clay-Ferguson/quantizr/blob/master/src/ma... You can point out that 80% of those API methods are resulting in some kind of CRUD method, and I'd agree, but nonetheless trying to make it a true REST API would be super awkward and verbose, imo, because lots of those functions result in multiple CRUD ops on multiple different types of data. When I design an API, I think: "What is this operation called? What data is best to send upstream, and what do I want to get back." Then I design the API. The API is a wrapper around an abstraction layer of functionality. REST is all about removing that abstraction layer which is moronic.
- tsimionescu 6y agoThis is all a matter of definitions. For example, from a syntactic point of view, Java has three verbs for all objects: "instantiate (new)", "call method" and "access field". An object has members, and you can use those 3 verbs to interact with the members of the object. In my experience, the nice part about designing APIs in a REST-like manner is that they encourage you to think in terms of observable operations. For example, instead of "calling" a long running blocking method, you create a resource that represents the long running operation, and now you can check its status while it is running, report progress, cancel it. Basically, when designing a REST API you think about the exact same things you are saying - what is the operation called? what data does it need, and what does it return? - and then you represent this as a resource that can be created with the right input, and that will point to a result resource for the final output. For example, my usual pattern for things outside of CRUD is something like this: --> POST .../operations/renderNode {ExecuteNodeRequest goes here} <-- 202 Accepted Location: .../operations/renderNode/891 --> GET .../operations/renderNode/891 <-- 200 OK {status: IN_PROGRESS, percentage: 78, ... (includes initial ExecuteNodeRequest params)} --> GET .../operations/renderNode/891 <-- 200 OK {status: SUCCESSFUL, percentage: 100, resultURL: .../operations/renderNode/891/result, ...} And then on GET .../operations/renderNode/891/result, you have the final result. Of course, if the operation finishes quickly enough, any of the polling steps can be omitted - e.g. it can directly return 200 OK and the result URL for the initial request. If you have WebSockets support, you can also be notified via WebSockets when execution finishes, instead of polling. It may look like more ceremony, but in general, for long running operations that will be called from a browser, this kind of approach is a requirement anyway, since the number of connections with a particular origin is extremely limited. Note that I also think your API would be much more concise as a REST API, since all of the miriad "setX", "getX", "createY" methods would be reduced to a few resources with multiple fields, that you can simply GET to see all fields, or PATCH to change a single field (or even change multiple fields in a single request).
- noblethrasher 6y agoYou can have as many verbs as you want, but they all need to be valid at every state of the application (i.e at every hypermedia target), because you still want a uniform interface. Responding with a standard error code is okay for verbs that are not supported at a particular state, but it's the uniform interface constraint that forces you to keep the set of verbs small. Also, HTTP has nine verbs: GET, POST, PUT, DELETE, HEAD, CONNECT, OPTIONS, PATCH, and TRACE.
- WClayFerguson 6y agoYou can read most any good book on software development and API design, and OOP, and how to create good abstraction layers, and how to name functions, and pass parameters etc. Here's the thing: None of those concepts in those books are trumped once you happen to be communicating over HTTP/HTTPS. None of those books tell you to come up with 9 verbs, and make everything a noun operated on by those 9. That's silly. HTTP layer has a place in the tech stack. Let it do what it does. Your API RPC layer is a separate abstraction layer, that also needs to exist. Trying to merge RPC down into the HTTP layer is silly and is cramming a square peg into a round hole, just because the round hole already existed.
- noblethrasher 6y agoHTTP is one particular implementation of REST that happens to have nine verbs. Another implementation might only have two or three. But no RESTful architecture will have much more than nine. Why? Because your application is going to have thousands of nominal states, and each one is going to need to support all of the verbs because of the uniform interface constraint. Why a uniform interface? A lot to say about this, but basically, the set of verbs is an abstraction of the state machine that is your application. If you have a million states and a million verbs, then you have no abstraction. If you have ten states and a hundred verbs then you have too much abstraction (i.e. you ran afoul of YAGNI). A good degree abstraction is somewhere in between, but if you care about scale (which is the raison d'être for REST), then the size of set of verbs is going to have a logarithmic relation to the size of the set of nominal states.
- mattmcknight 6y agoThis used to be bother me a fair bit, but I learned to noun a lot of the verbs I wanted to use. You don't sell, you create a sale. You don't move, make a movement.
- WClayFerguson 6y agoRight. So you bought into it, sounds like. Almost every other software developer did too. They all think they had an epiphany. They didn't. As for me, for 30 years I've known software function calls are inherently verbs and I'm not gonna let a trending "meme" (like REST) convince me otherwise. haha. I mean it's not so much the "nouning" of verbs that's the problem, but it's the loss of the ability to use verbs that I find so appalling. I mean if I need to run some reports it had better be called "runReports()" not some janky update of a state of some 'report' object to change it to 'running' state. So silly. REST is so jank. I mean what if "runReports()" needs to start N number of independent reports and return the status of startup of each one. With REST you always end up fighting things like that which are totally trivially easy without the REST nonsense.
- mattmcknight 6y agoI didn't really have an epiphany or buy in, I just figured out a way to think about it so I wasn't worrying about verbs all of the time. Purity in all things is a problem, REST included. One thing that kind of gets you is that HTTP itself is not the best transport for all of these things. If we are talking about something that has to run over HTTP, we might do something like create a run of reports (maybe a POST to reports/run). That could return a list of report_ids that were created and their associated status, with an run_id associated with the collect run. There's no fighting! However, if you want that data streaming back to you, this is where you might think you want something more like WebSockets. For some use cases, this can be more efficient than having the client polling to see if the result of a long running process is ready. It all depends. Anyway, not advocating for anything here, just pointing out that I had the same worry about supporting a rich vocabulary of verbs, but then kind of realized it didn't matter because all verbs you want can be nouns. If you are using HTTP though, the REST verbs match up pretty nicely with how the protocol works, so it avoids inventing another abstraction to sit on top of it.
- ivan_gammel 6y agoTrue REST API is hypermedia API and it is actually great for SPAs. It is more convenient than hardwired RPC, simplifies frontend architecture and offers much better approach to security (client does not care about security model implemented on server).
- vyrotek 6y agoAgreed! A SPA using an RPC API usually makes the most sense. I've wasted so much time over my career trying to jam functional concepts into REST resources for little gain. I really like the idea of each app getting it's own specialized backend. Have you heard of the BFF pattern? https://philcalcado.com/2019/07/12/some_thoughts_graphql_bff.html https://philcalcado.com/2019/07/12/some_thoughts_graphql_bff...
- WClayFerguson 6y agoI just read that entire article. Thanks for posting that. I like everything it's saying, and it points out some of the major drawbacks of REST. I've never used GraphQL yet but I know I do like it. Most of what I've done has been a mix of OSFA and BFF. RPC API design is more art than science, but definitely everything about REST is wrongheaded, inside out, upside down, and ass backwards. lol.
- lmilcin 6y agoI have stopped asking people I work with. Nobody seems to know who Roy Fielding is or have read the paper. It is no surprise nobody knows what REST is. The consensus seems that REST is SOAP but with JSON instead of XML and uses HTTP methods to... I guess to keep everybody annoyed.
- gfodor 6y agoThe great irony with soap is the whole point (iirc) was to avoid having to even look at the XML and just have your IDE and language tooling let you treat web services as libraries. If we had just swapped out XML for JSON (to please the ridiculous syntaxists that always plague technology choices) and maybe had someone write “SOAP: The Good Parts” to ditch some of the more “ambitious” subspecs we probably would have been better off. The book could have even had a clever title like “Clean SOAP” to ensure it caught on in our fashion-driven industry.
- bawolff 6y agoI'm pretty sure every technology that promised "you dont have to ever look at it, tooling will take care of it for you" has failed because eventually you do have to look at it, and no effort has been put in to make it look "nice"* *except arguably compilers. Its very rare that people look at the asm output outside of specialized domains.
- gfodor 6y agoSure, and this is why the syntaxists has a point about xml. As usual, it comes down to “things are hard to type” or “thinks are hard to read” when the abstractions leak.
- couchand 6y agoMaybe it's more of a thing in certain circles but I see links to godbolt.org all the time.
- AtlasBarfed 6y agoAnd that is doubly stupid for SOAP which is passing messages as text. Pass text messages, which are text so you can interpret what is being sent and received much more easily than a binary protocol, using only binary tools.
- snlacks 6y agoIt doesn't really matter what the dissertation says. Because we don't follow dogma. REST has evolved. Whether people understand it or not isn't that important, what matters is the patterns that emerge that people are actually implementing on working applications.
- lmilcin 6y agoREST is a very specific idea about exchanging states of resources rather than sending commands. The idea did not evolve and it is still useful to talk about it and use it the way it was intended.
- snlacks 6y agoThere's a dissertation and thousands of articles(one if which this comments section links to) that go into all the minutiae of a "proper" REST implementation. My comment poses the idea that an understanding of the proper or pure implementation isn't as important as the broad concepts that you are saying define the whole idea of REST. On the crux of the argument, we are in agreement - those academic details don't really matter.
- ivan_gammel 6y agoThe thing is, nobody can agree on those broad concepts because they are too vague. On every technical interview I’m asking one question „what is REST?“ usually followed by another „how is different from RPC?“ The answers Usually differ so much, that there’s no way to understand what kind of API these people are describing. It’s like in that tale about six blind men, describing an elephant after touching different parts of its body: one said elephant is like a snake, because he touched only the trunk. Another compared it to a tree after touching a leg. And so on.
- kgwxd 6y agoI stopped using the term REST for anything I've worked on/with years ago. I just call them Web APIs and no one has ever cared beyond that. REST as an idea is still ineresting, REST as a buzzword feels as dated as "Web 2.0" at this point.
- joantune 6y agoI see zero examples and rational/practical arguments against the usage of REST. The only thing here is: it wasn't intended to be used this way. I see it being called an overload, but I see no alternatives.. This article adds little of value, or even doesn't highlight or enunciate the disadvantages of using REST for everything. And on the other hand, the advantages are obvious
- deathanatos 6y ago> I see it being called an overload, but I see no alternatives.. Some APIs make rather poor use of HTTP, using it as a glorified RPC mechanism. Done poorly, this can make caching hard or impossible. A fair number of self-proclaimed "REST" APIs seem to do okay on the HTTP verb part of things, using GET/PUT as HTTP intended, but they insist on naming resources by "IDs" or something, and to then fetch the named resource, require the user of the API to manually construct the URL themselves. This is antithetical to what Fielding's REST proposed, which is that the URL serves as a universal mechanism for naming resources, and that end clients don't need to know anything about how to construct URLs, because they can just follow the one they are given. (And the server can do whatever it wants with URL layout.) Fielding himself notes this on his blog[1], > A REST API must not define fixed resource names or hierarchies (an obvious coupling of client and server). For practical examples of this, the Azure API is significantly hit or miss here. Some references to other resources are in URI-references (this is a good application of REST) but sometimes it is just a string name and you have to know, out of band, how to construct a URL to that resource. I'd recommend the ACME API as the best application of REST that I am aware of. [1]: https://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven https://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypert...
- throw-away_42 6y agoThe title is a misappropriation of "misappropriation".
- elchief 6y ago> I thought perhaps that there had been some chaotic experimental period where people were building APIs on top of HTTP all wrong, and then Fielding came along and presented REST as the sane way to do things. But the timeline doesn’t make sense here: APIs for web services, in the sense that we know them today, weren’t a thing until a few years after Fielding published his dissertation. SOAP 1998 Fielding's Dissertation: 2000 What is this garbage?
- ivan_gammel 6y agoDo you need someone to google that for you? Really not a good way to ask a question. Public APIs as we see them now were not a thing in 2000. There were talks about web services, but that was really different story (see WSDL). SOAP became a standard only in 2003 and it had different set of constraints and purpose.
- cromulent 6y agoTrue, although XML-RPC was around in 1998. http://1998.xmlrpc.com http://1998.xmlrpc.com
- pbreit 6y agoThe problem I see in trying to understand REST is that everyone is always trying to explain what it is whereas simply SHOWING what it is would seem so much easier and effective. Show me a REST API! Better, take a popular API and show me how it would be as REST.
- alasdair_ 6y ago> Show me a REST API! https://petstore.swagger.io/ https://petstore.swagger.io/ is an example. Quite a few companies use a similar format to document their public APIs.
- jonahx 6y agoWhere is the media type definition? Where is the single entry endpoint or the response links driving application state?
- BadInformatics 6y ago`uploadImage`, `createWithArray` and `createWithList` also read suspiciously like RPC endpoint names. Not that one should depend on such URLs having meaning in a REST system, but this is arguably more egregious than the SocialSite API (http://web.archive.org/web/20090123123719/http://wikis.glassfish.org/socialsite/Wiki.jsp?page=FinalizeRESTAPI http://web.archive.org/web/20090123123719/http://wikis.glass...) that Roy Fielding was tearing into in the blog post linked upthread.
- sunaurus 6y agoThis is an excellent example of how the word "REST" in its common use tells you absolutely nothing about an API. This API certainly does not look like a Fielding-REST-API, and it doesn't even look like a programming-blog-REST-API (in my experience, bloggers just like to use "REST" to mean "HTTP + JSON + no RPC"). Why can't we just call this an "HTTP API"?
- ratww 6y agoSome classic examples are AtomPub [1] and OData [2]. [1] https://bitworking.org/projects/atom/rfc5023/ https://bitworking.org/projects/atom/rfc5023/ [2] https://en.wikipedia.org/wiki/Open_Data_Protocol https://en.wikipedia.org/wiki/Open_Data_Protocol
- LordN00b 6y agoI used to measure how annoying a REST book or post was going to be by how long it would take the author to use the phrase 'Fielding's dissertation' and followed by the HATEOAS acronym.
- deleted 6y ago[deleted]
- mekoka 6y agoOver the years, I've seen a lot of people claiming that they understand what Fielding meant and trying to explain his ideas. Then I've seen him dismiss those explanations and examples. What I would have loved more than anything about REST is to see an implementation of those ideas by Fielding himself in some practical project.
- Lazare 6y agoAs noted in the linked article, arguably the most notable implementation of his ideas was the HTTP spec. He wasn't suggesting people build APIs; he was suggesting people build websites.
- AtlasBarfed 6y agoFor websites, 99% of them used only GET or POST though. POST was only done via forms, and even then a large number of websites used GET for form submissions. PUT, DELETE, and.. kinda... HEAD never got any use until REST APIs. So if the true representation of representational state is a simple website like this, then large parts of that "spec" were irrelevant to 99.9% of sites before "web services".
- Lazare 6y agoWell, yes? He wasn't writing about how to build web APIs. He makes no mention of HTTP verbs, and nothing about REST requires such verbs to even exist in the underlying protocol. He was discussing, at a high level, how you might design a protocol like HTTP/1.1, not how to build an API on HTTP/1.1. Further, the single key feature of a REST API is hypermedia, aka, links. If you do want to use HTTP for your REST API, GET and maybe POST are 100% of what you need, because that's what you use to follow hyperlinks. To quote Fielding: > A REST API should be entered with no prior knowledge beyond the initial URI... From that point on, all application state transitions must be driven by client selection of server-provided choice... Not mentioned: What HTTP verb you need to use to trigger the state transition, because it doesn't matter. And in fact, to the extent that a client has to "know" which verb to use, that actually goes against REST principles. > So if the true representation of representational state is a simple website like this, then large parts of that "spec" were irrelevant to 99.9% of sites before "web services". Again, there's no spec, unless you mean HTTP/1.1. And to the extent that we're talking about the principles that underpin the entire HTTP protocol, arguably they're relevant to 100% of sites. :)
- k__ 6y agoI had the impression nobody ever really read his work. I wrote a few API articles last year and people love them. I didn't know crap about API development when I wrote them, I just read Fielding's work and summarized it.
- dwheeler 6y agoIt's not misappropriated, it's evolved, just as most things are when others try to use them. Fielding had the notion that the HTTP idea of a few verbs, applied to arbitrary resources, was something to think more broadly about. Others agreed. Over time people decided that for their purposes Fielding's requirement of HATEOAS was unnecessary. I wouldn't say Fielding was wrong, but instead that others had different ideas of what was more important to them. The key plus of REST is its extreme simplicity if it's reasonable to work within those limitations. Sure, REST has limitations. But let's compare it to SOAP, its competitor at the time. I would much rather use a REST interface than a SOAP interface in practically all cases, and many others decided the same thing.
- saila 6y agoIs REST without hyperlinks for discovery and "state transfer" still REST? People use REST to mean just about any type of API-over-HTTP, which makes the term nearly meaningless. If someone--an individual developer, open source project, or vendor--claims to have implemented a RESTful API, that tells you nothing except that you're going use HTTP to consume it and that it probably uses JSON for data serialization. Why not just say JSON-over-HTTP instead?
- deleted 6y ago[deleted]
- BadInformatics 6y agoYou can see attempts to formalize this "HATEOAS-less REST" in frameworks like the Richardson Maturity Model [1]. One less-discussed area where REST has taken hold is in indexing/SEO (i.e. the Semantic Web's success stories). JSON-LD and other RDF microformats/representations are pervasive, while crawlers are much closer to the platonic ideal of a generic client consuming the uniform interface than most web API clients. [1] https://martinfowler.com/articles/richardsonMaturityModel.html https://martinfowler.com/articles/richardsonMaturityModel.ht...
- macca321 6y ago
- alasdair_ 6y agoFrom the article: > It’s not obvious why Fielding thinks anyone would ever attempt to build such a thing given that the web already exists; perhaps in 2000 it seemed like there was room for more than one distributed hypermedia system in the world. It’s worth remembering that Gopher was still a common thing in 2000. https://en.wikipedia.org/wiki/Gopher_(protocol) https://en.wikipedia.org/wiki/Gopher_(protocol)
- toyg 6y agoThose were the days - the web was one of many protocols, and people were still coming up with new things, new clients, new paradigms... Stuff like Napster, GNucleus/GNutella, RSS clients... Then Java applets failed, ActiveX got pwned into oblivion, people started using JS as a replacement runtime, and that killed absolutely everything else.
- fsckboy 6y agoThe URL to the dissertation in that article says "2up" in it, so I took it off and yes indeed, there is a 1-up (not two pages side by side) version of the PDF https://www.ics.uci.edu/~fielding/pubs/dissertation/fielding_dissertation.pdf https://www.ics.uci.edu/~fielding/pubs/dissertation/fielding...
- vbezhenar 6y agoProper REST is quite hard concept. I think that people just extract key useful features and use those. For me REST is HTTP + JSON + particular URL convention + using HTTP features as much as possible (e.g. use standard HTTP headers instead of custom response fields). But features like URL discovery: I never understood why someone would do that. API is consumed by code, not by people or AI. URL discovery would be useful for protocol without documentation, but that's hardly a useful replacement, just write a documentation.
- deleted 6y ago[deleted]
- throw_m239339 6y agoREST doesn't have any official normative spec, there is no proper REST at first place. This is why I never liked the idea itself. And let's be frank, very few businesses are actually really doing representational state transfert. Most are just taking advantage of HTTP stateless properties with a coat of RPC on top. SOAP was heavy and complex but at least it had a spec, so no endless debate as to what "proper SOAP" was. It was up to libraries to either follow the spec or not, many did not. This is also why GraphQL adoption was so fast. Developers don't care about ideas if there is no spec to implement or reference implementation, most aren't academicians. edit: again, my comment is obviously referring to API, AKA 2 web apps communicating with each others, not an internet user clicking on links with an web browser.
- jcrites 6y ago> And let's be frank, very few businesses are actually really doing representational state transfert. Every website on the Internet is doing representational state transfer. REST describes the interaction of humans using browsers to visit websites. It's not (mostly) meant to describe APIs for use by machines. When you understand that it describes websites, then it's also not a hard concept to understand. Example REST services are: reddit.com, google.com, facebook.com, amazon.com, ebay.com, etc. Compare how you interact with these REST services with the criteria Fielding clarified in his blog post "REST APIs must be hypertext-driven": https://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven https://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypert... When you build a website you typically meet these criteria without effort. It's a natural part of the experience. Machines can also interact with REST services, though usually not in the same way as people. (I agree that REST has minimal relevance to design of APIs that are intended for use by other software)
- throw_m239339 6y agoAfter all these years of complete REST/HATEOAS bullshit, finally, someone has the courage to say things like they really are. SOAP did nothing wrong. Fielding's paper was never meant for webapp developers.
- DonHopkins 6y agoIt's like the classic generic Pizza Box branding slogan: "You've tried the REST, now try the BEST!"
- jonahbenton 6y agoThis piece and conversation makes me sad. As someone who both wrote a (client-side) web browser in the 1990s and at the time also built server side HTTP systems, the piece gets it almost entirely wrong, and the degree of misguidedness in the HN comments is almost worse. But I guess that is how things go. Sigh. The competitor to ReST (representational state transfer) was not SOAP. It was and is RPC, and by extension, object oriented languages. The brilliant recognition Roy had, the genius of ReST, is that most systems are about data, not behavior, and solving for distributed system reliability was mostly about moving data around, statelessly. At the time, distributed systems were not the thing they are today, but what people were doing was informally called distributed objects- things that have state and behavior, the lifecycles of which are manageable remotely. Incredibly complicated stuff, failed all the time. You can see a good example of this in Java RMI, which was still shipping in Java until recently. The term "agent" has been deeply overloaded but it was also applied here. I think there is a good argument there is a direct line between Roy's insights, as expressed in ReST, and functional programming and the immutability revolution, and also the CAP theorem. The system design principles are exactly the same. Hope that story gets a proper telling some day.
- austincheney 6y agoIn order to better appreciate the idea you have to understand the context of addressing during that time. Addressing was a major factor in the architecture implemented at the time, for example CGI which executed dynamic scripts at the web server from a known fixed location. https://en.m.wikipedia.org/wiki/Common_Gateway_Interface https://en.m.wikipedia.org/wiki/Common_Gateway_Interface The web was invented so that supporting documents in research can be addressed via hyperlink, as opposed to just by citation, for more fluid understand of research material and technical documents. The hyperlink address of those supporting documents indicated where in the system those documents reside and that form of addressing was the basis of the URL. In later practice the URL would denote a service own via domain and a path on that server where documents reside. https://en.m.wikipedia.org/wiki/Uniform_Resource_Identifier https://en.m.wikipedia.org/wiki/Uniform_Resource_Identifier As the idea for web standards began to emerge in the mid 90s there came the idea of the URI. URI does not represent a location, as in a URL, but instead a unique identity. The idea of URI became a parent taxonomy to existing things like URL, URN, ISBN, and so forth. The idea for URI was influenced by the idea of email addressing which was at the time already in wide use as both a unique identifier and an address location. An example of this idea worked directly into a technology is RDF. https://en.m.wikipedia.org/wiki/Resource_Description_Framework https://en.m.wikipedia.org/wiki/Resource_Description_Framewo... Fielding was deeply involved in the work of addressing as he was co-authoring several of the related RFCs that would in several years get rolled up in RFC 3986, 5 years after the dissertation. The most influential idea introduced by REST is that as an architectural style an address can serve as an idea scheme instead of just document location on a distant server. Nobody cares where on a server a document resides so long as the address returns the intended content. Bigger still is that an address does not have to resolve or return anything to provide a variety of functional uses.
- cryptonector 6y agoWhere to start... First, nowadays altering the DOM is way more responsive than loading a new page, so no one really wants HATEOAS -- not even users, but especially not the sites we like to visit because they don't want to put out public APIs anymore. For non-browser app APIs (public or private), well, they can be the same, just driven by JS when in-browser. This... is sad. But this is a fact of life now. Just watch Tom Scott explain why the APIs went away, and when the APIs went away, so did HATEOAS (https://www.youtube.com/watch?v=BxV14h0kFs0 https://www.youtube.com/watch?v=BxV14h0kFs0). Second, there's a lot of APIs that needn't have anything more than one end-point -- no links to traverse, no HATEOAS. For example, a certification authority can take a CSR and authentication and return you a certificate -- one end-point is all you need, and other than that, the API can be RESTful in every sense. And then there's APIs where links aren't necessarily abundant or interesting. Third, HTTP kinda sucks anyways if you're dealing with databases. There's no nice RESTful way to construct transactions unless you put the RDBMS smarts into the client (JS again), which you can't do if it means trusting the client (it does). So right there, REST is broken anyways. Sure, if you're distributing your database, you need to deconstruct your transactions anyways, but you're not going to trust a user-agent to get that right, and anyways, you can't really do that with a HATEOAS interface. Put another way: show us how to build a secure application with REST (including HATEOAS) that a) users will enjoy, b) companies want to build, c) with complex transactions. If you do, we might all get our pitchforks out and protest for HATEOAS. Searching for examples of HATEOAS, I don't find much. Sure, for proprietary, corporate apps HATEOAS can be meaningful, but even there, I suspect for devs it's easier to just define APIs and drive all in-browser interaction via JS.
- rumanator 6y agoNone of your points make any sense. It's as if you believe HATEOAS is something entirely different than what it really is. The DOM is irrelevant wrt HATEOAS. HATEOAS is just a way to decouple clients from servers. You get that by not resorting to hardcoded links, and instead getting your server to supply links to clients in the form of links driven by link relations. HATEOAS is capabilities discovery. HATEOAS is API versioning without explicit versions. HATEOAS is a documented and discoverable API. That's it. It's also irrelevant to HATEOAS if you have 1 our 9999 links. You set a root document with a link. That's it. HTTP is completely irrelevant to HATEOAS. HATEOAS is an element of an architecture style. You can do REST with UDP if you'd like. And no, you can easily do transactions with REST over HTTP. No need to mix DB stuff on the API. Finally, you let it clear that you don't like REST or HATEOAS. That's ok. Yet, your personal preferences don't mean something is broken, specially if they are derived from misconceptions, confusion and ignorance.
- nightowl_games 6y agoThis article makes so much sense and has finally explained what REST is to me. I tweeted a similar comment about thinking "Everyone says REST but no one knows what it means" earlier this year. I had joined a web company and was studying up the definition in the interview. Of course they say they have a REST API and of course it doesn't contain links. I noted that as a violation with a sense of imposter syndrome and inconfidence in myself. When I got into the company I asked people what REST means and asked about the 'links within the response' trait. No one had heard of it. This article is exactly what I was looking for at that time. FIOH!
- sriku 6y agoThe piece states - > “state transfer” in “Representational State Transfer” refers to navigating a state machine using hyperlinks between resources (and not, as many people seem to believe, to transferring resource state over the wire). but this line from Fielding's thesis reads - > REST components communicate by transferring a representation of a resource in a format matching one of an evolving set of standard data types, selected dynamically based on the capabilities or desires of the recipient and the nature of the resource. .. which is closer to the alleged false belief?
- daotoad 6y agoThe same thing happened with MVC. MVC was originally used to describe a design using Smalltalk UI widgets as controllers and charts and other similar displays of data as views that worked with business logic stored in the model. State flowed only in one direction, from controller to model to view. Web MVC completely overthrew that approach and replaced it with something very different with the same name. All UX was moved to the view, controllers became HTTP endpoints. Communication became bidirectional at both interface layers. View talks to the controller which talks to the model. When people say they use REST APIs, they aren't. When people say they are building MVC applications, they aren't. Except they are. The new meanings that evolved have replaced the original meanings.
- emmanueloga_ 6y agoDoes anybody have any insights about how rest came to be such a buzzword? My pet theory is that rest was popularized by Rails. If you look at trends [1], rest itself shows up as a super slow trend ramp that only now is starting to diminish... But rails seems to have had the peak of its popularity between 2006/2007 [2], which happens to be the time Rails 1.2 came up with "restful routes" support. Even if this theory is correct, it begs the question how did the Rails developers come in contact with rest themselves and how did it happen that the whole thick thesis derived in just a simple HTTP routes convention ... 1: https://trends.google.com/trends/explore?date=all&geo=US&q=%2Fm%2F03nsxd,%2Fm%2F0505cl https://trends.google.com/trends/explore?date=all&geo=US&q=%... 2: https://weblog.rubyonrails.org/2007/1/19/rails-1-2-rest-admiration-http-lovefest-and-utf-8-celebrations/ https://weblog.rubyonrails.org/2007/1/19/rails-1-2-rest-admi...
- gridlockd 6y agoThe reason for this "misappropriation" is that REST is not actually good. It never was good. You can tell if a standard is bad when the actual implementations refuse to implement significant parts of it. Had it been good, it could've been implemented as intended it would have worked and solved actual problems. Instead, only a few ideas from REST that appeared useful were adopted and made their way into real-world APIs that actually solved problems. Most of these ideas are not actually net benefits and cause extra issues, but they look nice on the surface, people built around them, and so they stuck. The more attempts are made at implementing the more useless parts of REST (like HATEOAS), the worse an API becomes to use. So please, do less REST, not more. If possible, ship a library for your API for the major languages and don't leak any of the REST bullshit into it.
- trixie_ 6y agoIf you want to understand the problem with REST, just look at the discourse in this thread. REST isn’t a standard with a clear RFC, it’s a vague white paper that everyone interprets differently. It has more in common with religion than anything else. And just like religion it has wasted more productive time since it was created than anything else. I’ll never understand why such poorly defined system became the ‘bedrock’ for decades of incompatible and non-standardized APIs. And the somehow these false prophets defend it saying you just don’t understand it when they can’t agree among themselves.