<?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 Niranjan Sathindran on Medium]]></title>
        <description><![CDATA[Stories by Niranjan Sathindran on Medium]]></description>
        <link>https://medium.com/@niranjan.cs?source=rss-3ba8320ee0c0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*hvgdXjdzFhyrs6pp</url>
            <title>Stories by Niranjan Sathindran on Medium</title>
            <link>https://medium.com/@niranjan.cs?source=rss-3ba8320ee0c0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 22:01:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@niranjan.cs/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[What is JSON API?]]></title>
            <link>https://medium.com/@niranjan.cs/what-is-json-api-3b824fba2788?source=rss-3ba8320ee0c0------2</link>
            <guid isPermaLink="false">https://medium.com/p/3b824fba2788</guid>
            <category><![CDATA[api]]></category>
            <category><![CDATA[json-api]]></category>
            <dc:creator><![CDATA[Niranjan Sathindran]]></dc:creator>
            <pubDate>Fri, 08 Nov 2019 13:51:31 GMT</pubDate>
            <atom:updated>2019-11-08T13:51:31.659Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>A brief post about what JSON API specification is. You can read about the complete specification <a href="https://jsonapi.org/format/">here</a>. Note: This article assumes reader has basic knowledge of REST APIs</blockquote><p>The fundamental difference with JSON APIs starts with the use of its own specific MIME Type — <a href="http://www.iana.org/assignments/media-types/application/vnd.api+json">application/vnd.api+jso</a>n— and I want to touch on another aspect here. When I started reading about JSON APIs, there was a lot of discussion titled “REST APIs Vs JSON APIs”. I find this rather odd. REST has a pretty broad definition. Really what’s fundamental to REST is the use of standard HTTP methods (not arbitrary ones like SOAP) on user defined resources. JSON APIs do not drift from this standard, in fact it mostly just adds the additional constraint of using this very specific MIME type identified above. This constrains the information interchange to follow a set standard.</p><p>With that covered, I want to discuss JSON APIs with what would be its potential use cases. JSON API targets cases where typical standard MIME type (think application/json) data exchange becomes too chatty. Lets talk about about that “chattiness” using an example here, and for simplicity I’ll use the same example used by jsonapi.org. Consider the example of a blog post site that displays a single article at a time, with links to next and previous articles of say the same author or a specific series. This page also displays comments from users on the article, and author information. If you were to write an API to return this info to cater specifically for this requirement, you would potentialy have a GET on a resource named /articles that returns a list of all articles, and another implementation of a GET on a resource named /articles/{id} and the payload for this second GET would look something like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/343a335f75324854f52785dd0a3cff90/href">https://medium.com/media/343a335f75324854f52785dd0a3cff90/href</a></iframe><p>I oversimplify the payload up here, but this can get pretty verbose pretty quickly. A massive article, 100s of comments, etc. And this is on a simple blog post example with nothing other than article, author and comments shown as entities. So you would never implement an API that looks like the above. You would potentially expose a number of resources — /articles/{id}, /author, /comment for example. And there would be a number of back and forth calls before you have everything you need to display your one blog post page. In other words, the information exchange very quickly becomes chatty, which is probably perfectly fine and that’s the intended implementation. But JSON APIs takes a different approach here.</p><p>Now, lets look at the example that jsonapi.org uses for this very same case.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/74bd2503d1a9e82b24570413b659e0c5/href">https://medium.com/media/74bd2503d1a9e82b24570413b659e0c5/href</a></iframe><p>The application/vnd.api+json mime type has a very specific structure to it. If you carefully observe, it is like data from different relational tables all jammed into a single payload. Think of this payload above as the result of a GET on a master resource called /articles. This is the one payload you need in order to get everything there is to get about all articles within the blog post repository (I know it souds crazy, I’ll get to it). I’ll discuss some highlights of this payload , but not get too much into the details:</p><ul><li>The links.self key above is a self link to the /articles resource.</li><li>data array is additional details about each article. The example payload above has only one article, but it can be any number.</li><li>data[0].relationships describes all relationships to the parent element described within data[0].</li><li>included array element then describes each of the entity described within the data array.</li></ul><p>A similar payload can be returned using a standard application/json MIME type as well. Then why use the JSON API specific MIME? The answer is, this MIME allows you to slice and dice the payload shown above (imagine details of a 1000 articles in that payload) using a parameterized HTTP request. You can even sort, paginate, create, update and delete resources, all using a single resource end point. Here’s an example of selective field retireval:</p><pre><strong>GET /articles?include=author&amp;fields[articles]=title,body&amp;fields[people]=name HTTP/1.1</strong> Accept: application/vnd.api+json</pre><p>In this example, all articles are being requested, and author is explicitly being included, and only the title attribute of article is being requested and only name attribute of people is being requested. You can also filter data using HTTP request parameters and creating endpoints within. To request a single article you would doGET /articles/{id} without separately implementing a resource endpoint for the same. Needless to say you can again sparse fieldsets, sort, etc.</p><p>I hope you enojyed reading this and understood the additional advantage that JSON APIs bring in certain situations!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3b824fba2788" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The “language” of confusion]]></title>
            <link>https://medium.com/@niranjan.cs/the-language-of-confusion-2f6cce146abc?source=rss-3ba8320ee0c0------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f6cce146abc</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Niranjan Sathindran]]></dc:creator>
            <pubDate>Wed, 06 Nov 2019 20:39:43 GMT</pubDate>
            <atom:updated>2019-11-07T18:26:49.563Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>The question of which programming language is the best to write APIs, microservices and modularized applications is everywhere. And the answer is far from obvious. In this post I try to talk a little about the history of languages and how we got to where we are now.</blockquote><p>Starting with the first programming language created by Ada Lovelace in 1883, languages has had quite a history. Although the credit for the first programming language is given to Ada Lovelace, it was not until 1957 that there was really a programming language that was actually usable and still well known — ForTran. The next big notable step is the advent of Pascal and C in the early 70s. “C” arguably the most influential language that pretty much acted as the inspiration towards the evolution of all programming languages known today — C++, Java, Python, Ruby, Perl, you-name-it.</p><p>Early 80s was the time of Objective programming languages and while scrpiting languages Python and Perl came into being in the late 80s and early 90s, it did not play a significant role at that time when it came to writing complex applications. Those were almost always tackled by the likes of C and C++. This did not change until 1996, when Java arrived. The arrival of Java combined with the explosive growth of the internet at that time guaranteed Java its long presence in the world of programming. Elegant object oriented programming, frameworks created to enable web development gave way to the rise of Java. After this point, from a web development standpoint it was not a question of language, but only which framework in Java — There were many changes and iterations on this through the last 2 decades, starting from JSP/Servlets and EJB to springboot today.</p><p>From JDK 1.0.2 release in February 1996, Java has enjoyed the position of being the master programming language for web development. But that has drastically changed. One of the biggest upsetter in my opnion of JDK’s mighty prominence is microservices and modularization. While Java is/was easily the goto language for building enterprise grade massive monolithic application that scales vertically on a heavy weight application server (think weblogic), many other languages were much better in acheiving a small application built for a very specific business purpose, including scripting languages like Lisp, Perl, Python, etc. This gave rose to numerous web frameworks that made writing a <em>Hello World!</em> app — whether exposing it as an HTTP endpoint or rendering it as an HTML webpage — a matter of a few lines of code. Take Python for example, this snippet of code runs a webserver exposing port 5000, with the root URI (localhost:5000) returning <em>Hello World!</em> 7 lines of code in a single file and that is all you need! No configuration, no build files. That’s powerful.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9cf423f7e5e2f1b0f4b0e5d208ca66a6/href">https://medium.com/media/9cf423f7e5e2f1b0f4b0e5d208ca66a6/href</a></iframe><p>A similar <em>Hello World</em> in Java legacy spring, JSF or other Java Web frameworks would involve a several files and directories, a maven or gradle build file, a separate web/application server that you deploy packaged code into and certainly more than 7 lines of code!</p><p>Back to Java, Spring Boot changed this situation again. Kind of. Spring boot does a lot to reduce boiler plate Java code and importantly provides a built-in tomcat runtime container that reduces the need of a separate web/application server. While it reduces boiler plate code to a minimum, it still does not bring in the simplicity of say Python, Ruby or Groovy to build and deploy simple small web applications. Now, with no clear leader for app development, you now have many many choices, and with choices, comes the burden of decision making. I’ll explore the differences in using various languages and popular frameworks with examples in a future post. Keep following!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f6cce146abc" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>