<?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 Shashi Ranjan on Medium]]></title>
        <description><![CDATA[Stories by Shashi Ranjan on Medium]]></description>
        <link>https://medium.com/@shran?source=rss-e53881cb6e7c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*mV_MtCaIwhRi90zh.</url>
            <title>Stories by Shashi Ranjan on Medium</title>
            <link>https://medium.com/@shran?source=rss-e53881cb6e7c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 21:04:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shran/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[When Engineering is overdone]]></title>
            <link>https://medium.com/@shran/when-engineering-is-overdone-c5ed1a2875fd?source=rss-e53881cb6e7c------2</link>
            <guid isPermaLink="false">https://medium.com/p/c5ed1a2875fd</guid>
            <category><![CDATA[useful-tips]]></category>
            <category><![CDATA[overengineering]]></category>
            <category><![CDATA[impact]]></category>
            <category><![CDATA[focus]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Shashi Ranjan]]></dc:creator>
            <pubDate>Thu, 13 Jun 2024 11:03:14 GMT</pubDate>
            <atom:updated>2024-06-13T11:03:14.752Z</atom:updated>
            <content:encoded><![CDATA[<p>Overengineering (OE) is and has been more common than perceived. Often they are disguised as cool and fun piece of work, however not always. A poorly understood problem when solved more for passion than purpose, could very well result in one or more OEs.</p><p>Pride can easily trick us into focussing onto HOW (to solve) so quickly that WHAT (to solve) slips away, and often we land on solving future problems more than current ones.</p><p>Given — <em>Simpler solution(s) exists</em></p><p>When — <em>Complex solution is adopted</em></p><p>Then — <em>It’s </em><strong><em>O</em></strong><em>ver</em><strong><em>E</em></strong><em>ngineering</em></p><p>Continuous learning and experimenting is essential while working in technology, however serving solution based on it “too soon” can hurt. Therefore, cool technology should be judged for impact and not only passion.</p><p><strong>Snacking of OE: </strong>Arbitrary refactoring especially based on arbitrary standard, when entertained (or appreciated) can establish OE trend in team. Premature or micro optimisations, when done frequently, can compound making system often more complex. These snack aren’t healthy.</p><p>Feedbacks are great tool to avoid OEs, essentially when taken in time so that solution can be reflected upon without burden of big changes/shifts.</p><p>Estimation in terms of work item is another tool to avoid OE, because this tend to keep us on track with the scope with informed decision made.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c5ed1a2875fd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[src/main/entropy]]></title>
            <link>https://medium.com/@shran/src-main-entropy-822f3c93fbf9?source=rss-e53881cb6e7c------2</link>
            <guid isPermaLink="false">https://medium.com/p/822f3c93fbf9</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-maintainability]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[sottware-applications]]></category>
            <category><![CDATA[entropy]]></category>
            <dc:creator><![CDATA[Shashi Ranjan]]></dc:creator>
            <pubDate>Mon, 20 Mar 2023 21:32:05 GMT</pubDate>
            <atom:updated>2023-09-02T20:10:26.196Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/483/1*C9JdBoGR72TILN_3PrN9bA@2x.jpeg" /></figure><p><strong>Entropy</strong> is a crucial concept in chemistry and physics. I am trying to emphasise known good practices in software application development through the lens of entropy.</p><p>A simple definition of entropy is “It is measure of disorder”.</p><blockquote>“Entropy is measure of how complex a system is” I find this definition of entropy serviceable to software application development because,</blockquote><ol><li>Increase in cost to maintain software can be seen as increase of entropy</li><li>The cost to maintain software application at same level could be same as the rate at which system is moving towards being disordered.</li></ol><p>A software application’s entropy could be measured in terms of “Time taken to describe the system”, “easy to add new feature” and “Simplicity of handover of system to new engineer”.</p><p>I find the thought experiment <a href="https://en.wikipedia.org/wiki/Maxwell%27s_demon">Maxwell’s daemon</a> an easy way to visualise entropy in software engineering. This experiment shows the information as a main cause of increase in entropy of system. Here is a summary and I do recommend you reading about it,</p><blockquote>In first glance this experiment seems to violate entropy and astonishes us, No change of heat or anything else seems to be there in order to indicate disorder. The system seems to have gone into state of lower entropy. However, at later point of time the information being stored (probably in mind of Maxwell’s daemon) is seen as cause of increase in entropy.</blockquote><p>My little research tells me that information actually increases temperature of a system. It is in best interest of software system to keep entropy low or at least maintain at a level. Based on borrowed concepts from physics, I think following points are important.</p><ol><li>Do not add into amount of information needed to maintain a software.</li><li>Try enhancing a system in a way so that no new complexity is needed while explaining the system to new person (software engineer). Because more complex a system is to explain the more complex the system is to maintain and hand over.</li><li>Given an opportunity, try to lower the entropy by eliminating unnecessary information in the system. Also, many redundancy can be made singular.</li><li>Addition of extra bit of information contributes to increase in complexity of system. It is beneficial to make sure the extra bit of information added has a good ROI (Return On Investment).</li></ol><p>Often, it is not easy to control complexity of large software application. It is usually hard because of number of factors it comprises and the micro-state concept can help.</p><blockquote>A micro-state is complexity of small segment within a large system.</blockquote><p>So instead of getting overwhelm by complexity of large system it is better to identify (or create) micro state and lower entropy in the micro states.</p><p>Please drop you feedbacks. I am on my way in co-relating of micro-state concept in software system.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=822f3c93fbf9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Azure pipeline: Dynamic dependsOn]]></title>
            <link>https://medium.com/@shran/azure-pipeline-dynamic-dependson-94c11ef2a477?source=rss-e53881cb6e7c------2</link>
            <guid isPermaLink="false">https://medium.com/p/94c11ef2a477</guid>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[azure-pipelines]]></category>
            <category><![CDATA[yaml]]></category>
            <category><![CDATA[azure-devops]]></category>
            <category><![CDATA[azure-services]]></category>
            <dc:creator><![CDATA[Shashi Ranjan]]></dc:creator>
            <pubDate>Sun, 04 Oct 2020 19:45:45 GMT</pubDate>
            <atom:updated>2020-10-04T19:45:45.797Z</atom:updated>
            <content:encoded><![CDATA[<p>While exploring Azure Pipeline, I was stuck when trying to dynamically decide stage dependencies. I searched around but could not get my hands on solution. Finally, below is the way I could achieve.</p><p>A Typical <strong><em>dependsOn</em></strong> looks as follow</p><pre>- stage: multi-compilation<br>  dependsOn:<br>  - pre-check1<br>  - resource-validation<br>  displayName: ..<br>  condition: ...<br>  jobs:<br>  - job: ..</pre><p>My aim was to decide what a job dependsOn based on certain parameters/inputs.</p><p><strong>Example</strong>: If it is Test environment, I would not run <strong><em>resource-validation</em></strong> stage therefore <strong><em>multi-compilation</em></strong> stage should not dependsOn it (resource-validation, as this marked not to run for Test Environment).</p><p>Below are the steps, to be able to choose what a stage should dependsOn based on Environment parameter supplied during build trigger. However, I believe the same should be possible with any other input parameter similarly.</p><p>Step 1: Create input/deciding parameter (<strong><em>target-env</em></strong>) and dependsOn placeholder (<strong><em>multi-comp-depends-on)</em></strong> parameters as follow.</p><pre>parameters:<br>- name: target-env<br>  displayName: Target Environment<br>  type: string<br>  default: dev<br>  values:<br>  - dev<br>  - test<br>- name: multi-comp-depends-on<br>  type: object<br>  default:<br>  dev:<br>  - pre-check1<br>  - resource-validation<br>  test:<br>  - pre-check1</pre><p>Step 2: Get Stage[] based on input and iterate through to set each as dependsOn.</p><pre>- stage: multi-compilation<br>  displayName: Multi Compilation<br>  dependsOn:<br>  - ${{ each stg in parameters.multi-comp-depends-on[parameters.target-env] }}:<br>    - ${{ stg }}</pre><p>It first picks the stage[] based on <strong><em>target-env</em></strong> for <strong>multi-comp-depends-on </strong>then, iterates over stages.</p><p>In this case, if <em>target-env=dev, then [pre-check1, resource-validation ]</em> array is chosen. Later this each element of array is iterated and set (<em>each stg in parameters.multi-comp-depends-on[parameters.target-env]</em>) using loop.</p><p>One of implementation running on Azure pipeline can be refereed on <a href="https://github.com/srjha/sample-web/blob/re-trigger/azure-pipelines.yml">github here</a>.</p><p>Hope this helps some of you and please do share if you find a better way to achieve the same.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=94c11ef2a477" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Spring boot useful tips: Passing various types of values from property file]]></title>
            <link>https://medium.com/@shran/spring-boot-useful-tips-passing-various-types-of-values-from-property-file-4f94c06679cd?source=rss-e53881cb6e7c------2</link>
            <guid isPermaLink="false">https://medium.com/p/4f94c06679cd</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[spring-framework]]></category>
            <dc:creator><![CDATA[Shashi Ranjan]]></dc:creator>
            <pubDate>Wed, 16 Sep 2020 14:19:07 GMT</pubDate>
            <atom:updated>2020-10-02T13:57:39.069Z</atom:updated>
            <content:encoded><![CDATA[<h3>Spring boot: Passing various types of values from property file</h3><p>I have come across need of setting various types of values in property file and thought to make this info handy for self and other readers.</p><h4>Map</h4><p>A map can be set as configurable value with,<br><em>application.properties</em></p><pre>my.map=${MY_MAP_FROM_ENV:{&#39;key1&#39;:&#39;val1&#39;,&#39;key2&#39;:&#39;val2&#39;}}</pre><pre>## An empty map can be set with {}<br>my.map=${MY_MAP_FROM_ENV:{}}</pre><p><em>Stroring as a field in Java class</em></p><pre>@Value(&quot;#{${my.map}}&quot;)<br>private Map&lt;String, String&gt; myMap;</pre><p>If you are setting MY_MAP_FROM_ENV via some other configuration file (say k8s config map) then do not forget to enclose in double quotes otherwise those confif tool may convert it into their own map already.</p><pre>MY_MAP_FROM_ENV: &quot;{&#39;key1&#39;:&#39;val1&#39;,&#39;key2&#39;:&#39;val2&#39;}&quot;</pre><p><strong><em>null</em></strong></p><p>There may be instance when you want to set a configuration to null. Spring EL can be used as follow,</p><pre>some.config.with.null.default=${LG_IP:#{null}}</pre><p>This ensures that value remains null until set. You can supply #{null} to k8s config map/ENV as is if that is what you want to set.</p><p><strong>List</strong></p><p>A list can be configured as below and can be set to List&lt;String/Number etc&gt;</p><pre>my.lucky.numbers=${MY_LUCKY_NUMBERS:1,2}</pre><p><strong>Nested Collection (Ex Map&lt;String, List&lt;String&gt;&gt;..)</strong></p><pre>some.complex.config=${SOME_COMPLEX_CONFIG:{&#39;FOO&#39;: {1,7},&#39;BAR&#39;: {9,788,89}}}</pre><p>(To be continued…)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f94c06679cd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bitbucket Pipeline: AWS EKS, Terraform]]></title>
            <link>https://medium.com/@shran/bitbucket-pipeline-aws-eks-terraform-8cced086e652?source=rss-e53881cb6e7c------2</link>
            <guid isPermaLink="false">https://medium.com/p/8cced086e652</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[bitbucket-pipelines]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[bitbucket]]></category>
            <dc:creator><![CDATA[Shashi Ranjan]]></dc:creator>
            <pubDate>Mon, 06 May 2019 14:07:14 GMT</pubDate>
            <atom:updated>2019-05-14T14:08:16.178Z</atom:updated>
            <content:encoded><![CDATA[<p>As of today EKS example from <a href="https://bitbucket.org/account/user/awslabs/projects/BP">bitbucket</a> is missing, So I try to build one as follows. This article assumes you have some understanding of bitbucket pipeline already and now trying to do hands on creating EKS.</p><p>I have used terraform and aws cli to keep non pipeline part simpler. You can create an EKS manually or using cloud formation template</p><p><strong>Step 1: Getting EKS up and running</strong></p><p>I used terraform to do (this <a href="https://github.internet2.edu/internet2/terraform-aws-eks">git repo</a> can be of great help).</p><p><strong>Important: Please add s3 backend so that you do not loose state when pipeline is finished.</strong></p><pre>terraform {<br>  backend &quot;s3&quot; {<br>    bucket = &quot;backend-tf&quot;<br>    key = &quot;test/k8s/eks-e2-bitbucket.tfstate&quot;<br>    region = &quot;us-east-1&quot;<br>  }<br>}</pre><p>You can use Repository Variables to set ENV vars required by scripts.</p><p><strong>Execute below steps once EKS setups is done to verify (Can be skipped if you are already confident)</strong></p><p>To verify</p><pre>aws eks --region us-east-1 describe-cluster --name &lt;Cluster Name&gt; --query cluster.status</pre><p>To set kubectl context</p><pre>aws eks --region us-east-1 update-kubeconfig --name &lt;Cluster Name&gt;</pre><p>A handy way to get config map out</p><p><em>Say you want to store it in aws-auth-cm.yaml</em></p><pre>terraform output config_map_aws_auth &gt; aws-auth-cm.yaml</pre><p>Apply config map and test if all well</p><pre>kubectl apply -f aws-auth-cm.yaml</pre><p><strong>Step 2: Pipeline Script</strong></p><p>You can put a pipeline file as below in root directory of project.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/87abe89d291ae54c6e303b31742c4bf9/href">https://medium.com/media/87abe89d291ae54c6e303b31742c4bf9/href</a></iframe><p>Please have a look at all the variables set in pipeline file</p><pre>variables:<br>                AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID<br>                AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY<br>                AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION<br>                S3_BUCKET: $KUBE_CONFIG_CM_BUCKET<br>                LOCAL_PATH: $BITBUCKET_CLONE_DIR/auth</pre><p><em>AWS_DEFAULT_REGION</em> is name of bucket, where you expect state file to be stored. You must set AWS related ENV (first 3) and can leave last one as is.</p><p><em>KUBE_CONFIG_CM_BUCKET</em>: This is used to place config map file so that other services can use.</p><p>AUTH_CM_FILE: Name of Config map file</p><p><strong>Step 3: Pushing services to EKS</strong></p><p>Create an ECR repository and copy url to set it to <em>DOCKER_ECR_REPO_URL</em></p><p>Here is pipeline file to push a nodejs service to the EKS we just created. Complete project can be accessed <a href="https://github.com/srjha/bitbucket-pipeline-example">here</a></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/59eb178b4483d197ae6366814834cc42/href">https://medium.com/media/59eb178b4483d197ae6366814834cc42/href</a></iframe><p>Following ENV must be set as repository variable or account variable.</p><pre>DOCKER_ECR_REPO_URL = XXXXXXX121.dkr.ecr.us-east-1.amazonaws.com<br>DOCKER_IMAGE_NAME = hello-njs<br>K8S_NAMESPACE = default<br>K8S_DEPLOYMENT_NAME = hello-njs<br>CLUSTER_NAME = cluster</pre><p>Please note that, <em>AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, KUBE_CONFIG_CM_BUCKET</em> and <em>AUTH_CM_FILE </em>must have been set same as above pipeline.</p><p>You are all set to utilize pipeline to do new deployment for a service. Ideally you should be able to utilize this for any other kind of service (say spring boot etc).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8cced086e652" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>