Dylan Beattie
Dylan Beattie
  • 84
  • 1 543 644
Turns out REST APIs weren't the answer (and that's OK!)
A decade ago, it seemed like everybody was talking about ReST APIs and HATEOAS, blog comment threads bristled with spirited debates about whether something was, or was not, a REST API, and we all thought hypermedia was the key to building long-lived APIs. And yet here we are, a decade later, building just as many APIs as before but seems like hardly anybody's talking about hypermedia... so what happened?
NOTE: At 8:14 or so, you can hear what sounds like a cat in this video. I am absolutely baffled as to where this came from, as there weren't any cats (or kids, or anything else that might have made a weird meowing squeaky noise) anywhere nearby when I was filming this. I've decided it must be a Ghost Cat: one of my cats who's no longer with us is now haunting my OBS installation. Let's see if they show up again in any future videos.
Links:
Roy Fielding's dissertation "Architectural Styles and the Design of Network-based Software Architectures":
ics.uci.edu/~fielding/pubs/dissertation/top.htm
Roy Fielding: "REST APIs must be hypertext-driven", October 2008:
roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven
Hypermedia Formats:
SIREN: github.com/kevinswiber/siren
HYDRA: www.hydra-cg.com/
JSON-LD: json-ld.org/
Collection+JSON: amundsen.com/media-types/collection/
HAL - Hypertext Application Language: stateless.group/hal_specification.html
Переглядів: 12 569

Відео

I Was Too Busy Making Videos To Make This Video
Переглядів 1,1 тис.День тому
I've been in Norway all week at NDC Oslo... and, yep, been too busy making videos to make a video. So here's a little video diary from a sunny Sunday in downtown Oslo. Sorry about the wind noise... next time I'll remember to bring the Anker mic with the windshield :)
Spamhaus, GitHub Pages, and good error messages
Переглядів 1,3 тис.14 днів тому
Last week a bunch of my websites went down... well, kind of. It wasn't just mine: thousands of sites were down, including github.io itself. And they weren't down for everybody... just for quite a lot of people in the UK. Let's figure out what happened.
Moore's Law, Amdahl's Law, Conway's Law - and why we need to stop having meetings`
Переглядів 2 тис.21 день тому
Over fifty years ago, Gordon Moore, Gene Amdahl and Mel Conway shared three observations about computer engineering which would go on to be known as Moore's Law, Amdahl's Law, and Conway's Law... but what can anything published in the 1960s possibly have to do with designing cloud software in 2024? Turns out the answer might be more than you think.
Corel Linux: the OS that could have changed the world?
Переглядів 2,4 тис.Місяць тому
In the early 1990s, the Corel corporation created CorelDRAW!, a truly excellent vector graphics program for Microsoft Windows. Then they bought WordPerfect, tried to port it to Java, failed... then in 1999 they released a GNU/Linux distribution - Corel Linux. It should have been amazing. It's possibly the closest we ever came to a genuine "Linux on the desktop" challenger to Microsoft's de fact...
Apollo, Soyuz, Postel's Law - and some really old-school HTML
Переглядів 2 тис.Місяць тому
Way back in 1980, Jon Postel wrote, in the original spec for TCP/IP: "be conservative in what you send; be liberal in what you accept." That's become known as Postel's Law, and it's turned out to be a really powerful idea when it comes to designing client/server applications and network protocols. I also think it's one of the reasons why the World Wide Web was so successful... and it maybe even...
Why Does My Phone Think It's In Cairo?
Переглядів 2,1 тис.Місяць тому
I'm in Jordan, at the Dead Sea - so why does my phone's GPS think it's in Cairo? And how does GPS work, anyway?
What is Network Neutrality - And Why Does It Matter?
Переглядів 1,2 тис.Місяць тому
Last week the Federal Communications Commission, FCC, voted to restore "network neutrality" in the United States... what's the big deal? Why does network neutrality matter - and what's the surreal legal mechanism behind why it's been abolished, reinstated, abolished again, and now reinstated again, all in less than a decade?
There's a 1970s Tape Recorder in Interstellar Space
Переглядів 1,3 тис.2 місяці тому
There's a 1970s Tape Recorder in Interstellar Space
Why Emoji are More Complicated Than You Think
Переглядів 3,3 тис.2 місяці тому
Why Emoji are More Complicated Than You Think
Delving into the Landscape
Переглядів 1,7 тис.2 місяці тому
Delving into the Landscape
Does Your UI Pass The "Moron in a Hurry" Test?
Переглядів 7 тис.2 місяці тому
Does Your UI Pass The "Moron in a Hurry" Test?
You Forgot To Say The Magic Word!
Переглядів 3,5 тис.2 місяці тому
You Forgot To Say The Magic Word!
The Evolution of Web Apps 1992-2024
Переглядів 12 тис.3 місяці тому
The Evolution of Web Apps 1992-2024
Tips for Tech Presenters: Solving the "Super Mario" Problem
Переглядів 2,8 тис.3 місяці тому
Tips for Tech Presenters: Solving the "Super Mario" Problem
The Road to Rockstar 2.0: C#, Blazor, WASM, and AOT compilation.
Переглядів 9813 місяці тому
The Road to Rockstar 2.0: C#, Blazor, WASM, and AOT compilation.
Hey Tech Nerds - Here's a Question: Fundamental Layers of Abstraction
Переглядів 1,2 тис.3 місяці тому
Hey Tech Nerds - Here's a Question: Fundamental Layers of Abstraction
re:bass
Переглядів 31 тис.2 роки тому
re:bass
Teams
Переглядів 17 тис.2 роки тому
Teams
ONYX BOOX Note Air - an e-ink tablet running Android 10
Переглядів 9 тис.3 роки тому
ONYX BOOX Note Air - an e-ink tablet running Android 10
Building a Rockstar interpreter in TypeScript, Day 1
Переглядів 2,2 тис.3 роки тому
Building a Rockstar interpreter in TypeScript, Day 1
Advent of Code 2020 - Day 12, Part 1... using Amstrad LOGO
Переглядів 6373 роки тому
Advent of Code 2020 - Day 12, Part 1... using Amstrad LOGO
Advent of Code Day 12: Part 1 in Amstrad LOGO
Переглядів 8703 роки тому
Advent of Code Day 12: Part 1 in Amstrad LOGO
Hello Helpdesk
Переглядів 13 тис.3 роки тому
Hello Helpdesk
Tech Sales
Переглядів 11 тис.3 роки тому
Tech Sales
Meetup 2020
Переглядів 4 тис.3 роки тому
Meetup 2020
The Seven Microphone Showdown
Переглядів 3,1 тис.4 роки тому
The Seven Microphone Showdown
Learn To Fly : Live in Lockdown
Переглядів 2,3 тис.4 роки тому
Learn To Fly : Live in Lockdown
spleeter demo
Переглядів 3,2 тис.4 роки тому
spleeter demo
HTML
Переглядів 26 тис.4 роки тому
HTML

КОМЕНТАРІ

  • @auroraRealms
    @auroraRealms 34 хвилини тому

    I see now how Word Perfect died. Everything Novell buys goes up in flames. I used to use Linux SuSE unitl Novell bought it, and compeletly destroyed it.

  • @AbNomal621
    @AbNomal621 4 години тому

    Martin Fowler should be put where he belongs, that is in the place of someone making money be telling and not doing. And in his statement on definition of REST - well he needs to spend more time in language arts where we learn that definitions change over time.

  • @edgeeffect
    @edgeeffect 20 годин тому

    At work, we've got a 3rd party API that goes one stage further than returning an error message with a 200 code.... it returns NO error message and a 200 code.... even when your request has failed... neat huh?

  • @carrion1234
    @carrion1234 2 дні тому

    i actually implemented the HAL RFC draft for one of our backend APIs to enable HATEOAS. being able to reference related resources in the response, but also giving clients the ability to request the embedding of these resources on the fly turned out to be really useful. but so far i think no client implementation really uses the links to discover actions.

  • @adambickford8720
    @adambickford8720 2 дні тому

    I didn't know about stiglers law but i've claimed for years that the person who invented murphies law didn't get credit because something went wrong!

  • @erikslorenz
    @erikslorenz 2 дні тому

    JSON Apis that try to have links and stuff are just the worst lol.

  • @andreffrosa
    @andreffrosa 2 дні тому

    But graphql and grpc can still be rest, they are just middleware to enhance basic http communication. However, they don't really go against the rest principles.

  • @wolfblaide
    @wolfblaide 2 дні тому

    Yeah the issue has always been there's no point to the hypermedia part for most APIs. Nice idea, but impractical, difficult, and pointless. So REST in the IT business world just naturally became about having something better than SOAP to create, update, and read data remotely. I think it's fine to call these kind of APIs REST, or RESTful. Everyone does.

  • @martineyles
    @martineyles 2 дні тому

    In most cases the hypermedia is useless, because something will be programmed based on the spec rather than reverse engineering from submitted responses. Links could perhaps be applied if the API is designed to be called by a presentation layer, but that's the only case I can think of where it might have a use.

  • @philipoakley5498
    @philipoakley5498 2 дні тому

    All very Gödelian ;-) You can't prove Rest within a Rest framework. It's like pure maths arguing with applied maths.

  • @netssrmrz
    @netssrmrz 2 дні тому

    Awesome video. My personal opinion... REST is the dumbest possible solution to the problem of "client code wants to run server code". I feel like we've stepped backwards. Give me RPC with autogenerated client-side proxy stubs so I never have to give a dam about the network implementation. The real solution is not to use HTTP for this kind of IPC. I want a dedicated protocol that web servers can utilise alongside HTTP.

  • @davidbuchan2909
    @davidbuchan2909 2 дні тому

    HAHAHA, we're still using SOAP

  • @TheCheD3
    @TheCheD3 2 дні тому

    8:15 I think your cat doesn't like Swagger

  • @Dennis-vh8tz
    @Dennis-vh8tz 2 дні тому

    I remember when HATEOS, and hypermedia driven API's in general, were the darlings of framework developers and architecture astronauts; however, even during their heyday it was obvious to me that these ideas wouldn't survive contact with reality - they added a lot complexity (and thus development time and expense) while having little practical benefit for most applications.

  • @beofonemind
    @beofonemind 2 дні тому

    REST will be around in 15 years .... just like Javascript, we are stuck with it. I don't mind it. I like the ask receive nature of it.

  • @alexnoman1498
    @alexnoman1498 2 дні тому

    Now if you were to send the "Login" button itself instead of a json saying there should be a button - you get HTMX. It exposes the ability to request HTML elements themselves and layouts them in, which can then request more, different elements. The most web native hypertext solution possible, no protocol negotiation beyond "do you speak HTML". You just get sent the finished button.

  • @trudyandgeorge
    @trudyandgeorge 2 дні тому

    This advice is superb 👌

  • @49riddickful
    @49riddickful 2 дні тому

    How my watching went : "what is this guy even talking about, whole world is sitting on top of rest apis..." .... "Oh he's gonna talk about ACTUAL REST" 😂😂😂😅

  • @trudyandgeorge
    @trudyandgeorge 3 дні тому

    This is a masterpiece

  • @Kubu222
    @Kubu222 3 дні тому

    8:14 great video, now show your cat please 😸

  • @firstlast-tf3fq
    @firstlast-tf3fq 3 дні тому

    I’m one of the few stubborn assholes that still insists on hosting my own email server. However, I do so on a Linode VPS because my home internet hasn’t been the most reliable. Couldn’t send any emails for 3 days last week because of Spamhaus. No explanation given, no evidence I could find of my server having been compromised, nothing. Pain in the ass.

  • @RobertFabiano
    @RobertFabiano 3 дні тому

    Background noise: cat in heat or small child? 😂

    • @DylanBeattie
      @DylanBeattie 3 дні тому

      You know, I have absolutely no idea. No cats or children on the premises. I didn't even notice that until somebody pointed it out on the recording...

  • @roganl
    @roganl 3 дні тому

    Returning an application error in a 200 response is a valid choice. Why overload the transfer protocol signaling when you can and should handle the application error gracefully, and let the application domain remain loosely coupled.

  • @andygarfield6529
    @andygarfield6529 3 дні тому

    I’m curious if you intentionally didn’t mention HTMX. Doing HATEOAS with HTML makes a lot more sense to me than doing it with JSON because we don’t need to synchronize client state and server state, considering JavaScript isn’t doing a bunch of element creation. HTMX is great because it extends HTML as a hypermedia beyond just the anchor and form tags. It’s a very simple yet powerful idea.

  • @marcelvanLare
    @marcelvanLare 3 дні тому

    Ok , i guess i was working with openApi. Works fine for CRUD. So i will just keep going on.

  • @alecclews
    @alecclews 3 дні тому

    I used to weasel my way out of it by using the term "a REST like API'

  • @tlacmen
    @tlacmen 3 дні тому

    web turned successful: "citation needed" LOL ;)

  • @DavidBeaumont
    @DavidBeaumont 3 дні тому

    REST for me was always about CRUD and defining the data taxonomy in the URL path. Sometimes you added extra data, sometimes that extra data was trivial to compose so didn't need to be sent. You did whatever made the API as clean and stateless as possible because that is what matters for scaling the backend.

  • @lebenebou
    @lebenebou 4 дні тому

    this channel is a rare gem

  • @NotMarkKnopfler
    @NotMarkKnopfler 4 дні тому

    I've been screaming about this for years. You can pass the majority of parameters on the fricking URL. Or use http post. REST APIs just add more wrapping to the data which needs to be unwrapped. My simple PHP web application was 175 times faster by not having to wrap and unwrap data with JSON. You're just adding more overhead.

  • @pavelhoral
    @pavelhoral 4 дні тому

    Very interesting and well explained summary.

  • @LeeSmith-cf1vo
    @LeeSmith-cf1vo 4 дні тому

    imo hypermedia in APIs is just bloat. If the API is well documented then the links are worthless and the consuming code probably doesn't care. The only thing they do is slow down the response time.

  • @bobthemagicmoose
    @bobthemagicmoose 4 дні тому

    REST lost its meaning for me long ago. Tons of pedants running around trying to define it in different ways has left me thinking: “it’s just an API”

  •  4 дні тому

    I never figured out how to actually consume a REST API. I get links back, but usually these links are formulated in a way where coercing it into a shape that is suitable to be fed back into the HTTP client is a lot more work than just putting the paths in the code instead.

    • @neal321
      @neal321 2 дні тому

      You need to parse the result and display the result dynamically using links, buttons etc. To be able to display the results in a user friendly format you need some sort of directives in the response to specify placement, colour etc. So basically you need to develop your own version of a browser, markup language and css type language. Hint: we already have these things, just use them. Arguing if something meets someones definition of a REST API is a waste of time

  • @TwoThreeFour
    @TwoThreeFour 4 дні тому

    Aww man, give it a rest will ya 😂

  • @adambickford8720
    @adambickford8720 4 дні тому

    The alternative to rest was soap. Once you add HATEOAS, the simplicity advantage of rest evaporates but you still have the lack of tooling.

  • @kode4food
    @kode4food 4 дні тому

    My apologies for having anything to do with SOAP

  • @Twi1ightFr0st
    @Twi1ightFr0st 4 дні тому

    i build APIs with only GET method without building POST endpoints, and use query params to represent the params passed in, and its simple and works well. just like how unpure function calls can return different results, HTTP GET idempotency doesnt really need to be adhered to

    • @elijahbuscho7715
      @elijahbuscho7715 4 дні тому

      But then your request size is pretty heavily limited isn't it?

    • @Twi1ightFr0st
      @Twi1ightFr0st 4 дні тому

      @@elijahbuscho7715 yes agree with you, I havent build any file upload endpoints yet, that's better suited with POST endpoint and formdata object

  • @zBrain0
    @zBrain0 4 дні тому

    It is interesting to hear the history of the term. I think it has become basically synonymous with anything that uses HTTP verbs, and very often Json payloads. I didn't realize the original definition specifically included hypermedia. Interesting though to see the rise of htmx in the last year or so. I don't think it's for me, but it definitely swings back towards the use of hypermedia directly across the network.

  • @EvenTheDogAgrees
    @EvenTheDogAgrees 4 дні тому

    I'll be the weirdo here, but personally, I never really liked REST APIs. They're good for simple objects and CRUD operations only, but any time you try to represent something that doesn't fall within that realm, you're producing kludgy nonsense. Personally I'm more of a fan of RPC over REST.

    • @luckiydiot
      @luckiydiot 3 дні тому

      You're not alone :) BTW, another thing I don't like about REST APIs that they tend to push business logic to the frontend. And the languages we use on the frontend (practically, JS) are usually not really a solid choice to implement business logic...

  • @jacksorjacksor
    @jacksorjacksor 4 дні тому

    Genuine question : "Hyper" - why? Why Hypermedia, Hypertext, Hyperthirdthing - why was "Hyper" used in the context of the internet?

    • @DylanBeattie
      @DylanBeattie 4 дні тому

      It all dates back to a really influential paper by Ted Nelson from 1965 about structures of complex information systems, where Ted coined the terms "hypertext" and "hypermedia" (and, I believe "hyperdata" as well, although that one didn't stick as well as the other two...) dl.acm.org/doi/10.1145/800197.806036

    • @jacksorjacksor
      @jacksorjacksor 4 дні тому

      @@DylanBeattie Perfect answer, thank you so much!

  • @jimiscott
    @jimiscott 4 дні тому

    From a consumer of a lot of web APIs, REST is by far the easiest - the tooling is there, it's easy to understand (syntax, documentation) and all languages support JSON (or Xml). I cannot really think of a suitable alternative - there is GraphQL, but this is an absolute mess, which is difficult to understand, has a syntax which is not JSON compatible, and has limited language support. I can understand some of the complaints of REST (e.g. over-fetching), but where this is a concern, it can also be remedied easily.

  • @ayehavgunne
    @ayehavgunne 4 дні тому

    I've been using and creating APIs for well over a decade and somehow I never knew about the hypermedia stuff.

  • @kilo.ironblossom
    @kilo.ironblossom 4 дні тому

    My teammate told me returning null with 200 OK is restful

  • @georgehelyar
    @georgehelyar 4 дні тому

    The JSON APIs at my work are definitely not REST. Not only is there no hypermedia, almost all of them are actually RPC rather than representing resources, because we don't build CRUD APIs. We also don't use e.g. jsonrpc. I'm pushing to just switch to gRPC but people like to use what they are familiar with.

    • @Dennis-vh8tz
      @Dennis-vh8tz 2 дні тому

      There's nothing inherently wrong in modelling RPC's as an HTTP POST with JSON bodies in both request and response. The common REST frameworks can easily handle this, so why not use them if that's what the developers and users are familiar with?

  • @praecorloth
    @praecorloth 4 дні тому

    That was an amazing video. Sub'd, like'd, and now commenting for the algo. Also, SNMP. Four lies in one acronym. :D

    • @DylanBeattie
      @DylanBeattie 4 дні тому

      You mean the simple network management protocol that isn't a protocol, isn't simple, and doesn't manage networks? Yeah. Love that one.

  • @gotoastal
    @gotoastal 4 дні тому

    Imagine wearing a shirt from a megacorporate code forge that wants to make software into social media website & that requires an account to make upstream contributions to projects or even use search on code.

    • @DylanBeattie
      @DylanBeattie 4 дні тому

      I'm gonna print this comment onto a shirt and wear that in my next video.

  • @ThatRobHuman
    @ThatRobHuman 4 дні тому

    What a lovely take. as far as REST-adjacent patterns: I don't think I've ever written a single API that faithfully adheres to what RESTful actually is... For example, I constantly break the POST/PUT pattern - for me PUT is create a resource, PATCH is edit a resource, and POST is "perform some specific action against a resource", and that's *definitely* not RESTful, but it comes up a lot... And that's fine - I think what matters is Consistency and Documentation. (it helps also that every API that I've ever written has been self-documenting through a REPORT method to the same url as a kind of side-channel)

    • @pedrokalil4410
      @pedrokalil4410 4 дні тому

      And for me, I use post to create resources (my reasoning is that if the result is not identical after two requests than it is not a put), I use put to set all the data in an resource (this way even if someone somewhere changes something the result of calling out again is the same), patch for updating specific values in a resource (the ones I passed in the request), get for get, query parameters for query, etc

    • @pedrokalil4410
      @pedrokalil4410 4 дні тому

      Because of my constraints, I very rarely use put, I use post a lot for creating resources and lots of patches and gets

    • @dominikvonlavante6113
      @dominikvonlavante6113 4 дні тому

      For documentation, that's what OpenAPI 3.0 is for.

  • @DanielOpitz
    @DanielOpitz 4 дні тому

    That mismatch is the reason why most people call it RESTful today.

  • @RouteNRide
    @RouteNRide 4 дні тому

    Just callt them webapp and webui and implement the clients needs already! Enough with the mental instant gratification...