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

Sdílet
Vložit
  • čas přidán 27. 02. 2020
  • 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.com/
    ndc-london.com/
  • Věda a technologie

Komentáře • 101

  • @MartinThoma
    @MartinThoma Před 4 lety +107

    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 Před 4 lety +42

    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 Před 4 lety +10

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

    • @fullkickproductions7245
      @fullkickproductions7245 Před 2 lety

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

    • @1anre
      @1anre Před rokem

      @@dealloc *shiny new toolbox

    • @1anre
      @1anre Před rokem

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

    • @re1konn
      @re1konn Před rokem

      @@milfex-lostex3984 doom emacs :p Hi

  • @rauru8570
    @rauru8570 Před 4 lety +114

    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 Před 4 lety +4

      Lol exactly

    • @colinjohnson5515
      @colinjohnson5515 Před 4 lety +2

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

    • @PaulSebastianM
      @PaulSebastianM Před 4 lety +2

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

    • @mitchthepower
      @mitchthepower Před 3 lety +1

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

    • @rauru8570
      @rauru8570 Před 3 lety +2

      @@mitchthepower Our progress is measured in heartbeats

  • @scottamolinari
    @scottamolinari Před 4 lety +61

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

    • @AkosSzalay1988
      @AkosSzalay1988 Před 4 lety +10

      it varies between different accents

    • @arwahsapi
      @arwahsapi Před 4 lety +5

      Australian: kay-sh

    • @keja0
      @keja0 Před 4 lety +5

      @@BDnevernind Specifikayshing =))

    • @danielschmider5069
      @danielschmider5069 Před 4 lety +2

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

    • @colinjohnson5515
      @colinjohnson5515 Před 4 lety +1

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

  • @jamesmccabe2286
    @jamesmccabe2286 Před 3 lety +2

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

  • @onur7183
    @onur7183 Před 3 lety +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 Před rokem +1

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

  • @KamilSkalski
    @KamilSkalski Před 4 lety +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 Před 3 lety

      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

  • @jacquesduplessis6175
    @jacquesduplessis6175 Před 3 lety +1

    This is a good talk. Nicely balanced.

  • @parapadirapa
    @parapadirapa Před 3 lety +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

  • @GodOfMacro
    @GodOfMacro Před 4 lety +3

    what about datomic

  • @seff7183
    @seff7183 Před rokem +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 Před 4 lety +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.

  • @ArquimedesOfficial
    @ArquimedesOfficial Před rokem +3

    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 CZcams, Netflix, Amazon store...
    But the most important thing: All it depends of the bussiness needs, not your personal needs!

  • @falconeagle3655
    @falconeagle3655 Před 4 lety +4

    Good video.

  • @sariksiddiqui6059
    @sariksiddiqui6059 Před 3 lety +1

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

  • @MaheshKumar-lq1xm
    @MaheshKumar-lq1xm Před 3 lety +1

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

    • @DionV
      @DionV Před 2 lety

      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.

  • @user-yb4jd5jv2f
    @user-yb4jd5jv2f Před rokem

    Mature view on using different API approaches.

  • @stevepascoe
    @stevepascoe Před 4 lety +10

    Finally some common sense on this topic ❤️

  • @Christobanistan
    @Christobanistan Před 3 lety +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.

  • @Thrated
    @Thrated Před 3 lety +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 czcams.com/video/yLf0rIaRtRc/video.html (which is actually referenced in 18:01). But they complement each other nicely.

  • @theworld5937
    @theworld5937 Před 2 lety

    What beautiful slides

  • @les2997
    @les2997 Před 4 lety

    Can you abort a GraphQL query?

    • @rumble1925
      @rumble1925 Před 3 lety

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

  • @RogerValor
    @RogerValor Před 4 lety +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 Před 4 lety +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.

  • @alexclark6777
    @alexclark6777 Před 4 lety

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

  • @keja0
    @keja0 Před 4 lety +41

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

  • @YBWang-pi9qq
    @YBWang-pi9qq Před 3 lety

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

  • @moveaxebx
    @moveaxebx Před 4 lety

    How is GraphQL API? It's a query interface

  • @rafaelfreitas7080
    @rafaelfreitas7080 Před 4 lety +5

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

  • @yegorzakharov8514
    @yegorzakharov8514 Před rokem

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

  • @jonchicoine
    @jonchicoine Před 4 lety +18

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

    • @youtube.com-handle
      @youtube.com-handle Před 4 lety +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 Před 4 lety

      @@youtube.com-handle 👌👍

    • @PaulSebastianM
      @PaulSebastianM Před 4 lety +2

      Appli-kay-shin kay-shing. 😎

    • @bboy349833591
      @bboy349833591 Před 4 lety +1

      Since when is data pronounced as data. 🤪

    • @icodefor
      @icodefor Před 4 lety +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.

  • @TheVincent0268
    @TheVincent0268 Před 4 lety +2

    just use all of them. Hourses for courses

    • @thomasczthomash1859
      @thomasczthomash1859 Před 4 lety +1

      Horses 🐴

    • @TheVincent0268
      @TheVincent0268 Před 4 lety +1

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

  • @scottamolinari
    @scottamolinari Před 4 lety +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 Před 4 lety +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 Před 4 lety

      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 Před 4 lety +2

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

    • @scottamolinari
      @scottamolinari Před 4 lety

      @@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 Před 4 lety +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.

  • @MrChannell
    @MrChannell Před 4 lety +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 Před rokem

      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.

  • @archmad
    @archmad Před 2 lety +1

    these guys didnt know what will happen next month

  • @RH-of5cr
    @RH-of5cr Před 3 lety

    Ksh-able

  • @compartelo007
    @compartelo007 Před 4 lety

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

  • @koronci
    @koronci Před 3 lety

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

  • @ArtemBayandin
    @ArtemBayandin Před 4 lety +2

    thanks for the topic, but ... this is a duplicate of your video posted 3 months ago: czcams.com/video/LIaekiT6Ehs/video.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.

  • @thomasczthomash1859
    @thomasczthomash1859 Před 4 lety +5

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

  • @fr3ddyfr3sh
    @fr3ddyfr3sh Před 3 lety +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

  • @anonymousrulz
    @anonymousrulz Před 3 lety +1

    00:32 gPRC! :o

  • @BryonLape
    @BryonLape Před 4 lety

    There are no new ideas.

  • @igelineau
    @igelineau Před 2 lety

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

  • @JTMoustache
    @JTMoustache Před 2 lety

    I desperately need to blow my nose

  • @kehaarable
    @kehaarable Před 4 lety

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

  • @MrNorthCat
    @MrNorthCat Před 4 lety +9

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

  • @samanthaferguson6018
    @samanthaferguson6018 Před 3 lety +7

    Finally some common sense on this topic ❤️