<?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 Subhash Bharadwaj  on Medium]]></title>
        <description><![CDATA[Stories by Subhash Bharadwaj  on Medium]]></description>
        <link>https://medium.com/@subhash_bharadwaj?source=rss-321806cfcf21------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*hl4omEn7vnwsH3ji</url>
            <title>Stories by Subhash Bharadwaj  on Medium</title>
            <link>https://medium.com/@subhash_bharadwaj?source=rss-321806cfcf21------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 19:07:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@subhash_bharadwaj/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[System Design patterns — The Orchestrator pattern Vs The Assembly pattern]]></title>
            <link>https://medium.com/clark-engineering/system-design-patterns-the-orchestrator-pattern-vs-the-assembly-pattern-e084440dc7ba?source=rss-321806cfcf21------2</link>
            <guid isPermaLink="false">https://medium.com/p/e084440dc7ba</guid>
            <category><![CDATA[orchestrator-pattern]]></category>
            <category><![CDATA[assembly-pattern]]></category>
            <category><![CDATA[design-patterns]]></category>
            <category><![CDATA[system-design-concepts]]></category>
            <category><![CDATA[clark]]></category>
            <dc:creator><![CDATA[Subhash Bharadwaj ]]></dc:creator>
            <pubDate>Wed, 21 Sep 2022 12:59:45 GMT</pubDate>
            <atom:updated>2022-09-21T12:59:45.500Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>System Design patterns — The Orchestrator pattern Vs The Assembly pattern</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QbCttfTLOJUSCYe4" /></figure><p>Ever wondered why system design patterns are so important in software development?</p><p>Having a bad system design could lead to many serious problems among which, here are four common problems that everyone might encounter:</p><ul><li><strong>Rigidity</strong> — Forced to cascade changes in other dependent classes for making a small change in one class. It means coupling exists in the code which makes the code rigid</li><li><strong>Immobility</strong> — When the components are tightly coupled or highly dependent on each other and cannot be reused in another place, the code is said to be immobile</li><li><strong>Fragility</strong> — When any new change in code breaks other parts of the code unexpectedly, then the design is fragile</li><li><strong>Viscosity</strong> — this refers to the ease at which a developer can add a design-preserving code to the system</li></ul><p>I would not want to take much of your time by going through all/ rest of the design patterns and the problems of not having them, as you might know already.</p><p>In this blog, I am going to drive you through two design patterns in particular that I came across while building a project where my team members and I had to make a choice between the two.</p><p>They are — <em>The Orchestrator pattern and The Assembly pattern</em></p><p><strong>The Orchestrator pattern:</strong></p><p>This pattern believes in Centralisation. It believes that only a centralised and well-organised component can provide stability.</p><p>Imagine, we have a set of layers where each layer has its own responsibility, to get the desired output, each layer needs to be executed in some order but there should be someone who needs to take control and execute each layer in the required order to get the output. There comes the responsibility of the <strong>Orchestrator.</strong></p><p>The Orchestrator takes the responsibility of executing every layer that is involved in the flow. Any layer involved doesn’t need to know anything about the other layers. The Orchestrator knows the responsibilities of each layer and takes complete care of the flow.</p><p>To put it in simple terms, imagine this is an Orchestra concert. We have a conductor showing every group of musicians when to play their part resulting in a perfect musical feast. Without him, musicians wouldn’t know anything, resulting in chaos, likewise, the Orchestrator helps in the system design.</p><p>Here is the diagrammatic view for your better understanding.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*A2NFXxhMwWtt7es_" /></figure><p><strong>Pros:</strong></p><ul><li>Each layer is not dependent on one another — Which means that it’s not required that layers should call each other plus each layer is not required to do any processing that is needed for the next layer, meaning each layer can finish its assigned responsibility and need not care about what’s required for processing the next layer</li><li>We can exit the calculation at any step if required — having an Orchestrator class will enable this doing with much ease. Therefore the layers don’t need to know about any exit strategies</li><li>It enables Central error handling</li><li>It enables Context awareness (Orchestrator has context about each layer involved)</li><li>It also provides the ability to add monitoring and benchmarking</li></ul><p><strong>Cons:</strong></p><ul><li>In this solution, the Orchestrator class would have too much responsibility to deal with all/ each layer which is not so good</li><li>The orchestrator class would have to know about each layer and class involved in the process</li></ul><p><strong>Now lets understand — The Assembly pattern:</strong></p><p>This pattern believes that an additional decision-making component is redundant. It believes components should be autonomic and coupled loosely without impacting others.</p><p>Let’s imagine the same situation that we did at the beginning, we have a set of layers that needs to be executed to get the desired output. In this pattern, there is no orchestrator that takes control of the flow and executes all the layers instead, each layer handles executing the next layer. The first layer executes the second, the second one executes the third, and so on, this pattern acts more like a workflow where each layer is dependent on the previous layer.</p><p>To put it in simple terms, this is like a jazz band, when musicians are waiting for others to stop playing, they can start playing their part.</p><p>With this approach, we have one less component to maintain and we don’t have a big single point of contact.</p><p>To simplify further let us look into the diagrammatic flow -</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ImjrR369kic0PMnl" /></figure><p>This is how the flow looks like in the Assembly pattern where each layer calls the next one.</p><p><strong>Pros:</strong></p><ul><li>Each layer takes its own responsibility and does not pass on the whole responsibility to the Orchestrator</li><li>This solution adds more structure to the codebase</li><li>Also, the data flows from top to bottom</li></ul><p><strong>Cons:</strong></p><ul><li>Since this is more like a workflow, there is more dependency involved between the layers</li><li>Debugging might be a little tougher here if something goes wrong as multiple classes are involved in the flow</li><li>Error handling would be really difficult here as there is no Orchestrator to have control over all other layers</li></ul><p><strong>Summary</strong></p><p>In this blog, we spoke about the two patterns that I came across while building a project. It was a good learning experience for me and I wanted to share the same with you all.</p><p>As you saw, each pattern has its pros and cons. It totally depends on your use case on which pattern to choose. We went ahead with the Orchestrator pattern in our project as it made more sense to choose it based on our use cases and the whole system design.</p><p>I hope this blog was helpful in understanding these two patterns. Time for us to say toodles to each other and let’s meet again with some other blog posts soon. Thank you for your valuable time.</p><p>I would be really happy to get your valuable feedback or to start a conversation about these topics if you have any. Namaste and tata! 🙏</p><p>—</p><p>At CLARK, we believe <strong>people deserve peace of mind</strong>. Come <a href="https://www.clark.de/de/jobs">join us</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e084440dc7ba" width="1" height="1" alt=""><hr><p><a href="https://medium.com/clark-engineering/system-design-patterns-the-orchestrator-pattern-vs-the-assembly-pattern-e084440dc7ba">System Design patterns — The Orchestrator pattern Vs The Assembly pattern</a> was originally published in <a href="https://medium.com/clark-engineering">Clark Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to share files using the Peer to Peer Protocol / Interplanetary File System]]></title>
            <link>https://medium.com/clark-engineering/how-to-share-files-using-the-peer-to-peer-protocol-interplanetary-file-system-5127d94bbfd8?source=rss-321806cfcf21------2</link>
            <guid isPermaLink="false">https://medium.com/p/5127d94bbfd8</guid>
            <category><![CDATA[file-sharing]]></category>
            <category><![CDATA[ipfs]]></category>
            <category><![CDATA[interplanetary-file]]></category>
            <category><![CDATA[clark]]></category>
            <category><![CDATA[how-to-share-files]]></category>
            <dc:creator><![CDATA[Subhash Bharadwaj ]]></dc:creator>
            <pubDate>Tue, 03 May 2022 12:52:05 GMT</pubDate>
            <atom:updated>2022-05-03T12:52:05.057Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gL1HEJ1r0kTEik3t" /></figure><p>Sharing files has become a daily habit in our day to day lives also it has become an integral part of various kinds of industries. There are many ways of sharing files today, of those ways, one way which caught my attention was the <strong>IPFS</strong>. IPFS provides you with the fastest way to share files with other peers without using a commercial company. Does this mean, can we stop relying on our big brother Google and start using IPFS to share our files? Not just yet. IFPS is still in it’s infancy but it’s an exciting new technology worth investigating. I am pretty sure you would love it too. The way IPFS works is very simple and very interesting. Why don’t you go through the steps below to know more about IPFS and how it works.</p><p>IPFS stands for Interplanetary File System, it is nothing but a peer to peer communication protocol used for sharing files between peers. This is similar to a Blockchain where distributed and decentralised nodes store the chain of blocks, whereas nodes in IPFS store files in different nodes.</p><p>Confused as it’s too technical? Let me put it in a simpler way -</p><p>Sharing a file using IPFS is nothing but adding the file to the IPFS daemon network.</p><p>Once you add a file to IPFS, the file is split into smaller chunks and is given a unique fingerprint which is called a <strong>Content Identifier (CID). </strong>The CID always starts with a “<em>qm”. </em>This CID is the identifier of your file. This means, IPFS uses <em>content addressing</em> instead of location based hashing, which means your file cannot be retrieved using a location based URL but instead IPFS uses the generated Hash/ CID to retrieve your file.</p><p>For example, there is a file that has been added to IPFS and the generated hash is as follows: “QmQqzMTavQgT4f4T5v6PWBp7XNKtoPmC9jvn12WPT3gkSE”. So, you can fetch the image from IPFS using the below URL:</p><p><a href="https://ipfs.io/ipfs/QmQqzMTavQgT4f4T5v6PWBp7XNKtoPmC9jvn12WPT3gkSE">https://ipfs.io/ipfs/QmQqzMTavQgT4f4T5v6PWBp7XNKtoPmC9jvn12WPT3gkSE</a></p><p>This is how files are viewed from browser after added to IPFS. You can of course download them using command line which I will explain later in the blog.</p><p>Sometimes, IPFS might throw 504 bad gateway error when trying to open the link. If it happens, please try after sometime.</p><p>To continue, once you add a file to IPFS, it is now available for other peers to access that file. When other peers look up for that file, they ask the peer nodes for the file using the CID and whoever has it, will provide them with the file.</p><p>Once a node receives the file, it caches a copy and becomes another provider of your file until the cache is cleared.</p><p>A peer node can keep the content forever or discard the cache whenever it wants. It has the freedom to choose its content.</p><p>What happens when you or anyone adds the same file contents again to the IPFS? In this case, only one copy of the file would be stored. It avoids duplication of files with the same content resulting in saving a lot of space.</p><p>Why IPFS?</p><ul><li>Files added to IPFS are persistent. You won’t lose any data</li><li>Files added to IPFS are immutable. It means, if you already added a file to IPFS and now if you make some changes to the file and add it again, it will generate a new CID for the file which means the original file stays as it is and your new changes would reflect in a new file with a different CID</li><li>IPFS ensures that there is no single point of failure as files are distributed by different nodes</li><li>Data transfer would be really fast on IPFS as it has higher bandwidth</li></ul><p>Anything on this planet tends to have both pros and cons. Let me tell you some cons about IPFS.</p><ul><li>Security wise, IPFS is not a great tool since the files in IPFS are public. So if you have a very important file that needs to be shared, IPFS is not the one though it supports encryption. People can easily decrypt files today</li><li>Non-tech people don’t tend to use IPFS as IPFS installation requires some installations and server running which will result in shortage of nodes on the IPFS network</li><li>IPFS consumes a lot of bandwidth</li><li>IPFS servers tend to go down at times. So, you might see some failures at times</li></ul><p>Bored? Too much theory? Let’s get some practical knowledge and have fun!</p><p>I would assume you do not have IPFS installed on your system. Follow <a href="https://docs.ipfs.io/install/command-line/#official-distributions">this</a> link and install IPFS on your system. Ignore and excuse me if already installed.</p><p>Congratulations on installing IPFS 👏</p><p>IPFS stores all its settings and internal data in a directory called <em>the</em> repository. Before using IPFS for the first time, you’ll need to initialise the repository by running the following command:</p><pre>ipfs init</pre><p>Now that you have initialised the IPFS repository and are ready to share files, you’ll need to join your node to the public network. Run the following command:</p><pre>ipfs daemon</pre><p>Hurray! You are now connected to the public network of IPFS. You can now share your files with your colleagues.</p><p>To share a file, simply run the following command:</p><pre>ipfs add file_name</pre><p>With this, your file is added to the public network of IPFS.</p><p>This command would have generated a CID that starts with `<em>qm</em>`. Share it with people with whom you want to share the file.</p><p>Remember, you can also add a directory to IPFS by running</p><pre>ipfs add -r folder</pre><p>Now the receiver has to run the following command to get the file.</p><pre>ipfs get cid</pre><p>This will receive the file from IPFS and save it locally in the root path from wherever the “<em>get”</em> command is run . It will create a file named with CID and the contents get stored in that file.</p><p>You can also play around with the get command to store the contents in a separate file with a different name and in a different directory.</p><p>It is important to know that all the files in IPFS are public. To ensure safety, you can always encrypt your private files before you push them to IPFS.</p><p><strong>Summary</strong></p><p>In this blog, I have covered the basics of IPFS and how to use it. We have learned to initialise IPFS, running the daemon server, adding and retrieving files. IPFS is a lot more than that. I suggest you go through the IPFS official <a href="https://ipfs.io/">documentation</a> and learn a lot more about it. Hope you learned something out of this blog and hope you enjoyed it.</p><p>We might or might not use IPFS but I learnt something new and interesting and didn’t want you to miss it.</p><p>Sometime back, I created a CLI only ruby gem that uses IPFS to share files and <a href="https://github.com/VenkataSubhash96/itp">here</a> is the link to it. If you are interested, just have a look at it and comment for any improvements.</p><p>Finally, time to say bye. We shall meet again with some other blog and hope to see you soon. Thank you folks! 🙌</p><p>PS — Ping me if you have any queries or any conflict thoughts.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5127d94bbfd8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/clark-engineering/how-to-share-files-using-the-peer-to-peer-protocol-interplanetary-file-system-5127d94bbfd8">How to share files using the Peer to Peer Protocol / Interplanetary File System</a> was originally published in <a href="https://medium.com/clark-engineering">Clark Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>