<?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 Praveen Konduru on Medium]]></title>
        <description><![CDATA[Stories by Praveen Konduru on Medium]]></description>
        <link>https://medium.com/@praveen.konduru?source=rss-528d5915b7a3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*TB0D8AUHfedT6yvc.</url>
            <title>Stories by Praveen Konduru on Medium</title>
            <link>https://medium.com/@praveen.konduru?source=rss-528d5915b7a3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 19:51:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@praveen.konduru/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[BUILDING MICROSERVICES]]></title>
            <link>https://medium.com/@praveen.konduru/building-microservices-359e22ea7019?source=rss-528d5915b7a3------2</link>
            <guid isPermaLink="false">https://medium.com/p/359e22ea7019</guid>
            <dc:creator><![CDATA[Praveen Konduru]]></dc:creator>
            <pubDate>Sun, 31 May 2020 19:25:58 GMT</pubDate>
            <atom:updated>2020-05-31T19:33:05.476Z</atom:updated>
            <content:encoded><![CDATA[<p>This post is in continuation of MicroService&#39;s talk. If you have not read the previous one, I would recommend to please read that first. <a href="https://tinyurl.com/yaqoaejp">Part1</a></p><p>In this article, we will see how we can build microservices, design principles, ideas to build microservices.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*aJBmRA2m0MNqPdjk07ekiw.gif" /><figcaption>Microservices</figcaption></figure><p>The first big and complex task for the microservice adopters is identifying the service boundaries. Coming to a common agreement on the right slicing. From a management perspective how big the teams should be? Can one team build and maintain multiple services? If yes is that good practice? What are some of the guidelines?</p><p><strong>MicroService Design Principles:</strong></p><ul><li>Autonomous — A change to a microservice should not force others to change. Independently changeable, deployable, backward compatible.</li><li>Business Domain Centric</li><li>Resilient</li><li>Observable</li><li>Cohesive</li><li>self-contained</li></ul><p>In my opinion, the starting point should be identifying business domains for ex: I work for the automobile industry. Our portfolio deals with inventory Management Solutions. From a high-level business perspective, inventory management is one key area of the business. likewise, other areas are service, parts, accounting, CRM, aftermarket products, etc.,</p><p>In this article, we will take the Inventory Management domain and take an example of some applications which are in production today which are not built using a microservices architecture.</p><p>The starting point will be to start listing the functionality’s ex: Stocking In vehicles, Vehicle Search, Vehicle search with filters, Marketable vehicles on 3rdparty sites, Auctions, Appraisals, Reports, Import vehicles(From 3rd party feeds), Generating Buyers Guides, Manuals, Overlays, etc., Having an understanding of Domain-Driven Design will be beneficial.</p><p>You will continue further taking each of the high-level functionalities and further split it based on the workflows. During this process, you will arrive at a point to identify different microservices. Review the benefits of splitting it further, the principle is, each microservice should have high cohesion and the microservice should do only one thing well, It should only focus on one functionality. It&#39;s not always easy to draw the boundaries by functionality. You might have to model or identify services based on the existing DB schema, technical boundaries. In this process, you might identify a particular process only needs data, it does not write back so this can be extracted out and don&#39;t need to be part of the service which performs CRUD.</p><p>You should be open to change, fix any incorrect boundaries, and further split or combine. The next step will be identifying the internal and external interfaces of the services. At this point, you have identified your services and interfaces you start putting on the whiteboard and drawing the connectors between the services. By this, you identify the upstream and downstream systems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/672/1*ba-CPosLsrTmdYSfbtQSng.png" /></figure><p><em>— — — — — — — — — — -Image source Bing — — — — — — — — — —</em></p><p>Now you are at a decent point. At this time you have a good understanding and possibly services created. Now we need to understand the interaction between the services. Next, list out the know failures and unknown failures. More on these later.</p><p>Based on the above diagram, if you don&#39;t design properly you might end in a lot of unnecessary calls, which can essentially downgrade the performance. We need to decide how one service talks to another, synchronously or asynchronously?</p><p>A typical way to achieve synchronous communication between services is through Http. (Rest APIs). In this type of communication essentially service1 sends a request to sevice2 and waits for the response.</p><p>Asynchronous communication between services is done using message brokers, Enterprise service bus. In this type of communication, the services are decoupled. Services, post commands, or Events to the Messaging queues. Each service pulls messages out of the queues and writes the messages to the queue. The service creating the message is called the publisher and the service working on that message is called subscriber (Ex: Order service publishes “Order-Received” event. “Inventory-Service” watches for these events and updates the inventory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/490/1*P22I31CaLukW-xVGlNAHFQ.jpeg" /><figcaption>Image source Bing.</figcaption></figure><p>I think this is a good stop here. In the next posts, we will see</p><ul><li>Error Handling,</li><li>Logging</li><li>Caching</li><li>Hosting</li></ul><p>Thanks for reading!!.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=359e22ea7019" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Graph QL]]></title>
            <link>https://medium.com/@praveen.konduru/graph-ql-6d66056938ae?source=rss-528d5915b7a3------2</link>
            <guid isPermaLink="false">https://medium.com/p/6d66056938ae</guid>
            <dc:creator><![CDATA[Praveen Konduru]]></dc:creator>
            <pubDate>Sun, 03 May 2020 23:14:19 GMT</pubDate>
            <atom:updated>2020-05-30T18:02:50.048Z</atom:updated>
            <content:encoded><![CDATA[<h3>GraphQL</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/319/1*jeQdb3_VQ73ftiRlFz5clA.png" /></figure><p>GraphQL is another hot topic and hot technology today. In this post, I will try to cover all of the aspects. Hopefully, after reading this post, you will have a good understanding, and be ready to kick start with GraphQL in your next project.</p><p>I always believe when learning a new technology, we should start with what problem does it solve? rather than taking a first peek at the features list. On that note, let’s look into the problem it solves, then followed by how to get started with GraphQL.</p><p>In today’s world, the standard way of exchanging data or exposing data to clients is by using API’s, essentially REST-based API’s. In this post, I will not go into details of what Rest is, and its advantages, but only talk about the important aspects, which are relevant for the context.</p><p>In the context of REST, every data that is being exposed is viewed as a resource. Rest is based around a set of architectural constraints(Client-Server architecture, statelessness, cache-ability, uniform interface), and use standard HTTP verbs for communication between client and server. (users, books, authors, posts all these are examples of resources.)</p><ul><li>GET — To Get data</li><li>PUT — To update</li><li>POST — Create a new record</li><li>DELETE — Delete a record</li></ul><p>The API Developer exposes different endpoints on the server, for its clients pertaining to each HTTP Verb. So REST is very popular and has become a good fit for many applications.</p><blockquote><strong>So whats the problem with Rest Api’s?</strong></blockquote><p>By the nature of REST, each operation on a resource is a single endpoint. (get, put, post, delete) are four endpoints for one resource. With the increasing demand for targeting applications to different portable devices like mobile phones, this approach can be a problem, and will not give the best experience for users.</p><blockquote>“Mobile applications have lesser storage, not fast internet connections and most importantly you want to show only limited data in your views. For example a get request to user data will return all the data of the user. But in this case you may want to show only two or three pieces of information like name, email, and phone . In this case it is over-fetching of the data, which is clearly a problem for mobile devices. Like wise if the requested data has relationships it can get even worse. You have to make multiple requests(n+1) requests. Relational or hierarchical data resources suffer the most with rest apis style.”</blockquote><ul><li>Blogger<br> — Topics<br> — comments<br> — Likes<br> — Claps</li><li>author<br> — books<br> — published<br> — reviews<br> — ratings</li><li>Users Social Profile<br> — friends<br> — posts<br> — likes<br> — comments</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/931/1*xJJO2V7_kLXmPTrCKp7t3w.png" /><figcaption>The picture was taken from Bing</figcaption></figure><p>I hope, the problem is clear. So before jumping into GraphQL to see how it solves this problem, let’s see what are the possible solutions with Rest for these problems.</p><ul><li>Expose a query string parameter where the client can specify the fields using some delimiter</li><li>Links to navigate to the related information.</li><li>Create separate endpoints for mobile, web, etc.,</li><li>Come up with hybrid approaches and not following rest principles for rest APIs.</li></ul><p>To a certain extent, you might be able to solve the over-fetching problem, but this will not still solve the n+1 request’s problem. So essentially with any of these approaches, you are adding more complexity to the system and frequent changes to accommodate different requests, on top of it if you have multiple versions of the API’s it becomes really difficult.</p><blockquote>So lets think how to solve this problem? May be, take a break here and give a thought for couple of minutes and come back. Okay, so the good solution would be to give the power to client, to express the intent, and server fulfills the request.</blockquote><p>GraphQL solves this problem, by giving the power to the client to express what data he wants. GraphQL provides a declarative query language for APIs. Client express his intent using this declarative language and GraphQL server fulfills the request.</p><p>There is only one endpoint, so it solves the n+1 request’s problem. The client always makes one request with all the information he needs. Based on the server implementation, it might still be n+1 calls on the server to fulfill the data or fewer requests.</p><p>But from the client-side its only call. There’s only one endpoint on the server for read, update, delete as opposed to multiple endpoints in rest.</p><ul><li>GraphQL is not specific to any back-end or front end.</li><li>GraphQL is open-source software.</li><li>All major languages have GraphQL implementations.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P4F_FSlKocpXTVntptv-ow.png" /><figcaption>Image taken from Bing</figcaption></figure><p>with this understanding, lets now dive into specifics of GraphQL.</p><h4>Primary Components of GraphQL</h4><ul><li>GraphQL Server</li><li>GraphQL Client</li></ul><h4>Building Blocks of GraphQL Language</h4><ul><li>Schemas</li><li>Queries</li><li>Resolvers</li><li>DataTypes</li><li>Mutations</li><li>Subscriptions</li></ul><p>To start with, you will have to define your GraphQL schema. Schema is essentially modeled around your data graph. The API provider will define the schema. <em>“Yes there is a learning curve, you need to learn the GraphQL language”</em>. Each individual piece of information, the API exposes can be created as a GraphQL type.</p><p>Let’s see below how a simple GraphQ schema looks like. The below example shows a schema with two pieces of information users and posts. Users have posts showing one-to-many relationships. In real-world you expose all the fields on the user and person types just showing one field here.</p><p>! means mandatory. Now the next step is to create a Query.</p><pre>type User{<br>  name: String!<br>  posts:[Post]<br>}<br>type Post {<br>  title: String!<br>  author: User!<br>}</pre><pre>type query{<br>   getUsers():[User!]!</pre><pre>}</pre><p>So now we have defined a simple schema with two types, and a query to get user details. Now from the client, you can send the query and get the requested data in response. Resolvers are not shown in the above example, in the resolver you get the data from the database and assign data to your schema types.</p><p>Now the client will send queries to server like below.</p><pre>{<br>  getUsers{<br>    name<br>  }<br>}<br>-----<br>Another query could be request username and userposts<br>{<br>  getUsers{<br>    name<br>    posts<br>    {<br>      title<br>    }<br>  }<br>}</pre><p>Hope you are already seeing the power of GraphQL and liking it. Now based on the examples the above client has the authority to request what he wants. In the first example, only the name is returned, and in the second user, posts are also returned back.</p><p>In order to Update, Add, Delete, you will use Mutations. To add a new user, the client query will look like below shown. This is essentially a POST.</p><pre>mutation {<br>  createUser(name: &quot;Praveen&quot;) {<br>    name<br>  }<br>}</pre><ul><li>GraphQL also solves the problem of versioning, and you can add new types to your schema, and queries freely without needing to create another version.</li><li>You don’t need to create the documentation for your api contracts.</li><li>GraphQL has a built-in playground called Graphiql ( interactive playground) so you can quickly test and take the query from there and use in the client. You can also view the schema, queries, and docs.</li></ul><p>While you are excited about this, some things to keep in mind “ Great Power comes with Great Responsibility” You need to careful with queries and the nested level of data you are requesting. As an example requesting data like below will have an adverse effect and poor performance.</p><p>user<br> — Friends<br> — Friends<br> -Friends</p><p>There is no direct support for caching out of the box.</p><p>You need to think about how your authentications, would work with the GraphQL layer in between. Its ideal to have a nosql datastore like mongo if its a new application. But you can have your existing rest apis as data source for the GraphQL layer.</p><p><strong>Subscriptions: </strong><em>This is the powerful feature of GraphQL. Subscriptions provide real-time updates. You can subscribe to an event and the server automatically notifies you and pushes your new data. In order to achieve the same, you would have to do via web-sockets otherwise. This opens to a lot of opportunities to improve your UI; you can build self-updating UI widgets. ( ex project tracking dashboards, notifications, etc.,)</em></p><h4>So is it the best thing to move to GraphQL, Is it the future of API’s?</h4><p>Not necessarily, if your API’s serve simple data and clients are web applications Rest is still the best choice.</p><p>Hope this article helped you in gaining an understanding of GraphQL.</p><p>Thanks for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6d66056938ae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Micro Services]]></title>
            <link>https://medium.com/@praveen.konduru/micro-services-f913c6caa83c?source=rss-528d5915b7a3------2</link>
            <guid isPermaLink="false">https://medium.com/p/f913c6caa83c</guid>
            <category><![CDATA[microservices]]></category>
            <dc:creator><![CDATA[Praveen Konduru]]></dc:creator>
            <pubDate>Sun, 26 Apr 2020 17:18:38 GMT</pubDate>
            <atom:updated>2020-05-30T17:03:22.268Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article, I will try to uncover some of the aspects and myths of microservices.</p><p>In today’s world, microservices are the buzz word. Microservices architecture is gaining more popularity and adoption in the industry. <strong>“ But This is not a silver bullet”</strong>. Everything comes with a cost, engineers and architects need to consider this as a first step and be conscious about this.</p><h4>What is a Micro Service:</h4><ul><li>A service that is loosely coupled.</li><li>Scope and Boundaries are clearly defined.</li><li>Independently deploy-able</li><li>capable of maintaining its own datastore</li><li>work in isolation</li><li>providing a simple interface for external parties to communicate.</li></ul><h4>Need For Micro Services:</h4><p>The traditional software development for applications is a monolithic application style, Which is essentially including everything in one code base and you would have a database in the back. People in this industry for more than 10+ years have definitely seen this. Having 20 to 30 projects in one solution. When the solution is shipped all the functionality is put into a single process. The scaling of this is done by replicating this across multiple servers.</p><p><strong>Problems with Monolith Approach: </strong>Complexity grows, as your codebase increases, which causes a lot of side effects.</p><ul><li>Tight coupling between components.</li><li>Because of the complex nature of the system, it&#39;s not easy to release features or any changes quickly.</li><li>Quickly it creates the flux and dependency on SME’s for making even small changes. Long approval processes in place, and discussions for any small changes to application design.</li><li>We need to deploy software as a whole as part of each release, which has its own cost associated with it.</li></ul><figure><img alt="Monolith-App" src="https://cdn-images-1.medium.com/max/184/1*N3BZnsMgdBOOGfkIPt8sqw.gif" /><figcaption>Monolith</figcaption></figure><p>Microservices</p><figure><img alt="Small Independent Services" src="https://cdn-images-1.medium.com/max/344/1*HChDmaUFBcqct2QqcWRb0Q.gif" /></figure><p><strong>Does this mean Monoliths Are Bad?</strong></p><p>No, they are not bad, we have been developing applications in this style and are successfully running for more than two decades and this is not going away any time soon. But definitely not a good architecture style in today’s world where business needs are changing so frequently, a huge increase in application consumption demand for new features and rapidly growing applications, targeting different devices. This also poses a need to develop more applications around all the domains (Data-driven solutions, AI-based solutions, Reporting, Customer eccentric solutions, Integrations with common service providers, …).</p><p>In order to be able to cater to the business needs, and quick adoption leads to change in the thinking style of Developing software. <strong><em>We need to “Build loosely coupled systems”</em></strong></p><blockquote>If you are following along i am sure, some questions might already have sprouted in your mind . Is this practically possible for Enterprise scale applications and really reliable?</blockquote><p>As an example a customer buying a product on your website. Adding and removing several items from the shopping cart, trying to apply some discounts and discounts change frequently how would all this play when I start separating these as small subsystems. Or a transaction in a banking domain How do these systems coordinate consistently and leave the transaction atomic?</p><p>This is the reason why I called microservices are not a silver bullet. In this article, I will briefly touch upon all aspects and will provide detailed topics on all these topics in future posts.</p><h4>Advantages of Micro Services</h4><ul><li>small products, or components or modules not projects.</li><li>more authority on decisions around your service.</li><li>only deploy when needed, freely exist in isolation.</li><li>The service is only responsible to do one thing and only one thing correctly.</li></ul><h4>Micro Services Adoption Path:</h4><p>So considering the advantages of microservices architecture, if you jump start tearing systems without gaining a deep understanding of the overall ecosystem you will soon end up in chaos, and it will be a nightmare to manage all these small little pieces when put into action.</p><p>Usually, we start from the codebase trying to identify dependencies and trying to separate them and then build upon, but I think when you are planning to go as microservices you should start thinking from your infrastructure before you start from the codebase. A lot of automation needs to be in place and related infrastructure should be in place. <strong><em>“you cannot rely on your monolithic style of releasing the software possibly through some scripts or a build system which just publishes the artifact to a common location or a host”.</em></strong></p><ul><li>Automation Infrastructure in place.</li><li>CI-CD pipelines.</li></ul><h4>Familiarize with:</h4><ul><li>Thorough understanding of Domain-Driven Design</li><li>Cloud-based services and advantages (primarily auto-scaling, gateways, IAAS)</li><li>Containerization.</li><li>Decentralized data management strategies.</li><li>How to Build Event-Based systems.</li><li>CQRS</li><li>Efficient logging.</li></ul><p>Now we know what a microservice is, its also important to understand what good microservice should be capable of.</p><ul><li>These features are necessary for the big picture of the whole system.</li><li>A microservice should expose the ability to easily poll or check the status of the service, allowing the upstream systems to make decisions accordingly.</li><li>It should also employ defensive mechanisms like a Circuit breaker pattern in place, thereby not bringing down your downstream systems putting heavy load.</li><li>should support for A/B Testing (From the service perspective, the ability to coexist in different versions).</li><li>It should be backward compatible you should not break existing consumers with the next release.</li></ul><p>It&#39;s very important to build a system or use a service that should give a holistic view of the entire system and easily understand where the problem is. This is where most teams suffer trying to understand and fix the issue.</p><p>Also, it&#39;s very important to understand the organizational goals and road map and if it is aligned. Because this adoption is a journey and should be an evolving software rather next big release of your software or application.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f913c6caa83c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Javascript Closures Simplified]]></title>
            <link>https://medium.com/@praveen.konduru/javascript-closures-simplified-9ab0e76a5e03?source=rss-528d5915b7a3------2</link>
            <guid isPermaLink="false">https://medium.com/p/9ab0e76a5e03</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[closures-functions]]></category>
            <dc:creator><![CDATA[Praveen Konduru]]></dc:creator>
            <pubDate>Fri, 15 Mar 2019 22:52:04 GMT</pubDate>
            <atom:updated>2020-04-18T14:16:23.633Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>It’s a lot simpler than it sounds.</strong></p><p>This was one of the topics which were quite daunting. If you are one of those, or new to closures hopefully this article will help you. I will cover below things in this article.</p><p><strong>What are closures? </strong><br>I am from the c# background so this term was new to me. For people coming from OOPS background, if closures are confusing even after reading several times.<strong> “Closures are like static functions using static variables inside.”</strong></p><p>Closure simply means “<em>when the </em><strong><em>return type</em></strong><em> of a function</em><strong><em> “is a function”</em></strong><em>, the function will still have access to the variables declared in the </em><strong><em>outer/main function.</em></strong><em> Under normal circumstances, the output of a function(</em><strong><em>ex: value or object</em></strong><em>)will not have access to any state within the outer function, once the execution is completed. But with closures, the caller of the function can still access any state(variables) even after the function execution is completed. Before we understand more in detail, let&#39;s see below.</em></p><blockquote><strong>How to define a closure?</strong><br><em> </em>function MyCounter(){</blockquote><blockquote>var x=1;</blockquote><blockquote><em>function innerFunction(y)</em></blockquote><blockquote><em>{</em></blockquote><blockquote><em>x= x+1;</em></blockquote><blockquote><em>console.log(x+y);</em></blockquote><blockquote><em>}</em></blockquote><blockquote>return innerFunction;</blockquote><blockquote>}</blockquote><h4><a href="https://jsfiddle.net/#&amp;togetherjs=IrErnRRdHm"><em>https://jsfiddle.net/#&amp;togetherjs=IrErnRRdHm</em></a><em><br> var closureDemo = OuterFunction();<br> closureDemo(3); // output:5<br> closureDemo(3); // output:6<br> closureDemo(3); // output:7</em></h4><p>So whats happening here? The important thing to notice is MyCounter is a function, whose return value is another function. So what happens, is the reference of the function is returned to the caller and hence it has access to the var x which is defined in the MyCounter scope.</p><p><strong>Are these only available in Javascript.?</strong><br> These are available in c# and Java as well. We cannot directly return functions from within a function. Instead, we will return delegates or anonymous methods.<br> <br><strong>What&#39;s the catch with Closures?</strong><br> Now if i move the var x=1; outside of the function the results are still same. But now it is on global scope and we dont have control over it. Closures will give this benefit, acheving the same results but giving the caller complete control over this.<br> var x=1; <br> function OuterFunction()<br> { <br> function innerFunction(y)<br> { x= x+1; <br> console.log(x+y);<br> }<br> return innerFunction;<br> }<br> <a href="https://jsfiddle.net/#&amp;togetherjs=IrErnRRdHm">https://jsfiddle.net/#&amp;togetherjs=IrErnRRdHm</a><br> var closureDemo = OuterFunction();<br> closureDemo(3); // output:5<br> closureDemo(3); // output:6<br> closureDemo(3); // output:7<br> <br><strong>What are the advantages of closures?</strong><br>The advantage of closures in java script is it allows you to bind a variable to an execution context. <br>In general functions in java script run in the scope from where they are called not in the scope from where they are defined. Closures give you this advantage.</p><p><strong>What are the situations these can be useful?</strong><br>Closures can be useful when you want to check how many times a particular type of button is clicked.</p><p>How many times an image is clicked or like button is pressed for a particular item.</p><p>Items added to a shopping cart.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9ab0e76a5e03" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>