REST vs GraphQL | When to choose one over other | Tech Primers

Поділитися
Вставка
  • Опубліковано 5 вер 2024

КОМЕНТАРІ • 80

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

    ⏱Chapter Timestamps
    ====================
    0:00 - Intro
    0:23 - Agenda
    1:16 - Differences between REST and GraphQL
    1:44 - Practical example of GraphqQL
    5:07 - Practical example of REST
    6:20 - HTTP Methods
    8:16 - Overfetching/Underfetching
    9:57 - When to use GraphQL
    11:54 - Usecase - Messaging Application
    14:54 - Usecase - Ticket Booking Application
    18:31 - Summary

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

      I know im randomly asking but does any of you know a method to log back into an instagram account??
      I was dumb forgot my account password. I would love any tricks you can give me!

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

      @Franklin Rowan instablaster :)

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

      @Adrian Andres thanks for your reply. I found the site on google and im in the hacking process atm.
      Seems to take a while so I will reply here later with my results.

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

      @Adrian Andres It worked and I finally got access to my account again. I'm so happy!
      Thank you so much, you really help me out :D

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

      @Franklin Rowan Happy to help :D

  • @muks
    @muks 4 роки тому +29

    Very Interesting and useful. To summarize, can we safely say:
    GraphQL should be used when
    1. We need to provide the client with minimal data,
    2. Has need to know basis data requirement
    3. Multi tenant clients
    4. More front end centric apps like for e.g. mobile apps
    Rest should be used when
    1. It can co exist with GraphQL but mainly to be used for stronger backend services,
    2. No restriction in terms data flow and loading/unloading,
    3. Multi http protocol support is required,
    4. Huge no of backend services present in system design which needs to communication with each other,
    Please suggest,
    As usual Thanks for your efforts,

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

      Perfect. Thanks for summarizing Mukul. I’m going to pin this comment

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

      ​@@TechPrimers , for overfetching problem, we can use RestTemplates for REST API to fetch required data instead of loading all data

  • @AR-scorp
    @AR-scorp Рік тому +1

    Very good video. To the point. Great work.

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

    Man! you simplifies everything. Thank you for the video

  • @animeshvaibhav5392
    @animeshvaibhav5392 Рік тому +2

    Best explanation

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

    Great video. very easy to understand. The use cases really make the difference. Thanks for the effort

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

    Thanks for Video, its useful to understand when to use Rest or Graphql

  • @user-mf8hf4uk3h
    @user-mf8hf4uk3h 2 роки тому +1

    Great explanation.Thank you!

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

    Super simple. Well explained. Kudos

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

    Awesome video. Very informative

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

    Thanks for a wonderful video yet again. This helped me look at your earlier video on Spring Boot and GraphQL and gain some knowledge on it.

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

    GraphQL is handy way of reducing data over internet when clients interested in few fields. In past developer used json in built feature like serialize except these list of fields. For parsing query input RSQL, JAX-RS search.

  • @akshaykumar-bh4pr
    @akshaykumar-bh4pr 2 роки тому +1

    Great explanation 🔥👏🏻🙏🏼❤️

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

    Beautifully explained!

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

    Explained very well

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

    Interesting information about REST and GraphQl. Thanks

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

    Really nice explanation

  • @singh.karanbir
    @singh.karanbir 4 роки тому +2

    Thanks for the video

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

    Well explained 👍

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

    Awesome presentation 🙂

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

    Small correction: to create the country(resource), convention is to use POST (not PUT) and to update the existing country(resource) we can use PUT. I guess by mistake these got swapped in your explanation.

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

    Once again something useful and different 😊

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

    Too good

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

    Great explanation. 👌

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

    Thank you for your effort.
    Could you please explain API vs Webhook?

  • @7390-o8g
    @7390-o8g 3 роки тому +1

    so helpful!

  • @yogeshpatil-vx2pi
    @yogeshpatil-vx2pi 4 роки тому +1

    Great explanation as always ..😊 If u can make Video on Kafka Confluent and IBM MQ .. would be a great help ...Thanks for ur sharings 🙏🏻🙏🏻🤟🏻🤟🏻

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

    Thanks for the comparison ,great video!!
    Are you going to implement those use cases demo in the upcoming videos?

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

      I have already implemented them and explained them long back Asghar :). Check the description, I have linked those videos for reference.

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

      I will check thanks :)

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

    excellent video, very clear. few questions 1. is there a client on top of http client 2. isnt it better to just use gql as it can do what a rest could provide as well the benefits of gql, using both can be a overhead, 3. is there a different frame work for getting the backend to use gql . 4. how would the specification look like in case of gql

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

    Good job

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

    Very useful!! Just a small question please, do you think that there could be specific limitations on the info consumed via GraphQL?

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

      Yes. GraphQL solves a specific problem which is over fetching and under fetching. Also the request payload is specific to a schema and a format which is specific to GraphQL specification. In REST, most of the time, there are no request payloads while querying data. Even if it has, it will be in json or parameters

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

      Tech Primers Cool, Thanks!

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

    Interesting!

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

    I have a usecase where I need to get data from database (around 12 queries to be executed with complex joins and multiple tables) and this data need to be served into a dashboard. Each query result need to be displayed into the dashboard. What can be the best approach here. A single Graph QL API or multiple Rest endpoints. I need to save database calls by caching as well.

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

    How will GraphQL facilitates for multiple versions of API for mobile apps ? How can you support multiple schemas for different version of apps at same time ?

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

      As a best practice, GraphQL goes against the versioning for API because it controls the schema inside the API, so you can add a different nested schema for that API and make it behave like a versions schema

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

    Have doubt! Cant we acheive graphql capability thru a req body with post verb in rest style ?

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

      Yes you can. Infant GraphQL is a better REST. Facebook created graphql due to overfetching of data in mobile devices and had to standardise their APIs across mobile and web

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

    I love you!

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

    [GET] Rest API with payload would looks similar to GraphQL ?

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

    From this video I understood that graphql is ideally fit for BFF (back end for front end design Pattern). Is my understanding correct?

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

      Yes. let’s also take the example of Github. They expose GraphQL APIs so that developers can create any kind of application or cli over GitHub APIs. The developers can choose what data they need based on the graph based schema definition by GitHub

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

      I have been using GQL for about 8 months. UI loves GQL. Because you only get what you ask for the payload is very efficient. You remove all ambiguity from POST/GET requests. And you can combine multiple requests into 1 http request, so you dont need to chain http calls to load data

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

      @@glimpsee7941 nice to know! Since I lacked knowledge around what ecosystem GQL requires, I was still thinking if leveraged the tuned architectural design for REST APIs, there may not have any under/over fetch results.
      But your experience around - combine multiple requests into 1 http request, show cases GQL is quite versatile.
      Thank you!!

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

    Hey bro, any example for Spring boot batch processing with resttemplate.

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

    Reminds me of elasticsearch queries

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

    Thanks for the video..
    What tools are you using for these drawings?

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

      Just the basics Vishnu - Google Slides

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

    How to find API's Prefect Suitable for Client Requirement

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

    Supper

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

    Rest is Archiectural Style vs GraphQL borh are represent the Data. As Java prespectve we use RestAPI to expose defferent type of media formats.But GraphQL does not. Thanks.

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

      What unsupported media type are you specially looking for?
      Since both use HTTP they both use media types

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

    Thanks, what's the best step to learn GraphQL

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

      Trying hands on is the best option. Check my spring boot video on graphql, that’s a great start. Check the description for those links

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

    Is file upload possible in GraphQL?

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

      Yes Dhilip. Since GraphQL also follows HTTP protocol, you can leverage multipart content type to upload files like we do with REST

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

      @@TechPrimers Cool.. I agree on your point that GraphQL is not a complete replacement for REST. No other video made this point clear. Thanks for the video :)

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

      Cheers

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

    Good explanation even though it seems very fast ...

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

      You can slow down the video anytime by 0.5x or 0.75x :)

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

      @@TechPrimers :) do i share my resume ? Ability to work on Java and GraphQL

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

      I also work in a company buddy. TechPrimers is a hobby 🤓

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

    Your intro video remind me something #MKBHD?

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

      Dude his videos are insanely awesome and of great quality. Mine is nothing.