<?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:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[Let's Do Tech]]></title><description><![CDATA[Notes on CNCF Landscape and developer tools, with regards to system design, product dev, architecture, and AI.]]></description><link>https://news.letsdote.ch</link><image><url>https://substackcdn.com/image/fetch/$s_!1iAp!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7134fecb-b4c2-4eba-90eb-a40f8f94b1f4_1250x1250.png</url><title>Let&apos;s Do Tech</title><link>https://news.letsdote.ch</link></image><generator>Substack</generator><lastBuildDate>Tue, 19 May 2026 04:23:33 GMT</lastBuildDate><atom:link href="https://news.letsdote.ch/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Let's Do Tech]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[letsdotech@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[letsdotech@substack.com]]></itunes:email><itunes:name><![CDATA[Sumeet Ninawe]]></itunes:name></itunes:owner><itunes:author><![CDATA[Sumeet Ninawe]]></itunes:author><googleplay:owner><![CDATA[letsdotech@substack.com]]></googleplay:owner><googleplay:email><![CDATA[letsdotech@substack.com]]></googleplay:email><googleplay:author><![CDATA[Sumeet Ninawe]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[What would it take to adopt HTTP/2 and HTTP/3?]]></title><description><![CDATA[Differences, benefits, application refactoring, and infrastructure changes required to upgrade and improve app performance.]]></description><link>https://news.letsdote.ch/p/what-would-it-take-to-adopt-http2</link><guid isPermaLink="false">https://news.letsdote.ch/p/what-would-it-take-to-adopt-http2</guid><dc:creator><![CDATA[Sumeet Ninawe]]></dc:creator><pubDate>Mon, 03 Mar 2025 04:45:57 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1534224039826-c7a0eda0e6b3?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHxjb25uZWN0aW9ufGVufDB8fHx8MTc0MDk0MzcwNXww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1534224039826-c7a0eda0e6b3?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHxjb25uZWN0aW9ufGVufDB8fHx8MTc0MDk0MzcwNXww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1534224039826-c7a0eda0e6b3?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHxjb25uZWN0aW9ufGVufDB8fHx8MTc0MDk0MzcwNXww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1534224039826-c7a0eda0e6b3?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHxjb25uZWN0aW9ufGVufDB8fHx8MTc0MDk0MzcwNXww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1534224039826-c7a0eda0e6b3?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHxjb25uZWN0aW9ufGVufDB8fHx8MTc0MDk0MzcwNXww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1534224039826-c7a0eda0e6b3?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHxjb25uZWN0aW9ufGVufDB8fHx8MTc0MDk0MzcwNXww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1534224039826-c7a0eda0e6b3?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHxjb25uZWN0aW9ufGVufDB8fHx8MTc0MDk0MzcwNXww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" width="5311" height="3541" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1534224039826-c7a0eda0e6b3?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHxjb25uZWN0aW9ufGVufDB8fHx8MTc0MDk0MzcwNXww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:3541,&quot;width&quot;:5311,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;two square blue LED lights&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="two square blue LED lights" title="two square blue LED lights" srcset="https://images.unsplash.com/photo-1534224039826-c7a0eda0e6b3?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHxjb25uZWN0aW9ufGVufDB8fHx8MTc0MDk0MzcwNXww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1534224039826-c7a0eda0e6b3?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHxjb25uZWN0aW9ufGVufDB8fHx8MTc0MDk0MzcwNXww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1534224039826-c7a0eda0e6b3?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHxjb25uZWN0aW9ufGVufDB8fHx8MTc0MDk0MzcwNXww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1534224039826-c7a0eda0e6b3?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHxjb25uZWN0aW9ufGVufDB8fHx8MTc0MDk0MzcwNXww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="true">israel palacio</a> on <a href="https://unsplash.com">Unsplash</a></figcaption></figure></div><p></p><p>All of us in tech understand that there are deeper margins to be accessed on the performance side of things. No matter how well the product we might have built, we always strive for more speed, efficiency, and reliability. Less system utilization means lesser infrastructure bills to pay, which translates to more profits.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://news.letsdote.ch/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Let's Do Tech! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>We develop applications to reach maximum users, and the most fundamental part of this is the communication over the network. Overtime, the apps have become highly interconnected, leveraging various networking protocols, architecture patterns, and cutting edge technologies to improve user experience and deliver great results.</p><p>Applications typically talk to the &#8220;backend server&#8220; via APIs. APIs have been developed on the backend using various programming languages, which implement HTTP protocol support in their source code or libraries. As developers we don&#8217;t always think about it in deeper sense. For us, working API means using the http package. At times, we don&#8217;t even bother about the HTTP version - 1.1, 2, or 3.</p><p>I think it is important to understand the Hypertext Transfer Protocol (HTTP) a bit better and the improvements that it has undergone in the last decade.</p><p>HTTP/1.1 - introduced in 1997, laid the foundation as a text-based protocol relying on TCP for communication. When a request is made using HTTP/1.1, it is processed sequentially, often leading to delays when multiple resources are needed, a problem worsened by its lack of header compression and limited ability to handle parallel requests efficiently. Despite these constraints, its simplicity and widespread adoption have kept it relevant.</p><p>HTTP/2, finalized in 2015, marked a significant improvement where it adopted a binary format and introduced multiplexing. HTTP/2 allows multiple requests and responses to travel over a single connection simultaneously, reducing latency. It also compresses headers to cut bandwidth use and offers server push, enabling proactive resource delivery. However, its reliance on TCP can still cause delays if packets are lost, as the protocol waits for retransmission, which led to HTTP/3.</p><p>HTTP/3, which was standardized in 2022, builds on HTTP/2&#8217;s strengths but uses to QUIC (Quick UDP Internet Connections) protocol that runs over UDP. This change removes the bottlenecks introduced by TCP such as - head-of-line blocking, by allowing independent streams to proceed without delay. QUIC also integrates, and in fact mandates, TLS 1.3 encryption. This results in sped up secure-by-default connections with zero-round-trip resuming, making HTTP/3 ideal for modern, high-latency environments like mobile networks. While retaining HTTP/2&#8217;s multiplexing and compression, it adds resilience to network changes, such as switching from Wi-Fi to cellular.</p><p>This information leads us to ask questions like - how does it matter? what does it take for our applications to make use of HTTP/2 or HTTP/3? Or are they already using it? Does this involve code refactoring? or turning on the infrastructure support is enough? Does it increase or decrease cost? Is the current infrastructure supported?</p><p>We can approach these questions in 2 parts - application and infrastructure.</p><ol><li><p>Application - also represent the programming effort and what changes we may need.</p><ol><li><p>Optimization for multiplexing - When working with HTTP/1.1, we often bundle static assets to cater to sequential nature of communication. With HTTP/2 and HTTP3, we can leverage multiplexing and parallel delivery.</p></li><li><p>Server push - HTTP/2, you can take advantage of server push function to send certain critical data to client even before they request for it. Think notifications.</p></li><li><p>Fallback mechanisms - if you decide to build support for HTTP/3, consider building fallback mechanisms for HTTP/2 and HTTP/1.1. Mainly because, HTTP/3 is still quite new and end user devices might lack support.</p></li><li><p>Minimize header overhead - HTTP/2 and HTTP/3 improves performance by compressing headers. This opens 2 ways - minimize headers and further improve performance (should do anyway), or add new header to drastically imrove UX/feature without worrying much about overhead.</p></li><li><p>Handle blocking operations - HTTP/3 leverages UDP, which is great for unreliable networks. But this can also mean that tightly coupled code can misbehave.</p></li></ol></li><li><p>Infrastructure - servers, functions, clusters, gateways, etc.</p><ol><li><p>Protocol support on servers - Some cloud providers might need you to explicitly enable support for HTTP/2 and HTTP/3 protocols. If you are using reverse proxy like NGINX, make sure to configure the same.</p></li><li><p>TLS Configuration - HTTP/2 need TLS1.2 and HTTP/3 mandates TLS1.3. Using strong ciphers, configuring load balancers, and creating custom mechanism where required might be needed.</p></li><li><p>Network config - Use various tools to monitor network performance for throughput, latency. You might need to change firewall rules to enable UDP protocol, and open up secure ports.</p></li><li><p>CDN with HTTP/3 support - Offloading the protocol complexity (handshakes, etc.) to CDN reduces the processing workload on the application. CDNs can also help in routing traffic to appropriate backend that supports appropriate protocols.</p></li></ol></li></ol><p>Keeping an eye on the latest updates on the development and adoption of these improvements will always be helpful.</p><h2>Blog updates</h2><p>This week I published 2 more articles around gRPC.</p><h4><a href="https://letsdote.ch/post/grpc-communication-patterns/">gRPC Communication Patterns</a></h4><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://letsdote.ch/post/grpc-communication-patterns/" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!rIpK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e2b0153-8322-40f7-9e2b-345f58eac217_1920x1080.png 424w, https://substackcdn.com/image/fetch/$s_!rIpK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e2b0153-8322-40f7-9e2b-345f58eac217_1920x1080.png 848w, https://substackcdn.com/image/fetch/$s_!rIpK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e2b0153-8322-40f7-9e2b-345f58eac217_1920x1080.png 1272w, https://substackcdn.com/image/fetch/$s_!rIpK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e2b0153-8322-40f7-9e2b-345f58eac217_1920x1080.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!rIpK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e2b0153-8322-40f7-9e2b-345f58eac217_1920x1080.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5e2b0153-8322-40f7-9e2b-345f58eac217_1920x1080.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:78352,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://letsdote.ch/post/grpc-communication-patterns/&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://news.letsdote.ch/i/158249649?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e2b0153-8322-40f7-9e2b-345f58eac217_1920x1080.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!rIpK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e2b0153-8322-40f7-9e2b-345f58eac217_1920x1080.png 424w, https://substackcdn.com/image/fetch/$s_!rIpK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e2b0153-8322-40f7-9e2b-345f58eac217_1920x1080.png 848w, https://substackcdn.com/image/fetch/$s_!rIpK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e2b0153-8322-40f7-9e2b-345f58eac217_1920x1080.png 1272w, https://substackcdn.com/image/fetch/$s_!rIpK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e2b0153-8322-40f7-9e2b-345f58eac217_1920x1080.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>One of the advantages gRPC offers over REST based services is the streaming bi-directional communication. Traditional implementations which depend on REST APIs often implement Web Sockets to enable real bi-directional streaming of data packets. I said real because it is still possible to simulate streaming behavior using REST, which of course is not performant, and makes little sense.</p><h4><a href="https://letsdote.ch/post/grpc-in-kubernetes/">gRPC in Kubernetes</a></h4><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://letsdote.ch/post/grpc-in-kubernetes/" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!YbH7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7de29fb3-575d-4f41-8c24-c7f5dca39df1_1920x1080.png 424w, https://substackcdn.com/image/fetch/$s_!YbH7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7de29fb3-575d-4f41-8c24-c7f5dca39df1_1920x1080.png 848w, https://substackcdn.com/image/fetch/$s_!YbH7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7de29fb3-575d-4f41-8c24-c7f5dca39df1_1920x1080.png 1272w, https://substackcdn.com/image/fetch/$s_!YbH7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7de29fb3-575d-4f41-8c24-c7f5dca39df1_1920x1080.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!YbH7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7de29fb3-575d-4f41-8c24-c7f5dca39df1_1920x1080.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7de29fb3-575d-4f41-8c24-c7f5dca39df1_1920x1080.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:67292,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://letsdote.ch/post/grpc-in-kubernetes/&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://news.letsdote.ch/i/158249649?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7de29fb3-575d-4f41-8c24-c7f5dca39df1_1920x1080.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!YbH7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7de29fb3-575d-4f41-8c24-c7f5dca39df1_1920x1080.png 424w, https://substackcdn.com/image/fetch/$s_!YbH7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7de29fb3-575d-4f41-8c24-c7f5dca39df1_1920x1080.png 848w, https://substackcdn.com/image/fetch/$s_!YbH7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7de29fb3-575d-4f41-8c24-c7f5dca39df1_1920x1080.png 1272w, https://substackcdn.com/image/fetch/$s_!YbH7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7de29fb3-575d-4f41-8c24-c7f5dca39df1_1920x1080.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>I have been experimenting with gRPC for some time now. I wrote some articles to cover the basics like <a href="https://letsdote.ch/post/intro-to-grpc-and-protocol-buffers-using-go/">What is gRPC?</a> <a href="https://letsdote.ch/post/grpc-ssl-tls-auth/">SSL/TLS Auth in gRPC</a>, and <a href="https://letsdote.ch/post/grpc-communication-patterns/">communication patterns used in gRPC</a>. In these topics I went through some of the advantages of gRPC over traditional REST API for inter-service communication &#8211; especially in a distributed architecture which led me to wonder about how gRPC works in Kubernetes environment. The crux is &#8211; gRPC offers great performance using Protobuf and natively supports uni and bi directional streaming.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://news.letsdote.ch/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Let's Do Tech! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[Budge: Product (soft) launch, tech blogs, and future plans.]]></title><description><![CDATA[I am excited to be back!]]></description><link>https://news.letsdote.ch/p/budge-product-soft-launch-tech-blogs</link><guid isPermaLink="false">https://news.letsdote.ch/p/budge-product-soft-launch-tech-blogs</guid><dc:creator><![CDATA[Sumeet Ninawe]]></dc:creator><pubDate>Mon, 17 Feb 2025 06:23:52 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1551263640-1c007852f616?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1Mnx8cHJvZHVjdCUyMGxhdW5jaHxlbnwwfHx8fDE3Mzk3Mjk4MDR8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1551263640-1c007852f616?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1Mnx8cHJvZHVjdCUyMGxhdW5jaHxlbnwwfHx8fDE3Mzk3Mjk4MDR8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1551263640-1c007852f616?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1Mnx8cHJvZHVjdCUyMGxhdW5jaHxlbnwwfHx8fDE3Mzk3Mjk4MDR8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1551263640-1c007852f616?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1Mnx8cHJvZHVjdCUyMGxhdW5jaHxlbnwwfHx8fDE3Mzk3Mjk4MDR8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1551263640-1c007852f616?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1Mnx8cHJvZHVjdCUyMGxhdW5jaHxlbnwwfHx8fDE3Mzk3Mjk4MDR8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1551263640-1c007852f616?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1Mnx8cHJvZHVjdCUyMGxhdW5jaHxlbnwwfHx8fDE3Mzk3Mjk4MDR8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1551263640-1c007852f616?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1Mnx8cHJvZHVjdCUyMGxhdW5jaHxlbnwwfHx8fDE3Mzk3Mjk4MDR8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" width="6000" height="4000" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1551263640-1c007852f616?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1Mnx8cHJvZHVjdCUyMGxhdW5jaHxlbnwwfHx8fDE3Mzk3Mjk4MDR8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:4000,&quot;width&quot;:6000,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;black app sign on white wall&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="black app sign on white wall" title="black app sign on white wall" srcset="https://images.unsplash.com/photo-1551263640-1c007852f616?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1Mnx8cHJvZHVjdCUyMGxhdW5jaHxlbnwwfHx8fDE3Mzk3Mjk4MDR8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1551263640-1c007852f616?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1Mnx8cHJvZHVjdCUyMGxhdW5jaHxlbnwwfHx8fDE3Mzk3Mjk4MDR8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1551263640-1c007852f616?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1Mnx8cHJvZHVjdCUyMGxhdW5jaHxlbnwwfHx8fDE3Mzk3Mjk4MDR8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1551263640-1c007852f616?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1Mnx8cHJvZHVjdCUyMGxhdW5jaHxlbnwwfHx8fDE3Mzk3Mjk4MDR8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="true">Tim van der Kuip</a> on <a href="https://unsplash.com">Unsplash</a></figcaption></figure></div><p>The last time I sent out the LDT News issue was a year and ten days ago, and since then I never uttered a word, until today. The reason being - rethinking that involves a lot of overthinking. Rethinking about the definite path to build Let&#8217;s Do Tech. I have been addressing questions like - whether it should be a solo peaceful venture or an investment marathon? what does Let&#8217;s Do Tech mean to me? What do I want to do with it? etc.</p><p>The good news is, I have some clarity and made a few promises to myself around this. I may not be 100% sure of what I want to do, but whatever 20% is fixed is quite concrete. And if you are a fan of 80:20 rule - you get the jig. IMO, it is difficult to make such promises, and one has to be careful. Carelessness is the other way, and it works, but not my cup of tea.</p><p>This does not mean that I did not do anything apart from thinking. I just chose to shut my mouth until I reached a point where my position made sense to myself. I have not published anything, anywhere, not even on my personal social media pages. But trust me, I have worked on quite a few things in the meanwhile and I am excited to share them with you, in LDT News series.</p><p>As far as this newsletter is concerned - I want to send out issues, but only when I have something substantial to say. That doesn&#8217;t mean I will be silent for the next one year. I will be sending out blog post updates where I often write about product dev, system design, architecture, and perhaps starting this year - AI. I would also shed some light on certain decisions I made to run LDT in a specific way, so that others can benefit from it in some way.</p><h3><a href="https://budge.me">Product launch: Budge - for the traveller in you</a></h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://budge.me" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!6TeB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F550427dd-7615-4193-b462-fd20805efcee_1100x413.png 424w, https://substackcdn.com/image/fetch/$s_!6TeB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F550427dd-7615-4193-b462-fd20805efcee_1100x413.png 848w, https://substackcdn.com/image/fetch/$s_!6TeB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F550427dd-7615-4193-b462-fd20805efcee_1100x413.png 1272w, https://substackcdn.com/image/fetch/$s_!6TeB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F550427dd-7615-4193-b462-fd20805efcee_1100x413.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6TeB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F550427dd-7615-4193-b462-fd20805efcee_1100x413.png" width="728" height="273.3309090909091" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/550427dd-7615-4193-b462-fd20805efcee_1100x413.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:413,&quot;width&quot;:1100,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:52088,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://budge.me&quot;,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!6TeB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F550427dd-7615-4193-b462-fd20805efcee_1100x413.png 424w, https://substackcdn.com/image/fetch/$s_!6TeB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F550427dd-7615-4193-b462-fd20805efcee_1100x413.png 848w, https://substackcdn.com/image/fetch/$s_!6TeB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F550427dd-7615-4193-b462-fd20805efcee_1100x413.png 1272w, https://substackcdn.com/image/fetch/$s_!6TeB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F550427dd-7615-4193-b462-fd20805efcee_1100x413.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>I launched Budge (v0.1.1, now v0.1.2) in January this year. It is a basic travel app to help you to cut down on your research time for the things to do at the destination you are travelling to. You can also maintain your Budge profile which caters to the question we all get - Where all have you been? You can find more information about the app on the <a href="https://budge.me">website</a>, or in this <a href="https://letsdote.ch/post/budge-v0-1-1/">blog post</a>.</p><p>This is the first time ever I have done something like this. First time building the mobile app, first time releasing it to the app stores under the LDT banner, etc. Am I happy with the app? No. I made a lot of mistakes, and there is still a long way to go. But I learnt a lot of things while doing this. I realise that Budge is a very large project in terms of &#8220;could be features&#8221;. For now, try downloading the app and feel free to let me know any feedback you may have.</p><h5>Backstory</h5><p>I have been a backend guy for all of the 14 years of my career. Even though I know a lot of cool stuff there, I always had to struggle with frontend simply because I could not afford to spend more time. This also kept me from launching my own products. I know - it doesn&#8217;t make sense to do everything by myself, more over its not even scalable in the long run. But more on that later.</p><h3>Blogs</h3><p>I have started publishing again.</p><p>And I never stopped learning. Somewhere in the past I made a post about &#8220;Why learning K8s is important&#8220;. Amongst other things, I followed my own words and got certified in the October of the last year. Continuing the tradition, this year I plan to learn and work on &#8220;AI/ML stuff&#8221;. Apologies, but as a newbie I don&#8217;t have better words to choose. But I will of course keep publishing blogs on the Cloud and DevOps. Here are some blogs I published recently.</p><h4><a href="https://letsdote.ch/post/intro-to-grpc-and-protocol-buffers-using-go/">Intro to gRPC and Protocol Buffers using Go</a></h4><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://letsdote.ch/post/intro-to-grpc-and-protocol-buffers-using-go/" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!On5l!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3332dbe8-dd21-4408-8299-56c1ac45fea1_1920x1080.png 424w, https://substackcdn.com/image/fetch/$s_!On5l!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3332dbe8-dd21-4408-8299-56c1ac45fea1_1920x1080.png 848w, https://substackcdn.com/image/fetch/$s_!On5l!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3332dbe8-dd21-4408-8299-56c1ac45fea1_1920x1080.png 1272w, https://substackcdn.com/image/fetch/$s_!On5l!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3332dbe8-dd21-4408-8299-56c1ac45fea1_1920x1080.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!On5l!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3332dbe8-dd21-4408-8299-56c1ac45fea1_1920x1080.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3332dbe8-dd21-4408-8299-56c1ac45fea1_1920x1080.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:88908,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://letsdote.ch/post/intro-to-grpc-and-protocol-buffers-using-go/&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!On5l!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3332dbe8-dd21-4408-8299-56c1ac45fea1_1920x1080.png 424w, https://substackcdn.com/image/fetch/$s_!On5l!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3332dbe8-dd21-4408-8299-56c1ac45fea1_1920x1080.png 848w, https://substackcdn.com/image/fetch/$s_!On5l!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3332dbe8-dd21-4408-8299-56c1ac45fea1_1920x1080.png 1272w, https://substackcdn.com/image/fetch/$s_!On5l!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3332dbe8-dd21-4408-8299-56c1ac45fea1_1920x1080.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>gRPC had been on my radar since a long time, and honestly I never got to explore it fully. The blog post above provides a quick introduction to gRPC and the example will help you realise what it would be like working with gRPC and get you up to speed.</p><h4><a href="https://letsdote.ch/post/grpc-ssl-tls-auth/">Implementing SSL/TLS Auth in gRPC</a></h4><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://letsdote.ch/post/grpc-ssl-tls-auth/" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!sohG!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff4a0c81-dada-42c4-85f8-32f1e1d0aaae_1920x1080.png 424w, https://substackcdn.com/image/fetch/$s_!sohG!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff4a0c81-dada-42c4-85f8-32f1e1d0aaae_1920x1080.png 848w, https://substackcdn.com/image/fetch/$s_!sohG!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff4a0c81-dada-42c4-85f8-32f1e1d0aaae_1920x1080.png 1272w, https://substackcdn.com/image/fetch/$s_!sohG!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff4a0c81-dada-42c4-85f8-32f1e1d0aaae_1920x1080.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!sohG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff4a0c81-dada-42c4-85f8-32f1e1d0aaae_1920x1080.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ff4a0c81-dada-42c4-85f8-32f1e1d0aaae_1920x1080.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:67931,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://letsdote.ch/post/grpc-ssl-tls-auth/&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!sohG!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff4a0c81-dada-42c4-85f8-32f1e1d0aaae_1920x1080.png 424w, https://substackcdn.com/image/fetch/$s_!sohG!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff4a0c81-dada-42c4-85f8-32f1e1d0aaae_1920x1080.png 848w, https://substackcdn.com/image/fetch/$s_!sohG!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff4a0c81-dada-42c4-85f8-32f1e1d0aaae_1920x1080.png 1272w, https://substackcdn.com/image/fetch/$s_!sohG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff4a0c81-dada-42c4-85f8-32f1e1d0aaae_1920x1080.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Ever since I dealt with certificate based auth mechanism, I have been a huge fan. One can never say not to secure communication these days. SSL/TLS based auth IMO is the &#8220;easiest best&#8221; way to secure machine-to-machine gRPC comms. It supports other auth mechanisms as well, which I will cover in later blog posts.</p><div class="poll-embed" data-attrs="{&quot;id&quot;:274110}" data-component-name="PollToDOM"></div><p></p>]]></content:encoded></item><item><title><![CDATA[Automating Containerized Tasks Using Argo Workflows]]></title><description><![CDATA[Lightweight introduction to Argo toolset - starting with Workflows]]></description><link>https://news.letsdote.ch/p/automating-containerized-tasks-using</link><guid isPermaLink="false">https://news.letsdote.ch/p/automating-containerized-tasks-using</guid><pubDate>Wed, 07 Feb 2024 20:47:49 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1574717024757-c1ec4d86ae82?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHx3b3JrZmxvd3N8ZW58MHx8fHwxNzA3MTcyMDE0fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1574717024757-c1ec4d86ae82?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHx3b3JrZmxvd3N8ZW58MHx8fHwxNzA3MTcyMDE0fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1574717024757-c1ec4d86ae82?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHx3b3JrZmxvd3N8ZW58MHx8fHwxNzA3MTcyMDE0fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1574717024757-c1ec4d86ae82?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHx3b3JrZmxvd3N8ZW58MHx8fHwxNzA3MTcyMDE0fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1574717024757-c1ec4d86ae82?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHx3b3JrZmxvd3N8ZW58MHx8fHwxNzA3MTcyMDE0fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1574717024757-c1ec4d86ae82?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHx3b3JrZmxvd3N8ZW58MHx8fHwxNzA3MTcyMDE0fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1574717024757-c1ec4d86ae82?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHx3b3JrZmxvd3N8ZW58MHx8fHwxNzA3MTcyMDE0fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" width="6000" height="4000" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1574717024757-c1ec4d86ae82?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHx3b3JrZmxvd3N8ZW58MHx8fHwxNzA3MTcyMDE0fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:4000,&quot;width&quot;:6000,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;flat screen TV&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="flat screen TV" title="flat screen TV" srcset="https://images.unsplash.com/photo-1574717024757-c1ec4d86ae82?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHx3b3JrZmxvd3N8ZW58MHx8fHwxNzA3MTcyMDE0fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1574717024757-c1ec4d86ae82?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHx3b3JrZmxvd3N8ZW58MHx8fHwxNzA3MTcyMDE0fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1574717024757-c1ec4d86ae82?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHx3b3JrZmxvd3N8ZW58MHx8fHwxNzA3MTcyMDE0fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1574717024757-c1ec4d86ae82?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHx3b3JrZmxvd3N8ZW58MHx8fHwxNzA3MTcyMDE0fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/@peter_s">Peter Stumpf</a> on <a href="https://unsplash.com">Unsplash</a></figcaption></figure></div><p>One of the most used open source tools to assist container orchestration in the CNCF landscape is Argo. It offers 4 different offerings - Workflows, Rollouts, Events, and CD (Continuous Deployment). I got some time to play around with Argo Workflows and the same is discussed in this post.</p><p>Automation is the king today in almost all paths of life. It facilitates convenience and abstracts away the redundant and menial tasks, and lets us focus on better things. Almost in all the automation solutions, and especially in DevOps, automation often involves a series of steps and decisions undertaken by the system to achieve a certain result.</p><p>These series of steps and decisions are known as workflows. Argo Workflows mean the same in the context of containers. With Argo Workflows, it is possible to program a workflow to be executed by multiple containers either in sequence or in parallel.</p><h3>Pre-requisites</h3><p>Apart from the kubectl, Docker, and minikube installation, working with Argo Workflows requires the Argo CLI to be installed as well. As far as configuration files are concerned, it follows the format similar to, but not same as Kubernetes resources. Argo introduces CRDs for K8s, and Workflows is an example of the same. We will see how later in this post.</p><h3>Why do we need workflows?</h3><p>Imagine a scenario where we have to process an image (picture) in a series of steps to apply multiple effects followed by changing the dimensions of the photograph, etc. Let us assume that every modification is performed by an individual programs which are containerised. If we know the sequence of the transformations, then we can use Argo Workflows to spin up corresponding container images, pass the image as input for processing, and then pass the processed image to the next container, and so on.</p><h3>Basic Argo Workflow example</h3><p>You might have used Docker to run single containers, or kubectl to run an instance of a container in a pod within Kubernetes. The example below shows how to achieve the same using Argo Workflow. Note that this example is just to familiarise you with how Argo templates are used to create container instances.</p><pre><code>apiVersion: argoproj.io/v1alpha1
kind: Workflow                  
metadata:
  generateName: image-inverter-    
spec:
  entrypoint: invertimage          
  templates:
    - name: invertimage              
      container:
        image: docker/invertimage
        command: [ invert ]
        args: [ "picture.jpg" ]</code></pre><p>Here, we specify the <code>apiVersion</code> as <code>argoproj.io/v1alpha1</code> and <code>kind</code> as <code>Workflow</code>. This lets K8s know where to get the resource definitions from and what kind of resources will be created in the K8s environment. We also supply a generateName attribute under metadata which helps generate a unique name by appending a string of random alphanumeric characters.</p><p>The spec section defines an entry point. Every workflow requires an entry point, where the execution begins. The templates attribute which follows, defines the <code>entrypoint</code> further with respect to its container image repository location, command to run in the container and some arguments.</p><p>Apply this yaml template by running the Argo CLI command as below.</p><p><code>argo submit &lt;filename&gt;.yaml</code></p><p>This will create a container instance of <code>invertimage</code> image, run the <code>invert</code> command with args specified and shutdown once the invert process is complete.</p><h3>High-level image processing example</h3><p>The example above is a very basic introduction to YAMLs to be written to use Argo capabilities. Lets assume that we want to process the image in below sequence of activities:</p><ol><li><p>Invert operation - containerised as invertimage image</p></li><li><p>Increase the brightness operation - containerised as brightness image</p></li><li><p>Highlight the edges operation - containerised as highlight image</p></li><li><p>Compress - containerised as compress image</p></li></ol><p>To achieve this, we make use of Steps in Argo Workflow, as shown below.</p><pre><code>apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: image-processing-
spec:
  entrypoint: image-processor
  templates:
    - name: invertimage
        inputs:
          parameters:
            - name: imagename
        container:
          image: docker/invertimage
          command: [ invert ]
          args: [ "{{inputs.parameters.imagename}}" ]
    - name: brightness
        inputs:
          parameters:
            - name: imagename
        container:
          image: docker/brightness
          command: [ invert ]
          args: [ "{{inputs.parameters.imagename}}" ]
    - name: highlight
        inputs:
          parameters:
            - name: imagename
        container:
          image: docker/highlight
          command: [ invert ]
          args: [ "{{inputs.parameters.imagename}}" ]
    - name: compress
        inputs:
          parameters:
            - name: imagename
        container:
          image: docker/compress
          command: [ invert ]
          args: [ "{{inputs.parameters.imagename}}" ]
    - name: image-processor
      steps:
        - - name: invert
            template: invertimage
            arguments:
              parameters:
              - name: imagename
                value: "picture.jpg"
        - - name: brighten
            template: brightness
            arguments:
              parameters:
              - name: imagename
                value: "picture.jpg"
        - - name: highlight
            template: highlight
            arguments:
              parameters:
              - name: imagename
                value: "picture.jpg"
        - - name: compress
            template: compress
            arguments:
              parameters:
              - name: imagename
                value: "picture.jpg"</code></pre><p>Note that the example above does NOT work - this is only for representational purpose to understand how is it possible to configure Argo Workflow.</p><p>Here, after the <code>entrypoint</code> spec, we define a few <code>templates</code>. The template name specified in the entrypoint &#8220;<code>image-processor</code>&#8220; depends on more templates, which constitute individual steps in the workflow. The individual steps are also called as leaf nodes and all of them are specified with the corresponding image names based on the operation they perform.</p><p>In the <code>image-processor</code> template, we specify steps referring to the leaf node templates and pass the parameter argument indicating the filename of the image that needs to be processed. The sequence is defined using &#8216;-&#8216;. &#8216;<code> - -</code>&#8216; means that the workflow needs to wait for the previous step to complete. Whereas, &#8216;<code> -</code>&#8217; would mean the next job can run in parallel to the current step.</p><p>Learn more about Argo Workflows here: https://argo-workflows.readthedocs.io/en/latest/</p>]]></content:encoded></item><item><title><![CDATA[HNY 2024! 🥳 Too late? 🙈]]></title><description><![CDATA[I am back with cool stuff!]]></description><link>https://news.letsdote.ch/p/hny-2024-too-late</link><guid isPermaLink="false">https://news.letsdote.ch/p/hny-2024-too-late</guid><pubDate>Mon, 22 Jan 2024 04:32:16 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1503238774835-1e800884d53b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1OXx8bmV3JTIweWVhcnxlbnwwfHx8fDE3MDU4MzU0ODJ8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1503238774835-1e800884d53b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1OXx8bmV3JTIweWVhcnxlbnwwfHx8fDE3MDU4MzU0ODJ8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1503238774835-1e800884d53b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1OXx8bmV3JTIweWVhcnxlbnwwfHx8fDE3MDU4MzU0ODJ8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1503238774835-1e800884d53b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1OXx8bmV3JTIweWVhcnxlbnwwfHx8fDE3MDU4MzU0ODJ8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1503238774835-1e800884d53b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1OXx8bmV3JTIweWVhcnxlbnwwfHx8fDE3MDU4MzU0ODJ8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1503238774835-1e800884d53b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1OXx8bmV3JTIweWVhcnxlbnwwfHx8fDE3MDU4MzU0ODJ8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1503238774835-1e800884d53b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1OXx8bmV3JTIweWVhcnxlbnwwfHx8fDE3MDU4MzU0ODJ8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" width="5472" height="3648" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1503238774835-1e800884d53b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1OXx8bmV3JTIweWVhcnxlbnwwfHx8fDE3MDU4MzU0ODJ8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:3648,&quot;width&quot;:5472,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;bokeh photography of sparkler&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="bokeh photography of sparkler" title="bokeh photography of sparkler" srcset="https://images.unsplash.com/photo-1503238774835-1e800884d53b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1OXx8bmV3JTIweWVhcnxlbnwwfHx8fDE3MDU4MzU0ODJ8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1503238774835-1e800884d53b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1OXx8bmV3JTIweWVhcnxlbnwwfHx8fDE3MDU4MzU0ODJ8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1503238774835-1e800884d53b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1OXx8bmV3JTIweWVhcnxlbnwwfHx8fDE3MDU4MzU0ODJ8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1503238774835-1e800884d53b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1OXx8bmV3JTIweWVhcnxlbnwwfHx8fDE3MDU4MzU0ODJ8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/@t_rampersad">Tessa Rampersad</a> on <a href="https://unsplash.com">Unsplash</a></figcaption></figure></div><p>Hey!</p><p>I hope it&#8217;s not too late for wishing you a very Happy New Year 2024! Apologies for the late wishes though. My vacations extended for way to long than intended. I would not call them vacations since I wasn&#8217;t really having a &#8220;leisure&#8221; time. But I did take time to address certain things on personal front to put them behind closed doors once and for all.</p><p>Anyway, as promised, I am back with some more cool stuff around Cloud and DevOps. While I was away I could think of many ideas with which I can deliver more value to you, starting with this newsletter. Instead of delivering a tech-capsule in each email, I plan to <strong>publish more during the week and send a consolidated newsletter at the beginning of the week</strong>.</p><p>This will also help me in being more conversational with you in my newsletter and perhaps will give more points for you to discuss them with me. As I have always mentioned, <strong>I always look forward to your comments and opinions</strong> on everything, especially the feedback that would make this newsletter more worthwhile.</p><p>This year, I plan for major changes with regards to my career. It finally looks like the sky is clear to take off towards a full-time independent role. Going indie full time for me means, I will <strong>write more, explore more, build more, and develop more</strong>. I am keen to share this journey with you so that you can do this too!</p><div class="pullquote"><p><strong>Let my failures be the lessons for all of us.</strong></p></div><p>Having said that, here are a couple of blog posts I wrote this week.</p><h4><a href="https://blog.letsdote.ch/p/why-should-you-take-kubernetes-seriously">Why Should You Take Kubernetes Seriously In 2024.</a></h4><p>New year new resolutions. When it comes to learning a new tech, we often end up in a situation where we learn it &#8220;as and when required&#8221;. I did the same with Kubernetes since a few years - only to realise its worth towards the end of 2023. It was then, when I realised that mastering Kubernetes is a much needed virtue in Cloud and DevOps career. This post describes why we should take up Kubernetes as priority ASAP, i.e. 2024.</p><h4><a href="https://blog.letsdote.ch/p/managing-postgresql-instance-on-rds">Managing PostgreSQL instance on RDS using Pulumi and Go</a></h4><p>Keeping in tune with the New Year theme, I picked up Pulumi to explore more. Well, I didn&#8217;t exactly start this year, but I have been doing it since a couple of months while travelling. In this post, I talk about how to manage - i.e. provision and configure - a relational database in AWS. We should know by now that provisioning databases in cloud is straightforward, but configuring them using IaC can be a bit challenging. Here I present an example of provisioning a PostgreSQL database instance, and configuring a few parameters, using Pulumi.</p><p></p><p>Sumeet N.</p><p> </p>]]></content:encoded></item><item><title><![CDATA[Managing PostgreSQL instance on RDS using Pulumi and Go]]></title><description><![CDATA[New year, new tool!]]></description><link>https://news.letsdote.ch/p/managing-postgresql-instance-on-rds</link><guid isPermaLink="false">https://news.letsdote.ch/p/managing-postgresql-instance-on-rds</guid><pubDate>Sun, 21 Jan 2024 09:31:20 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1555066931-4365d14bab8c?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw2fHxjb2RlfGVufDB8fHx8MTcwNTgyOTM2NHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1555066931-4365d14bab8c?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw2fHxjb2RlfGVufDB8fHx8MTcwNTgyOTM2NHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1555066931-4365d14bab8c?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw2fHxjb2RlfGVufDB8fHx8MTcwNTgyOTM2NHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1555066931-4365d14bab8c?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw2fHxjb2RlfGVufDB8fHx8MTcwNTgyOTM2NHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1555066931-4365d14bab8c?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw2fHxjb2RlfGVufDB8fHx8MTcwNTgyOTM2NHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1555066931-4365d14bab8c?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw2fHxjb2RlfGVufDB8fHx8MTcwNTgyOTM2NHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1555066931-4365d14bab8c?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw2fHxjb2RlfGVufDB8fHx8MTcwNTgyOTM2NHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" width="5184" height="3456" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1555066931-4365d14bab8c?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw2fHxjb2RlfGVufDB8fHx8MTcwNTgyOTM2NHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:3456,&quot;width&quot;:5184,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;turned-on MacBook Pro wit programming codes display&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="turned-on MacBook Pro wit programming codes display" title="turned-on MacBook Pro wit programming codes display" srcset="https://images.unsplash.com/photo-1555066931-4365d14bab8c?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw2fHxjb2RlfGVufDB8fHx8MTcwNTgyOTM2NHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1555066931-4365d14bab8c?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw2fHxjb2RlfGVufDB8fHx8MTcwNTgyOTM2NHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1555066931-4365d14bab8c?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw2fHxjb2RlfGVufDB8fHx8MTcwNTgyOTM2NHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1555066931-4365d14bab8c?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw2fHxjb2RlfGVufDB8fHx8MTcwNTgyOTM2NHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/@clark_fransa">Arnold Francisca</a> on <a href="https://unsplash.com">Unsplash</a></figcaption></figure></div><p>I have been dabbling with Pulumi since a couple of months, which is an Infrastructure as Code tool. I would not call myself an expert at this stage, but having closely worked with IaC it was easy for me to learn Pulumi. This is the first ever post I have written on Pulumi, and in this post I discuss how easy it is to spin up a PostgreSQL database instance in RDS.</p><h2>Provisioning</h2><p>Creating a relational database in RDS is easy. But the database experts would disagree with this statement. Data is important, and thus how we configure the database for security and efficiency matters a lot. Spinning a basic PostgreSQL instance is a matter of few seconds, whether you do it with web console or any API calls. But to configure the same, there are hundreds of parameters available.</p><p>The reason I tried to create and configure RDS database using Pulumi is that I really wanted to experience for myself - how exactly can we configure the database instance parameters. It was as expected - straightforward.</p><p>The code below provisions a basic PostgreSQL instance. I have used Pulumi&#8217;s Golang SDK, and the same is achievable using TS, Java, Python, C#, and YAML.</p><pre><code>package main

import (
&#9;"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/rds"
&#9;"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
&#9;pulumi.Run(func(ctx *pulumi.Context) error {

&#9;&#9;// Create the database instance
&#9;&#9;db, err := rds.NewInstance(ctx, "myrds", &amp;rds.InstanceArgs{
&#9;&#9;&#9;AllocatedStorage: pulumi.Int(10),
&#9;&#9;&#9;DbName:           pulumi.String("mypgdb"),
&#9;&#9;&#9;Engine:           pulumi.String("postgres"),
&#9;&#9;&#9;EngineVersion:    pulumi.String("15.4"),
&#9;&#9;&#9;InstanceClass:    pulumi.String("db.t3.micro"),
&#9;&#9;&#9;Password:          pulumi.String("pass1234"),
&#9;&#9;&#9;SkipFinalSnapshot: pulumi.Bool(true),
&#9;&#9;&#9;Username:          pulumi.String("bob"),
&#9;&#9;})
&#9;&#9;if err != nil {
&#9;&#9;&#9;return err
&#9;&#9;}

&#9;})
}
</code></pre><p>Since this post focuses on managing PG Database using Pulumi, I will not go through the details of Pulumi here. However, the code above is fairly readable. The IaC code in Golang to create RDS PostgreSQL instance is wrapped in the <code>pulumi.Run()</code> function.</p><p><code>rds.NewInstance()</code> function defines several parameters like allocated storage, database name, engine and it&#8217;s version, etc. Of course, you can specify more arguments, and <a href="https://www.pulumi.com/registry/packages/aws/api-docs/rds/instance/#inputs">here is the link to Pulumi docs for reference</a>. The parameters specified here are basic - enough to create a database instance.</p><p>Let&#8217;s try to provision this database using Pulumi&#8217;s up command, and observe the output below.</p><pre><code>pulumi up
Previewing update (aws-rds)

View in Browser (Ctrl+O): &lt;URL to Pulumi dashboard&gt;

     Type                 Name             Plan       
 +   pulumi:pulumi:Stack  aws-rds-aws-rds  create     
 +   &#9492;&#9472; aws:rds:Instance  myrds            create     

Resources:
    + 2 to create

Do you want to perform this update? yes
Updating (aws-rds)

View in Browser (Ctrl+O): &lt;URL to Pulumi dashboard&gt;

     Type                 Name             Status             
 +   pulumi:pulumi:Stack  aws-rds-aws-rds  created (210s)     
 +   &#9492;&#9472; aws:rds:Instance  myrds            created (205s)     


Resources:
    + 2 created

Duration: 3m33s</code></pre><p>Note: Since I am using Pulumi&#8217;s backend to manage state and stack information, I have removed the URL information from above output.</p><p>Running <code>pulumi up</code> command has confirmed the creation of RDS instance <code>myrds</code> within a stack named <code>aws-rds-aws-rds</code>. Pulumi creates a stack to manage resources being provisioned in the current directory/project. It counts the stack as one resource, due to which we see that 2 resources are created in the duration of 3m33s.</p><h2>Fetching the database info after provisioning</h2><p>If we check the AWS console, we can find the newly created database. It is also possible to configure output variables to print certain information of the newly created. Some information like the database endpoint is only available after the provisioning process. It is convenient to have relevant information available in the console output for various purposes.</p><p>Let us update the code above by adding <code>ctx.Export</code> function as shown below. Place this function before the return of <code>Run()</code> function.</p><pre><code>//Get database connection string
ctx.Export("DB endpoint", db.Endpoint)</code></pre><p>Here, we are accessing the database endpoint output of the Pulumi run. The <code>Export()</code> function saves this output in the state managed on Pulumi&#8217;s dashboard, as well as outputs the same in console. The screenshot below confirms the same.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!b62O!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbd3a25f-12d6-42f8-802a-e52065a00e39_1002x256.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!b62O!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbd3a25f-12d6-42f8-802a-e52065a00e39_1002x256.png 424w, https://substackcdn.com/image/fetch/$s_!b62O!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbd3a25f-12d6-42f8-802a-e52065a00e39_1002x256.png 848w, https://substackcdn.com/image/fetch/$s_!b62O!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbd3a25f-12d6-42f8-802a-e52065a00e39_1002x256.png 1272w, https://substackcdn.com/image/fetch/$s_!b62O!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbd3a25f-12d6-42f8-802a-e52065a00e39_1002x256.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!b62O!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbd3a25f-12d6-42f8-802a-e52065a00e39_1002x256.png" width="1002" height="256" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cbd3a25f-12d6-42f8-802a-e52065a00e39_1002x256.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:256,&quot;width&quot;:1002,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:22197,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!b62O!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbd3a25f-12d6-42f8-802a-e52065a00e39_1002x256.png 424w, https://substackcdn.com/image/fetch/$s_!b62O!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbd3a25f-12d6-42f8-802a-e52065a00e39_1002x256.png 848w, https://substackcdn.com/image/fetch/$s_!b62O!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbd3a25f-12d6-42f8-802a-e52065a00e39_1002x256.png 1272w, https://substackcdn.com/image/fetch/$s_!b62O!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbd3a25f-12d6-42f8-802a-e52065a00e39_1002x256.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Also observe the console output. You will find the same information there.</p><pre><code>...
Outputs:
    DB endpoint: "myrdsf487fca.cosay9dfuboe.eu-central-1.rds.amazonaws.com:5432"

Resources:
    + 2 created

Duration: 3m33s</code></pre><h2>Configuring PostgreSQL database parameters</h2><p>As discussed previously, various types of relational database have their specific set of configuration parameters. These configuration parameters help database administrators to apply more settings as per their needs. In AWS RDS, this is achieved by creating a Parameter Group and associating the same with relevant database instance.</p><p>The arguments we used in the <code>NewInstance()</code> functions apply to all kinds of databases to be provisioned in AWS RDS. However, since we have provisioned Postgres database and would like to further configure the same, we need to use another Pulumi resource to create Parameter Groups. In the code below, the function <code>rds.NewParameterGroup() </code>provisions a parameter group. Here we have specified a couple of parameters - <code>autovaccum</code> and <code>deadlock_timeout</code> - which are specific to Postgres. </p><p>Note: Refer to <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.PostgreSQL.CommonDBATasks.Parameters.html">this link</a> to find reference to more parameters.</p><p>If you are following along, place this function before <code>rds.NewInstance()</code> function.</p><pre><code>//Parameter group for PostgreSQL
pgParameterGroup, err := rds.NewParameterGroup(ctx, "pg-param-group", &amp;rds.ParameterGroupArgs{
&#9;Family: pulumi.String("postgres15"),
&#9;Parameters: rds.ParameterGroupParameterArray{
&#9;&#9;&amp;rds.ParameterGroupParameterArgs{
&#9;&#9;&#9;ApplyMethod: pulumi.String("immediate"),
&#9;&#9;&#9;Name:        pulumi.String("autovacuum"),
&#9;&#9;&#9;Value:       pulumi.String("1"),
&#9;&#9;},
&#9;&#9;&amp;rds.ParameterGroupParameterArgs{
&#9;&#9;&#9;ApplyMethod: pulumi.String("immediate"),
&#9;&#9;&#9;Name:        pulumi.String("deadlock_timeout"),
&#9;&#9;&#9;Value:       pulumi.String("10"),
&#9;&#9;},

&#9;&#9;// ... more Parameters
&#9;},
})
if err != nil {
&#9;return err
}</code></pre><p>The code above will independently provision a parameter group with above values, but will not associate the same to with our Postgres database instance. To do the same, add one argument named &#8220;<code>ParameterGroupName</code>&#8221; to the <code>NewInstance()</code> function we previously wrote and associate it with the parameter group (<code>pgParameterGroup</code>) we created in above function, and as shown below.</p><pre><code>// Create the database instance
db, err := rds.NewInstance(ctx, "myrds", &amp;rds.InstanceArgs{
&#9;AllocatedStorage:   pulumi.Int(10),
&#9;DbName:             pulumi.String("mypgdb"),
&#9;Engine:             pulumi.String("postgres"),
&#9;EngineVersion:      pulumi.String("15.4"),
&#9;InstanceClass:      pulumi.String("db.t3.micro"),
&#9;Password:           pulumi.String("pass1234"),
&#9;SkipFinalSnapshot:  pulumi.Bool(true),
&#9;Username:           pulumi.String("bob"),
&#9;ParameterGroupName: pgParameterGroup.Name,
})
if err != nil {
&#9;return err
}</code></pre><p>This time when we run &#8220;pulumi up&#8221; the output confirms that we are creating an additional resource - Parameter Group.</p><pre><code>pulumi up     
Previewing update (aws-rds)

View in Browser (Ctrl+O): &lt;URL to Pulumi dashboard&gt;

     Type                       Name             Plan       
 +   pulumi:pulumi:Stack        aws-rds-aws-rds  create     
 +   &#9500;&#9472; aws:rds:ParameterGroup  pg-param-group   create     
 +   &#9492;&#9472; aws:rds:Instance        myrds            create     

Outputs:
    DB endpoint: output&lt;string&gt;

Resources:
    + 3 to create

Do you want to perform this update? yes
Updating (aws-rds)

View in Browser (Ctrl+O): &lt;URL to Pulumi dashboard&gt;

     Type                       Name             Status             
 +   pulumi:pulumi:Stack        aws-rds-aws-rds  created (307s)     
 +   &#9500;&#9472; aws:rds:ParameterGroup  pg-param-group   created (2s)       
 +   &#9492;&#9472; aws:rds:Instance        myrds            created (299s)     

Outputs:
    DB endpoint: "myrds26be326.cosay9dfuboe.eu-central-1.rds.amazonaws.com:5432"

Resources:
    + 3 created

Duration: 5m10s</code></pre><p>After a successful Pulumi execution, login to AWS console and verify if the parameter group is associated with the Postgres database instance. </p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!GnZO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46cedd7b-7f54-4d0c-8021-852115104e90_331x127.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!GnZO!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46cedd7b-7f54-4d0c-8021-852115104e90_331x127.png 424w, https://substackcdn.com/image/fetch/$s_!GnZO!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46cedd7b-7f54-4d0c-8021-852115104e90_331x127.png 848w, https://substackcdn.com/image/fetch/$s_!GnZO!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46cedd7b-7f54-4d0c-8021-852115104e90_331x127.png 1272w, https://substackcdn.com/image/fetch/$s_!GnZO!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46cedd7b-7f54-4d0c-8021-852115104e90_331x127.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!GnZO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46cedd7b-7f54-4d0c-8021-852115104e90_331x127.png" width="331" height="127" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/46cedd7b-7f54-4d0c-8021-852115104e90_331x127.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:127,&quot;width&quot;:331,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:16933,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!GnZO!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46cedd7b-7f54-4d0c-8021-852115104e90_331x127.png 424w, https://substackcdn.com/image/fetch/$s_!GnZO!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46cedd7b-7f54-4d0c-8021-852115104e90_331x127.png 848w, https://substackcdn.com/image/fetch/$s_!GnZO!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46cedd7b-7f54-4d0c-8021-852115104e90_331x127.png 1272w, https://substackcdn.com/image/fetch/$s_!GnZO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46cedd7b-7f54-4d0c-8021-852115104e90_331x127.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h2>Conclusion</h2><p>This was a small demonstration of how can we provision and configure RDS Postgres database using Pulumi. If you would like me to write more similar articles, feel free to subscribe and send me a note.</p>]]></content:encoded></item><item><title><![CDATA[Why Should You Take Kubernetes Seriously In 2024.]]></title><description><![CDATA[Realisations after ignoring it till now.]]></description><link>https://news.letsdote.ch/p/why-should-you-take-kubernetes-seriously</link><guid isPermaLink="false">https://news.letsdote.ch/p/why-should-you-take-kubernetes-seriously</guid><pubDate>Thu, 18 Jan 2024 14:01:25 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1605745341112-85968b19335b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw3fHxrdWJlcm5ldGVzfGVufDB8fHx8MTcwNTU4NTkzMnww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1605745341112-85968b19335b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw3fHxrdWJlcm5ldGVzfGVufDB8fHx8MTcwNTU4NTkzMnww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1605745341112-85968b19335b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw3fHxrdWJlcm5ldGVzfGVufDB8fHx8MTcwNTU4NTkzMnww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1605745341112-85968b19335b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw3fHxrdWJlcm5ldGVzfGVufDB8fHx8MTcwNTU4NTkzMnww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1605745341112-85968b19335b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw3fHxrdWJlcm5ldGVzfGVufDB8fHx8MTcwNTU4NTkzMnww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1605745341112-85968b19335b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw3fHxrdWJlcm5ldGVzfGVufDB8fHx8MTcwNTU4NTkzMnww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1605745341112-85968b19335b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw3fHxrdWJlcm5ldGVzfGVufDB8fHx8MTcwNTU4NTkzMnww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" width="4988" height="3325" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1605745341112-85968b19335b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw3fHxrdWJlcm5ldGVzfGVufDB8fHx8MTcwNTU4NTkzMnww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:3325,&quot;width&quot;:4988,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;blue and red cargo ship on sea during daytime&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="blue and red cargo ship on sea during daytime" title="blue and red cargo ship on sea during daytime" srcset="https://images.unsplash.com/photo-1605745341112-85968b19335b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw3fHxrdWJlcm5ldGVzfGVufDB8fHx8MTcwNTU4NTkzMnww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1605745341112-85968b19335b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw3fHxrdWJlcm5ldGVzfGVufDB8fHx8MTcwNTU4NTkzMnww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1605745341112-85968b19335b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw3fHxrdWJlcm5ldGVzfGVufDB8fHx8MTcwNTU4NTkzMnww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1605745341112-85968b19335b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw3fHxrdWJlcm5ldGVzfGVufDB8fHx8MTcwNTU4NTkzMnww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/@carrier_lost">Ian Taylor</a> on <a href="https://unsplash.com">Unsplash</a></figcaption></figure></div><p>I have always believed in the power of Kubernetes when it comes to managing large workloads for large organisations. However, I am a natural critic, and this virtue drove me toward other directions where I started searching for &#8220;options&#8221;. And there indeed are a few other ways to do what Kubernetes can do. So after travelling the world, I have come to the conclusion that Kubernetes is here to stay and it shines different. Here, I elaborate on a few factors of my personal analysis on why you should take Kubernetes seriously if you haven&#8217;t yet.</p><h2>How to skip Kubernetes and the guilt.</h2><p>I have always been fond of exploring new technologies. Thus, when I came across K8s in 2016 for the first time, I did attempt to explore it then. Soon I found out there were so many concepts, features, and strategies to learn. Moreover there were things beyond documentation, which we could only grasp with experience. I liked the technology then, but it <strong>did not make sense for me to invest time dedicated only for Kubernetes</strong>.</p><p>In the following years, I did work on few more projects involving Kubernetes but the same attitude was carried forward. During this time the serverless domain had started to heat up. The buzz around &#8220;how cost-effective the serverless technology is&#8221; had just begun. There came a point where I thought why can&#8217;t we do the deployments the serverless way? Why do we have to be good at K8s? </p><blockquote><p><em>Being good at Kubernetes is not a joke. It does require dedication. You may work full time on provisioning and managing Kubernetes clusters for a couple of years, and still feel lost.</em></p></blockquote><p>Or even better, if money is not a problem, then why not stick to the basics? Let&#8217;s spin up auto-scaling capabilities and buy a few reserved EC2 instances with load balancers, and we are good to go right? So with such thoughts, I only learnt Kubernetes &#8220;when required&#8221; in the projects, and focused more on alternatives instead.</p><p>It was only in the 2nd half of 2023, I could conclude that nothing beats Kubernetes and had to dedicate my time to learning the same in greater details and more focus. At the same time, I have been thankful to all the &#8220;when required&#8221; learnings, which in my opinion are significant and unorganised.</p><h2>What&#8217;s wrong with non-Kubernetes methods?</h2><p>Generally, a lot depends on the kind and scale of the workload you want to run. Based on this information there are a couple of options as mentioned above.</p><p>Deploying the workloads on EC2 instances in an auto-scaling group, behind a load balancer is a traditional way to do it. But it comes with it&#8217;s own complexities with respect to provisioning of EC2 instances, making them part of the auto-scaling group, placing them in appropriate subnets, paying for the unused capacity, and not being able to go multi-cloud.</p><p>Agreed, that Kubernetes has a steep learning curve and setting up a cluster can be a bit of a complex task. Additionally adopting containerisation and the associated DevOps practices can add up to this initial effort. </p><p>But once done, its abstraction offers flexibility and scalability with minimum efforts. It abstracts away the cognitive load required while thinking about managing new workloads with varied resource requirements.</p><p>On the other hand, serverless sounds quite promising in theory. You may even feel the same way for initial few weeks when traffic is limited. But the cost-effectiveness fades away during peak traffic, when compared to Kubernetes. Serverless also has other not-so-minor issues like cold starts, and there has hardly been any ideal solution around for them.</p><p>Writing web applications for serverless architecture also involves utilizing multiple other services, which require learning. More services also mean more elaborate pricing model. If not given enough attention, it can cause unintended cost implications.</p><h2>Why does Kubernetes make sense?</h2><p>To answer this simply - <strong>Kubernetes provides the much needed optimisation on all fronts at higher scale.</strong></p><p>Working with traditional methods or serverless is completely fine, but with conditions. In terms of cost, if the incoming traffic is not very high, a serverless setup can be very very cost-effective and efficient. The same amount of traffic if served with EC2 instance will accumulate a lot of unnecessary EC2 instance costs.</p><p>On the other hand, serving high traffic on serverless deployments will soon reach the billing limits and will tend to uncover hidden costs in an unpleasant way. One should remember - refactoring serverless apps to containers or executables, and vice versa also involves some effort. Auto-scaling group might sound a better option for high traffic, but it is not the most optimum solution either.</p><p>With the experiences I have had, I can say for sure that all the capabilities offered by Kubernetes make the most sense in these contexts. Kubernetes might not be the right choice at the beginning, but I will always choose the same for it&#8217;s long term management and maintability aspects. </p><h2>When does it make sense to use Kubernetes?</h2><p>The previous sections highlight the fact that it might not be right for small applications and might not financially make sense at the beginning. Kubernetes is definitely not a solution if you are looking at a couple of USD 1000 in monthly revenue. In such cases, I would still stick to which ever non-K8s approach I have been using till now.</p><p>It is important to understand the relationship between the revenue and the costs associated with running a Kubernetes cluster. With this understanding we get a better clarity of the pivot point. Now, depending on how you run your business, you may have this clarity from day 0, and if thats the case and you are sure you will generate enough revenue that overshadows the costs to run K8s - then by all means, go for K8s from day 1.</p><p>However, for smaller applications, applications with lesser traffic, non-critical applications, there is either no revenue model attached, or has a very small revenue. Then K8s might not be the right choice here. </p><p>Lets assume that you are not sure about how a specific application/business would grow, and you decide to go the non-Kubernetes way. First, this is completely fine. Second, keep an eye on economics related to Kubernetes. Periodically ask this specific question to yourself - How much would it cost to run all of this on K8s? vs. How much is it costing you right now? That would give you an idea about when to make a switch with a sufficient runway.</p><h2>Industry demand and influencing factors</h2><p>Lastly, I am not the authority to preach all of this. Looking at the industry, the job openings, the fact that every major and minor cloud platforms offer Kubernetes as a service - it is clear that Kubernetes has proven its importance time and again.</p><p>Some of the crucial factors to think about Kubernetes success are listed below. Feel free to read further on these topics.</p><ol><li><p>Strong community support</p></li><li><p>Rich ecosystem of K8s related products</p></li><li><p>Benefits offered by containerisation</p></li><li><p>CI/CD flexibility</p></li><li><p>Microservices architecture</p></li><li><p>Ease of scaling</p></li><li><p>Reduced operational overhead</p></li><li><p>Vendor lock-in</p></li></ol><h2>Conclusion</h2><p>So 2024 indeed is the 2nd best time to dedicate some time to learn Kubernetes and add this valuable skill to your Cloud and DevOps resume. </p><p></p><p>Sumeet N.</p>]]></content:encoded></item><item><title><![CDATA[Time for some rest and updates! 🏖️]]></title><description><![CDATA[Newsletter updates, the path forward for LDT, less newsletters for the rest of the year!]]></description><link>https://news.letsdote.ch/p/time-for-some-rest-and-updates</link><guid isPermaLink="false">https://news.letsdote.ch/p/time-for-some-rest-and-updates</guid><pubDate>Mon, 06 Nov 2023 04:01:18 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1564613469739-c78f970f9c17?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxN3x8dmFjYXRpb258ZW58MHx8fHwxNjk5MTcwNDAwfDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1564613469739-c78f970f9c17?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxN3x8dmFjYXRpb258ZW58MHx8fHwxNjk5MTcwNDAwfDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1564613469739-c78f970f9c17?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxN3x8dmFjYXRpb258ZW58MHx8fHwxNjk5MTcwNDAwfDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1564613469739-c78f970f9c17?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxN3x8dmFjYXRpb258ZW58MHx8fHwxNjk5MTcwNDAwfDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1564613469739-c78f970f9c17?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxN3x8dmFjYXRpb258ZW58MHx8fHwxNjk5MTcwNDAwfDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1564613469739-c78f970f9c17?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxN3x8dmFjYXRpb258ZW58MHx8fHwxNjk5MTcwNDAwfDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1564613469739-c78f970f9c17?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxN3x8dmFjYXRpb258ZW58MHx8fHwxNjk5MTcwNDAwfDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" width="4719" height="3234" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1564613469739-c78f970f9c17?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxN3x8dmFjYXRpb258ZW58MHx8fHwxNjk5MTcwNDAwfDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:3234,&quot;width&quot;:4719,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;people sitting near seashore viewing sea under orange and blue skies&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="people sitting near seashore viewing sea under orange and blue skies" title="people sitting near seashore viewing sea under orange and blue skies" srcset="https://images.unsplash.com/photo-1564613469739-c78f970f9c17?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxN3x8dmFjYXRpb258ZW58MHx8fHwxNjk5MTcwNDAwfDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1564613469739-c78f970f9c17?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxN3x8dmFjYXRpb258ZW58MHx8fHwxNjk5MTcwNDAwfDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1564613469739-c78f970f9c17?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxN3x8dmFjYXRpb258ZW58MHx8fHwxNjk5MTcwNDAwfDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1564613469739-c78f970f9c17?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxN3x8dmFjYXRpb258ZW58MHx8fHwxNjk5MTcwNDAwfDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/@cmophoto">cmophoto.net</a> on <a href="https://unsplash.com">Unsplash</a></figcaption></figure></div><p>Hey!</p><blockquote><p>Have you been able to achieve the goals you set at the start of this year?</p></blockquote><p>In the last 2 months I have been writing about Golang in Let&#8217;s Do Tech&#8217;s newsletter, and have delivered several critical aspects around <a href="https://blog.letsdote.ch/t/go-theme">Go Theme</a>. Thank you for getting back to me with queries and appreciation texts. I hope all of you got some value out of it.</p><p>Having said that, I am here to provide some updates to this newsletter going ahead. As mentioned in one of the previous posts, I will be writing a series of newsletters around a specific topic related to cloud-native. For example, in Sept and Oct, it was about Go Theme.</p><p>The break</p><p>The Themes will continue, but perhaps after a long pause. In the month of November, I will be travelling a lot and may not be able to keep up with regular newsletter deliveries. The newsletters will be delivered with reduced frequency for November and may be even in December - if the travel plans extend. But starting January onwards, I will be back with regular frequency i.e. every Monday.</p><p>I will be most active on Twitter <a href="https://twitter.com/letsdotech_dev">@letsdotech_dev</a> though! Do follow me there to get the latest updates. </p><p>Format update</p><p>I took some time in the last 2 months to reflect on the value being provided in current newsletters. To be fair, I would not say I am communicating everything I publish on the internet. So I have decided to change the format to make it better by linking to the articles I wrote and were published on various platforms.</p><p>It will not just be theory anymore. Instead, it will have links to the latest published technical articles written by me. These articles encompass multiple &#8220;categories&#8221; - IaC, Productivity, Architecture, etc.</p><p>Themes will still be there, but instead of delivering the theory in a lengthy newsletter, I will shorten it and provide the link to the details. Some of the upcoming themes are on the lines of DevOps, Cloud-Native, and Platform Engineering concepts.</p><p>Path forward for LDT</p><p>I started LDT to primarily share my solo journey in tech business. I have made some progress this year, but I am still not at that point where I want to be. But where do I want to be? Will it be about consulting, or product dev, or farming?</p><p>To cover the same, I will be starting a new member-only newsletter series (in January, if things go well). I plan to share lessons from tech, business, marketing, and if theres anything else&#8217;s perspectives. I also plan to share numbers!</p><p>So the path forward for LDT will be revealed in more details in the new series!</p><p></p><p>That&#8217;s it for now! I will see you around soon.</p><p></p><p>Sumeet N.</p>]]></content:encoded></item><item><title><![CDATA[Deploying Go Applications with Docker and Kubernetes: Best Practices]]></title><description><![CDATA[10 Best Practices for Docker and K8s]]></description><link>https://news.letsdote.ch/p/deploying-go-applications-with-docker</link><guid isPermaLink="false">https://news.letsdote.ch/p/deploying-go-applications-with-docker</guid><pubDate>Mon, 30 Oct 2023 04:19:18 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1553484771-371a605b060b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzNHx8ZXRoaWNzfGVufDB8fHx8MTY5MzQ3MTQyOHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1553484771-371a605b060b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzNHx8ZXRoaWNzfGVufDB8fHx8MTY5MzQ3MTQyOHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1553484771-371a605b060b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzNHx8ZXRoaWNzfGVufDB8fHx8MTY5MzQ3MTQyOHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1553484771-371a605b060b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzNHx8ZXRoaWNzfGVufDB8fHx8MTY5MzQ3MTQyOHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1553484771-371a605b060b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzNHx8ZXRoaWNzfGVufDB8fHx8MTY5MzQ3MTQyOHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1553484771-371a605b060b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzNHx8ZXRoaWNzfGVufDB8fHx8MTY5MzQ3MTQyOHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1553484771-371a605b060b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzNHx8ZXRoaWNzfGVufDB8fHx8MTY5MzQ3MTQyOHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" width="6720" height="4480" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1553484771-371a605b060b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzNHx8ZXRoaWNzfGVufDB8fHx8MTY5MzQ3MTQyOHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:4480,&quot;width&quot;:6720,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;person reading book&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="person reading book" title="person reading book" srcset="https://images.unsplash.com/photo-1553484771-371a605b060b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzNHx8ZXRoaWNzfGVufDB8fHx8MTY5MzQ3MTQyOHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1553484771-371a605b060b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzNHx8ZXRoaWNzfGVufDB8fHx8MTY5MzQ3MTQyOHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1553484771-371a605b060b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzNHx8ZXRoaWNzfGVufDB8fHx8MTY5MzQ3MTQyOHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1553484771-371a605b060b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzNHx8ZXRoaWNzfGVufDB8fHx8MTY5MzQ3MTQyOHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/@austindistel">Austin Distel</a> on <a href="https://unsplash.com">Unsplash</a></figcaption></figure></div><div class="pullquote"><p>This is the 9th (and last) post as part of the <a href="https://blog.letsdote.ch/t/gotheme">Golang Theme</a>.</p></div><p>The Docker-Kubernetes' containerization of Go applications and orchestration capabilities has embarked us in a new era of streamlined application deployment. The robustness of Go, coupled with the portability and scalability advantages of Docker and Kubernetes, offers us a potent toolkit to conquer the challenges of contemporary software deployment.</p><div class="pullquote"><p>Navigating the complexities of deploying Go applications within the Docker-Kubernetes ecosystem demands a comprehensive understanding of not only the individual technologies but also their harmonious integration. </p></div><p>As the demand for scalable and fault-tolerant applications skyrockets, so does the need for insights into best practices that optimize resource utilization, ensure seamless scaling, and strengthens the application's resilience. By combining Go's speed and concurrency with Docker's containerization and Kubernetes' orchestration prowess, we gain the ability to architect applications that transcend traditional deployment hurdles. </p><p>In this post we will cover 10 best practices to achieve the same.</p><h3>Containerized Application Design</h3><p>Design the Go application with containerization in mind. Keep components loosely coupled and microservices-oriented, allowing them to function as independent containers that can be easily scaled and updated.</p><h3>Optimized Docker Images</h3><p>Craft minimalistic Docker images for the Go applications by utilizing multi-stage builds. Begin with a base image, compile the Go application, and then copy only the necessary artifacts into the final image. This reduces image size and improves security.</p><h3>Efficient Resource Utilization</h3><p>Tune the application's resource allocation to prevent over-provisioning. Monitor the application's memory and CPU usage to right-size Kubernetes pods, ensuring efficient resource utilization and minimizing costs.</p><h3>Horizontal Pod Autoscaling</h3><p>Leverage Kubernetes' Horizontal Pod Autoscaler to automatically adjust the number of replicas based on traffic. Set up custom metrics and define scaling thresholds to ensure Go application handles varying loads while minimizing downtime.</p><h3>Graceful Shutdown and Startup</h3><p>Implement graceful shutdown and startup mechanisms in the Go application to ensure that it handles connections, completes ongoing tasks, and properly cleans up resources during pod scaling or maintenance events.</p><h3>Health Probes and Readiness Checks</h3><p>Utilize Kubernetes' liveness and readiness probes to monitor the health of the Go application. These checks help Kubernetes decide whether a pod is ready to serve traffic and when to restart it.</p><h3>Secrets Management</h3><p>Store sensitive information like API keys, passwords, and configuration details outside the application code. Use Kubernetes Secrets or other secure methods to inject these secrets into the Go application at runtime.</p><h3>Logging and Monitoring</h3><p>Integrate centralized logging and monitoring solutions to gain insights into the Go application's performance and health. Tools like Prometheus for monitoring and Grafana for visualization can help us identify and mitigate issues promptly.</p><h3>Deployment Automation</h3><p>Implement CI/CD pipelines to automate the deployment process. This ensures consistent and reliable application updates across environments while reducing the risk of human error.</p><h3>Error Handling and Recovery</h3><p>Develop robust error-handling mechanisms in the Go application to gracefully handle failures and recover from errors. Implement retries, circuit breakers, and fallback strategies to maintain application stability.</p><p>By adhering to these best practices, we can deploy Go applications with Docker and Kubernetes in a manner that optimizes performance, scalability, and reliability while fostering a streamlined development and deployment workflow.</p><p></p><p>Sumeet N.</p>]]></content:encoded></item><item><title><![CDATA[Data Serialization and Deserialization in Go 🔁]]></title><description><![CDATA[JSON, XML, Binary serialization in Go, Versioning Using struct tags, Security Considerations, and Best Practices.]]></description><link>https://news.letsdote.ch/p/data-serialization-and-deserialization</link><guid isPermaLink="false">https://news.letsdote.ch/p/data-serialization-and-deserialization</guid><pubDate>Mon, 23 Oct 2023 03:50:11 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1501526029524-a8ea952b15be?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxMHx8ZGF0YXxlbnwwfHx8fDE2OTM0NzA0MDd8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1501526029524-a8ea952b15be?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxMHx8ZGF0YXxlbnwwfHx8fDE2OTM0NzA0MDd8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1501526029524-a8ea952b15be?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxMHx8ZGF0YXxlbnwwfHx8fDE2OTM0NzA0MDd8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1501526029524-a8ea952b15be?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxMHx8ZGF0YXxlbnwwfHx8fDE2OTM0NzA0MDd8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1501526029524-a8ea952b15be?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxMHx8ZGF0YXxlbnwwfHx8fDE2OTM0NzA0MDd8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1501526029524-a8ea952b15be?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxMHx8ZGF0YXxlbnwwfHx8fDE2OTM0NzA0MDd8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1501526029524-a8ea952b15be?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxMHx8ZGF0YXxlbnwwfHx8fDE2OTM0NzA0MDd8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" width="5472" height="3648" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1501526029524-a8ea952b15be?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxMHx8ZGF0YXxlbnwwfHx8fDE2OTM0NzA0MDd8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:3648,&quot;width&quot;:5472,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;red and blue lights from tower steel wool photography&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="red and blue lights from tower steel wool photography" title="red and blue lights from tower steel wool photography" srcset="https://images.unsplash.com/photo-1501526029524-a8ea952b15be?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxMHx8ZGF0YXxlbnwwfHx8fDE2OTM0NzA0MDd8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1501526029524-a8ea952b15be?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxMHx8ZGF0YXxlbnwwfHx8fDE2OTM0NzA0MDd8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1501526029524-a8ea952b15be?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxMHx8ZGF0YXxlbnwwfHx8fDE2OTM0NzA0MDd8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1501526029524-a8ea952b15be?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxMHx8ZGF0YXxlbnwwfHx8fDE2OTM0NzA0MDd8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/@hharritt">Hunter Harritt</a> on <a href="https://unsplash.com">Unsplash</a></figcaption></figure></div><div class="pullquote"><p>This is the 8th post as part of the <a href="https://blog.letsdote.ch/t/gotheme">Golang Theme</a>.</p></div><p>In this post, we go through various aspects of data serialization and deserialization. As developers, we often find ourselves working with data in various formats, ranging from simple text files to complex data structures. Serialization involves transforming data into a format that can be easily stored or transmitted, while deserialization is the process of reconstructing that data into its original form. </p><p>These processes play a crucial role in modern software development, where data interchange between different systems is a common requirement. We will explore how to perform data serialization and deserialization in the Go programming language, uncovering techniques, best practices, and the libraries that make these tasks efficient and manageable using Go programming language.</p><h2>What is Data Serialization?</h2><p>Data serialization is a fundamental concept in computer science, and Go programming. Serialization enables seamless communication and data interchange, especially when dealing with diverse technologies, languages, or platforms. In Go, understanding data serialization is essential for building robust and scalable applications that interact with external services, databases, or even for implementing efficient communication between different components of a single application.</p><p>Go offers a variety of techniques to accomplish data serialization, each catering to different scenarios and requirements. One common approach is using the <strong>encoding/json</strong> package, which provides a straightforward way to serialize Go data structures into JSON format, a widely used standard for data interchange. </p><p>JSON's human-readable and lightweight nature makes it a popular choice for web APIs and configuration files. However, while encoding/json is great for simple use cases, more complex scenarios might demand additional features or performance optimizations.</p><p>For scenarios where performance is critical, Go supports binary serialization through the <strong>encoding/gob</strong> package. Gob serialization is more efficient than JSON serialization in terms of both size and speed, making it a suitable choice for high-performance applications or systems with limited bandwidth. </p><div class="pullquote"><p>Understanding when to use JSON or binary serialization is essential for designing efficient communication protocols and storage mechanisms.</p></div><h2>Serializing and Deserializing JSON, XML, and Gob in Go</h2><p><strong>JSON (JavaScript Object Notation)</strong> is one of the most used formats for data interchange due to its simplicity, human-readable structure, and compatibility with a wide range of programming languages. Go makes JSON serialization and deserialization a breeze with its built-in `encoding/json` package. </p><p>This package allows us to effortlessly encode Go data structures into JSON and decode JSON data back into Go objects. Whether we are building RESTful APIs, handling configuration files, or communicating between different microservices, JSON serialization is a versatile tool at your disposal.</p><p><strong>XML (eXtensible Markup Language)</strong> is another popular format for data serialization, particularly in scenarios where hierarchical data structures need to be represented. While XML might not be as lightweight as JSON, it offers more expressive power for representing complex data relationships and metadata. </p><p>In Go, XML serialization and deserialization are supported by the `encoding/xml` package. This package empowers us to marshal Go structs into XML and unmarshal XML data into Go objects, while preserving the hierarchical and attribute-based nature of XML.</p><p>For prioritising performance, Go offers an alternative in the form of binary serialization with the `encoding/gob` package. Gob serialization is a Go-specific format that leverages compact size and efficient encoding/decoding speeds. It is particularly well-suited for inter-process communication, local storage, or network communication between Go applications. </p><div class="pullquote"><p>Gob serialization, while not as human-readable as JSON or XML, is an excellent choice when the focus is on minimizing data size and maximizing data transfer speeds.</p></div><h2>Versioning in Go&#8217;s data Serialization</h2><p>Versioning and Compatibility are crucial aspects of data serialization that we must address to ensure seamless communication and maintainability in evolving software systems. When data structures evolve over time due to feature enhancements or bug fixes, it is essential to manage these changes in a way that doesn't disrupt existing functionalities. This is where versioning comes into play.</p><p>When serializing and deserializing data, it's important to be prepared for changes in the structure, such as adding new fields or modifying existing ones. Without proper versioning, changes can lead to deserialization errors, data loss, or even system failures.</p><p>To handle changes in data structures without breaking deserialization, Go provides a powerful tool: <strong>struct tags</strong>. Struct tags are metadata annotations that can be attached to struct fields, providing additional information to the encoding and decoding processes. By using tags, we can specify how a field should be serialized and deserialized, even across different versions of a data structure. This allows for mapping fields to different names, ignoring fields that are no longer needed, or even implementing custom serialization logic for specific cases. Example below.</p><pre><code>type OldUserProfile struct {
  ID          int    `json:"user_id"`        // Field Renaming
  Username    string `json:"username"`       // Field Renaming
  Email       string `json:"-"`              // Field Omission
  CreatedTime int64  `json:"created_timestamp"` // Custom Encoding Logic
}

type NewUserProfile struct {
  ID          int       `json:"id"`                 // Field Renaming
  Username    string    `json:"username"`           // Field Renaming
  Email       string    `json:"email,omitempty"`    // Field Omission
  CreatedTime time.Time `json:"created_time"`   // Custom Encoding Logic
  NewField    string    `json:"new_field,omitempty"` // Optional Fields
}</code></pre><p>This version identifier informs the deserialization process about which version of the data structure is being used, enabling it to apply the appropriate parsing logic. Deprecated fields are handled by marking them as deprecated in the code and providing clear migration paths for users to update their data. The use of explicit versioning also empowers us to communicate changes effectively, making it easier for users to adapt their systems accordingly.</p><h2>Security considerations</h2><p>Improper handling of serialized data can lead to severe vulnerabilities and compromise the integrity and confidentiality of applications. </p><p>Serialization attacks: Attackers can manipulate serialized data to execute malicious code during deserialization, potentially leading to remote code execution, denial of service, or data leaks. These attacks exploit weaknesses in the deserialization process, making it crucial for us to implement stringent security measures.</p><p>To prevent security risks during deserialization, several best practices should be followed. </p><ol><li><p>It's essential to minimize the use of third-party serialization libraries and prefer using well-vetted, built-in serialization mechanisms such as the standard encoding packages in Go. </p></li><li><p>Limiting the deserialization of untrusted data is crucial, as it significantly reduces the attack surface. </p></li><li><p>Input validation plays a pivotal role in resisting attacks &#8211; implement strict input validation and sanitize incoming data to ensure it adheres to expected formats. </p></li><li><p>Applying the principle of least privilege by restricting the permissions of deserialized objects can also mitigate potential damage.</p></li><li><p>Struct tags, used for both serialization and validation, can help enforce constraints on deserialized data. </p></li><li><p>Sanitization involves removing or neutralizing potentially harmful content from data before processing. This is particularly important for fields like strings that might contain special characters or injection attempts. </p></li><li><p>Utilizing regular expressions, predefined whitelists, or blacklists can aid in effective sanitization.</p></li></ol><p></p><p>Sumeet N.</p>]]></content:encoded></item><item><title><![CDATA[🛡️ Secure Coding Practices in Go: Preventing Common Vulnerabilities]]></title><description><![CDATA[Securing Data At Rest and In Transit With Go, Code Reviews And Static Analysis And Related Resources]]></description><link>https://news.letsdote.ch/p/secure-coding-practices-in-go-preventing</link><guid isPermaLink="false">https://news.letsdote.ch/p/secure-coding-practices-in-go-preventing</guid><pubDate>Mon, 16 Oct 2023 03:34:10 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1607705703571-c5a8695f18f6?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzM3x8c2VjdXJlJTIwY29kZXxlbnwwfHx8fDE2OTM0MzcyMjl8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1607705703571-c5a8695f18f6?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzM3x8c2VjdXJlJTIwY29kZXxlbnwwfHx8fDE2OTM0MzcyMjl8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1607705703571-c5a8695f18f6?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzM3x8c2VjdXJlJTIwY29kZXxlbnwwfHx8fDE2OTM0MzcyMjl8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1607705703571-c5a8695f18f6?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzM3x8c2VjdXJlJTIwY29kZXxlbnwwfHx8fDE2OTM0MzcyMjl8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1607705703571-c5a8695f18f6?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzM3x8c2VjdXJlJTIwY29kZXxlbnwwfHx8fDE2OTM0MzcyMjl8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1607705703571-c5a8695f18f6?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzM3x8c2VjdXJlJTIwY29kZXxlbnwwfHx8fDE2OTM0MzcyMjl8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1607705703571-c5a8695f18f6?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzM3x8c2VjdXJlJTIwY29kZXxlbnwwfHx8fDE2OTM0MzcyMjl8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" width="6720" height="4480" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1607705703571-c5a8695f18f6?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzM3x8c2VjdXJlJTIwY29kZXxlbnwwfHx8fDE2OTM0MzcyMjl8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:4480,&quot;width&quot;:6720,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;black samsung flat screen computer monitor&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="black samsung flat screen computer monitor" title="black samsung flat screen computer monitor" srcset="https://images.unsplash.com/photo-1607705703571-c5a8695f18f6?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzM3x8c2VjdXJlJTIwY29kZXxlbnwwfHx8fDE2OTM0MzcyMjl8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1607705703571-c5a8695f18f6?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzM3x8c2VjdXJlJTIwY29kZXxlbnwwfHx8fDE2OTM0MzcyMjl8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1607705703571-c5a8695f18f6?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzM3x8c2VjdXJlJTIwY29kZXxlbnwwfHx8fDE2OTM0MzcyMjl8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1607705703571-c5a8695f18f6?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzM3x8c2VjdXJlJTIwY29kZXxlbnwwfHx8fDE2OTM0MzcyMjl8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/@afgprogrammer">Mohammad Rahmani</a> on <a href="https://unsplash.com">Unsplash</a></figcaption></figure></div><div class="pullquote"><p>This is the 7th post as part of the <a href="https://blog.letsdote.ch/t/gotheme">Golang Theme</a>.</p></div><p>From injection attacks to cross-site scripting and everything in between, there is a lot to discuss as for as securing our codebase is concerned. In this post, we delve into the world of secure coding practices in Go, shedding light on the common vulnerabilities that can undermine the integrity of your software. </p><h2>Common Vulnerabilities, and Go</h2><p>In software development, vulnerabilities are like hidden traps, waiting to be exploited by malicious actors. Injection attacks, Cross-Site Scripting (XSS), Cross-Site Request Forgery (CSRF), and other common vulnerabilities have become common in many applications. </p><p>Injection attacks, such as SQL injection, occur when untrusted data is fed into an interpreter as part of a query, causing unintended and potentially harmful actions. XSS involves malicious scripts injected into web pages viewed by users, compromising their data and privacy. </p><p>CSRF manipulates a user's trust in a specific website, leading them to unknowingly perform actions they did not intend. Recognizing these vulnerabilities is the first step towards fortifying our software against cyber threats.</p><p>Go is not immune to these vulnerabilities. Injection attacks can infiltrate Go applications through unsanitized user inputs, exploiting data validation. XSS can manifest in Go web applications when output is not properly sanitized, opening a gateway for malicious scripts. CSRF attacks can exploit Go applications if they lack mechanisms to verify the origin of incoming requests. Understanding how these vulnerabilities can materialize within the Go environment is crucial for us aiming to build robust and secure applications.</p><h2>Avoiding Memory Corruption and Buffer Overflows</h2><p>Memory corruption and buffer overflows arise from improper manipulation of memory spaces, leading to data corruption, crashes, and even unauthorized access. Memory corruption occurs when a program writes data outside the bounds of allocated memory, often due to unchecked buffers or inadequate input validation. These vulnerabilities can grant malicious actors unintended control over a program's execution.</p><p>One of Go's standout features is its ability to mitigate the risks of buffer overflows and memory corruption through a combination of features and practices. Go employs a garbage collector that automatically manages memory, deallocating unused memory blocks and reducing the likelihood of memory leaks. </p><p>Moreover, Go enforces strict array and slice bounds checking, ensuring that memory writes stay within their designated spaces. This fundamental shift in memory management inherently reduces the prevalence of buffer overflow vulnerabilities, paving the way for more robust and secure applications.</p><p>Go slices and arrays play an important role in preventing buffer overflow incidents. Slices are dynamic structures that offer a safer alternative to arrays, as they handle their own memory management. The built-in append() function, for instance, ensures that underlying arrays are resized as needed, eliminating the risk of buffer overflows caused by manual memory management. This fundamentally shifts the onus of memory management away from developers, reducing the likelihood of accidental vulnerabilities.</p><p>Go does allow the use of pointers and unsafe operations, but it's crucial to wield this power responsibly. The "unsafe" package sidesteps some of Go's safety mechanisms, making it a potential breeding ground for vulnerabilities if not used judiciously. We should exercise extreme caution when resorting to unsafe operations, using them only when absolutely necessary and with a thorough understanding of the risks involved.</p><h2>Securing Data in Transit</h2><p>Secure communication begins with encryption, and Go offers a rich set of cryptographic libraries that cover a wide range of encryption algorithms, from AES to RSA. The `crypto` package in Go provides easy-to-use APIs for encrypting and decrypting data, as well as generating and managing keys. This package is an invaluable resource for us looking to implement encryption standards within their applications, ensuring that data transmitted over networks remains confidential and tamper-proof.</p><p>Transport Layer Security (TLS) is the cornerstone of secure communication over the internet. Go simplifies the implementation of TLS through the `crypto/tls` package, enabling us to establish encrypted connections with ease. This package allows for the configuration of SSL/TLS certificates, ciphersuites, and mutual authentication, ensuring that data exchanged between clients and servers remains private and untampered.</p><p>Go's standard library includes the `net/http` package, which seamlessly integrates with TLS to provide a secure foundation for building web servers. With just a few lines of code, we can enable HTTPS, encrypting data exchanged between users and servers. This is particularly crucial for protecting sensitive user information, such as login credentials and personal data, from falling into the wrong hands.</p><h2>Securing Data at Rest</h2><p>Go's standard library includes the `crypto` package, which provides encryption and decryption functions to secure data before it's stored. Using symmetric or asymmetric encryption algorithms, we can encode sensitive information in a way that only authorized parties with the appropriate keys can decode. </p><p>Go's `crypto` package assists developers in generating and managing cryptographic keys securely. We can employ techniques like key derivation and key wrapping to ensure that keys are well-protected, preventing unauthorized access to the encrypted data.</p><p>Modern applications heavily rely on databases to store and manage vast amounts of data. Go&#8217;s capabilities extend to database security, enabling developers to encrypt data before storing it in databases like PostgreSQL and MySQL. By encrypting data at the application level, we retain control over the encryption process, mitigating the risk of database breaches compromising sensitive information.</p><h2>Code Reviews and Analysis</h2><p>Ensuring code quality is essential to building reliable and secure applications. Code reviews and static analysis stand as two vital pillars of this quality assurance process. These practices take on even greater significance, as they help identify issues early, promote best practices, and contribute to the creation of maintainable and efficient codebases.</p><p>Code reviews are a collaborative practice where developers scrutinize each other's code to identify defects, improve readability, and enforce coding standards. The approach to code reviews is guided by the language's simplicity and readability. </p><p>With its strict formatting requirements and conventions, Go's codebase becomes predictably readable. Code reviews in Go emphasize clean code and adherence to best practices, fostering a culture of quality that translates into more maintainable software.</p><p>Static analysis tools are essential tools to scrutinize source code without executing it, identifying potential issues and vulnerabilities before they manifest. Go's static analysis tools, such as `go vet` and `golint`, provide us with insights into issues like code correctness, style violations, and potential performance bottlenecks.</p><p>The synergy between code reviews and static analysis is of great value. Code reviews provide human insight, fostering an environment of knowledge sharing and mentorship among developers. Static analysis tools, on the other hand, offer a systematic and unbiased perspective that can catch issues that might escape human eyes. Together, they create a robust defense against bugs, vulnerabilities, and suboptimal code.</p><h2>Resources</h2><p><a href="https://golang.org/doc/security">Go Security</a>: The official Go website provides a dedicated page on security best practices, covering topics like authentication, encryption, and secure coding guidelines.</p><p><a href="https://pkg.go.dev/crypto">Go Crypto</a>: The standard `crypto` package in Go offers a comprehensive set of cryptographic functions and libraries for encryption, decryption, hashing, and more.</p><p><a href="https://github.com/securego/gosec">Web Application Security in Go</a>: This GitHub repository contains a curated list of resources and libraries for building secure web applications in Go.</p><p><a href="https://github.com/guardrailsio/awesome-golang-security">Awesome Go Security</a>: This GitHub repository gathers a collection of resources, libraries, and tools related to security in Go programming.</p><p></p><p>Sumeet N.</p>]]></content:encoded></item><item><title><![CDATA[Microservices Architecture 🗄️ with Go: Designing Scalable and Resilient Systems]]></title><description><![CDATA[Favorable Go Features For Microservices, Communication, and Security &#128110;]]></description><link>https://news.letsdote.ch/p/microservices-architecture-with-go</link><guid isPermaLink="false">https://news.letsdote.ch/p/microservices-architecture-with-go</guid><pubDate>Mon, 09 Oct 2023 03:25:05 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1639322537228-f710d846310a?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHxibG9ja2NoYWlufGVufDB8fHx8MTY5MzQ3MDUwM3ww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1639322537228-f710d846310a?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHxibG9ja2NoYWlufGVufDB8fHx8MTY5MzQ3MDUwM3ww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1639322537228-f710d846310a?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHxibG9ja2NoYWlufGVufDB8fHx8MTY5MzQ3MDUwM3ww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1639322537228-f710d846310a?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHxibG9ja2NoYWlufGVufDB8fHx8MTY5MzQ3MDUwM3ww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1639322537228-f710d846310a?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHxibG9ja2NoYWlufGVufDB8fHx8MTY5MzQ3MDUwM3ww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1639322537228-f710d846310a?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHxibG9ja2NoYWlufGVufDB8fHx8MTY5MzQ3MDUwM3ww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1639322537228-f710d846310a?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHxibG9ja2NoYWlufGVufDB8fHx8MTY5MzQ3MDUwM3ww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" width="3840" height="2160" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1639322537228-f710d846310a?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHxibG9ja2NoYWlufGVufDB8fHx8MTY5MzQ3MDUwM3ww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:2160,&quot;width&quot;:3840,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;a group of cubes that are on a black surface&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="a group of cubes that are on a black surface" title="a group of cubes that are on a black surface" srcset="https://images.unsplash.com/photo-1639322537228-f710d846310a?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHxibG9ja2NoYWlufGVufDB8fHx8MTY5MzQ3MDUwM3ww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1639322537228-f710d846310a?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHxibG9ja2NoYWlufGVufDB8fHx8MTY5MzQ3MDUwM3ww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1639322537228-f710d846310a?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHxibG9ja2NoYWlufGVufDB8fHx8MTY5MzQ3MDUwM3ww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1639322537228-f710d846310a?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHxibG9ja2NoYWlufGVufDB8fHx8MTY5MzQ3MDUwM3ww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/@theshubhamdhage">Shubham Dhage</a> on <a href="https://unsplash.com">Unsplash</a></figcaption></figure></div><div class="pullquote"><p>This is the 6th post as part of the <a href="https://blog.letsdote.ch/t/gotheme">Golang Theme</a>.</p></div><p>Microservices architecture has gained immense popularity in recent years, while organizations on the other hand, have chosen to move away from monolithic software design. Microservices is a design approach where a complex application is broken down into smaller, loosely coupled services, each responsible for a specific piece of functionality. </p><p>These services are developed, deployed, and scaled independently, fostering agility and adaptability in the face of evolving business needs. By decoupling components, microservices allow teams to work on individual services concurrently, accelerating development cycles and enabling rapid innovation.</p><p>In this post, we dive into the world of microservices architecture and explore how Go, with its speed, simplicity, and concurrency support, can be the perfect choice for developing and deploying microservices.</p><h2>Go for Microservices</h2><p>Using the Go programming language for building microservices offers a range of distinct advantages that align perfectly with the architectural principles of microservices. </p><ol><li><p>Go's exceptional performance and efficiency stand out. With its compiled nature and lightweight concurrency model, Go enables microservices to handle high traffic loads and concurrent requests with remarkable speed. This is crucial in a microservices ecosystem where responsiveness and low latency are paramount, allowing applications to efficiently manage numerous simultaneous interactions.</p></li><li><p>Go's simplicity and clean syntax contribute to rapid development and ease of maintenance. Microservices projects often involve multiple services, each with its own codebase. Go's straightforward syntax reduces the cognitive load on us, making it easier to write and understand code. </p></li><li><p>Go's built-in testing and profiling tools add another layer of convenience, enabling us to ensure the reliability and performance of microservices throughout their lifecycle.</p></li><li><p>Go's native support for concurrency through goroutines and channels is a game-changer for microservices architecture. It&#8217;s concurrency primitives allow us to elegantly manage these tasks without the complexities of traditional threading. This results in applications that are both efficient and scalable.</p></li><li><p>Finally, the compact and self-contained nature of Go binaries simplifies the deployment of microservices. Go programs compile to standalone executables that include all their dependencies, eliminating the need to manage complex runtime environments. As a result, deploying, scaling, and managing individual microservices becomes smoother, reducing potential conflicts and streamlining the overall system architecture. </p></li></ol><p>Overall, Go's performance, simplicity, concurrency, and deployment characteristics makes it a great choice for architects and developers seeking to develop robust and responsive microservices systems.</p><h2>Communication Between Microservices in Go</h2><p>When it comes to communication between microservices in the Go programming language, several strategies and tools are employed to ensure seamless interaction and data flow.</p><ol><li><p><strong>HTTP:</strong> Go's native support for HTTP is a natural fit for microservices communication. Leveraging the standard library's `net/http` package, we can effortlessly create HTTP-based APIs that facilitate the exchange of data between services. With frameworks like Gorilla Mux, we can easily build sophisticated HTTP routing and middleware, streamlining the development of RESTful APIs.</p></li><li><p><strong>gRPC:</strong> A powerful communication mechanism in the Go ecosystem is the use of gRPC. Built on top of HTTP/2, gRPC offers efficient and low-latency communication by employing protocol buffers for serialization and deserialization. This approach is particularly advantageous in scenarios where high-performance, real-time communication is required.</p></li><li><p><strong>Event-driven:</strong> When aiming for event-driven communication or asynchronous messaging between microservices, Go's channels and goroutines are most useful. While not a dedicated messaging framework, Go's concurrency primitives provide a lightweight and intuitive way to establish communication patterns like publish-subscribe or request-reply queues. Libraries such as NATS or RabbitMQ are employed to extend Go's capabilities in event-driven communication scenarios. </p></li></ol><p>Go provides a robust foundation for creating effective communication pathways between microservices. Whether through traditional HTTP, gRPC, event-driven channels, or the assistance of orchestration tools, Go empowers us to build microservices systems that communicate seamlessly and reliably, fostering the growth and adaptability of modern software architectures.</p><h2>Securing Microservices using Go</h2><p>Securing microservices is of paramount importance in today's interconnected and distributed software landscape. The Go programming language offers a range of features and libraries that can be leveraged to fortify the security of microservices-based systems.</p><ol><li><p><strong>Authentication and authorization:</strong> Go's standard library provides tools for implementing authentication mechanisms such as JWT (JSON Web Tokens) and OAuth2. These protocols enable services to validate the identity of users and grant them access based on predefined roles and permissions.</p></li><li><p><strong>Simplicity and readability:</strong> The clear and concise syntax of Go makes it easier to write secure code by minimising the potential for common programming errors that could lead to vulnerabilities like injection attacks. Additionally, Go's type safety and memory management features help prevent buffer overflows and other memory-related vulnerabilities that can be exploited by attackers.</p></li><li><p><strong>Secure communication:</strong> Go's support for HTTPS through the `net/http` package enables services to establish encrypted connections using SSL/TLS protocols, safeguarding data in transit from eavesdropping and tampering. The open-source package "crypto" in the Go standard library provides a comprehensive set of cryptographic functions that can be used to implement hashing, encryption, and other security measures.</p></li></ol><h2>Conclusion</h2><p>The fusion of microservices principles and the Go programming language has unveiled a powerful synergy, offering architects and developers the tools to create systems that adapt, scale, and withstand the challenges of today's complex digital world. From dissecting the intricacies of communication to ensuring security, monitoring, and debugging, we've delved into the core aspects that underpin the success of microservices architecture using Go.</p><p>The realm of microservices is a space of both boundless opportunities and formidable challenges. With the proper understanding of service decomposition, communication patterns, fault tolerance, and the array of tools Go brings to the table, I hope you are at a bit of comfort while exploring the avenues of building microservices using Go.</p><p></p><p>Sumeet N.</p>]]></content:encoded></item><item><title><![CDATA[📦 Go Modules Demystified: Managing Dependencies the Right Way]]></title><description><![CDATA[Managing Dependencies, Update and Upgrade, Vendor Directory and Isolation, and Resources!]]></description><link>https://news.letsdote.ch/p/go-modules-demystified-managing-dependencies</link><guid isPermaLink="false">https://news.letsdote.ch/p/go-modules-demystified-managing-dependencies</guid><pubDate>Mon, 02 Oct 2023 03:34:14 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1573166364266-356ef04ae798?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw5fHxzb2Z0d2FyZSUyMGRlc2lnbnxlbnwwfHx8fDE2OTM0MzMzMDl8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1573166364266-356ef04ae798?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw5fHxzb2Z0d2FyZSUyMGRlc2lnbnxlbnwwfHx8fDE2OTM0MzMzMDl8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1573166364266-356ef04ae798?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw5fHxzb2Z0d2FyZSUyMGRlc2lnbnxlbnwwfHx8fDE2OTM0MzMzMDl8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1573166364266-356ef04ae798?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw5fHxzb2Z0d2FyZSUyMGRlc2lnbnxlbnwwfHx8fDE2OTM0MzMzMDl8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1573166364266-356ef04ae798?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw5fHxzb2Z0d2FyZSUyMGRlc2lnbnxlbnwwfHx8fDE2OTM0MzMzMDl8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1573166364266-356ef04ae798?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw5fHxzb2Z0d2FyZSUyMGRlc2lnbnxlbnwwfHx8fDE2OTM0MzMzMDl8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1573166364266-356ef04ae798?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw5fHxzb2Z0d2FyZSUyMGRlc2lnbnxlbnwwfHx8fDE2OTM0MzMzMDl8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" width="6016" height="4016" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1573166364266-356ef04ae798?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw5fHxzb2Z0d2FyZSUyMGRlc2lnbnxlbnwwfHx8fDE2OTM0MzMzMDl8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:4016,&quot;width&quot;:6016,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;person writing on dry-erase board&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="person writing on dry-erase board" title="person writing on dry-erase board" srcset="https://images.unsplash.com/photo-1573166364266-356ef04ae798?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw5fHxzb2Z0d2FyZSUyMGRlc2lnbnxlbnwwfHx8fDE2OTM0MzMzMDl8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1573166364266-356ef04ae798?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw5fHxzb2Z0d2FyZSUyMGRlc2lnbnxlbnwwfHx8fDE2OTM0MzMzMDl8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1573166364266-356ef04ae798?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw5fHxzb2Z0d2FyZSUyMGRlc2lnbnxlbnwwfHx8fDE2OTM0MzMzMDl8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1573166364266-356ef04ae798?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw5fHxzb2Z0d2FyZSUyMGRlc2lnbnxlbnwwfHx8fDE2OTM0MzMzMDl8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/@wocintechchat">Christina @ wocintechchat.com</a> on <a href="https://unsplash.com">Unsplash</a></figcaption></figure></div><div class="pullquote"><p>This is the 5th post as part of the <a href="https://blog.letsdote.ch/t/gotheme">Golang Theme</a>.</p></div><p>The foundation of any robust software project depends not just on how optimally the code is written, but also on how seamlessly it integrates with external libraries, frameworks, and tools. This is where dependency management steps into the spotlight, which ensures our project's stability, scalability, and maintainability. In this post we explore dependency management in the context of the Go programming language.</p><p>Go modules are constructs, introduced as the official method for managing dependencies. They define the way we handle external packages. With Go modules, the process of acquiring, updating, and organizing dependencies is streamlined, making it easier than ever to maintain a clear and predictable project structure.</p><h2>Modules in Go</h2><p>Dependency management in Go is all about orchestrating the external libraries, frameworks, and tools that your project relies on. Effective dependency management ensures our project's stability, security, and longevity. As the Go ecosystem evolves and grows, managing dependencies becomes increasingly complex, necessitating a reliable solution that can navigate these intricacies seamlessly.</p><p>Before the introduction of Go modules, managing dependencies in Go projects was far from straightforward. The Go community initially relied on the GOPATH environment variable to establish a unified directory structure for all Go code. However, this approach had its limitations. It posed challenges when different projects required different versions of the same library, leading to version conflicts and often leaving developers in dependency hell.</p><p>With the official release of Go 1.11 in August 2018, the Go community introduced Go modules as the definitive solution to the once-difficult task of dependency management. Go modules are designed to streamline the way developers handle external packages, providing a systematic approach to versioning, compatibility, and collaboration.</p><p>A Go module is a collection of related Go packages. It encapsulates not only the source code but also crucial metadata that defines the module's dependencies, version constraints, and other essential information. The main file of the Go module system is the `go.mod` file, a declarative file that outlines the module's structure and its dependencies' specifications. This simple yet powerful file transforms the landscape of Go development by offering easy control over dependency management.</p><h2>Managing dependencies in Go</h2><p>The dependencies in Go modules are managed by the `go get` command. This command not only fetches the desired package from the Go module repository but also updates the project's `go.mod` file with the necessary information about the dependency. It eliminates the need for manual updates to dependency lists and version information.</p><p>With Go modules, we can define version constraints using a combination of operators and version numbers, making sure that only compatible versions of dependencies are used. This helps in mitigating the risk of unexpected breaking changes due to dependency updates. Further, Go modules adhere to semantic versioning principles, ensuring that version changes are communicated effectively and consistently.</p><p>As the development landscape continues to evolve, Go modules provide a robust framework for not only adding and managing dependencies but also for adapting to changing requirements and maintaining the integrity of projects over time. This dynamic toolset empowers us to navigate the complex web of dependencies with confidence, fostering a collaborative and efficient environment for building remarkable Go applications.</p><h2>Updating and Upgrading Go Modules</h2><p>When it comes to managing updates in Go modules, the process is designed to be both intuitive and efficient. The `go get` command serves as our friend to the latest versions of our dependencies. By invoking this command with specific version constraints, we can ensure that only compatible updates are pulled, preserving the stability of your project. </p><p>Once an update is fetched, Go modules automatically update our `go.mod` file, reflecting the change and keeping track of version information. This smart integration simplifies the process and allows us to remain focused on building, without getting tangled in dependency management complexities.</p><p>Navigating the realm of upgrades demands an understanding of semantic versioning. By adhering to the rules of semantic versioning, we can confidently decide when to perform a major version upgrades. Go modules' version constraints facilitate this process, allowing us to incrementally upgrade dependencies without triggering breaking changes in our project.</p><p>As Go modules manage our updates, they also bring attention to indirect dependencies, an often-overlooked aspect of the dependency ecosystem. These are the dependencies that our direct dependencies rely on. Go modules automatically track and manage these indirect dependencies, ensuring that they're not just compatible with our project but also aligned with each other.</p><p>By adhering to version constraints, semantic versioning, and automated dependency tracking, we can confidently navigate the process of keeping their projects current, secure, and ready to embrace new functionalities while maintaining the stability that is important to any successful software process.</p><h2>Vendor Directory and Dependency Isolation</h2><p>The vendor directory, a feature of Go modules, is a designated repository that holds all the dependencies required by a project. It acts as a shield against external changes, creating a self-sufficient environment where the project's dependencies are insulated from changes in the global package space. </p><p>This isolation is a key factor in mitigating compatibility issues that can arise when different projects rely on different versions of the same dependency. By containing dependencies within the vendor directory, Go modules prevent unintended interactions and version collisions.</p><p>The beauty of the vendor directory lies in its simplicity. When we use the `go get` command to fetch dependencies, Go modules not only update the `go.mod` file but also populate the vendor directory with the corresponding package code. This means that the project can be built and run independently, regardless of the state of the user's global Go environment. </p><p>Additionally, Go modules prioritize the contents of the vendor directory over any globally installed packages during compilation, ensuring that our project remains isolated from external changes and that its dependencies are consistently utilized.</p><h2>Conclusion</h2><p>The importance of effective dependency management cannot be overstated, as it directly impacts the stability, maintainability, and collaboration potential of projects. Go modules are necessary since they address the limitations of the traditional GOPATH approach and align seamlessly with the needs of modern development.</p><p>Go modules not only simplify the process of handling dependencies but also enhance version compatibility, reproducibility, and security in our projects. From creating new projects to updating dependencies, supporting team collaborations, and migrating legacy projects, Go modules offer a comprehensive toolkit that empowers us to overcome challenges and build reliable software.</p><h2>Additional Resources</h2><p>For further exploration and learning, consider these additional resources:</p><ol><li><p><strong><a href="https://blog.golang.org/using-go-modules">The Go Blog: Using Go Modules</a></strong> - A comprehensive guide from the official Go blog on using Go modules, including information on the vendor directory and dependency management.</p></li><li><p><strong><a href="https://github.com/golang/go/wiki/Modules">Go Modules Wiki</a></strong> - The official Go wiki page on Go modules, providing detailed information about the vendor directory, dependency isolation, and best practices.</p></li><li><p><strong><a href="https://github.com/go-modules-by-example/index">Go Modules by Example</a></strong> - A collection of practical examples and use cases for Go modules, including insights into how the vendor directory contributes to dependency isolation.</p></li></ol><p></p><p>Sumeet N.</p>]]></content:encoded></item><item><title><![CDATA[❌ Error Handling in Go: Strategies for Writing Robust and Maintainable Code]]></title><description><![CDATA[Understanding Error Handling Philosophy, Approaches, and Strategies.]]></description><link>https://news.letsdote.ch/p/error-handling-in-go-strategies-for</link><guid isPermaLink="false">https://news.letsdote.ch/p/error-handling-in-go-strategies-for</guid><pubDate>Mon, 25 Sep 2023 03:37:08 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1532003885409-ed84d334f6cc?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw2Nnx8ZXJyb3J8ZW58MHx8fHwxNjkzMDk3NzY5fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1532003885409-ed84d334f6cc?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw2Nnx8ZXJyb3J8ZW58MHx8fHwxNjkzMDk3NzY5fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1532003885409-ed84d334f6cc?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw2Nnx8ZXJyb3J8ZW58MHx8fHwxNjkzMDk3NzY5fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1532003885409-ed84d334f6cc?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw2Nnx8ZXJyb3J8ZW58MHx8fHwxNjkzMDk3NzY5fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1532003885409-ed84d334f6cc?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw2Nnx8ZXJyb3J8ZW58MHx8fHwxNjkzMDk3NzY5fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1532003885409-ed84d334f6cc?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw2Nnx8ZXJyb3J8ZW58MHx8fHwxNjkzMDk3NzY5fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1532003885409-ed84d334f6cc?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw2Nnx8ZXJyb3J8ZW58MHx8fHwxNjkzMDk3NzY5fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" width="6720" height="4480" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1532003885409-ed84d334f6cc?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw2Nnx8ZXJyb3J8ZW58MHx8fHwxNjkzMDk3NzY5fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:4480,&quot;width&quot;:6720,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;closed white steel gate&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="closed white steel gate" title="closed white steel gate" srcset="https://images.unsplash.com/photo-1532003885409-ed84d334f6cc?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw2Nnx8ZXJyb3J8ZW58MHx8fHwxNjkzMDk3NzY5fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1532003885409-ed84d334f6cc?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw2Nnx8ZXJyb3J8ZW58MHx8fHwxNjkzMDk3NzY5fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1532003885409-ed84d334f6cc?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw2Nnx8ZXJyb3J8ZW58MHx8fHwxNjkzMDk3NzY5fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1532003885409-ed84d334f6cc?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw2Nnx8ZXJyb3J8ZW58MHx8fHwxNjkzMDk3NzY5fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/@nate_dumlao">Nathan Dumlao</a> on <a href="https://unsplash.com">Unsplash</a></figcaption></figure></div><div class="pullquote"><p>This is the 4th post as part of the <a href="https://blog.letsdote.ch/t/gotheme">Golang Theme</a>.</p></div><p>Error handling is a critical aspect of software development in Go, playing an important role in creating robust, reliable, and maintainable programs. In Go, errors are considered a first-class citizen rather than an afterthought, emphasizing the importance of gracefully handling unexpected situations. This approach encourages us to confront potential issues head-on, leading to more resilient codebases.</p><p>One of the main reasons error handling is crucial in Go is that it promotes program stability. By explicitly addressing errors, we can prevent unhandled exceptions that might lead to program crashes or unpredictable behavior. </p><p>Go's emphasis on checking and handling errors at the point of occurrence encourages programmers to anticipate failure scenarios and handle them gracefully, ensuring that a single faulty operation doesn't jeopardize the entire application.</p><p>Furthermore, effective error handling contributes to code readability and maintainability. Clear and concise error messages facilitate troubleshooting and debugging. When errors are properly handled and reported, it becomes easier to diagnose issues during development and in production environments, reducing the time spent on identifying and rectifying problems. </p><p>Additionally, comprehensive error handling allows us to make informed decisions about how to proceed when things go wrong, whether that involves retrying an operation, falling back to an alternative approach, or alerting administrators about critical failures.</p><p>By dealing with errors proactively, we ensure that our applications are more predictable, reliable, and user-friendly, ultimately leading to higher quality software products.</p><h2>Approaches To Handle Go Errors</h2><p>As mentioned earlier, error handling is a first-class citizen, and the language provides several approaches to handle errors effectively and gracefully. Here are some common approaches to handling errors in Go:</p><ol><li><p><strong>Return Error Values:</strong> This is the most straightforward approach, where functions return both their usual result and an error value. If the function executes successfully, the error is typically <code>nil</code>; otherwise, an error value containing relevant information is returned. The calling code can then check the error value and take appropriate action.</p></li><li><p><strong>Panic and Recover:</strong> While not recommended for routine error handling, we can use <code>panic</code> to stop normal execution of a function and initiate a panic, and <code>recover</code> to capture and handle this panic, allowing the program to continue running. This approach is more suitable for catastrophic errors. </p></li><li><p><strong>Custom Error Types:</strong> Go allows us to define custom error types by implementing the <code>error</code> interface. This enables us to create more informative error messages or group related errors together. This is particularly useful when we need to distinguish between different types of errors.</p></li><li><p><strong>Error Wrapping and Propagation:</strong> Sometimes, we might need to wrap errors to provide additional context about where the error occurred. The <code>errors</code> package in Go provides the <code>Wrap</code> function to add context to an error and <code>Unwrap</code> function to retrieve the original error. This helps to preserve the error chain while enriching it with more information.</p></li></ol><p>These approaches provide various levels of granularity and control over error handling in Go. Choosing the appropriate approach depends on the nature of the error and the context in which it's being handled.</p><h2>Error Types And Assertions</h2><p>Error types and assertions are mechanisms used for managing and processing errors in a more structured and informative manner.</p><h3>Error Types</h3><p>In Go, an error is not just a simple string but a value of an interface type called <code>error</code>. The <code>error</code> interface has a single method:</p><pre><code>type error interface {
    Error() string
}</code></pre><p>This means that any type that implements a method named <code>Error()</code> that returns a string can be used as an error. This provides the flexibility to create custom error types that carry additional information beyond a simple error message. By defining custom error types, we can include more context about the error, making it easier to identify the source and nature of the problem.</p><p>Here's an example of defining and using a custom error type:</p><pre><code>type MyError struct {
    Message string
}

func (e MyError) Error() string {
    return e.Message
}

func someFunction() error {
    return MyError{"This is a custom error."}
}

func main() {
    err := someFunction()
    if err != nil {
        fmt.Println("Error:", err)
    }
}</code></pre><h3>Assertions</h3><p>Also known as type assertions, are used to extract the underlying value of an interface and check its concrete type. This is especially useful when we work with interface values like error types and need to access the methods or properties of the concrete type. Assertions allow us to safely convert an interface value to its concrete type.</p><p>Assertions are performed using the syntax <code>(value).(Type)</code>. If the assertion is successful, the value is converted to the specified type; otherwise, a runtime panic occurs.</p><p>Here's an example of using assertions with error types:</p><pre><code>func main() {
    err := someFunction()
    
    // Check if the error is of type MyError
    if myErr, ok := err.(MyError); ok {
        fmt.Println("Custom error:", myErr.Message)
    } else {
        fmt.Println("Generic error:", err)
    }
}</code></pre><p>In this example, the code attempts to assert the error returned by <code>someFunction()</code> into a <code>MyError</code> type. If the assertion is successful, it prints the custom error message; otherwise, it treats the error as a generic error.</p><p>Both custom error types and assertions contribute to clearer error handling by allowing you to encapsulate error-specific information and safely work with interface values. This leads to more informative error messages and better debugging capabilities in our Go programs.</p><h2>Error Management Strategies</h2><p>Error management strategies are employed to handle unexpected situations, errors, and exceptions that can occur during the execution of a program. These strategies are essential for creating reliable, robust, and maintainable software. Some of the error management strategies used while programming in Go are:</p><ol><li><p><strong>Return Errors Explicitly:</strong> Go encourages functions to return both the primary result and an error. Errors are returned as a separate return value, often the last one, allowing callers to check for errors directly.</p></li><li><p><strong>Use Named Return Values:</strong> Named return values in Go functions allow us to initialise variables along with the <code>return</code> statement. This simplifies error handling by reducing the need to create new variables for return values and errors.</p></li><li><p><strong>Check Errors Immediately:</strong> Errors should be checked and handled as close to their origin as possible. This prevents errors from propagating through multiple layers of code and makes error handling more explicit.</p></li><li><p><strong>Wrap Errors:</strong> The <code>errors</code> package provides the <code>fmt.Errorf</code> function, which allows us to wrap errors with additional context. This helps to provide more meaningful error messages without losing the original error information.</p></li><li><p><strong>Custom Error Types:</strong> Go allows us to define our own error types by implementing the <code>error</code> interface. This is useful when we want to categorize or differentiate between different types of errors.</p></li><li><p><strong>Defer and Clean-Up:</strong> The <code>defer</code> statement is used to ensure that certain clean-up actions, such as closing files or releasing resources, are performed even if an error occurs.</p></li><li><p><strong>Logging and Debugging:</strong> Go's standard library provides a robust logging package (<code>log</code>) that is used to log errors and other relevant information. Debuggers and profilers are also utilised for diagnosing errors during development.</p></li><li><p><strong>Graceful Degradation:</strong> Designing systems to handle errors gracefully and continue functioning with degraded features is an important strategy in Go, especially for distributed systems.</p></li></ol><p>Go's error handling philosophy centers around explicit error checking, simplicity, and transparency. By following these strategies, we can create reliable, maintainable, and robust code that handles errors effectively while maintaining a clear and readable code structure.</p><p></p><p>Sumeet N.</p>]]></content:encoded></item><item><title><![CDATA[Exploring the Power of Interfaces in Go: Polymorphism Simplified 🏷️]]></title><description><![CDATA[Understanding Interfaces, Their Use, Interfaces vs. Concrete Types]]></description><link>https://news.letsdote.ch/p/exploring-the-power-of-interfaces</link><guid isPermaLink="false">https://news.letsdote.ch/p/exploring-the-power-of-interfaces</guid><pubDate>Mon, 18 Sep 2023 03:37:17 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1535054820380-92c41678b087?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzM3x8dHlwZXN8ZW58MHx8fHwxNjkzMDkzNDA2fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1535054820380-92c41678b087?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzM3x8dHlwZXN8ZW58MHx8fHwxNjkzMDkzNDA2fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1535054820380-92c41678b087?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzM3x8dHlwZXN8ZW58MHx8fHwxNjkzMDkzNDA2fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1535054820380-92c41678b087?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzM3x8dHlwZXN8ZW58MHx8fHwxNjkzMDkzNDA2fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1535054820380-92c41678b087?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzM3x8dHlwZXN8ZW58MHx8fHwxNjkzMDkzNDA2fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1535054820380-92c41678b087?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzM3x8dHlwZXN8ZW58MHx8fHwxNjkzMDkzNDA2fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1535054820380-92c41678b087?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzM3x8dHlwZXN8ZW58MHx8fHwxNjkzMDkzNDA2fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" width="4862" height="3241" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1535054820380-92c41678b087?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzM3x8dHlwZXN8ZW58MHx8fHwxNjkzMDkzNDA2fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:3241,&quot;width&quot;:4862,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;flat-lay photography of stamp lot&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="flat-lay photography of stamp lot" title="flat-lay photography of stamp lot" srcset="https://images.unsplash.com/photo-1535054820380-92c41678b087?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzM3x8dHlwZXN8ZW58MHx8fHwxNjkzMDkzNDA2fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1535054820380-92c41678b087?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzM3x8dHlwZXN8ZW58MHx8fHwxNjkzMDkzNDA2fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1535054820380-92c41678b087?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzM3x8dHlwZXN8ZW58MHx8fHwxNjkzMDkzNDA2fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1535054820380-92c41678b087?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzM3x8dHlwZXN8ZW58MHx8fHwxNjkzMDkzNDA2fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/@kristianstrand">Kristian Strand</a> on <a href="https://unsplash.com">Unsplash</a></figcaption></figure></div><div class="pullquote"><p>This is the 3rd post as part of the <a href="https://blog.letsdote.ch/t/gotheme">Golang Theme</a>.</p></div><p>An interface is a type that specifies a set of method signatures that any type implementing the interface must provide. It is a core concept in Go's type system and is a building block used to achieve polymorphism and abstraction. Following pointers help us explain interfaces better.</p><ol><li><p>An interface defines a contract by specifying a list of method signatures (function prototypes) without any implementation details. Any type that implements all the methods listed in the interface is said to satisfy or implement that interface.</p></li><li><p>Unlike some other programming languages, Go's interfaces are implemented implicitly. If a type has methods with the exact method signatures defined in an interface, it is automatically considered to implement that interface.</p></li><li><p>Go's approach to interfaces is sometimes called "structural typing" or "duck typing." This means that a type is considered to implement an interface based on the methods it has, rather than being explicitly declared to implement the interface.</p></li></ol><p>Consider an example of a &#8220;shape&#8221; interface in Go that implements an &#8220;area()&#8221; method. Further, there are a couple of more types - &#8220;circle&#8221; and &#8220;rectangle&#8221; which implement a method each, with same name - area(). The circle and rectangle types are said to implicitly implement the Shape interface.</p><p>Interfaces play a significant role in Go's philosophy of simplicity and composition, enabling code to be more modular, testable, and adaptable.</p><h2>Why Do We Need Interfaces?</h2><p>Interfaces in Go have several important uses that contribute to the language's design principles and capabilities.</p><ol><li><p><strong>Polymorphism and Abstraction:</strong> Interfaces enable polymorphism, which means we can write functions and methods that can work with different types that implement the same interface. This promotes code reuse and allows us to write more generic and flexible code.</p></li><li><p><strong>Decoupling:</strong> Interfaces help decouple different parts of our codebase. When we write code that depends on interfaces rather than concrete types, we create a separation between the implementation details and the parts of the code that use those implementations.</p></li><li><p><strong>Composition:</strong> Interfaces encourage composition over inheritance. Instead of building deep inheritance hierarchies, we can compose types by combining smaller interfaces. This approach is often more flexible and easier to manage.</p></li><li><p><strong>Testability:</strong> Interfaces make it easier to write unit tests and mock implementations. We can create mock implementations of interfaces to isolate and test specific components of our code without relying on real implementations.</p></li><li><p><strong>Flexibility and Future-Proofing:</strong> Interfaces allow us to write code that's more adaptable to changes. If we later need to introduce a new type that satisfies an existing interface, we can seamlessly integrate it without modifying existing code.</p></li><li><p><strong>Third-Party Libraries:</strong> Interfaces facilitate the integration of third-party libraries. If a library defines interfaces, we can implement those interfaces to customize or extend the library's functionality.</p></li><li><p><strong>Dynamic Behavior:</strong> Interfaces provide a way to achieve dynamic behavior in Go. This is particularly useful when working with unknown types at runtime, as in scenarios involving reflection.</p></li><li><p><strong>Code Contracts:</strong> Interfaces serve as contracts that define what behavior a type must provide. This makes it clear to developers what methods a type should implement to satisfy a particular interface.</p></li><li><p><strong>API Design:</strong> Interfaces play a crucial role in designing clean and usable APIs. They allow us to define the core behaviours that our types should provide, promoting consistency and ease of use.</p></li><li><p><strong>Avoiding Tight Coupling:</strong> By programming interfaces rather than concrete types, we avoid tightly coupling different parts of our application. This makes our codebase more modular and maintainable.</p></li></ol><p>Interfaces in Go contribute to the language's simplicity, flexibility, and focus on clean code design. They encourage practices that lead to better software engineering principles, such as separation of concerns, testability, and maintainability.</p><h2>Interfaces vs. Concrete Types</h2><p>Interfaces and concrete types represent different aspects of data and behavior abstraction, and understanding their distinctions is important for designing effective and maintainable software.</p><p>Concrete types are the building blocks of data in a program. They define the structure and attributes of a specific object or entity. A concrete type provides the blueprint for creating instances with specific data and methods. They types are used to represent <strong>tangible entities and encapsulate their properties and behaviors</strong>.</p><p>Interfaces define a <strong>contract for behavior</strong>. It specifies a set of method signatures that any type can choose to implement. It serves as a way to guarantee that certain methods will be available on a type, irrespective of its concrete nature. Interfaces are used to establish a common ground for various unrelated types to interact with the rest of the program in a consistent manner- aka Polymorphism.</p><p>Concrete types provide the specific implementation details and encapsulate data, while interfaces establish a shared language for communication between different parts of the application. This separation promotes loose coupling, allowing different components to work together without needing to know the intricate details of each other.</p><p>Interfaces are implemented implicitly, meaning there's no need to declare that a type explicitly implements an interface. As long as a type defines all the methods in an interface, it automatically satisfies that interface. This design encourages a cleaner codebase, making it easy to add new implementations without modifying existing code. </p><h2>Empty interfaces {}</h2><p>Empty interfaces, often denoted as `interface{}`, are a unique and powerful feature in Go. Unlike regular interfaces that define a set of required methods, an empty interface doesn't have any method requirements. This means that any value in Go can be assigned to an empty interface. </p><p>The flexibility of empty interfaces allows us to work with values of unknown types, making them a powerful tool for handling dynamic and heterogeneous data. They are commonly used in scenarios where we need to create generic functions that can work with a wide range of data types. </p><p>Another important use case for empty interfaces is in reflection, a mechanism that enables programs to inspect their own structure and data at runtime. When combined with reflection, empty interfaces allow us to dynamically examine the type and structure of an unknown value. This is useful when writing code that needs to handle arbitrary data coming from various sources.</p><p>However, it's important to use empty interfaces judiciously. While they offer flexibility, they can also lead to less type safety, as type information is lost when a value is assigned to an empty interface. This leads to runtime errors if the actual types don't match the expected behavior. </p><p>Empty interfaces provide a dynamic and versatile way to work with values of varying types, making them valuable in scenarios that require handling heterogeneous data or using reflection. However, care should be taken to ensure proper type checks and assertions to avoid runtime errors.</p><p></p><p>Sumeet N.</p>]]></content:encoded></item><item><title><![CDATA[Building ⚡ Lightning-Fast APIs ⚡ with Go: A Comprehensive Guide]]></title><description><![CDATA[Performance Factors, Supporting Go Features, Architectural Considerations]]></description><link>https://news.letsdote.ch/p/building-lightning-fast-apis-with</link><guid isPermaLink="false">https://news.letsdote.ch/p/building-lightning-fast-apis-with</guid><pubDate>Mon, 11 Sep 2023 03:36:08 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1558980664-769d59546b3d?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw5fHxmYXN0JTIwYXBpfGVufDB8fHx8MTY5MzA5MDc2M3ww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1558980664-769d59546b3d?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw5fHxmYXN0JTIwYXBpfGVufDB8fHx8MTY5MzA5MDc2M3ww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1558980664-769d59546b3d?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw5fHxmYXN0JTIwYXBpfGVufDB8fHx8MTY5MzA5MDc2M3ww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1558980664-769d59546b3d?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw5fHxmYXN0JTIwYXBpfGVufDB8fHx8MTY5MzA5MDc2M3ww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1558980664-769d59546b3d?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw5fHxmYXN0JTIwYXBpfGVufDB8fHx8MTY5MzA5MDc2M3ww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1558980664-769d59546b3d?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw5fHxmYXN0JTIwYXBpfGVufDB8fHx8MTY5MzA5MDc2M3ww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1558980664-769d59546b3d?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw5fHxmYXN0JTIwYXBpfGVufDB8fHx8MTY5MzA5MDc2M3ww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" width="8192" height="5462" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1558980664-769d59546b3d?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw5fHxmYXN0JTIwYXBpfGVufDB8fHx8MTY5MzA5MDc2M3ww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:5462,&quot;width&quot;:8192,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;person riding cruiser motorcycle during daytime&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="person riding cruiser motorcycle during daytime" title="person riding cruiser motorcycle during daytime" srcset="https://images.unsplash.com/photo-1558980664-769d59546b3d?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw5fHxmYXN0JTIwYXBpfGVufDB8fHx8MTY5MzA5MDc2M3ww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1558980664-769d59546b3d?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw5fHxmYXN0JTIwYXBpfGVufDB8fHx8MTY5MzA5MDc2M3ww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1558980664-769d59546b3d?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw5fHxmYXN0JTIwYXBpfGVufDB8fHx8MTY5MzA5MDc2M3ww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1558980664-769d59546b3d?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw5fHxmYXN0JTIwYXBpfGVufDB8fHx8MTY5MzA5MDc2M3ww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/@harleydavidson">Harley-Davidson</a> on <a href="https://unsplash.com">Unsplash</a></figcaption></figure></div><div class="pullquote"><p>This is the 2nd post as part of the <a href="https://blog.letsdote.ch/t/gotheme">Golang Theme</a>.</p></div><p>The lightning-fast speeds and reduced latency of 5G have ushered in a new era of real-time data exchange, prompting APIs to evolve accordingly. APIs now need to support the seamless and instantaneous transfer of larger data volumes, catering to the increased demand for high-quality multimedia content and dynamic interactions. </p><p>This demands a reevaluation of API design, necessitating the creation of endpoints that can handle the surge in data traffic without sacrificing performance. Modern APIs must prioritize efficiency, scalability, and low latency, ensuring that applications can leverage the technology's capabilities to their fullest extent.</p><p>In this post, we will explore how to build lightning fast APIs using Go programming language.</p><h2>Factors contributing to the API Performance</h2><p>API performance is a multidimensional concept that encompasses factors like throughput, request/response times, and latency benchmarks. Developers must consider these factors while designing and optimizing APIs to ensure they can handle the demands of modern applications, deliver a seamless user experience, and leverage the capabilities of technologies like 5G to their fullest extent.</p><p>API performance directly impacts user experience, application responsiveness, and overall system efficiency. Several factors come into play when considering API performance, and understanding these factors is essential for creating responsive and reliable applications.</p><ol><li><p><strong>Throughput:</strong> refers to the number of requests an API can handle within a given time frame. High throughput indicates that the API can efficiently process numerous requests concurrently. It is especially crucial in scenarios where the API is handling a substantial number of simultaneous connections, for example during peak usage periods.</p></li><li><p><strong>Request-Response Time:</strong> Request time is the duration it takes for a client to send a request to the API, while response time is the duration it takes for the API to process the request and send a response back to the client. Low request and response times are essential for delivering a seamless user experience, especially in interactive applications where users expect quick results.</p></li><li><p><strong>Latency:</strong> This refers to the time it takes for data to travel from the client to the server and back. With the advent of technologies like 5G, where low latency is a hallmark, APIs must strive to minimize latency to provide real-time and interactive experiences.</p></li></ol><p>Several factors can influence API performance, including the hardware and infrastructure on which the API runs, the <strong>efficiency of the code</strong>, the complexity of the database queries, and the network conditions, scalability, caching mechanisms, data compression, and optimized algorithms can contribute to improved performance.</p><h2>Designing Efficient APIs in Go</h2><p>Designing efficient APIs in Go requires a deep understanding of the language's features and its concurrency model. By leveraging features like strong typing, composition, concurrency, and efficient memory management, we can create APIs that leverage Go's strengths for optimal performance. Here are some key principles and practices to keep in mind:</p><ol><li><p><strong>Use Strong Typing and Structs:</strong> Go's <a href="https://blog.letsdote.ch/p/chatgpt-to-process-rest-responses">strong typing and struct</a> support allow you to define well-structured data models. Design your API endpoints to work with well-defined structs, making data handling more efficient and reducing the risk of type-related errors.</p></li><li><p><strong>Favor Composition over Inheritance:</strong> Go does not support traditional class-based inheritance. Instead, it promotes composition through embedding structs. This approach encourages clean and modular code, which can lead to more efficient APIs by minimizing unnecessary overhead.</p></li><li><p><strong>Concurrency with Goroutines:</strong> Go's concurrency model is centered around goroutines and channels. Utilize goroutines to handle concurrent tasks efficiently. For example, processing incoming requests concurrently, enabling better utilization of resources and improved response times.</p></li><li><p><strong>Optimize for the Heap:</strong> Go's garbage collector can impact performance. Minimize unnecessary memory allocation by reusing objects and using object pooling when appropriate. This reduces the load on the garbage collector and improves overall throughput.</p></li><li><p><strong>Keep Dependencies Minimal:</strong> Go's philosophy encourages minimal dependencies. Only import packages that are essential for the API's functionality. Excessive dependencies can bloat the codebase and increase startup times.</p></li><li><p><strong>Use Benchmarking:</strong> The `testing` package in Go includes benchmarking tools. Regularly run benchmarks to identify performance bottlenecks and track improvements. This helps us make data-driven decisions to optimize our API.</p></li><li><p><strong>Profiling:</strong> Go's built-in profiling tools (like the pprof package) allows us to analyze our code's performance. Profiling helps pinpoint hotspots and bottlenecks, guiding our optimization efforts effectively.</p></li></ol><h2>Architectural Considerations For Improving API Performance</h2><p>Any discussion about system performance is incomplete without discussing the architectural details. Some considerations:</p><ol><li><p><strong>Minimalist Design:</strong> Keep your API design simple and focused. Avoid unnecessary endpoints and minimize data transferred in each request. A minimalist design reduces processing time and response payload size.</p></li><li><p><strong>Caching Strategies:</strong> Utilize caching for frequently requested data. Employ edge caching, in-memory caching (Redis), or content delivery networks (CDNs) to serve cached content quickly and reduce the load on the server.</p></li><li><p><strong>Content Compression:</strong> Compress response payloads using techniques like Gzip or Brotli. This significantly reduces data transfer time and enhances API response speed, especially for clients with limited bandwidth.</p></li><li><p><strong>Efficient Data Transfer Formats:</strong> Use lightweight data interchange formats like JSON or Protocol Buffers. Minimize unnecessary fields and nested structures to decrease serialization and deserialization times.</p></li><li><p><strong>Optimized Database Queries:</strong> Optimize database queries by using appropriate indexes, avoiding N+1 query issues, and employing database caching. Well-structured and efficient queries enhance response times.</p></li><li><p><strong>Asynchronous Processing:</strong> Offload non-critical tasks to asynchronous processing to free up the API to handle incoming requests promptly. Utilize message queues or event-driven architectures for efficient background processing.</p></li><li><p><strong>Microservices with Service Segmentation:</strong> Employ microservices architecture to segment functionality into discrete services. This allows each microservice to be optimized individually, leading to better performance and scalability.</p></li><li><p><strong>Connection Pooling:</strong> Use connection pooling for databases and external services. Reusing established connections reduces the overhead of creating new connections for each request.</p></li><li><p><strong>Load Balancing:</strong> Distribute traffic across multiple server instances using load balancers. This prevents overloading a single server and ensures even resource utilization.</p></li><li><p><strong>API Gateway for Aggregation:</strong> Implement an API gateway for aggregating requests to multiple microservices. This reduces the number of client-server round trips and minimizes latency.</p></li></ol><p></p><h4>Announcement:</h4><blockquote><h5>I have enabled the paywall on this publication, and to access posts older than 2 months, the same can be temporarily broken for free by referring this newsletter to more friends. Check out the options below.</h5></blockquote><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://news.letsdote.ch/leaderboard?&amp;utm_source=post&quot;,&quot;text&quot;:&quot;Refer a friend&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://news.letsdote.ch/leaderboard?&amp;utm_source=post"><span>Refer a friend</span></a></p><p>Sumeet N.</p><p></p>]]></content:encoded></item><item><title><![CDATA[Mastering Concurrency ⚔️: A Dive into Go's Goroutines and Channels]]></title><description><![CDATA[Goroutines vs. Threads, Concepts, 5 Architectural benefits, and Frequently used Patterns]]></description><link>https://news.letsdote.ch/p/mastering-concurrency-a-dive-into</link><guid isPermaLink="false">https://news.letsdote.ch/p/mastering-concurrency-a-dive-into</guid><pubDate>Mon, 04 Sep 2023 03:36:07 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1582213782179-e0d53f98f2ca?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHx0b2dldGhlcnxlbnwwfHx8fDE2OTMyNTgxNjR8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1582213782179-e0d53f98f2ca?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHx0b2dldGhlcnxlbnwwfHx8fDE2OTMyNTgxNjR8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1582213782179-e0d53f98f2ca?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHx0b2dldGhlcnxlbnwwfHx8fDE2OTMyNTgxNjR8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1582213782179-e0d53f98f2ca?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHx0b2dldGhlcnxlbnwwfHx8fDE2OTMyNTgxNjR8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1582213782179-e0d53f98f2ca?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHx0b2dldGhlcnxlbnwwfHx8fDE2OTMyNTgxNjR8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1582213782179-e0d53f98f2ca?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHx0b2dldGhlcnxlbnwwfHx8fDE2OTMyNTgxNjR8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1582213782179-e0d53f98f2ca?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHx0b2dldGhlcnxlbnwwfHx8fDE2OTMyNTgxNjR8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" width="5040" height="3360" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1582213782179-e0d53f98f2ca?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHx0b2dldGhlcnxlbnwwfHx8fDE2OTMyNTgxNjR8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:3360,&quot;width&quot;:5040,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;person in red sweater holding babys hand&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="person in red sweater holding babys hand" title="person in red sweater holding babys hand" srcset="https://images.unsplash.com/photo-1582213782179-e0d53f98f2ca?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHx0b2dldGhlcnxlbnwwfHx8fDE2OTMyNTgxNjR8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1582213782179-e0d53f98f2ca?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHx0b2dldGhlcnxlbnwwfHx8fDE2OTMyNTgxNjR8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1582213782179-e0d53f98f2ca?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHx0b2dldGhlcnxlbnwwfHx8fDE2OTMyNTgxNjR8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1582213782179-e0d53f98f2ca?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHx0b2dldGhlcnxlbnwwfHx8fDE2OTMyNTgxNjR8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/@hannahbusing">Hannah Busing</a> on <a href="https://unsplash.com">Unsplash</a></figcaption></figure></div><div class="pullquote"><p>This is the first one in the series of Golang <a href="https://blog.letsdote.ch/p/lets-do-tech-and-then-chat-about">Themed articles</a>.</p></div><p>One of the most <strong>in-demand skills in the cloud-native</strong> community is the ability to write concurrent programs to leverage all the multi-core processor power today&#8217;s hardware has to offer. Golang was developed keeping concurrency in mind.</p><p>Digital transformation does not just mean moving to cloud platforms. In fact, digital transformation is indeed a continuous process undertaken by organisations to constantly optimize their IT spend. Well, not just organizations, solo-businesses, and startups alike - who does not want to save money?</p><p>In this post, we will understand the concepts related to Golang&#8217;s concurrency, the benefits in the context of cloud architecture, and also explore a few patterns to use concurrency in Golang.</p><h2>Goroutines vs. Threads</h2><p>Before we move ahead, it is important to understand the difference between threads and goroutines.</p><p><strong>Threads are managed by OS, while Goroutines are managed by Go runtime environment.</strong> Threads are single units of execution within a process - multiple threads belong to a process - and all these threads share the same resources. While Goroutines are independently scheduled functions and do not share resources.</p><p>Due to the sharing aspect described above, threads tend to be more prone to deadlocks and race conditions. While Goroutines are better immune to the same. Since Goroutines are managed by Go runtime environment, it offers higher level of abstraction - thus easy to implement by developers. Threads on the other hand offer lower level of abstraction.</p><p>This managed nature of Goroutines is of great advantage over threads when automatically scheduling them on multiple OS threads. As developers, it <strong>reduces the cognitive load</strong> of worrying about shared resources, and also makes them lightweight so that instantiation and context switching becomes faster.</p><h2>What should we know to understand Golang concurrency?</h2><p>Goroutines and channels are fundamental concurrency constructs in the Go programming language, designed to <strong>simplify and enhance the development of concurrent and parallel applications</strong>. They allow us to achieve concurrency by enabling multiple tasks to be executed concurrently without the need for creating separate threads or managing complex synchronization mechanisms.</p><p>Channels, provide a safe and structured way for goroutines to communicate and synchronize their actions. Channels act as <strong>pipes for the exchange of data</strong> between goroutines. They ensure proper synchronization and avoid race conditions by enforcing a model where data is sent on a channel by one goroutine and received by another in a coordinated manner, resulting in clean and clear communication between concurrent tasks. Channels are used for data sharing and signaling, allowing goroutines to coordinate their actions and operate in a synchronized manner. </p><p>The combination of goroutines and channels enables us to write concurrent programs that are both efficient and comprehensible, fostering easier maintenance and debugging of complex parallel applications.</p><h2>Top 5 Benefits of Goroutines in cloud architecture</h2><p>Backend applications built using Golang have greater impact on reliablility, and resource optimization - in a good way!</p><h4>Efficient Concurrency</h4><p>Goroutines are designed to be lightweight and have a lower memory footprint compared to traditional threads. This efficiency makes it easier to handle a large number of concurrent tasks in cloud applications without consuming excessive resources.</p><h4>Scalability</h4><p>Cloud architectures often require the ability to scale resources up or down dynamically based on demand. Goroutines can help distribute workloads efficiently, enabling cloud applications to handle increased traffic and workload reducing the need to provision or manage additional VM instances.</p><h4>Parallelism</h4><p>Goroutines allow for easy parallelism by executing tasks concurrently. This leads to improved performance for tasks that are divided into smaller subtasks, such as data processing, image manipulation, or network requests. In a cloud environment, this leads to faster response times and optimized resource utilization.</p><h4>Cost Optimization</h4><p>Cloud services are billed based on resource usage. By utilizing goroutines, applications can make better use of available resources, optimizing the utilization of CPU cores and memory. This efficiency can result in cost savings in cloud deployments.</p><h4>Resource Pooling</h4><p>In cloud architectures, resources like database connections or network sockets need to be managed efficiently. Goroutines are used to manage resource pooling, allowing multiple tasks to share limited resources effectively.</p><h2>Top 3 Frequently used concurrency patterns in Golang</h2><p>As a very basic example, if you make a function call with a `go` keyword at the beginning, it will automatically be executed in parallel. Let us take a look at some of the advanced patterns below.</p><h4>Producer-Consumer</h4><p>As the name suggests, the producer function is where input data is generated and passed to the calling function via channels to consumer function. The consumer function processes any data that arrives on the channel in concurrent manner. There can me multiple producers, and a single consumer can take care of the input data.</p><h4>Worker Pools</h4><p>In this pattern, the logic to process the input/data is wrapped in a separate function called &#8220;worker&#8221; function. The calling function</p><ol><li><p>divides the input data into multiple batches</p></li><li><p>creates input channel</p></li><li><p>calls the worker function with each batch of input data</p></li></ol><h4>Fan-Out, Fan-In</h4><p>Similar to Worker Pools pattern, the worker function is present here as well. The difference here is that the calling function waits for aggregating the results from all the workers (fan-in). The calling function </p><ol><li><p>divides the input data into multiple batches</p></li><li><p>creates input channel and results channel</p></li><li><p>passes each batch of data to the worker function using go keyword to induce concurrent execution</p></li><li><p>waits for all the workers to return results on results channel</p></li></ol><p>Refer to <a href="https://www.youtube.com/watch?v=f6kdp27TYZs">this video for more information on Golang Concurrency</a>.</p><p></p><p>Sumeet N.</p>]]></content:encoded></item><item><title><![CDATA[Some updates from LDT! ☕]]></title><description><![CDATA[Themes, Social Media, Chat, more... and a Poll!]]></description><link>https://news.letsdote.ch/p/lets-do-tech-and-then-chat-about</link><guid isPermaLink="false">https://news.letsdote.ch/p/lets-do-tech-and-then-chat-about</guid><pubDate>Mon, 28 Aug 2023 03:37:02 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1475483768296-6163e08872a1?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxMHx8Z3JvdXAlMjB0YWxrfGVufDB8fHx8MTY5MjQ0ODc2MXww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1475483768296-6163e08872a1?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxMHx8Z3JvdXAlMjB0YWxrfGVufDB8fHx8MTY5MjQ0ODc2MXww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1475483768296-6163e08872a1?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxMHx8Z3JvdXAlMjB0YWxrfGVufDB8fHx8MTY5MjQ0ODc2MXww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1475483768296-6163e08872a1?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxMHx8Z3JvdXAlMjB0YWxrfGVufDB8fHx8MTY5MjQ0ODc2MXww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1475483768296-6163e08872a1?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxMHx8Z3JvdXAlMjB0YWxrfGVufDB8fHx8MTY5MjQ0ODc2MXww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1475483768296-6163e08872a1?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxMHx8Z3JvdXAlMjB0YWxrfGVufDB8fHx8MTY5MjQ0ODc2MXww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1475483768296-6163e08872a1?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxMHx8Z3JvdXAlMjB0YWxrfGVufDB8fHx8MTY5MjQ0ODc2MXww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" width="5760" height="3840" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1475483768296-6163e08872a1?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxMHx8Z3JvdXAlMjB0YWxrfGVufDB8fHx8MTY5MjQ0ODc2MXww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:3840,&quot;width&quot;:5760,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;people having a bonfire&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="people having a bonfire" title="people having a bonfire" srcset="https://images.unsplash.com/photo-1475483768296-6163e08872a1?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxMHx8Z3JvdXAlMjB0YWxrfGVufDB8fHx8MTY5MjQ0ODc2MXww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1475483768296-6163e08872a1?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxMHx8Z3JvdXAlMjB0YWxrfGVufDB8fHx8MTY5MjQ0ODc2MXww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1475483768296-6163e08872a1?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxMHx8Z3JvdXAlMjB0YWxrfGVufDB8fHx8MTY5MjQ0ODc2MXww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1475483768296-6163e08872a1?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxMHx8Z3JvdXAlMjB0YWxrfGVufDB8fHx8MTY5MjQ0ODc2MXww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/@mikejerskine">Mike Erskine</a> on <a href="https://unsplash.com">Unsplash</a></figcaption></figure></div><p>This is the last newsletter of this month, and I would like to take this opportunity to provide you guys with some updates about the plans regarding the same in upcoming months. I have been doing a bit of organising and thinking about how can I provide more value in your email inbox.</p><h2>Themes</h2><p>To being with, I have realised the importance of having a schedule for these emails, and to give that schedule a meaning - I am <strong>introducing Themes</strong>.</p><p>As you may have realised by now, my emails usually land in the morning hours every Monday. That remains the same. However, <strong>starting from September I will be sending out emails related to a particular topic</strong>. This topic will be discussed in progression throughout the period of a month or two.</p><blockquote><p>Themes define the topic of the month, wherein I will share curated and crisp insights about frequently used and most relevant aspects of the Theme.</p></blockquote><p>For example, I will begin discussing various aspects of Go Programming Language with respect to <strong>various architectural usecases, patterns, frameworks, etc.</strong> I found so many important topics for Go, that I decided to run this theme for 2 months.</p><p>These newletters will be <strong>code-less, but architecture and business oriented</strong> - enough to give food for thought for the rest of the week.</p><p>It is not just about programming languages, I plan to explore various <strong>topics in Cloud, DevSecOps, and Serverless domains</strong>. Additionally, I will also be running themes covering upcoming projects in <strong><a href="https://landscape.cncf.io/">CNCF landscape</a></strong>. I am also open for <strong>suggestions from YOU</strong> - if you want me to cover a specific Theme topic, I would be glad to do so. Next sections will point at a way to get in touch with me for the same.</p><h2>Social Media</h2><p>This is a brand new addition. I have decided to create short-form content on various social media platforms - <a href="https://blog.letsdote.ch/p/resources">all links here</a>. These short-form content will be <strong>multiple mini-deep-dives</strong> in the topic being discussed in that particular week. <strong>There will NOT be any overlap</strong> in the information shared in the newsletter and the short-form content. </p><p>The intension here is to spend the week&#8217;s time in understanding various aspects of the topic at hand in that particular week. <a href="https://blog.letsdote.ch/p/resources">Feel free to follow along if you wish</a> and invite a few friends!</p><h2>Chat</h2><p>I&#8217;m also announcing a brand new addition to my Substack publication: the Let's Do Tech chat.</p><p>This is a <strong>conversation space in the Substack app that I set up exclusively for you all</strong> &#8212; kind of like a group chat or live hangout. I&#8217;ll post short prompts, thoughts, and updates that come my way, and you can jump into the discussion. </p><p><strong>To join this chat, you&#8217;ll need to download the <a href="https://substack.com/app/app-store-redirect">Substack app</a>, now available for both iOS and Android.</strong> Chats are sent via the app, not email, so turn on push notifications so you don&#8217;t miss conversation as it happens.</p><blockquote><p><strong>Imp!</strong> If the chat gets too busy, I will be restricting the ability to start the threads only to paid subscribers. All of us can still continue to contribute then.</p></blockquote><div><hr></div><h2>How to get started</h2><ol><li><p><strong>Download the app by clicking <a href="https://substack.com/app/app-store-redirect">this link</a> or the button below.</strong> Substack Chat is now available on both iOS and Android.</p></li></ol><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://substack.com/app/app-store-redirect&quot;,&quot;text&quot;:&quot;Get app&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://substack.com/app/app-store-redirect"><span>Get app</span></a></p><ol start="2"><li><p><strong>Open the app and tap the Chat icon.</strong> It looks like two bubbles in the bottom bar, and you&#8217;ll see a row for my chat inside.</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!2H2-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F9a23d49f-76bd-4f75-baac-0ae5733774bd_1456x743.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!2H2-!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F9a23d49f-76bd-4f75-baac-0ae5733774bd_1456x743.png 424w, https://substackcdn.com/image/fetch/$s_!2H2-!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F9a23d49f-76bd-4f75-baac-0ae5733774bd_1456x743.png 848w, https://substackcdn.com/image/fetch/$s_!2H2-!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F9a23d49f-76bd-4f75-baac-0ae5733774bd_1456x743.png 1272w, https://substackcdn.com/image/fetch/$s_!2H2-!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F9a23d49f-76bd-4f75-baac-0ae5733774bd_1456x743.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!2H2-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F9a23d49f-76bd-4f75-baac-0ae5733774bd_1456x743.png" width="542" height="276.5837912087912" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/9a23d49f-76bd-4f75-baac-0ae5733774bd_1456x743.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:743,&quot;width&quot;:1456,&quot;resizeWidth&quot;:542,&quot;bytes&quot;:501468,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!2H2-!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F9a23d49f-76bd-4f75-baac-0ae5733774bd_1456x743.png 424w, https://substackcdn.com/image/fetch/$s_!2H2-!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F9a23d49f-76bd-4f75-baac-0ae5733774bd_1456x743.png 848w, https://substackcdn.com/image/fetch/$s_!2H2-!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F9a23d49f-76bd-4f75-baac-0ae5733774bd_1456x743.png 1272w, https://substackcdn.com/image/fetch/$s_!2H2-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F9a23d49f-76bd-4f75-baac-0ae5733774bd_1456x743.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><ol start="3"><li><p><strong>That&#8217;s it!</strong> Jump into my thread to say hi, and if you have any issues, check out <a href="https://support.substack.com/hc/en-us/sections/360007461791-Frequently-Asked-Questions">Substack&#8217;s FAQ</a>.</p></li></ol><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://open.substack.com/pub/sumeetninawe/chat&quot;,&quot;text&quot;:&quot;Join chat&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://open.substack.com/pub/sumeetninawe/chat"><span>Join chat</span></a></p><p></p><h2>More&#8230;?</h2><p>That is about it for now. There will be more updates in upcoming weeks. The format of the newsletter would be:</p><ol><li><p>Announcements and updates (if any)</p></li><li><p>The Theme topic post</p></li><li><p>Curated list of top 3 news in Cloud, DevSecOps, and Serverless (in progress)</p></li></ol><h2>Poll</h2><p>I love exploring tech. <a href="https://blog.letsdote.ch/p/professional-history">I have explored a lot since 10+ years</a>. So, naturally I have come to find a new topic to explore. Given the demand, I plan to explore ML and AI space in coming months.</p><p>I am a complete newbie in this space, and would love to share my mistakes, lessons, things-I-could-have-done-better, and overall learning experience so that it helps you learn as well. How about we do it together?</p><div class="poll-embed" data-attrs="{&quot;id&quot;:97254}" data-component-name="PollToDOM"></div><p></p><p>Sumeet N.</p>]]></content:encoded></item><item><title><![CDATA[My Take On Hashicorp's adoption of BSL 📑]]></title><description><![CDATA[Signed OpenTF Manifesto for the sake of community but, I also understand Hashicorp had tough choices &#9878;&#65039;.]]></description><link>https://news.letsdote.ch/p/my-take-on-hashicorps-adoption-of</link><guid isPermaLink="false">https://news.letsdote.ch/p/my-take-on-hashicorps-adoption-of</guid><pubDate>Mon, 21 Aug 2023 03:35:03 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1588689653688-9b312cd6bc2b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxM3x8bG9ja3xlbnwwfHx8fDE2OTIxOTEwNDV8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1588689653688-9b312cd6bc2b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxM3x8bG9ja3xlbnwwfHx8fDE2OTIxOTEwNDV8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1588689653688-9b312cd6bc2b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxM3x8bG9ja3xlbnwwfHx8fDE2OTIxOTEwNDV8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1588689653688-9b312cd6bc2b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxM3x8bG9ja3xlbnwwfHx8fDE2OTIxOTEwNDV8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1588689653688-9b312cd6bc2b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxM3x8bG9ja3xlbnwwfHx8fDE2OTIxOTEwNDV8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1588689653688-9b312cd6bc2b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxM3x8bG9ja3xlbnwwfHx8fDE2OTIxOTEwNDV8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1588689653688-9b312cd6bc2b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxM3x8bG9ja3xlbnwwfHx8fDE2OTIxOTEwNDV8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" width="5184" height="3456" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1588689653688-9b312cd6bc2b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxM3x8bG9ja3xlbnwwfHx8fDE2OTIxOTEwNDV8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:3456,&quot;width&quot;:5184,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;brown padlock on blue wooden door&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="brown padlock on blue wooden door" title="brown padlock on blue wooden door" srcset="https://images.unsplash.com/photo-1588689653688-9b312cd6bc2b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxM3x8bG9ja3xlbnwwfHx8fDE2OTIxOTEwNDV8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1588689653688-9b312cd6bc2b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxM3x8bG9ja3xlbnwwfHx8fDE2OTIxOTEwNDV8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1588689653688-9b312cd6bc2b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxM3x8bG9ja3xlbnwwfHx8fDE2OTIxOTEwNDV8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1588689653688-9b312cd6bc2b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxM3x8bG9ja3xlbnwwfHx8fDE2OTIxOTEwNDV8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/@jornadaprodutora">Jornada Produtora</a> on <a href="https://unsplash.com">Unsplash</a></figcaption></figure></div><p><a href="https://opentf.org/">I pledged my support to opentf foundation</a>, and here are the details about why I did. I have tried to be as clear as possible from the information I have read.</p><h2>Context</h2><p>Hashicorp&#8217;s Terraform has been a leading open source IaC tool for almost a decade now. Terraform has helped startups and organizations to streamline their cloud infrastructure operations - saving them a fortune in the digital transformation journeys.</p><p>Given their open source commitment, and the success described above, an entire ecosystem of partners, vendors, and community was born providing additional features with freemium pricing model. As far as the pricing model comparison between Hashicorp and most of the other vendors is concerned, they are similar.</p><h2>What happened?</h2><p><a href="https://www.hashicorp.com/blog/hashicorp-adopts-business-source-license">Hashicorp recently adopted Business Source License v1.1 (BSL or BUSL)</a> which was previously based on Mozilla Public License v2.0 (MPL v2.0). In summary, now they do support open source and community efforts in terms of &#8220;<em>copy, modify, and redistribute the code for all non-commercial and commercial use, except where providing a competitive offering to HashiCorp</em>&#8220;.</p><p>This restriction is specifically targeted towards vendors who are using Hashicorp&#8217;s products to build their commercial offerings which provide additional features and benefits in varied flavours.</p><p>The main concern expressed by Hashicorp is that the offerings provided by these vendors are either fundamentally or substantially based on Hashicorp&#8217;s core products, while not contributing enough to their open source commitment.</p><h2>How does this affect?</h2><p>As an individual developer, it does not affect you and me. It also does not affect if your organisation&#8217;s commercial offerings are completely different than those of Hashicorp&#8217;s. I.e. you can still use Hashicorp&#8217;s products in production (if I understand the words correctly).</p><p>But if you are a vendor (or work for a vendor) who creates a platform to offer competing features which are similar to what Hashicorp&#8217;s platform has to offer, then that is not allowed after a specific Terraform version - v1.5.5.</p><p>Overall, I think this is a bit vague. Besides, the cause I am rooting for is greater than this.</p><h2>Opinion</h2><p>I truly appreciate and admire what Hashicorp has achieved and contributed in the space of cloud operations. They are indeed an authority in the space of IaC. I am sure this feeling of gratitude is shared by that specific set of vendors too.</p><p>It is not that I never had this question about the obvious concern they have expressed. I have always admired Hashicorp to play a fatherly figure in this way. This also makes me understand where they are coming from with regards to this issue - for all the right reasons.</p><div class="pullquote"><p>When someone has authority, there is nothing right or wrong as far as the actions performed by them within their area of influence are concerned.</p></div><p>I understand Hashicorp&#8217;s decision and the fact that open source projects do undergo this license evolution phase. But at the same time, this always leaves an impact in upcoming days - especially at this stage. Apart from the specific set of vendors and partners, <strong>this also sends ripples of uncertainty across the community and customers</strong> - even if each of them fully understand what BSL means.</p><p>It is not about what the current or previous license means - it is more about the conscious action taken in the light of this situation, which somewhere impacts the confidence of community. That goes on to say that the customers - not the targeted vendors and partners - <strong>may now consider other options with lesser licensing complexities - which is also another headache</strong>.</p><p>To look at it retrospectively with an absurd angle - and I apologise beforehand for this - I question myself - was this all part of the plan by Hashicorp? Why did they wait 10 years for this to happen? In hindsight, Hashicorp could have leveraged this <strong>authority to contribute to the healthy competition - with an upper hand</strong> - to their vendors. Its not that all the infrastructure pain points are addressed.</p><p>I do understand that the pioneers like Hashicorp have a better view about this situation, more so who else would know their business better than themselves. Hashicorp deserves full credit to what they have built, and they are very well aware of what impact this decision would cause. But <strong>perhaps, they had tough choices to make from business survival perspective</strong>.</p><p>The contradiction I am unable to figure out for Hashicorp is - did they really understand the meaning of OSS back then? It is easy to talk about charity, and hard to do so. <strong>If business was the corner-stone of their operations, then they should have not touted the &#8220;free and open source&#8221; slogan in the first place</strong>. At least an intimation or a hint would have worked too. As I said before, I understand this decision of theirs, but if that is the case then it all sounds like a misuse of OSS model and community. Almost like gaining popularity and hard-but-free great contributions from thousands in the community, and then licensing it.</p><blockquote><p>I want to but I am not in a position to imagine what would happen if all the OSS decides to adopt BSL/close-source hence forth.</p></blockquote><p>It can happen that I did not understand the license fully, but I am skeptical for 2 reasons:</p><ol><li><p>I am not a legal expert, I am just a developer who loves Terraform. I am really not sure about when to use and when not to use it for production.</p></li><li><p>I am not sure if and when will they change their minds again.</p></li></ol><p>I signed the opentf pledge to highlight the impact of this decision on their own ecosystem, more importantly I believe they can do better.</p><p>Rest is described in the <a href="https://opentf.org">OpenTF Manifesto</a>.</p><p></p><p>Sumeet N.</p><p></p>]]></content:encoded></item><item><title><![CDATA[Using Cognito Auth with API Gateway is easy, but weird]]></title><description><![CDATA[Still struggling with authentication via Postman!]]></description><link>https://news.letsdote.ch/p/using-cognito-auth-with-api-gateway</link><guid isPermaLink="false">https://news.letsdote.ch/p/using-cognito-auth-with-api-gateway</guid><pubDate>Mon, 14 Aug 2023 10:45:45 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1542202024422-83d20d29efff?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxMXx8YXV0aCUyMGJsb2NrfGVufDB8fHx8MTY5MjAwOTg5NHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1542202024422-83d20d29efff?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxMXx8YXV0aCUyMGJsb2NrfGVufDB8fHx8MTY5MjAwOTg5NHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1542202024422-83d20d29efff?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxMXx8YXV0aCUyMGJsb2NrfGVufDB8fHx8MTY5MjAwOTg5NHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1542202024422-83d20d29efff?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxMXx8YXV0aCUyMGJsb2NrfGVufDB8fHx8MTY5MjAwOTg5NHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1542202024422-83d20d29efff?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxMXx8YXV0aCUyMGJsb2NrfGVufDB8fHx8MTY5MjAwOTg5NHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1542202024422-83d20d29efff?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxMXx8YXV0aCUyMGJsb2NrfGVufDB8fHx8MTY5MjAwOTg5NHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1542202024422-83d20d29efff?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxMXx8YXV0aCUyMGJsb2NrfGVufDB8fHx8MTY5MjAwOTg5NHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" width="4734" height="3156" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1542202024422-83d20d29efff?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxMXx8YXV0aCUyMGJsb2NrfGVufDB8fHx8MTY5MjAwOTg5NHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:3156,&quot;width&quot;:4734,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;closed blue and red door&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="closed blue and red door" title="closed blue and red door" srcset="https://images.unsplash.com/photo-1542202024422-83d20d29efff?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxMXx8YXV0aCUyMGJsb2NrfGVufDB8fHx8MTY5MjAwOTg5NHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1542202024422-83d20d29efff?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxMXx8YXV0aCUyMGJsb2NrfGVufDB8fHx8MTY5MjAwOTg5NHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1542202024422-83d20d29efff?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxMXx8YXV0aCUyMGJsb2NrfGVufDB8fHx8MTY5MjAwOTg5NHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1542202024422-83d20d29efff?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxMXx8YXV0aCUyMGJsb2NrfGVufDB8fHx8MTY5MjAwOTg5NHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/@cristina_gottardi">Cristina Gottardi</a> on <a href="https://unsplash.com">Unsplash</a></figcaption></figure></div><p>This will be a short one, since I don&#8217;t really have a good explanation of the behaviour posed by API Gateway. I have been struggling with this issue all throughout last week. But I do want to appreciate the Auth aspect offered by Cognito and API Gateway.</p><p>There are mainly 3 ways to do implement Authentication and Authorization logic for the private API calls made by users and service acccounts.</p><ol><li><p>Do it from scratch: This means</p><ol><li><p>Developing user signup, signin, signout workflows from scratch</p></li><li><p>There are more workflows to be handled - forgot password, reset password</p></li><li><p>The complexity increases multifold with MFA and email confirmation logic</p></li><li><p>Store the user credentials securely, etc.</p></li><li><p>&#8230; this is a lot of work</p></li></ol></li><li><p>Use Cognito with Lambda authorizers: here, all the workflows are handled by Cognito, along with the support for Federated auth with enough room for customizations. The auth logic (both authentication and RBAC) is to be developed in the Lambda functions. Special lambda functions are created to handle these incoming requests. There is indeed some coding involved.</p></li><li><p>Use Cognito with API Gateway authorizers: To think of it, if we categorize incoming requests targeted towards, they are mainly of 2 types - user initiated, and service accounts initiated (for automation purposes). It makes sense for API Gateway to incorporate the Auth handling by leveraging Cognito. By simply setting some parameters like scopes and headers, various use cases are satisfied. Additionally, this is not mutually exclusive to Lambda authorizers. For specific use cases it is possible to incorporate both.  For example, for basic authentication, API Gateway authorizers work well, for further authorization Lambda authorizers can be used.</p></li></ol><p>Implementing a secure system is a basic - all pervading - task, but at the same time it causes a lot of deliberation in terms of security. For small teams, Cognito abstracts away this crucial aspect and lets them focus on the core business. </p><p>Having followed the 3rd route, when I try to test the logic using Postman, it throws weird error - &#8220;<em>not a valid key=value pair (missing equal-sign) in Authorization header</em>&#8221;. I think there is either something minor setting that I have not been able to find since a week, or there is an entire universe in auth world that I might be missing. Fingers crossed.</p><p></p><p>Sumeet N.</p>]]></content:encoded></item><item><title><![CDATA[ChatGPT to process REST Responses in Golang]]></title><description><![CDATA[Get a head-start along with all those benefits Golang has to offer!]]></description><link>https://news.letsdote.ch/p/chatgpt-to-process-rest-responses</link><guid isPermaLink="false">https://news.letsdote.ch/p/chatgpt-to-process-rest-responses</guid><pubDate>Mon, 07 Aug 2023 03:35:55 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1642367340318-96fdbc5d30f5?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxnb2xhbmd8ZW58MHx8fHwxNjkxMzU3ODUwfDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1642367340318-96fdbc5d30f5?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxnb2xhbmd8ZW58MHx8fHwxNjkxMzU3ODUwfDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1642367340318-96fdbc5d30f5?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxnb2xhbmd8ZW58MHx8fHwxNjkxMzU3ODUwfDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1642367340318-96fdbc5d30f5?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxnb2xhbmd8ZW58MHx8fHwxNjkxMzU3ODUwfDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1642367340318-96fdbc5d30f5?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxnb2xhbmd8ZW58MHx8fHwxNjkxMzU3ODUwfDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1642367340318-96fdbc5d30f5?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxnb2xhbmd8ZW58MHx8fHwxNjkxMzU3ODUwfDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1642367340318-96fdbc5d30f5?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxnb2xhbmd8ZW58MHx8fHwxNjkxMzU3ODUwfDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" width="5184" height="3456" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1642367340318-96fdbc5d30f5?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxnb2xhbmd8ZW58MHx8fHwxNjkxMzU3ODUwfDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:3456,&quot;width&quot;:5184,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;a picture of a cartoon character on a wall&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="a picture of a cartoon character on a wall" title="a picture of a cartoon character on a wall" srcset="https://images.unsplash.com/photo-1642367340318-96fdbc5d30f5?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxnb2xhbmd8ZW58MHx8fHwxNjkxMzU3ODUwfDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1642367340318-96fdbc5d30f5?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxnb2xhbmd8ZW58MHx8fHwxNjkxMzU3ODUwfDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1642367340318-96fdbc5d30f5?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxnb2xhbmd8ZW58MHx8fHwxNjkxMzU3ODUwfDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1642367340318-96fdbc5d30f5?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxnb2xhbmd8ZW58MHx8fHwxNjkxMzU3ODUwfDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/@geekgunda">Chinmay B</a> on <a href="https://unsplash.com">Unsplash</a></figcaption></figure></div><p>Working with Golang can be a pain sometimes, especially when you are new and don&#8217;t yet appreciate its beauty. A trivial task like processing a JSON response object - which is way easier in JS, to a point where you don&#8217;t even have to care about using <em>variables</em> to hold those values - in Golang, becomes too complicated.</p><p>But trusting the process and the wise words spoken around, if you be patient and just continue with the tedious process, there will come a point where you would love doing it in Golang. In this post, I help relieve some of that pain.</p><h3>What&#8217;s the deal with JSON and Golang?</h3><p>JSONs are the top-most universal standards defined for communication of text based information across tools, interfaces, and SaaS-based services. It enjoys inherent support in all the major programming languages today - arguably except Golang. </p><p>This caused headaches for me for a few weeks, until the requirements forced it down my throat - a hard pill to swallow. Especially, coming from a JS background, I found it absolutely useless to do so much of wiring just to process a simple JSON - forget about the nested ones.</p><h3>How we do it in JS?</h3><p>Its a joke - and I say this with a sense of appreciation. It is way too easy to access attributes or loop over a JSON object for processing. Let us consider a simple JSON object that looks like below.</p><pre><code>{
  "name": "value",
  "env" : "production"
}</code></pre><p>We can simply access name and env values by doing this:</p><pre><code>var jsonObj = &lt;object above&gt;
console.log(jsonObj.name)
console.log(jsonObj.env)</code></pre><p>This saves up a lot of development time.</p><h3>In Golang&#8230;</h3><p>Like otherwise, even in Golang you need to know the structure of the JSON object before running the executable. We take advantage of this to explicitly define a struct for the JSON object being processed. Golang is a bit orthodox that way. To process the JSON object above, we first define a struct as below.</p><pre><code>type JSONObj struct {
  Name string `json:"name"`
  Env  string `json:"env"`
}</code></pre><p>The code block above just defines the struct in Golang to process the corresponding instance of JSON object. As we can see, we explicitly define the type (as string) for each of the attributes which would be processed by the functions. Additionally, <code>`json:&#8221;name&#8221;`</code> and <code>`json:&#8221;env&#8221;`</code> tells the compiler that the incoming JSON object would have attributes named (keys) with these values.</p><p>Further, to actually access these values the incoming JSON object - let us call it a response - has to be <code>Unmarshalled</code> into this struct, and vice versa - <code>Marshalled</code> to be converted back in byte format if it has to be returned. To do the same, we have to use the <code>json</code> module of Golang as shown below.</p><pre><code>// Assuming we get this response in response.Body
response, err := ioutil.ReadAll(response.Body)
var jsonResp JSONObj
err := json.Unmarshall(response, &amp;jsonResp)

// Access the attributes now -
fmt.println(jsonResp.name, jsonResp.env)</code></pre><div class="pullquote"><p>It seems like there is a lot going on here. But as I said before, trust the process. It is this strongly typed nature of Golang which makes it way more performant than JS.</p></div><p>Think of this like an essential transformation of the incoming JSON object so that it can be processed normally in the Golang environment. For the specific understanding of the Golang syntax above, if you are not familiar, I suggest you to check out the documentation or simply ChatGPT it. ;)</p><h3>What about complex JSONs?</h3><p>Yes, you guessed it right - things get even worse in Golang. In cases where we have multi-nested JSON objects and for the sake of keeping the code readable, we make use of multiple structs. Consider nested JSON example below.</p><pre><code>{
  "name": "John Doe",
  "age": 30,
  "contact": {
    "email": "john@example.com",
    "phone": "123-456-7890"
  },
  "address": {
    "street": "123 Main St",
    "city": "New York",
    "zipcode": "10001",
    "country": "USA"
  }
}</code></pre><p>To consume and process such a JSON response, the structs below have to be created, before we can <code>Unmarshall</code> or <code>Marshall</code> the same.</p><pre><code>type Person struct {
&#9;Name    string  `json:"name"`
&#9;Age     int     `json:"age"`
&#9;Contact Contact `json:"contact"`
&#9;Address Address `json:"address"`
}

type Contact struct {
&#9;Email string `json:"email"`
&#9;Phone string `json:"phone"`
}

type Address struct {
&#9;Street  string `json:"street"`
&#9;City    string `json:"city"`
&#9;Zipcode string `json:"zipcode"`
&#9;Country string `json:"country"`
}</code></pre><p>Notice how the structs for nested JSONs - <code>Address</code> and <code>Contact</code> - are created, and then used in the &#8220;parent&#8221; struct named <code>Person</code>. Similar pattern is followed if we have 3-level, 4-level, so-on-and-so-forth level of nested JSON.</p><h3>What have you decided?</h3><p>Before we talk about the ChatGPT part, perhaps you are thinking this to yourself if you are not a Golang dev already. Not that ChatGPT should be the reason for you to choose this language. Golang has its merits which far outweigh than this generic trick.</p><div class="pullquote"><p>Looking at the difference above - would you be interested in learning Golang or stick to what you have been doing?</p></div><p>No doubt, writing Golang code is tedious. But if you ask any cloud architect worried about compute costs - they will any day prefer Golang.</p><h3>ChatGPT? Relieve pain?</h3><p>Now straight to the point - since we already know what kind of JSON is going to be processed, we can simply ask ChatGPT to generate the corresponding structs and it does so in seconds - perfectly with the `json:&#8221;&lt;attribute_name&gt;&#8221;` notations.</p><p>I am shameless in saying this because:</p><ol><li><p>We cannot ignore the reality of ChatGPT. When space travel has become affordable, why would you still buy vacations in Hawaii?</p></li><li><p>Manually typing structs is really a tedious and slow process, prone to human error - thus slowing down the development.</p></li></ol><p>That was the tip with some insight and background in Golang. I highly encourage all the web devs to learn Golang for all the right reasons. By no way I meant other languages are not good, each language has its merits.</p><p></p><p>Sumeet N.</p><p></p><p></p><p></p>]]></content:encoded></item></channel></rss>