<?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 Govind Shah on Medium]]></title>
        <description><![CDATA[Stories by Govind Shah on Medium]]></description>
        <link>https://medium.com/@gvndshah?source=rss-b2323336432e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*0CGeBykNsZ63GATt.</url>
            <title>Stories by Govind Shah on Medium</title>
            <link>https://medium.com/@gvndshah?source=rss-b2323336432e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 01:57:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@gvndshah/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[Programming at scale]]></title>
            <link>https://life.jupiter.money/programming-at-scale-d60232250439?source=rss-b2323336432e------2</link>
            <guid isPermaLink="false">https://medium.com/p/d60232250439</guid>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[scaleup]]></category>
            <dc:creator><![CDATA[Govind Shah]]></dc:creator>
            <pubDate>Wed, 13 Apr 2022 10:44:52 GMT</pubDate>
            <atom:updated>2022-05-04T08:13:24.628Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fWutoTMAzYK9PGDLhrW32A.png" /></figure><ul><li><a href="#ec73">Context</a></li><li><a href="#5cd2">Assumptions</a></li><li><a href="#167f">Pre-requisite Questions</a></li><li><a href="#5a77">Framework/technology choices</a><br>- <a href="#4fe3">Comparison</a><br>- <a href="#d063">Why? 🤔</a></li><li><a href="#f8e4">Coding Paradigms &amp; Patterns</a></li><li><a href="#daf2">TL;DR</a></li></ul><h3>Context</h3><p>Recently, Jupiter launched the engineering initiative for a Mutual Fund platform for its customers. This gave us the opportunity to re-evaluate the technologies Jupiter has been reliant on so far, and their performance at scale.</p><p>These are the major considerations to undertake -</p><ol><li>Framework/technology choices</li><li>Coding paradigms, patterns</li></ol><p>With each of the above legs, a re-evaluation was required to check how scalable the systems inherently are. This exercise also helped us in figuring out the limitations of our systems, and how well do they scale.</p><h3>Assumptions</h3><ol><li>The audience is aware about micro-service architecture, and the in-general benefits it provides over monolithic code.</li><li>The audience is working primarily with any one of the JVM Languages<a href="https://www.baeldung.com/jvm-languages">[link]</a></li></ol><h3>Pre-requisite Questions</h3><p>Along with the functional requirements, the following evaluations need to happen. <br>These cover both a) Team Evaluation, and b) Project Evaluation -</p><ol><li>What is the core expertise/knowledge base of the team? Which language/framework is the team familiar with?</li><li>Do we have enough people, with varied skills and expertise, to avoid an echo chamber?</li><li>How much time will it take for the team to ramp up on new frameworks/technologies?</li><li>What is the scale for which the system is being designed?</li><li>What is the timeline that product is envisioning? What are the rough timelines from the engineering POV [including tech evaluations, POCs and considerations]?</li></ol><p>Considering these questions before-hand will make sure that the project does not turn out to be a <a href="http://www.laputan.org/mud/">BigBallOfMud</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*RKEbvvcedgVj0P6OEKxOlg.png" /></figure><h3>Framework/technology choices</h3><p>Rome was not built in a day.</p><p>Here, we are also proposing two alternatives, and also using them in various services.</p><h3>Comparison</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1a16d081931cb946dece605349659f1b/href">https://medium.com/media/1a16d081931cb946dece605349659f1b/href</a></iframe><h3>Why? 🤔</h3><h4>Micronaut vs Spring-Boot</h4><p>Micronaut is designed natively for cloud services, does dependency injection at compile-time, and requires 50% less boot time and memory [as compared to spring-boot]<a href="https://www.baeldung.com/micronaut-vs-spring-boot">[link]</a></p><h4>Kotlin vs Java</h4><p>Kotlin requires fewer lines of code + easier to maintain and adopt + has good support<a href="https://medium.com/everything-full-stack/kotlin-for-backend-is-it-that-good-ba5bff277559">[link]</a><a href="https://sagaratechnology.medium.com/what-are-the-benefits-of-kotlin-d7fdcd1cfc0">[link]</a></p><h4>Feign vs Webflux vs Micronaut</h4><p>Feign doesn’t natively support reactive programming, and performs all API calls in a blocking manner. This results in the service being choked [running out of threads] in case of a downstream service timing out.</p><p>Webflux supports reactive out of the box, and has good integration with the OpenAPI generator, eliminating the need to write a lot of boiler plate code</p><p>Micronaut is designed for cloud services by default, and does not require any third-party API clients</p><h4>jOOQ, R2DBC and KMongo</h4><p>jOOQ R2DBC support makes sure that the DB i/o is non-blocking in nature<a href="https://blog.jooq.org/reactive-sql-with-jooq-3-15-and-r2dbc/">[link]</a></p><p>For MongoDB, KMongo<a href="https://litote.org/kmongo/">[link]</a> provides object-mapping out of the box, and type-safes the queries<a href="https://litote.org/kmongo/">[link]</a></p><h4>Schema Migration [TBD]</h4><p>MongoDB is a document DB, and doesn’t require schema migrations [there is no fixed schema that a collection adheres to]</p><p>In case of indexes and creation of new collections, Mongock<a href="https://github.com/mongock/mongock">[link]</a> is an option. Alternatively, we are also thinking of a lambda push for any ad-hoc changes.</p><h4>OpenAPI Generator</h4><p>OpenAPI generator saves the team from writing a lot of boiler plate code for the clients/models required for the service. <br>Unfortunately, Micronaut is not supported by the OpenAPI Generator at the moment (beta)<a href="https://openapi-generator.tech/docs/generators/java-micronaut-client/">[link]</a>. Therefore, for now, we are generating the OpenAPI YAML spec based on the micronaut annotations.<a href="https://micronaut-projects.github.io/micronaut-openapi/latest/guide/index.html">[link]</a></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4d7bb26297810f596010cbfc846a3a13/href">https://medium.com/media/4d7bb26297810f596010cbfc846a3a13/href</a></iframe><p>Gets converted to:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d61982fe9bb8b2d3fc408e6bf1882f2e/href">https://medium.com/media/d61982fe9bb8b2d3fc408e6bf1882f2e/href</a></iframe><h4>Postgres vs MongoDB</h4><p>Postgres is not a naturally shard-able database. It provides partitioning, which helps in keeping indexes smaller, and makes searches faster.</p><p>However<em>, with infinite scale, come infinite problems</em>. When the data bloats up to an extent where a single server can’t process it, even partitioning is difficult to handle.</p><p>NoSQL helps in horizontal scaling by making the tables naturally shard-able, by just defining a shard key. If the access patterns of an application are not too complex [i.e., it doesn’t require too many joins, or doesn’t depend on database triggers + transactions], document DBs provide faster key-value access, and are virtually infinitely scalable.</p><p>Other considered options: DynamoDB, ScyllaDB, Cassandra</p><h4>Cache</h4><p>Redis has primarily served as our time-tested caching layer, serving any subsequent and duplicate user queries from the cache layer itself.</p><p>With Mongo, we are planning to expand the use case to also act as our data store for some fast access data, and therefore, making the system less reliant on indexes.</p><p>For instance, we will be storing all user transaction IDs sorted by their timestamp in redis, such that slicing and dicing can happen on the cache data itself, and the DB need not be queried for each user request.</p><p>The DB will primarily serve one purpose — given a record ID, fetch the record details [be it for users, transactions, orders, etc]</p><h3>Coding Paradigms &amp; Patterns</h3><p>There are two things that can be primarily focused on -</p><ol><li>Algorithms</li><li>Access Patterns</li></ol><p>There are a lot of resources available for this part of the problem, and therefore I will just mention the key points to consider.</p><ol><li>Adhere to SOLID Principles <a href="https://www.baeldung.com/solid-principles">[link]</a></li><li>Avoid re-computing/re-fetching things that are already known. If data isn’t changing often, it can be cached at multiple places [client-side, CDN, server-side, DB fast access layer etc]</li><li>Avoid premature optimization <a href="https://www.toptal.com/freelance/curse-premature-optimization">[link]</a></li><li>Keep the over-all UX in mind</li></ol><h3>TL;DR</h3><ol><li>Project the user traffic on your systems, first. Analyse, that over the next 2 years, what is the expected traffic on your application, and try and provision for at least 10x of the same. [This can be a simple projection of the current traffic].</li><li>Based on the user traffic, try and figure out the bottle-necks. Is there a query which is taking too long to run, or using a lot of database compute? Can the query be optimised? Can the queryable parameters be indexed, if not already?</li><li>Understand the inherent limitations of your system. Is the code monolithic, or has any other single point of failure? Does the architecture have inherent limitations, like too many dependencies and blocking calls? How can this be re-architectured with minimal changes?</li><li>DO NOT refactor code unless absolutely required. Do not over-optimise, and avoid making the life of other engineers much more complicated in the project’s future.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d60232250439" width="1" height="1" alt=""><hr><p><a href="https://life.jupiter.money/programming-at-scale-d60232250439">Programming at scale</a> was originally published in <a href="https://life.jupiter.money/">life-at-jupiter</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>