GraphQL, gRPC or REST? Resolving the API Developer's Dilemma - Rob Crowley

Поділитися
Вставка
  • Опубліковано 5 жов 2024
  • GraphQL, gRPC, REST and WebHooks are among a bewildering array of technologies and architectural styles that are available to API developers today. Presented with such myriad options, how can we be confident of making an appropriate decision for the problem at hand? In search of guidance, developers often turn to online communities. This can exacerbate the problem as discussions about API styles often descend into statements about the superiority of one approach over another being presented as universal truths. Such comments invariably earn emotive rebuttals that also lack sufficient nuance. The result of such exchanges is increased confusion and uncertainty. Join me on a tour of these API styles where we will cut through this noise, demonstrate where each style shines (plus where they don't!) and ultimately resolve this dilemma of choice.
    In this session we'll take an in-depth look at API design; the best practices that have evolved; the game changing supporting technologies that are now available including HTTP/2; and most importantly what you need to do to deliver a world class developer experience:
    How to determine the suitability of an API style for your application context. Don't be a victim of technology hype!
    What is required to support graceful evolution of the API contract including the potential implications of both Hyrum's Law and the Law of Implicit Interfaces
    Understand the supporting toolchains and technologies that dovetail with each API style.
    The importance of treating your API as a product with an unwavering focus on improving the ease of consumption for your clients.
    By the end of the session, you will not only understand the concepts underpinning these various API styles but also have the knowledge to put them into practice. If you want to take to your API design expertise to the next level, then this is the session for you. See you there!
    Check out more of our talks, courses, and conferences in the following links:
    ndcconferences...
    ndc-london.com/

КОМЕНТАРІ • 101

  • @MartinThoma
    @MartinThoma 4 роки тому +108

    1:02 Start with Agenda
    2:40 About the speaker RobDCrowley
    8:18 API Timeline
    18:13 REST vs GraphQL
    19:29 GraphQL = RDA + RPC
    19:55: gRPC = HTTP/2 + Protobuf
    21:48: REST is a state-machine over HTTP
    27:48 GraphQL breaks caching - client-side chaching, server-side caching
    30:58 Authentication
    33:09 Caching summary
    33:50 "REST APIs are inefficient"
    35:34 Over/Underfetching
    40:52 Performance
    41:52: "GraphQL elimits the need for API versioning"
    48:00 Contract First

  • @drmangrum
    @drmangrum 4 роки тому +43

    The problem is too many developers latch on to the "great new thing" thinking it's better to what came before it just because it's new. Just because a technology is new doesn't mean the old technologies are irrelevant. New technologies are just new tools in the toolbox. Use what's best for your situation.

    • @dealloc
      @dealloc 4 роки тому +10

      Sometimes they're old tools in a new toolbox :-)

    • @fullkickproductions7245
      @fullkickproductions7245 2 роки тому

      See LISP as an example! One of the oldest high level languages, and certainly one of the finest!

    • @1anre
      @1anre Рік тому

      @@dealloc *shiny new toolbox

    • @1anre
      @1anre Рік тому

      @@fullkickproductions7245 LISP has been reskinned in what new language now?

    • @re1konn
      @re1konn Рік тому

      @@milfex-lostex3984 doom emacs :p Hi

  • @rauru8570
    @rauru8570 4 роки тому +115

    Me coming here: ok I need to learn more abour GraphQL
    Me coming out: ok I need to learn more HTTP2 and find out what the heck is gRPC

    • @shakambarix
      @shakambarix 4 роки тому +4

      Lol exactly

    • @colinjohnson5515
      @colinjohnson5515 4 роки тому +2

      Docs aren’t the greatest but for internal apis it’s pretty kickass

    • @PaulSebastianM
      @PaulSebastianM 4 роки тому +2

      ...or RPC in general, in fact. It should have never become more complicated than the basic concept of Remote Procedure Calls...

    • @mitchthepower
      @mitchthepower 3 роки тому +1

      I think you might have learned enough about simic... ;-)

    • @rauru8570
      @rauru8570 3 роки тому +2

      @@mitchthepower Our progress is measured in heartbeats

  • @Euler123-h8n
    @Euler123-h8n 2 роки тому +4

    From my experience:
    RPC is good when you need execute actions or events -> eg. An authoritative game server; A "near real-time" system.
    Use REST when you need expose data or datasets -> eg. Data from a "products" table for a frontend ecommerce; Statistical data for analysis like Covid19 datasets...
    GraphQL is good when you need specific fields from different datasets/tables, conceptually very similar to "views" in databases -> eg. Personalized recommendation systems like those on UA-cam, Netflix, Amazon store...
    But the most important thing: All it depends of the bussiness needs, not your personal needs!

    • @archmad
      @archmad 2 роки тому

      not real-time. it is event-driven

    • @Euler123-h8n
      @Euler123-h8n 2 роки тому

      @@archmad Right.

  • @scottamolinari
    @scottamolinari 4 роки тому +61

    I always thought "cache" was spoken like "cash". Is it not?

    • @AkosSzalay1988
      @AkosSzalay1988 4 роки тому +10

      it varies between different accents

    • @arwahsapi
      @arwahsapi 4 роки тому +5

      Australian: kay-sh

    • @keja0
      @keja0 4 роки тому +5

      @@BDnevernind Specifikayshing =))

    • @danielschmider5069
      @danielschmider5069 4 роки тому +2

      he also pronounces "leverage" as "leaverage". English is flexible

    • @colinjohnson5515
      @colinjohnson5515 4 роки тому +1

      I speak ‘Merican(Texican) and cache and cash are pronounced the same.

  • @keja0
    @keja0 4 роки тому +41

    This was a great presentation, but the kayshing destroyed it. I literally had to take a break to recover. *_*

  • @onur7183
    @onur7183 3 роки тому +6

    This presentation was amazing! I am going to start with my bachelor thesis soon about graphql and rest. Are there any good book recommendations out there? Let me know 😎

  • @chandragie
    @chandragie Рік тому +1

    It's 2023. And this is still a brilliant talk!

  • @KamilSkalski
    @KamilSkalski 4 роки тому +5

    You can also use grpc-js, which is purely-JS grpc client (think are also wrapping up server implementation, for use in node I guess), so browser can easily become one of many polyglot consumers of grpc based API

    • @jamesmccabe2286
      @jamesmccabe2286 3 роки тому

      1:02 Start with Agenda
      2:40 About the speaker RobDCrowley
      8:18 API Timeline
      18:13 REST vs GraphQL
      19:29 GraphQL = RDA + RPC
      19:55: gRPC = HTTP/2 + Protobuf
      21:48: REST is a state-machine over HTTP
      27:48 GraphQL breaks caching - client-side chaching, server-side caching
      30:58 Authentication
      33:09 Caching summary
      33:50 "REST APIs are inefficient"
      35:34 Over/Underfetching
      40:52 Performance
      41:52: "GraphQL elimits the need for API versioning"
      48:00 Contract First

  • @seff7183
    @seff7183 2 роки тому +1

    love seeing this nuanced approach. twitter takes constantly make me feel like making any decision is the wrong decision because there's some expert out there flinging witty puns around shitting on my tech stack.

  • @thorick590
    @thorick590 4 роки тому +1

    Totally agree with the sentiment. Each architecture addresses a certain type of problem. You choose the one that best fits your circumstance. Good luck with message type polymorphism if you try to change your SOAP service to REST using JSON as the message format, for example. For the vast majority of consumer facing web/mobile apps this kind of capability is completely irrelevant so SOAP is complicated to use and a complete waste of computing resources. Like owning a McLaren if all you want is a car to get around town to go grocery shopping. You're far better off with that Toyota Yaris.

  • @MrNorthCat
    @MrNorthCat 4 роки тому +9

    Great talk! A lot of very useful stuff and it is really thoughts provoking.

  • @Thrated
    @Thrated 4 роки тому +7

    First part of the talk is basically a repetition of everything that's said in the "REST vs. GraphQL: Critical Look" talk by Zdenek Nemec ua-cam.com/video/yLf0rIaRtRc/v-deo.html (which is actually referenced in 18:01). But they complement each other nicely.

  • @RogerValor
    @RogerValor 4 роки тому +2

    SOAP failed because it was trying to create self building protocols serving project management instead of software development. All comparisons to REST (and Xml-Rpc/Json-Rpc) being embraced again is quite hard to compare to it. So I would not listen to such hyped articles anyway. Whenever people want to create programs without understanding how to code try to create protocols, it will just fail. So this talk greatly shows, how each more simple API strategy has it's strengths and weaknesses.

    • @colinjohnson5515
      @colinjohnson5515 4 роки тому +1

      Roger Valor by the time cross platform SOAP became popular in my neck of the woods, the modern web was just taking off and REST made sense to web devs as well as backend server guys.

  • @stevepascoe
    @stevepascoe 4 роки тому +10

    Finally some common sense on this topic ❤️

  • @parapadirapa
    @parapadirapa 3 роки тому +1

    Anyone has a couple of books on this subject, comparing the pros and cons of the different API styles and mentioning practical applications of each style? Thanks in advance

  • @Christobanistan
    @Christobanistan 3 роки тому +1

    Note that Protobuf can be replaced in gRPC. If both ends were .Net, for example, you could not serialize at all but blit out the in-memory binary representation, which is much faster.

  • @MaheshKumar-lq1xm
    @MaheshKumar-lq1xm 4 роки тому +1

    Before even hearing out I can tell the answer
    "It depends"
    Then why to compare ?

    • @DionV
      @DionV 2 роки тому

      Why compare? Because there is always someone new to the tech who is asking this exact question. Getting a nice summary of the pros and cons of each is very helpful.

  • @AlexeyLopatin-m4r
    @AlexeyLopatin-m4r Рік тому

    Mature view on using different API approaches.

  • @sariksiddiqui6059
    @sariksiddiqui6059 3 роки тому +1

    Server push is being removed as of now from chrome,given how less it's being used

  • @GodOfMacro
    @GodOfMacro 4 роки тому +3

    what about datomic

  • @MrChannell
    @MrChannell 4 роки тому +4

    Cache is a French word that is pronounced Cash in Englishing (as in "Cash of Gold", rather than "We accept Cash")... maybe it's SQL (S-Q-L or Sequal), difficult to listen to someone who can't pronounce the word, but the summary was OK: GraphQL for query, gRPC for RPC

    • @edgeeffect
      @edgeeffect 2 роки тому

      I've assumed that this recent trend towards cay-she derives from American-English but I might be hurling blame at the easy victim there. ;)
      I had to stop listening once he started in that direction but then again, I'm incapable of controlling my aversion to "sequel" so I'm obviously not the most pronunciation-tolerant person in the world.

  • @jacquesduplessis6175
    @jacquesduplessis6175 3 роки тому +1

    This is a good talk. Nicely balanced.

  • @scottamolinari
    @scottamolinari 4 роки тому +6

    One other thing. It is always missed, because these discussions are targeted at GraphQL as an API, but GraphQL clients also do one other thing amazingly well, which helps developer efficiency. They allow for the components (as in SFCs in React/ Vue, etc.) to be the masters of their own data. You can't do that easily with a REST client.

    • @thomasczthomash1859
      @thomasczthomash1859 4 роки тому +3

      The client is a master of the data if someone is writing the GraphQL back end to supply that data, exactly the same as REST, it doesn't come for free. GraphQL is pointless.

    • @AB-fp8xo
      @AB-fp8xo 4 роки тому

      If you use ODATA with you REST API, you can also specify properties you want and load all required related entities at once. It event goes further and allows you to sort and filter data - something you cannot do in GraphQL without implementing it yourself...

    • @scottamolinari
      @scottamolinari 4 роки тому +2

      @@thomasczthomash1859 Sorry you see it that way. You are missing out on a lot.

    • @scottamolinari
      @scottamolinari 4 роки тому

      @@AB-fp8xo Your missing the whole point. I see this quite often, people stuck in the REST paradigm. Oh well. I'll leave you with this. GraphQL wasn't built only for the data and state transfer between client and server. It was built for a better developer experience too, because a component's data/ state (also fetching/ mutating on the server) is local to itself. You can't do that with REST.

    • @nexxmex
      @nexxmex 4 роки тому +2

      @@scottamolinari Just to be sure: honest question, what is REST for you? Many people think that REST is using HTTP verbs, but this is (surprise surprise) a plain HTTP API. If you do not utilize hyperlinks and dont allow clients to discover and traverse your object graph, you might as well be honest and not call the API a REST API. Sadly this is a very common misconception in the industry.

  • @rafaelfreitas7080
    @rafaelfreitas7080 4 роки тому +6

    54:08 I just have to say the name Native Mobile BFF sounds absolutely hilarious

  • @jonchicoine
    @jonchicoine 4 роки тому +18

    since when is "caching" pronounced as "Kay-shing"?

    • @youtube.com-handle
      @youtube.com-handle 4 роки тому +15

      So, and let me get this correct, you failed to Cache in THIS Entire Demo, because its kayshing... dont be such a compiler.

    • @PaulSebastianM
      @PaulSebastianM 4 роки тому

      @@youtube.com-handle 👌👍

    • @PaulSebastianM
      @PaulSebastianM 4 роки тому +2

      Appli-kay-shin kay-shing. 😎

    • @bboy349833591
      @bboy349833591 4 роки тому +1

      Since when is data pronounced as data. 🤪

    • @icodefor
      @icodefor 4 роки тому +1

      Not going to lie, this hung me up to for the first 3 times he said it that way. But by the 6th time I got used to it.

  • @archmad
    @archmad 2 роки тому +1

    these guys didnt know what will happen next month

  • @falconeagle3655
    @falconeagle3655 4 роки тому +4

    Good video.

  • @YBWang-pi9qq
    @YBWang-pi9qq 3 роки тому

    51:21 Sample Scenarios Typical Use Cases of REST/GraghQL/gRPC

  • @theworld5937
    @theworld5937 2 роки тому

    What beautiful slides

  • @les2997
    @les2997 4 роки тому

    Can you abort a GraphQL query?

    • @rumble1925
      @rumble1925 3 роки тому

      I think so. It's a regular network call so it should be possible to handle cancellations

  • @thomasczthomash1859
    @thomasczthomash1859 4 роки тому +5

    GraphQL is definitely not the new REST. REST is still the king. Long live REST.

  • @yegorzakharov8514
    @yegorzakharov8514 Рік тому

    I had involuntary ticks everytime he said "Kayshh" when reading "cache" xD

  • @moveaxebx
    @moveaxebx 4 роки тому

    How is GraphQL API? It's a query interface

  • @alexclark6777
    @alexclark6777 4 роки тому

    Okay but I'm still confused. Is this guy Dutch or Irish?

  • @TheVincent0268
    @TheVincent0268 4 роки тому +2

    just use all of them. Hourses for courses

    • @thomasczthomash1859
      @thomasczthomash1859 4 роки тому +1

      Horses 🐴

    • @TheVincent0268
      @TheVincent0268 4 роки тому +1

      @@thomasczthomash1859 o yes, ha ha, what a silly mistake. I will leave it, otherwise readers won't understand your comment :)

  • @fr3ddyfr3sh
    @fr3ddyfr3sh 3 роки тому +2

    Im still in in love with the power of wsdl (not it’s steep learning curve though). Grpc is really nice, super easy IDL. Never was a big fan of REST, because before openAPI it was a nightmare to do larger applications and doing refactorings.
    The hate for XML being noisy is 99% irrelevant, just use attributes instead of elements and you get the exact same noisiness like JSON.
    And XML supports comments, and you can describe your document’s structure with xsd. And that since it’s beginnings.
    Not a big fan of the namespaces for XML though, I just leave them away.
    They make sense for really special cases like xaml, html svg, webgl etc

  • @compartelo007
    @compartelo007 4 роки тому

    podías hablar más rápido por favor?

  • @RH-of5cr
    @RH-of5cr 4 роки тому

    Ksh-able

  • @igelineau
    @igelineau 2 роки тому

    is it NDC paying for bots in the comments ? very stange... I expect them on Crypto content, but not talks about API technologies!

  • @koronci
    @koronci 4 роки тому

    you have different types of kayshing :D ..brainfreeze..wait what...whaaaat

  • @anonymousrulz
    @anonymousrulz 4 роки тому +1

    00:32 gPRC! :o

  • @BryonLape
    @BryonLape 4 роки тому

    There are no new ideas.

  • @ArtemBayandin
    @ArtemBayandin 4 роки тому +2

    thanks for the topic, but ... this is a duplicate of your video posted 3 months ago: ua-cam.com/video/LIaekiT6Ehs/v-deo.html ...
    i got a bit anxious before reminded that i had already seen this video))
    nevertheless, keep going) nice videos, have dozens in my lists.

  • @kehaarable
    @kehaarable 4 роки тому

    omg, it was all fine until he tried to pronounce "caching" - he sounds Irish - why can't he pronounce that word?

  • @JTMoustache
    @JTMoustache 2 роки тому

    I desperately need to blow my nose

  • @jamesmccabe2286
    @jamesmccabe2286 3 роки тому +2

    Great talk! A lot of very useful stuff and it is really thoughts provoking.

  • @samanthaferguson6018
    @samanthaferguson6018 3 роки тому +7

    Finally some common sense on this topic ❤️