<?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 Vimal on Medium]]></title>
        <description><![CDATA[Stories by Vimal on Medium]]></description>
        <link>https://medium.com/@vimal.software.engineer?source=rss-b1e5ed0bff8b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*USg1p38LZl9RHgnT</url>
            <title>Stories by Vimal on Medium</title>
            <link>https://medium.com/@vimal.software.engineer?source=rss-b1e5ed0bff8b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 09:15:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vimal.software.engineer/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[Simple and Super Trick in Git for Monolith App, Shared Repo, Open source, Sensitive repositories]]></title>
            <link>https://medium.com/@vimal.software.engineer/simple-and-super-trick-in-git-for-monolith-app-shared-repo-open-source-sensitive-repositories-3d2e7fe76f57?source=rss-b1e5ed0bff8b------2</link>
            <guid isPermaLink="false">https://medium.com/p/3d2e7fe76f57</guid>
            <category><![CDATA[development]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[Vimal]]></dc:creator>
            <pubDate>Fri, 16 Feb 2024 10:47:52 GMT</pubDate>
            <atom:updated>2024-02-17T03:48:32.537Z</atom:updated>
            <content:encoded><![CDATA[<p>Many devs are pretty happy after the arrival of microservice architecture design. It helps dev team to manage their own repository with complete ownership and freedom.</p><p>However, in real world, there are still a few repositories which are common for devs across organisation.</p><p>Eg :</p><ol><li>common services/libraries repositories</li><li>IaaC (infrastructure as code) repositories. Eg : Terraform repository to build rabbitMQ for the organization.</li></ol><p>There might be teams responsible for managing such common repositories. Eg : An infrastructure team for managing IaaC repositories , and a core dev team to manage common service/libraries, and so on.</p><p>Booom.. Here comes a situation where we need a repository which has to owned by two or more teams but not everyone in the organisation. This situation will arise when people have the idea to build monolithic/open source/shared repositories.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*phj6fOTXU1HiOmJc1C_3kA.png" /></figure><p>Here is a case study :</p><p>Consider the following repository structure and changes are contributed by developers from 4 teams such as checkout team, invoice team, notification team and payment team.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*svlYyz3m2mhbhjBiExumSg.png" /><figcaption>Repo 1 : ECommerce is the project name</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/1*MjHa4j9zvTK5am4VLIjFtA.png" /><figcaption>Repo 2 : RabbitMQ Terraform for different teams</figcaption></figure><p>If we provide the write and code ownership access to all these 4 dev teams, then it opens a door to risk..</p><p>In the above example, we have 1 repo for all the teams such as checkout team, invoice team, notification team and payment team. A pull request on payment folder should be approved by a member from payment team and not from any other teams. Similarly, checkout team’s change on “checkout” folder must be approved and reviewed by check team, and so on.</p><p>Lets see a threat since we have one repo shared for everyone : What if a terraform rabbit-mq change in checkout folder deleted by some other dev team accidentally?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*u9Loejm6kJPltvZKKeQVAg.png" /></figure><p>No worries. Git has come up with the idea for code ownership on file level against team or individual level.</p><p>Here is the steps to follow :</p><ol><li>Create git teams <a href="https://github.com/team">https://github.com/team</a></li><li>Create a file named <a href="https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners#codeowners-and-forks">CODEOWNERS</a> in the root of your repo. The <a href="https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners#codeowners-and-forks">CODEOWNERS</a> file can mention filename/package name and its owner</li><li>Apply merge approval required by code owner option in git settings for merge pull request.</li></ol><p>Eg :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u1ELxqMm0ssSzTabz0SuBA.png" /></figure><p>note : replace <em>org-name</em> with your organisation name showing in git.</p><p>After this change, only respective team can approve and secure their files. Meaning, a file change in payment package can only be reviewed and merged by a member from payment team.</p><p>Note : we can assign git ownership at file and individual user level.</p><p>Copying the git documentation : <a href="https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners#example-of-a-codeowners-file">https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners#example-of-a-codeowners-file</a></p><pre># This is a comment.<br># Each line is a file pattern followed by one or more owners.<br><br># These owners will be the default owners for everything in<br># the repo. Unless a later match takes precedence,<br># @global-owner1 and @global-owner2 will be requested for<br># review when someone opens a pull request.<br>*       @global-owner1 @global-owner2<br><br># Order is important; the last matching pattern takes the most<br># precedence. When someone opens a pull request that only<br># modifies JS files, only @js-owner and not the global<br># owner(s) will be requested for a review.<br>*.js    @js-owner #This is an inline comment.<br><br># You can also use email addresses if you prefer. They&#39;ll be<br># used to look up users just like we do for commit author<br># emails.<br>*.go docs@example.com<br><br># Teams can be specified as code owners as well. Teams should<br># be identified in the format @org/team-name. Teams must have<br># explicit write access to the repository. In this example,<br># the octocats team in the octo-org organization owns all .txt files.<br>*.txt @octo-org/octocats<br><br># In this example, @doctocat owns any files in the build/logs<br># directory at the root of the repository and any of its<br># subdirectories.<br>/build/logs/ @doctocat<br><br># The `docs/*` pattern will match files like<br># `docs/getting-started.md` but not further nested files like<br># `docs/build-app/troubleshooting.md`.<br>docs/*  docs@example.com<br><br># In this example, @octocat owns any file in an apps directory<br># anywhere in your repository.<br>apps/ @octocat<br><br># In this example, @doctocat owns any file in the `/docs`<br># directory in the root of your repository and any of its<br># subdirectories.<br>/docs/ @doctocat<br><br># In this example, any change inside the `/scripts` directory<br># will require approval from @doctocat or @octocat.<br>/scripts/ @doctocat @octocat<br><br># In this example, @octocat owns any file in a `/logs` directory such as<br># `/build/logs`, `/scripts/logs`, and `/deeply/nested/logs`. Any changes<br># in a `/logs` directory will require approval from @octocat.<br>**/logs @octocat<br><br># In this example, @octocat owns any file in the `/apps`<br># directory in the root of your repository except for the `/apps/github`<br># subdirectory, as its owners are left empty.<br>/apps/ @octocat<br>/apps/github<br><br># In this example, @octocat owns any file in the `/apps`<br># directory in the root of your repository except for the `/apps/github`<br># subdirectory, as this subdirectory has its own owner @doctocat<br>/apps/ @octocat<br>/apps/github @doctocat</pre><p>More detailed</p><p><a href="https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners#codeowners-file-location">About code owners - GitHub Docs</a></p><h3>Conclusion</h3><p>Git allow code ownership at different levels. This helps to secure code reviews and code merge especially for monolith , open source or shared repositories</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d2e7fe76f57" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Loosely Coupled Microservice Design by Event Driven Architecture (EDA) — AWS Event Bridge and…]]></title>
            <link>https://medium.com/@vimal.software.engineer/loosely-coupled-microservice-design-by-event-driven-architecture-eda-aws-event-bridge-and-e895c699c881?source=rss-b1e5ed0bff8b------2</link>
            <guid isPermaLink="false">https://medium.com/p/e895c699c881</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[design-patterns]]></category>
            <dc:creator><![CDATA[Vimal]]></dc:creator>
            <pubDate>Fri, 31 Mar 2023 18:23:29 GMT</pubDate>
            <atom:updated>2023-04-03T14:06:58.121Z</atom:updated>
            <content:encoded><![CDATA[<h3>Loosely Coupled Microservice Design by Event Driven Architecture (EDA) — AWS Event Bridge and Workflow Studio</h3><p>Think of a typical travel booking or E-Commerce application.. What happens when you completed a purchase ?</p><ul><li>The customer has to get a confirmation notification as Email/ SMS/ Mobile app messages.</li><li>The amount should be charged from customer</li><li>The customer care systems has to be aware about the transaction.</li><li>The purchase data send to reporting system for analytical purpose</li><li>so on…..</li></ul><p>It will be like the below image :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m2t9hmCO_D4JrCtTJEFMcw.png" /></figure><p>Basically, when the BOOKING EVENT happened, the other events like send email, notify customer care, prepare reports etc subsequently occurs.</p><p>This belongs to the world of Event Driven Architecture (EDA). In simple term “When an event happened, a set of operations should be done”.</p><p>Imagine, the above diagram depicts different microservices . Then it will be something like as follows :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OO-eNOP2HmjvmHmw0DiI3w.png" /></figure><p>Alight. Now we have a set of microservices. What should be the integration pattern?</p><p>Should it be REST API Way?</p><p>NO !!!</p><p>Why ? Calling multiple microservices synchronously results highly coupled environment. There is no point of immediately notifying customer-operation-service, notify-services, payment-service (imagine payment happens after purchase confirmation), analysis-service as per this usecase. The down time of any of these microservice will impact the booking service. Hence, we forced to bring more resiliency (circuit breakers) over here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lfOp-pk2j1Btb6uaInUUuQ.png" /></figure><p>Let’s think of message distribution approach (RabbitMQ, AWS Kinesis stream ).</p><p>The great advantages with message distributions approach design is that booking-service is not tightly coupled with any other microservices. The downtime of any dependent microservices wont make an impact over booking-services. The recovery mechanisms can easily developed on a distributed message system too if something went wrong on a consumer. Example: notification-service is down. In this case data in the notification queue will be persisted and also can take backup to another hardware if needed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IBYCNoq6X_LHoJw2N051aw.png" /></figure><p>Are we done??? NO!!!! Why? The above design is a loosely coupled system. But, is it a SaaS model? Consider the following usecases on a purchase:</p><ul><li>Notify applications like Salesforce for Customer Care</li><li>Notify applications like Datadog, PagerDuty, etc for monitoring</li><li>Notify any other standard applications like ServiceNow</li><li>Notify one of your parter / third party / vendor systems via service call</li><li>A SaaS model purchase (ie, booking service should be SaaS)</li></ul><p>In the above usecases, a distribution system (example RabbitMQ, Kinesis) wont be a fully fit. Because we have to create dedicated consumer microservice for fulfilling these needs.</p><p>All these above usecases can be tackled with following technologies</p><ol><li>AWS Event Bridge</li><li>AWS Workflow Studio</li></ol><h3><strong>AWS Event Bridge</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rD63NzAZOSJO4BpFsiXPxQ.png" /></figure><p>AWS Event Bridge (EB) is a modern way design for SaaS model, Mircoservice, Cloud related solutions. EB can be easily integrated with any existing API, SQS (AWS Queue), SaaS softwares. Also, EB takes all the resiliency concepts. Hence, developers’ life become very happy.</p><p>Onboarding/attaching a new or existing client(consumer or producer) to EB is just like adding a new configuration.</p><p>Many of Post Booking/Purchase Actions can be solved by AWS Event Bridge as per the AWS Documentations. The following are some of the useful links.</p><ul><li><a href="https://aws.amazon.com/event-driven-architecture/">https://aws.amazon.com/event-driven-architecture/</a></li><li><a href="https://www.redhat.com/en/topics/integration/what-is-event-driven-architecture">https://www.redhat.com/en/topics/integration/what-is-event-driven-architecture</a></li><li><a href="https://aws.amazon.com/eventbridge/">https://aws.amazon.com/eventbridge/</a> — What , Why and How</li><li><a href="https://aws.amazon.com/eventbridge/integrations/">https://aws.amazon.com/eventbridge/integrations/</a> — SaaS connect</li><li><a href="https://www.fourtheorem.com/blog/what-can-you-do-with-eventbridge">https://www.fourtheorem.com/blog/what-can-you-do-with-eventbridge</a></li></ul><h4><strong>I will write story on AWS Workflow Studio in my next blog</strong></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e895c699c881" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tips to accelerate development if your team building a lot of Microservices]]></title>
            <link>https://medium.com/@vimal.software.engineer/tips-to-accelerate-development-if-your-team-building-a-lot-of-microservices-b0dd2fb149c6?source=rss-b1e5ed0bff8b------2</link>
            <guid isPermaLink="false">https://medium.com/p/b0dd2fb149c6</guid>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[maven]]></category>
            <dc:creator><![CDATA[Vimal]]></dc:creator>
            <pubDate>Sat, 09 Jul 2022 18:52:51 GMT</pubDate>
            <atom:updated>2022-07-15T17:06:44.445Z</atom:updated>
            <content:encoded><![CDATA[<p>We are in the era of microservice based applications. It is a common usecases that a development team building multiple microservices having similar structure.</p><p>Imagine a scenario that you need to develop 4 microservices for your application. All these 4 services should have spring web security, logging , service discovery, dockerized, helm deployment, acceptance test, and so on. Your organisation may have shared libraries too and mandating to have those libs in your services. What should be the design comes to your mind to quick start development those 4 microservices ???? Are you thinking of creating one service and copy paste the code to another services? Are you thinking of duplicating code for each services??? Well, there is an easy solution for handling such scenarios. All you need is do develop a template and build your microservices from it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*auQcj3S0TTunbBCDaVSJXw.png" /></figure><p>Now, I am going to rephrase the term template as <strong>archetype</strong>.</p><p>Let’s see how a maven archetype helps to solve the problem. Maven Archetype is an abstraction of any project. Creating Maven Archetype is a very simple task. You just create a project structure (prototype), package and share it. This packaged item is called archetype and anyone can create a an application from this archetype.</p><p>Let’s learn with an example.</p><h4><strong>Step 1 : Create your prototype .</strong></h4><p>See the following example. Let’s imagine your intension is to create a microservice with a default REST API, Web Security, common libraries in pom.xml , configurations in application.yaml files, Dockerfile, Helm charts, a readme , sample test cases, and gitignore file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/1*EuPyCBtp7PgvQYNIR1jRjg.png" /></figure><h4><strong>Step 2: Create your custom archetype.</strong></h4><p>Create a plain mvn project and add <strong><em>org.apache.maven.archetype</em></strong> build extension. See the example.</p><pre>&lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot;<br>         xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;<br>         xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&gt;<br>    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;<br><br>    &lt;groupId&gt;com.my-org&lt;/groupId&gt;<br>    &lt;artifactId&gt;my-org-archetype&lt;/artifactId&gt;<br>    &lt;version&gt;1.0.0&lt;/version&gt;<br>    &lt;name&gt;My Organization Custom Maven Archetype&lt;/name&gt;<br>    &lt;packaging&gt;maven-archetype&lt;/packaging&gt;<br><br>    &lt;properties&gt;<br>        &lt;maven.compiler.source&gt;11&lt;/maven.compiler.source&gt;<br>        &lt;maven.compiler.target&gt;11&lt;/maven.compiler.target&gt;<br>        &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;<br>        &lt;project.reporting.outputEncoding&gt;UTF-8&lt;/project.reporting.outputEncoding&gt;<br>        &lt;archetype-packaging.version&gt;3.1.2&lt;/archetype-packaging.version&gt;<br>    &lt;/properties&gt;<br><br>  <strong>  &lt;build&gt;<br>        &lt;extensions&gt;<br>            &lt;extension&gt;<br>                &lt;groupId&gt;org.apache.maven.archetype&lt;/groupId&gt;<br>                &lt;artifactId&gt;archetype-packaging&lt;/artifactId&gt;<br>                &lt;version&gt;${archetype-packaging.version}&lt;/version&gt;<br>            &lt;/extension&gt;<br>        &lt;/extensions&gt;<br>    &lt;/build&gt;</strong><br>&lt;/project&gt;</pre><h4><strong>Step 3: Create the following folders and files in the custom archetype</strong></h4><ul><li>src/main/resources/archetype-resources</li><li>src/main/resources/META-INF</li><li>src/main/resources/META-INF/maven</li><li>src/main/resources/META-INF/maven/archetype-metadata.xml</li><li>src/main/resources/META-INF/maven/archetype-post-generate.groovy</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/918/1*J9B3iG0tRtEge5eaoI1v2Q.png" /></figure><h4><strong>Step 4 : Copy your prototype application files into archetype.</strong></h4><p>Next step is to copy prototype application files to the archetype-resources folder of the custom archetype project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1022/1*ULSoVjHFK-pH8Hkug8Ommw.png" /></figure><p>You can add any number of files to your archetype-resources. But, you need to mention what all files to be selected for the output project in <strong>archetype-metadata.xml</strong>.</p><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br>&lt;archetype-descriptor<br>        xsi:schemaLocation=&quot;http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0<br>        http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd&quot;<br>        xmlns=&quot;http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0&quot;<br>        xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;<br>        name=&quot;my-org-maven-archetype&quot;&gt;<br>    &lt;fileSets&gt;<br>        &lt;fileSet filtered=&quot;true&quot; packaged=&quot;true&quot; encoding=&quot;UTF-8&quot;&gt;<br>            &lt;directory&gt;src/main/java&lt;/directory&gt;<br>        &lt;/fileSet&gt;<br>        &lt;fileSet filtered=&quot;true&quot; packaged=&quot;true&quot; encoding=&quot;UTF-8&quot;&gt;<br>            &lt;directory&gt;src/test/java&lt;/directory&gt;<br>        &lt;/fileSet&gt;<br>        &lt;fileSet filtered=&quot;true&quot; encoding=&quot;UTF-8&quot;&gt;<br>            &lt;directory&gt;src/main/resources&lt;/directory&gt;<br>        &lt;/fileSet&gt;<br>        &lt;fileSet filtered=&quot;true&quot; encoding=&quot;UTF-8&quot;&gt;<br>            &lt;directory&gt;helm&lt;/directory&gt;<br>        &lt;/fileSet&gt;<br>        &lt;fileSet filtered=&quot;true&quot; encoding=&quot;UTF-8&quot;&gt;<br>            &lt;directory&gt;&lt;/directory&gt;<br>            &lt;includes&gt;<br>                &lt;include&gt;.gitignore&lt;/include&gt;<br>                &lt;include&gt;HELP.md&lt;/include&gt;<br>                &lt;include&gt;Dockerfile&lt;/include&gt;<br>                &lt;include&gt;initial-script.sh&lt;/include&gt;<br>                &lt;include&gt;pom.xml&lt;/include&gt;<br>            &lt;/includes&gt;<br>        &lt;/fileSet&gt;<br>    &lt;/fileSets&gt;<br>&lt;/archetype-descriptor&gt;</pre><p>Now do <strong><em>mvn clean install </em></strong>for your custom archetype project. You will be seeing the followings log in the build.</p><p><em>maven-archetype-plugin:3.2.1:update-local-catalog (default-update-local-catalog) @ my-org-archetype — -</em></p><h4><strong>Step 5 : Create a your application from archetype</strong></h4><p>Use <em>mvn archetype:generate</em> command to create desired application from your template.</p><pre>mvn archetype:generate \<br>  -DarchetypeGroupId=com.my-org \<br>  -DarchetypeArtifactId=my-org-archetype \<br>  -DarchetypeVersion=1.0.0 \<br>  -DgroupId={your-group-id} \<br>  -DartifactId={your-artifact-id} \<br>  -DinteractiveMode=false</pre><p>See an example of creating a service from the custom archetype.</p><pre>mvn archetype:generate \<br>  -DarchetypeGroupId=com.my-org \<br>  -DarchetypeArtifactId=my-org-archetype \<br>  -DarchetypeVersion=1.0.0 \<br>  -DgroupId=com.sample \<br>  -DartifactId=new-microservice-one \<br>  -DinteractiveMode=false</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rw7bbN4jWFRc4dKZDhBFlw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ei5MI-q7HmAO_4sGunOktg.png" /></figure><p><strong>Yes… That’s it. You done it!!!.</strong> This will accelerate the development speed of your project execution.</p><p>Additional Note : If you wish to execute any groovy scripts immediately after the generation of new project, then it can be done by writing the script in src/main/resources/META-INF/maven/archetype-post-generate.groovy file.</p><h3>Conclusion</h3><p>Maven Archetype is an amazing method to create template of a project. This template can accelerate the development speed of your project execution.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b0dd2fb149c6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HTTPie speaks better than cURL]]></title>
            <link>https://medium.com/@vimal.software.engineer/httpie-speaks-better-than-curl-259042f97781?source=rss-b1e5ed0bff8b------2</link>
            <guid isPermaLink="false">https://medium.com/p/259042f97781</guid>
            <category><![CDATA[curl]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[httpie]]></category>
            <category><![CDATA[web-services]]></category>
            <dc:creator><![CDATA[Vimal]]></dc:creator>
            <pubDate>Fri, 01 Jul 2022 19:13:35 GMT</pubDate>
            <atom:updated>2022-07-01T19:17:56.576Z</atom:updated>
            <content:encoded><![CDATA[<h3>HTTPie speaks better than cURL on Web Service API</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/978/1*dWrqLU8h-4ej5qtws_-wQw.png" /></figure><p>Before starts, for your info : We are focusing only on HTTP and HTTPS protocols in this article.</p><h3><strong>cURL</strong></h3><p>cURL aka <em>Client URL </em>is very popular and widely using command line tool to handle scenarios like Consume a web server API (HTTP , HTTPS) , Transfer files to a server (FTP, SFTP, TFTP, FILE), Read emails from a server (IMAP , POP3, SMTP), Login to server (TELNET) and Access informations from a server directories (LDAP) . Thats pretty long long lists…</p><p>Lets see some examples of cURL command :</p><pre>GET :<br>curl <a href="http://localhost:3000/data">http://localhost:8080/my-app/search/?place=abc&amp;limit=10</a></pre><pre>POST : <br>curl -d &quot;username=john&amp;password=xyz&quot; -X POST <a href="http://localhost:3000/data">http://localhost:8080/my-app/login</a></pre><pre>POST JSON Data from file :<br>curl -X POST -H &quot;Content-Type: application/json&quot; -d @FILENAME <a href="http://localhost:3000/data">http://localhost:8080/my-app/save-data</a></pre><pre>Basic Auth :<br>curl -u john:xyz <a href="http://localhost:3000/data">http://localhost:8080/my-app/login</a>  </pre><pre>Bearer Token Auth :<br>curl <a href="http://localhost:3000/data">http://localhost:8080/my-app/login</a><br>   -H &quot;Accept: application/json&quot;<br>   -H &quot;Authorization: Bearer {token}&quot;</pre><h3>HTTPie</h3><p>Now lets see how <a href="https://httpie.io/">HTTPie</a> looks like :</p><pre>GET :<br>http GET <a href="http://localhost:3000/data">http://localhost:8080/my-app/search/</a> place=abc limit=10</pre><pre>POST : <br>http POST <a href="http://localhost:8080/my-app/login">http://localhost:8080/my-app/login</a> username=john password=xyz</pre><pre>POST JSON Data from file :<br>http <a href="http://localhost:3000/data">http://localhost:8080/my-app/save-data</a> &lt; FILENAME</pre><pre>Basic Auth :<br>http -a john:xyz <a href="http://localhost:3000/data">http://localhost:8080/my-app/login</a></pre><pre>Bearer Token :<br>http -A bearer -a token <a href="http://localhost:3000/data">http://localhost:8080/my-app/profile</a></pre><p>The intention of HTTPie is to consume Web Services the way human talks. If you noticed the HTTPie syntax, it’s look much more simple than cURL.</p><h4>Conclusion</h4><p>Here are two key points :</p><ul><li>cURL is a general command line tool for most protocols like HTTP, FTP, IMAP, LDAP, TELNET and so on. HTTPie is specific to HTTP and HTTPS protocols</li><li>The syntax of HTTPie can very much human readable format compared to cURL.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=259042f97781" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Easy , Simple & Powerful Performance Test Tools for your API — AB, HEY and WRK]]></title>
            <link>https://medium.com/@vimal.software.engineer/easy-simple-powerful-performance-test-tools-for-your-api-ab-hey-and-wrk-51eb536b91ad?source=rss-b1e5ed0bff8b------2</link>
            <guid isPermaLink="false">https://medium.com/p/51eb536b91ad</guid>
            <category><![CDATA[apache-bench]]></category>
            <category><![CDATA[wrk]]></category>
            <category><![CDATA[load-testing]]></category>
            <category><![CDATA[hey]]></category>
            <category><![CDATA[web-service-testing]]></category>
            <dc:creator><![CDATA[Vimal]]></dc:creator>
            <pubDate>Thu, 30 Jun 2022 03:52:04 GMT</pubDate>
            <atom:updated>2022-06-30T04:34:45.281Z</atom:updated>
            <content:encoded><![CDATA[<h3>Easy , Simple &amp; Powerful Performance Test Tools for your API — AB, HEY and WRK</h3><p>Manager : <em>Hey Team.. We are reaching the deadline of delivering our new API. Are we all in track?</em></p><p>Lead : <em>Yeah. It’s all done. We completed the development and got sign-off. We have good code coverages , automations, zero vulnerabilities, documentations, monitoring systems in place. All Good.</em></p><p>Manager : <em>Super cool.. Hey Client, you heard it? We can launch the new API.</em></p><p>Client : <em>Wow. Excellent. I am happy to see the customer feedback…</em></p><p>&lt; ! — — — — — — — — A few days Later — — — — — — — — !&gt;</p><p>Monitoring System : <em>Critical issue. 504 Gateway Timeout.</em></p><p>Customer : <em>Hello, the application is super slow. I am seeing blank pages.. Can someone help?</em></p><p>Team member : <em>Our new API is not responding. We can no longer scale the application too. It seems an implementation or some wrong autoscaling configuration causing the latency.</em></p><p>Lead : <em>Oops.. We missed to do performance testing on our new API.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*FwFa7OSBc2i8pHez.jpg" /></figure><p>This is a story that many of the development teams came across. The developers are so good at writing APIs, especially for Mircoservices. But, developers often miss to consider the API performance before releasing to production. People think of frameworks like JMeter, LoadRunner, etc whenever the term performance test comes. In-fact, it is very easy nowadays to do performance test by simple commands. I am hereby sharing a few super cool load testing tools which are very easy to use and powerful by nature.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*954rcgrSv7IBWQY4ts-92g.png" /></figure><p>Here is a sample code of an API written in Springboot to generate a random number between 1–6 for a user. Thereafter, lets try load test on this API by <strong>ab, hey </strong>and <strong>wrk.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*bPGTr5YTm7lqrkejA-N_5g.png" /></figure><pre>@RestController<br>@RequestMapping(&quot;/random-number&quot;)<br>public class RandomNumberController {<br><br>    private final RandomNumberService randomNumberService;<br><br>    @Autowired<br>    public RandomNumberController(RandomNumberService randomNumberService) {<br>        this.randomNumberService = randomNumberService;<br>    }<br><br>    @GetMapping(&quot;/{user}&quot;)<br>    public String randomNumber(@PathVariable(&quot;user&quot;) String user) {<br>        int randomNumber = randomNumberService.randomNumber();<br>        return user  + &quot;!!! , Your dice number is &quot; + randomNumber;<br>    }<br>}</pre><pre>@Service<br>public class RandomNumberService {</pre><pre>    public int randomNumber() {<br>        return new Random().nextInt(6) + 1;<br>    }<br>}<br></pre><p>I am going to send 100 requests with a concurrency of 10. Lets see how it will be looks like:</p><h4>&gt; ab (Apache Bench)</h4><blockquote>ab -n 100 -c 10 <a href="http://localhost:8080/random-number/user1">http://localhost:8080/random-number/user1</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bk4KMokl7BLp2h07ZPr4hA.png" /></figure><h4>&gt; hey</h4><blockquote>hey -n 100 -c 10 <a href="http://localhost:8080/random-number/user1">http://localhost:8080/random-number/user1</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*41O5RxMOCLyBtAhWLHqTaA.png" /></figure><h4><strong>&gt; wrk</strong></h4><blockquote>wrk -t10 -c100 <a href="http://localhost:8080/random-number/user1">http://localhost:8080/random-number/user1</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LUgHZmquejKUKPAQofYXRQ.png" /></figure><p>Install and Usages :</p><ul><li>ab ===&gt; <a href="https://httpd.apache.org/docs/2.4/programs/ab.html">https://httpd.apache.org/docs/2.4/programs/ab.html</a></li><li>hey ===&gt; <a href="https://github.com/rakyll/hey">https://github.com/rakyll/hey</a></li><li>wrk ===&gt; <a href="https://github.com/wg/wrk">https://github.com/wg/wrk</a></li></ul><h4>Conclusion</h4><p>Performance testing is extremely significant factor in software development life cycle. It is always good practice to perform load test on a Web Service APIs before delivering to production in order to avoid unforeseen issues. Developers can easily do powerful load tests by the help of tools like <strong>ab, hey </strong>and<strong> wrk</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51eb536b91ad" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Micronaut vs Springboot — Closer Look]]></title>
            <link>https://medium.com/@vimal.software.engineer/micronaut-vs-springboot-closer-look-51e183d05329?source=rss-b1e5ed0bff8b------2</link>
            <guid isPermaLink="false">https://medium.com/p/51e183d05329</guid>
            <category><![CDATA[micronaut]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[serverless]]></category>
            <dc:creator><![CDATA[Vimal]]></dc:creator>
            <pubDate>Tue, 28 Jun 2022 05:17:35 GMT</pubDate>
            <atom:updated>2022-06-28T16:36:37.642Z</atom:updated>
            <content:encoded><![CDATA[<h3>Micronaut vs Springboot — Closer Look</h3><p>Mircoservice, Microservice, Microservice…. Yeah… Its everywhere.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/1*g1jy5jdVZww0J8Z7GH6E6g.png" /></figure><p>Before jump into the battle field of Springboot vs Micronaut, let’s have a quick look on <a href="https://microservices.io/">Microservices</a> aka Microservice Architecture.</p><p>One single repository, lakhs of lines of code, gigantic shared database , complex business logics, highly dependent modules, sensitive to create critical issues or bugs, unscalable, difficult to develop and test , and so on.. Yes, we were (some are still) living with Monolith Applications. Then comes the arrival of our Super hero, Microservice Architecture, and is the solution for all these pitfalls. The Microservice architecture enables rapid, frequent and reliable delivery of large, complex applications. It also enables an organisation to evolve its technology stack.</p><p>Nowadays, it become a global level standard that organisations adopt Microservices in Cloud.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*kUCyr4RynQ_2OCt7jWElKg.png" /></figure><p>Now, Let’s come to our topic.</p><h3><strong>What is Micronanut ?</strong></h3><p><strong>A MODERN, JVM-BASED, FULL-STACK FRAMEWORK FOR BUILDING MODULAR, EASILY TESTABLE MICROSERVICE AND SERVERLESS APPLICATIONS</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7qOwBaiszt8ONWj34tQ75w.png" /></figure><h3><strong>Why Micronaut?</strong></h3><p>The intension of Micronaut is crystal clear… It is none other than provides a framework to early market microservices running in cloud or Serverless (eg: AWS Lambda) applications. Having said that, Micronaut is Native in Cloud.</p><p>The Mironaut developers took all the good recipes of Spring framework and minimised the usage of disliked ingredients. Most of the JVM frameworks (eg : Springboot) rely on Java Reflection based inversion of control development. Yeah… Reflections, Proxies, Extreme usage of Cache are the disliking ingredients observed by Mironaut developers.</p><p><strong>What happening on Reflection-based IoC frameworks (eg Springboot):</strong></p><ul><li>Touching on a reflection data performs a lot of things in backend. It will load and cache reflection data for every single field, method, and constructor in the code.</li><li>Byte code generates all the time and perform runtime analysis for every Beans.</li><li>This Results : Quick Build , but High Memory Consumption &amp; Slower Startup time due to Reflection!!!</li></ul><p><strong>The Micronaut Way :</strong></p><ul><li>Ahead of Time Compilation</li><li>Minimal use of reflection</li><li>Minimal use of proxies</li><li>No runtime bytecode generation</li><li>Start-up time and memory consumption aren’t bound to the size of codebase</li><li>This Results : Fast Start-up time, Less Memory footprint, Suitable for Serverless Cloud Applications</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6yk3Us5n6gXwyBEq5qNaKQ.png" /></figure><p>The Development of Micronaut is lightening fast…</p><p>Simply, <a href="https://micronaut.io/download/">Get</a> (Install), <a href="https://micronaut.io/launch">Set and Go </a>(Launch).</p><p>Here is a sample code of an API written in Springboot and Micronaut to generate a random number between 1–6. Thereafter, I tried to gather a few data such as Startup Time, Performance , Memory and Build Time.</p><p>Springboot :</p><pre>@RestController<br>@RequestMapping(&quot;/spring-boot&quot;)<br>public class RandomNumberController {<br><br>    private final RandomNumberService randomNumberService;<br><br>    @Autowired<br>    public RandomNumberController(RandomNumberService randomNumberService) {<br>        this.randomNumberService = randomNumberService;<br>    }<br><br>    @GetMapping(&quot;/{name}&quot;)<br>    public String randomNumber(@PathVariable(&quot;name&quot;) String name) {<br>        int randomNumber = randomNumberService.randomNumber();<br>        return name  + &quot;!!! , Your dice number is &quot; + randomNumber;<br>    }<br>}</pre><pre>@Service<br>public class RandomNumberService {<br><br>    public int randomNumber() {<br>        return new Random().nextInt(6) + 1;<br>    }<br>}</pre><p>Micronaut :</p><pre>@Controller(&quot;/micronaut&quot;)<br>public class MicronautRandomNumber {<br><br>    private final RandomNumberService randomNumberService;<br><br>    public MicronautRandomNumber(RandomNumberService randomNumberService) {<br>        this.randomNumberService = randomNumberService;<br>    }<br><br>    @Get(&quot;/{name}&quot;)<br>    public String randomNumber(String name) {<br>        int randomNumber = randomNumberService.randomNumber();<br>        return name + &quot;!!! , Your dice number is &quot; + randomNumber;<br>    }<br><br>}</pre><pre>@Singleton<br>public class RandomNumberService {<br><br>    public int randomNumber() {<br>        return new Random().nextInt(6) + 1;<br>    }<br><br>}</pre><ul><li><strong>Observation on Startup Time</strong> : <em>Springboot started in 1.573seconds and Micronaut started in 646milli seconds.</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5LQ6sfFxMlpFGEXL5ojfhQ.png" /><figcaption>Startup time comparison of Springboot vs Mirconaut</figcaption></figure><ul><li><strong>Observation on Performance </strong>— Load Testing <a href="https://httpd.apache.org/docs/2.4/programs/ab.html">Apache Benchmark</a> (cmd : ab -n 100 -c &lt;api&gt;)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uiJApPq_w34UwkFXhQ20iw.png" /><figcaption>Load test on Springboot and Micronaut on the above source code</figcaption></figure><ul><li><strong>Observation on Memory </strong><em>— Springboot : 134 MB and Micronaut : 116MB</em></li><li><strong>Build time — </strong><em>Springboot : 5.2sec and Micronaut : 6.4sec</em></li></ul><p>I’have experimented on Build Time, Startup, Response time, and Memory nearly 10 times for the above source codes of Springboot and Micronaut. Sharing the consolidated results :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lk0-VQPyd3EXWW-YdxJVsQ.png" /></figure><p>Yeah… Build time needs to improved for Micronaut. Isn’t ? No worries.. Here the <a href="https://www.graalvm.org/">GraalVM</a> to came on the arena. GraalVM compiles the java application to native machine code. <a href="https://docs.micronaut.io/latest/guide/index.html#graal">Micronaut loved it, because it helps to have faster build time.</a></p><p>Now, back to the Microservice Concepts for a moment. The following diagram depicts common usecases which usually come across during the development of a microservice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QDDxqRleTjKUl5Vi5Qvpbg.png" /></figure><p>Let’s see how Springboot and Micronaut looks like.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0EUyEBqer40bm5Y5bcE8ng.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*58ik0pPNBDHaTmF-MwujYA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1L74w3Qopm_bgyzRJWKnHQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3-bFFFeDTTOOMbADSzHE5w.png" /></figure><p>Now, You might be thinking of adopting Micronaut. But, you will still have a lots of doubts in your mind. You might even be a die hard fan of spring/springboot. No worries, Here is the happy news for you.</p><p>There is a project called <a href="https://micronaut-projects.github.io/micronaut-spring/latest/guide/"><strong>Micronaut for Spring</strong></a><strong> </strong>to</p><ul><li>Integrate Spring components into a Micronaut application</li><li>Run Spring applications as Micronaut applications</li><li>Expose Micronaut Beans to a Spring Application</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*25AA_zAHyCUlGSV-oLuE1Q.png" /></figure><p>In addition to that, Micronaut is suitable for developing Serverless Applications. I wish to remind you Micronaut is Cloud native framework. Developing FaaS (Function as a Service) applications in this framework is very easy and super awesome.</p><p><a href="https://guides.micronaut.io/latest/mn-serverless-function-aws-lambda-maven-java.html">https://guides.micronaut.io/latest/mn-serverless-function-aws-lambda-maven-java.html</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LkGayT1_moxiEL57Xfz0ZQ.png" /></figure><h3>Its time for Conclusion :</h3><ul><li>Springboot is a Proven Tech having huge fans. Earned a lot of trust for building Mircoservices.</li><li>Micronaut is a promising tech for Microservice Applications running in Cloud and Serverless Cloud Applications. It is on the path of earning trust.</li><li>Micronaut has the dedicated focus on developing Cloud based Microservices and Serverless Applications. Unlike Springboot, Micronaut is cloud native.</li><li>Micronaut using Ahead of Time Compilation and less usages of Reflections. This makes Microanut to have quick startup time and less memory.</li><li>With the help of GraalVM , Micronaut achieving quick build time.</li><li>Competition is Good!!!</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51e183d05329" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>