<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Rithvik Ravilla on Medium]]></title>
        <description><![CDATA[Stories by Rithvik Ravilla on Medium]]></description>
        <link>https://medium.com/@rithvik.ravilla?source=rss-9a68527ba58a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Nr2Xj6lh2REyioTO</url>
            <title>Stories by Rithvik Ravilla on Medium</title>
            <link>https://medium.com/@rithvik.ravilla?source=rss-9a68527ba58a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 02:33:25 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rithvik.ravilla/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Choosing the Right API for you]]></title>
            <link>https://medium.com/spidernitt/choosing-the-right-api-for-you-6271784cdfc8?source=rss-9a68527ba58a------2</link>
            <guid isPermaLink="false">https://medium.com/p/6271784cdfc8</guid>
            <dc:creator><![CDATA[Rithvik Ravilla]]></dc:creator>
            <pubDate>Wed, 22 Feb 2023 12:25:25 GMT</pubDate>
            <atom:updated>2023-02-22T12:25:25.943Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4_dEtqgRF7aRm3k-ud6mWA.jpeg" /><figcaption>Types of APIs</figcaption></figure><p>Serving as the backbone of many software products such as operating systems and websites, the Application Programming Interface (API) plays a critical role in giving functionality to your most used applications. What exactly is an API you might ask? It is a set of protocols and definitions that enable multiple software and applications to interact with each other. They are an accessible way to extract and share data within and across organizations and platforms.</p><p>APIs are utilized whenever abstraction is required to better improve a product. Thus, they are found everywhere- from weather apps to even major digital wallets or UPIs. To better understand an API and its various applications, this article will take you through various web application APIs as follows:</p><ul><li>REST</li><li>GraphQL</li><li>gRPC</li></ul><p><strong>Rest API:</strong></p><p>When the term API comes up, the chances that the Representational State Transfer (REST) API first comes to most web developers’ minds are pretty high. This type of API was devised by Roy Fielding in 2000 which sends data to specific locations within a website through various types of requests.</p><p><strong>Requests and Endpoints:</strong></p><p>REST APIs use HTTP (Hyper Text Transfer Protocol) Requests sent through the web application URL to communicate between the server and the client. HTTP has various methods that are added on while sending a request that tell the server what the client needs and what it should do. The various HTTP methods include:</p><ul><li>GET: Read/Retrieve existing data</li><li>POST: Creating/Adding new data</li><li>PUT: Replacing existing data</li><li>PATCH: Updating data</li><li>DELETE: Deleting existing data</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6cjGAevnut9YuDmprV1Qmw.png" /><figcaption>Basic REST API Architecture</figcaption></figure><p>These requests need to have a specific location so that the API can tell the server when to return or modify data for the client. This can be achieved by defining various endpoints in the URL that tell the API what to do when the client makes a request. For example, let’s say you have a website <a href="http://www.example.com./">www.example.com.</a> We can then say that the URL can have an endpoint <a href="http://www.example.com/users">www.example.com/users</a> that returns data on all the people who have registered to the site.</p><p>With that being said, the REST API is actually a set of architectural constraints and not a single protocol or standard. This means that we can make the API in our way and if it follows a certain set of rules, we can call it a REST API.</p><p>With the API being lightweight, highly scalable, and its wide availability of support, REST APIs are truly an industry standard when it comes to web application APIs. It makes sense why the RESTful APIs are popular and is the most widely used API out of the three on this list.</p><p><strong>GraphQL API:</strong></p><p>Now we move on to another popular API, GraphQL. GraphQL is a query language for APIs that also fulfils requests using existing data.</p><p>Unlike the standard endpoints that make up a REST API, GraphQL only has a single endpoint (which is generally a POST method). In the context of a REST API, this would mean all the data and functionality would have to be served using this one endpoint. However, GraphQL eliminates this problem through its queries and mutations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oTYTlhO8knXYPcyND8lHNg.png" /><figcaption>GraphQL mutations and query</figcaption></figure><p><strong>Mutations and Queries:</strong></p><p>Unlike the endpoints found in the URL for REST, GraphQL uses <strong>Queries </strong>that define how much data is needed and what format the data has to be returned by the server by using a body. This way, only the required information gets sent back to the user. This also means a single query can return as little or as much information as required solving the issue of sending too much or too little data which is one of the major issues in REST API.</p><p>Since the endpoint is the same, that also means that the other HTTP methods (such as POST, PATCH, and DELETE ) need to change too. To fix this issue, GraphQL uses <strong>Mutations</strong> that have a separate body that defines what data will be sent off and how the data will be returned when the request is complete.</p><p>Unlike the rigid REST API architecture that operates more on the server side, GraphQL is a breath of fresh air that gives the client more power and flexibility with their requests. It lets clients query for large chunks of information with a single request all while being much faster and using less bandwidth as compared to a normal REST API but it is also important to note that it will still place a heavy load in on the server side.</p><p><strong>gRPC API: (Google Remote Procedure Call)</strong></p><p>Lastly, we have the gRPC API which is a modern open source high-performance Remote Procedure Call (RPC) framework that can run in any environment. It can efficiently connect services in and across data centers with pluggable support for load balancing, tracing, health checking, and authentication. It is also applicable in the last mile of distributed computing to connect devices, mobile applications, and browsers to backend services.</p><p>gRPC is generally used for distributed systems and uses HTTP 2.0 as its underlying transfer protocol and protocol buffers as its data format. Let’s take a minute to understand what all these terms mean.</p><p><strong>Components of gRPC:</strong></p><p><strong>HTTP/2 </strong>is a revised version of the standard HTTP protocol created in 2015. By using HTTP/2, a gRPC API can concurrently receive multiple requests for the same connection. This means that gRPC is well suited for applications that have real-time data transfer such as chat apps, live streaming etc.</p><p><strong>Protocol buffer </strong>or <strong>Protobuff </strong>is where you store data and function contracts as a proto file which acts as an intermediary contract for the client to call at any time. Generally, binary serialization(storing data in a stream of bytes) is used with these protobuffs which means they are more compact and faster to parse as compared to JSON(JavaScript Object Notation) or XML<strong>(</strong>eXtensible Markup Language).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/504/1*Wxbyq3GPdxXwlnE2N29cCg.png" /><figcaption>gRPC architecture example</figcaption></figure><p>With its use of emerging technologies to implement more efficient software, we can say that gRPC is a very high-end API that can be used in many different scenarios that involve live data streaming such as chat-apps and video streaming. While this API is very fast and efficient, its recent release means that it has less support and resources as compared to its REST and GraphQL.</p><p>Conclusion:</p><p>So the next time you’re trying to figure out the right API for your web project, ask yourself, “How big is my project? Is it worth setting up a certain API? Does it match my scaling needs?”and hopefully you’ll find the answer! Cheers!</p><p>Resources:</p><p><a href="https://www.redhat.com/en/topics/api/what-are-application-programming-interfaces">https://www.redhat.com/en/topics/api/what-are-application-programming-interfaces</a></p><p><a href="https://www.geeksforgeeks.org/rest-api-introduction/">https://www.geeksforgeeks.org/rest-api-introduction/</a></p><p><a href="https://graphql.org/">https://graphql.org/</a></p><p><a href="https://cloud.google.com/blog/products/api-management/understanding-grpc-openapi-and-rest-and-when-to-use-them">https://cloud.google.com/blog/products/api-management/understanding-grpc-openapi-and-rest-and-when-to-use-them</a></p><p><a href="https://grpc.io/">gRPC</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6271784cdfc8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/spidernitt/choosing-the-right-api-for-you-6271784cdfc8">Choosing the Right API for you</a> was originally published in <a href="https://medium.com/spidernitt">Spider R&amp;D</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>