<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Devang Tomar</title>
    <description>The latest articles on Forem by Devang Tomar (@devangtomar).</description>
    <link>https://forem.com/devangtomar</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F909207%2F482ff0d2-44d7-473a-97c0-e9e54783234b.png</url>
      <title>Forem: Devang Tomar</title>
      <link>https://forem.com/devangtomar</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/devangtomar"/>
    <language>en</language>
    <item>
      <title>The Secret Cost of Microservices: Why Your ‘Scalable’ Architecture is Draining Engineering Morale…</title>
      <dc:creator>Devang Tomar</dc:creator>
      <pubDate>Sun, 06 Apr 2025 08:42:17 +0000</pubDate>
      <link>https://forem.com/devangtomar/the-secret-cost-of-microservices-why-your-scalable-architecture-is-draining-engineering-morale-dbb</link>
      <guid>https://forem.com/devangtomar/the-secret-cost-of-microservices-why-your-scalable-architecture-is-draining-engineering-morale-dbb</guid>
      <description>&lt;h3&gt;
  
  
  The Secret Cost of Microservices: Why Your ‘Scalable’ Architecture is Draining Engineering Morale 😓
&lt;/h3&gt;

&lt;h3&gt;
  
  
  The Hidden Human Toll of Distributed Systems
&lt;/h3&gt;

&lt;p&gt;🔄 &lt;em&gt;“We migrated to microservices for agility!”&lt;/em&gt;&lt;br&gt;&lt;br&gt;
📈 &lt;em&gt;“Our system scales infinitely now!”&lt;/em&gt;&lt;br&gt;&lt;br&gt;
⚙️ &lt;em&gt;“Every team owns their services independently!”&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Then why is your engineering team burned out and your velocity slowing down?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F52jn8zmgbb9cl18tas8e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F52jn8zmgbb9cl18tas8e.png" width="800" height="464"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After working with dozens of companies that adopted microservices, I’ve discovered an uncomfortable truth: &lt;strong&gt;Most microservice implementations create more problems than they solve&lt;/strong&gt;. Here’s how your “modern” architecture might be sabotaging your team.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. The Myth of Independent Development
&lt;/h3&gt;

&lt;h4&gt;
  
  
  The Promise vs Reality
&lt;/h4&gt;

&lt;p&gt;Promised BenefitActual Outcome”Teams can deploy independently””We need 5 services to release one feature””No more coordination!””Daily cross-team syncs for API changes””Faster iteration!””Spend 80% time debugging distributed systems”&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F946%2F0%2AHMF0BFjRB9xctN40" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F946%2F0%2AHMF0BFjRB9xctN40" width="946" height="720"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Case Study:&lt;/strong&gt; A mid-sized company adopted microservices and saw:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;40% increase in deployment frequency…&lt;/li&gt;
&lt;li&gt;But &lt;strong&gt;3x longer feature development cycles&lt;/strong&gt; due to coordination overhead&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. The 5 Silent Productivity Killers
&lt;/h3&gt;

&lt;h4&gt;
  
  
  🕳️ 1. Distributed Debugging Hell
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Traces spread across 5 systems&lt;/li&gt;
&lt;li&gt;“It works in test but fails in prod” becomes 10x harder&lt;/li&gt;
&lt;li&gt;Engineers need to understand 15 services to fix one bug&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  📉 2. The Testing Illusion
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;100% test coverage on each service…&lt;/li&gt;
&lt;li&gt;But zero tests for cross-service workflows&lt;/li&gt;
&lt;li&gt;“We didn’t realize Service A would break Service B’s cache”&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  🔄 3. Deployment Synchronization
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;“Independent deployments” require careful orchestration&lt;/li&gt;
&lt;li&gt;Feature flags become a distributed system themselves&lt;/li&gt;
&lt;li&gt;Rollbacks now require coordinated multi-service efforts&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  📊 4. Observability Overload
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;30 dashboards but no unified view&lt;/li&gt;
&lt;li&gt;Alerts fire constantly from downstream services&lt;/li&gt;
&lt;li&gt;“Is this our problem or someone else’s?”&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  💸 5. The Talent Tax
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;New engineers take 6 months to become productive&lt;/li&gt;
&lt;li&gt;Senior devs spend all time mentoring instead of coding&lt;/li&gt;
&lt;li&gt;Constant context switching destroys deep work&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. When Microservices Make Sense (And When They Don’t)
&lt;/h3&gt;

&lt;h4&gt;
  
  
  ✅ Good Candidates
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Clear domain boundaries (payment vs inventory)&lt;/li&gt;
&lt;li&gt;True scale needs (100k+ RPS)&lt;/li&gt;
&lt;li&gt;Mature platform/SRE team&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  ❌ Bad Candidates
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Small teams (&amp;lt; 15 engineers)&lt;/li&gt;
&lt;li&gt;Rapidly evolving product&lt;/li&gt;
&lt;li&gt;No existing monolith problems&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Rule of Thumb:&lt;/strong&gt; If you can’t draw your service boundaries on a napkin without ambiguity, you’re not ready.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxjz8lqsxrv29tcp9o39o.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxjz8lqsxrv29tcp9o39o.jpeg" width="500" height="721"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  4. The Modest Alternative: Modular Monoliths
&lt;/h3&gt;

&lt;h4&gt;
  
  
  The Architecture Everyone Forgot
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Single deployable unit&lt;/li&gt;
&lt;li&gt;Clear internal modules&lt;/li&gt;
&lt;li&gt;Shared database with bounded contexts&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Benefits:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;90% of microservice advantages&lt;/li&gt;
&lt;li&gt;10% of the complexity&lt;/li&gt;
&lt;li&gt;Works beautifully for 80% of companies&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Case Study:&lt;/strong&gt; A team migrated from 22 microservices to a modular monolith and saw:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;60% reduction in production incidents&lt;/li&gt;
&lt;li&gt;2x faster feature development&lt;/li&gt;
&lt;li&gt;New engineers productive in days instead of months&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  5. The Microservices Litmus Test
&lt;/h3&gt;

&lt;p&gt;Ask your team:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Can most engineers name all our services and their purposes?&lt;/li&gt;
&lt;li&gt;Do we regularly deploy services independently?&lt;/li&gt;
&lt;li&gt;Is cross-service coordination &amp;lt;10% of our time?&lt;/li&gt;
&lt;li&gt;Can new hires ship to prod in their first week?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you answered “no” to any, you’re paying the microservices tax without getting the benefits.&lt;/p&gt;

&lt;h3&gt;
  
  
  Final Thought: Architecture Should Serve People, Not Vice Versa
&lt;/h3&gt;

&lt;p&gt;The best architecture is the &lt;strong&gt;simplest one that solves your actual problems&lt;/strong&gt;  — not the one that looks best on an engineering blog.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F800%2F0%2AgfJgjaNzw8KjW9Kb" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F800%2F0%2AgfJgjaNzw8KjW9Kb" width="800" height="529"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;💬 &lt;strong&gt;Has your team fallen into the microservices trap? What architecture lessons have you learned the hard way?&lt;/strong&gt; Let’s discuss!&lt;/p&gt;

</description>
      <category>microservicearchitec</category>
      <category>bestpracticeprogramm</category>
      <category>monolithicarchitectu</category>
    </item>
    <item>
      <title>How to Create Kubernetes CRDs Using Golang and Master Controller Programming ️</title>
      <dc:creator>Devang Tomar</dc:creator>
      <pubDate>Sat, 22 Feb 2025 11:15:37 +0000</pubDate>
      <link>https://forem.com/devangtomar/how-to-create-kubernetes-crds-using-golang-and-master-controller-programming-2982</link>
      <guid>https://forem.com/devangtomar/how-to-create-kubernetes-crds-using-golang-and-master-controller-programming-2982</guid>
      <description>&lt;p&gt;Kubernetes has revolutionized the way we manage containerized applications, but what happens when you need to extend its capabilities to fit your unique use case? Enter &lt;strong&gt;Custom Resource Definitions (CRDs)&lt;/strong&gt; and &lt;strong&gt;Controllers&lt;/strong&gt;! With these powerful tools, you can define your own resources and automate their management in Kubernetes. 🌟&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F894%2F0%2AMWwtx-gsKLtaBFCY" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F894%2F0%2AMWwtx-gsKLtaBFCY" width="800" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this article, we’ll explore how to create Kubernetes CRDs using Golang and dive into the world of controller programming with the &lt;strong&gt;Watcher-Informer model&lt;/strong&gt;. Whether you’re building a custom operator or extending Kubernetes for your organization, this guide will help you get started. Let’s dive in! 💻&lt;/p&gt;

&lt;h3&gt;
  
  
  🤔 Why Create Custom Resources and Controllers?
&lt;/h3&gt;

&lt;p&gt;Before we jump into the &lt;em&gt;how&lt;/em&gt;, let’s talk about the &lt;em&gt;why&lt;/em&gt;. Here are a few reasons you might want to create CRDs and controllers:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Custom Workflows&lt;/strong&gt; : You need to manage resources that Kubernetes doesn’t natively support.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automation&lt;/strong&gt; : You want to automate complex tasks like provisioning, scaling, or healing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Extending Kubernetes&lt;/strong&gt; : You’re building a platform or tool that integrates deeply with Kubernetes.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If any of these resonate with you, it’s time to roll up your sleeves and start building! 🛠️&lt;/p&gt;

&lt;h3&gt;
  
  
  🧰 What You’ll Need
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2ASwKKLEaCqBGtBHNM" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F0%2ASwKKLEaCqBGtBHNM" width="800" height="339"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Before we begin, make sure you have the following tools installed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Go (Golang)&lt;/strong&gt;: We’ll use Go to write our CRD and controller. Install it from &lt;a href="https://golang.org/" rel="noopener noreferrer"&gt;golang.org&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Kubebuilder or Operator SDK&lt;/strong&gt; : These frameworks simplify the process of building Kubernetes operators. Install one of them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Kubernetes Cluster&lt;/strong&gt; : You’ll need a cluster to test your CRD and controller. Minikube or Kind are great for local development.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;kubectl&lt;/strong&gt; : The Kubernetes CLI tool for interacting with your cluster.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🚀 Step 1: Define Your Custom Resource (CRD)
&lt;/h3&gt;

&lt;p&gt;Let’s create a CRD for a “Widget” resource.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Scaffold Your Project&lt;/strong&gt; :
Use Kubebuilder to set up your project.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubebuilder init --domain mydomain.com --repo github.com/yourusername/widget-operator  
kubebuilder create api --group widgets --version v1 --kind Widget  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This generates the files you need for your CRD and controller.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Define the Widget Schema&lt;/strong&gt; :&lt;br&gt;&lt;br&gt;
Open api/v1/widget_types.go and define your Widget resource.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package v1  

import (  
    metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"  
)  

// WidgetSpec defines the desired state of Widget  
type WidgetSpec struct {  
    Name string `json:"name"`  
    Description string `json:"description,omitempty"`  
    Replicas int32 `json:"replicas"`  
}  

// WidgetStatus defines the observed state of Widget  
type WidgetStatus struct {  
    AvailableReplicas int32 `json:"availableReplicas"`  
}  

//+kubebuilder:object:root=true  
//+kubebuilder:subresource:status  

// Widget is the Schema for the widgets API  
type Widget struct {  
    metav1.TypeMeta `json:",inline"`  
    metav1.ObjectMeta `json:"metadata,omitempty"`  

    Spec WidgetSpec `json:"spec,omitempty"`  
    Status WidgetStatus `json:"status,omitempty"`  
}  

//+kubebuilder:object:root=true  

// WidgetList contains a list of Widget  
type WidgetList struct {  
    metav1.TypeMeta `json:",inline"`  
    metav1.ListMeta `json:"metadata,omitempty"`  
    Items []Widget `json:"items"`  
}  

func init() {  
    SchemeBuilder.Register(&amp;amp;Widget{}, &amp;amp;WidgetList{})  
}  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Generate and Apply the CRD&lt;/strong&gt; :
Run these commands to generate and apply your CRD.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;make manifests  
kubectl apply -f config/crd/bases/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Boom! Your CRD is now live in the cluster. 🎉&lt;/p&gt;

&lt;h3&gt;
  
  
  🛠️ Step 2: Build the Controller
&lt;/h3&gt;

&lt;p&gt;Now, let’s build the controller to manage your Widgets.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Understand the Watcher-Informer Model&lt;/strong&gt; :&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Watcher&lt;/strong&gt; : Watches for changes to resources. 👀&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Informer&lt;/strong&gt; : Caches resource state and triggers events. 🤖&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Implement the Reconcile Loop&lt;/strong&gt; :&lt;br&gt;&lt;br&gt;
Open controllers/widget_controller.go and add your logic.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package controllers  

import (  
    "context"  
    "fmt"  

    "github.com/go-logr/logr"  
    "k8s.io/apimachinery/pkg/runtime"  
    ctrl "sigs.k8s.io/controller-runtime"  
    "sigs.k8s.io/controller-runtime/pkg/client"  

    widgetv1 "github.com/yourusername/widget-operator/api/v1"  
)  

// WidgetReconciler reconciles a Widget object  
type WidgetReconciler struct {  
    client.Client  
    Log logr.Logger  
    Scheme *runtime.Scheme  
}  

func (r *WidgetReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {  
    log := r.Log.WithValues("widget", req.NamespacedName)  

    // Fetch the Widget  
    var widget widgetv1.Widget  
    if err := r.Get(ctx, req.NamespacedName, &amp;amp;widget); err != nil {  
        return ctrl.Result{}, client.IgnoreNotFound(err)  
    }  

    // Your logic here  
    log.Info("Reconciling Widget", "name", widget.Name)  
    fmt.Printf("Widget Spec: %+v\n", widget.Spec)  

    // Update status  
    widget.Status.AvailableReplicas = widget.Spec.Replicas  
    if err := r.Status().Update(ctx, &amp;amp;widget); err != nil {  
        return ctrl.Result{}, err  
    }  

    return ctrl.Result{}, nil  
}  

func (r *WidgetReconciler) SetupWithManager(mgr ctrl.Manager) error {  
    return ctrl.NewControllerManagedBy(mgr).  
        For(&amp;amp;widgetv1.Widget{}).  
        Complete(r)  
}  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Run the Controller&lt;/strong&gt; :
Start your controller locally to test it.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;make run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🧪 Step 3: Test Your CRD and Controller
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Create a Widget Resource&lt;/strong&gt; :
Create a widget-example.yaml file:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apiVersion: widgets.mydomain.com/v1  
kind: Widget  
metadata:  
  name: example-widget  
spec:  
  name: "example-widget"  
  description: "This is an example widget."  
  replicas: 3  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Apply the Resource&lt;/strong&gt; :
Use kubectl to apply it.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl apply -f widget-example.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Check the Logs&lt;/strong&gt; :
Watch your controller logs to see the magic happen! ✨&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  🚀 Step 4: Deploy Your Controller
&lt;/h3&gt;

&lt;p&gt;Once it works locally, deploy it to your cluster.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Build and Push the Docker Image&lt;/strong&gt; :
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;make docker-build docker-push IMG=&amp;lt;your-docker-image&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Deploy the Controller
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;make deploy IMG=&amp;lt;your-docker-image&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🎉 You Did It!
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl8w4cetnvpzlw254mng2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl8w4cetnvpzlw254mng2.png" width="515" height="665"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You’ve just:&lt;br&gt;&lt;br&gt;
✅ Created a &lt;strong&gt;Custom Resource Definition (CRD)&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
✅ Built a &lt;strong&gt;Controller&lt;/strong&gt; using the Watcher-Informer model&lt;br&gt;&lt;br&gt;
✅ Automated your custom resources like a pro! 🚀&lt;/p&gt;

&lt;p&gt;Now go forth and extend Kubernetes to fit YOUR needs! 🌟&lt;/p&gt;

</description>
      <category>kubernetesoperator</category>
      <category>kubernetescluster</category>
      <category>kubernetestraining</category>
      <category>kubernetessecurity</category>
    </item>
    <item>
      <title>Interacting with the Kubernetes API: From kubectl to Custom Clients</title>
      <dc:creator>Devang Tomar</dc:creator>
      <pubDate>Sat, 08 Feb 2025 10:40:22 +0000</pubDate>
      <link>https://forem.com/devangtomar/interacting-with-the-kubernetes-api-from-kubectl-to-custom-clients-3gei</link>
      <guid>https://forem.com/devangtomar/interacting-with-the-kubernetes-api-from-kubectl-to-custom-clients-3gei</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq4ghfnss8paukxhc1ak4.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq4ghfnss8paukxhc1ak4.jpeg" width="553" height="451"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Kubernetes is like the brain of your cloud-native applications, managing everything from deploying workloads to keeping them healthy. But how does it actually work behind the scenes? That’s where the &lt;strong&gt;Kubernetes API Server&lt;/strong&gt; comes in!&lt;/p&gt;

&lt;p&gt;If you’ve ever run kubectl get pods, congratulations—you’ve already used the API server! But there’s a whole world beyond just kubectl—from direct API calls to writing custom clients and controllers. Let’s dive in and explore how you can talk to Kubernetes like a pro!&lt;/p&gt;

&lt;h3&gt;
  
  
  🤖 Meet the Kubernetes API Server
&lt;/h3&gt;

&lt;p&gt;The &lt;strong&gt;Kubernetes API Server (&lt;/strong&gt;&lt;strong&gt;kube-apiserver)&lt;/strong&gt; is the gateway to all things Kubernetes. It’s like the receptionist at a busy office—handling requests, checking permissions, and making sure everything runs smoothly.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5t2tjbdfue75utf1d29f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5t2tjbdfue75utf1d29f.png" width="324" height="455"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here’s what happens when you interact with Kubernetes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;You make a request&lt;/strong&gt; (e.g., create a pod, list services).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The API Server checks permissions&lt;/strong&gt; (using authentication and authorization).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It validates and processes the request&lt;/strong&gt; (possibly modifying it via admission controllers).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The new state is stored in etcd&lt;/strong&gt; (the brain of Kubernetes!).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Controllers and schedulers react&lt;/strong&gt; to ensure everything is running as expected.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Everything in Kubernetes is an API call under the hood — so mastering the API is key!&lt;/p&gt;

&lt;h3&gt;
  
  
  🛠️ Talking to Kubernetes with kubectl
&lt;/h3&gt;

&lt;p&gt;The simplest way to interact with the Kubernetes API is via kubectl. It's a friendly wrapper around API requests. Let’s see some fun tricks!&lt;/p&gt;

&lt;h4&gt;
  
  
  Get Raw API Data
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get pods -o json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is just a fancy way of saying &lt;strong&gt;“Hey Kubernetes, show me everything about my pods”&lt;/strong&gt; in JSON format.&lt;/p&gt;

&lt;h4&gt;
  
  
  Explore API Endpoints
&lt;/h4&gt;

&lt;p&gt;Want to see what resources are available? Try this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl api-resources
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You’ll get a list of all the things Kubernetes can manage — from pods to secrets to custom resources!&lt;/p&gt;

&lt;h4&gt;
  
  
  Making Direct API Calls
&lt;/h4&gt;

&lt;p&gt;If you’re feeling adventurous, try accessing the API directly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl proxy --port=8080
curl http://localhost:8080/api/v1/nodes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This bypasses kubectl and talks to Kubernetes &lt;em&gt;raw and unfiltered&lt;/em&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  👨‍💻 Building Your Own Kubernetes API Client
&lt;/h3&gt;

&lt;p&gt;Want to go beyond kubectl? Let’s build a &lt;strong&gt;custom Go client&lt;/strong&gt; to interact with Kubernetes directly!&lt;/p&gt;

&lt;h4&gt;
  
  
  Install client-go
&lt;/h4&gt;

&lt;p&gt;First, install the official Kubernetes Go client:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;go get k8s.io/client-go@latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Connecting to Your Cluster
&lt;/h4&gt;

&lt;p&gt;Here’s a simple Go program that lists all pods in the default namespace:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package main

import (
 "context"
 "fmt"
 "k8s.io/client-go/kubernetes"
 "k8s.io/client-go/rest"
 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

func main() {
 config, err := rest.InClusterConfig()
 if err != nil {
  panic(err.Error())
 }

 clientset, err := kubernetes.NewForConfig(config)
 if err != nil {
  panic(err.Error())
 }

 pods, err := clientset.CoreV1().Pods("default").List(context.TODO(), metav1.ListOptions{})
 if err != nil {
  panic(err.Error())
 }

 for _, pod := range pods.Items {
  fmt.Println("Pod Name:", pod.Name)
 }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will list all pods in your cluster programmatically. Now, you’re officially a Kubernetes hacker! 🚀&lt;/p&gt;

&lt;h3&gt;
  
  
  🌟 Advanced Fun: Custom Controllers and CRDs
&lt;/h3&gt;

&lt;p&gt;Want to &lt;strong&gt;teach Kubernetes new tricks&lt;/strong&gt;? You can create your own &lt;strong&gt;Custom Resource Definitions (CRDs)&lt;/strong&gt; and build controllers to manage them automatically.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F500%2F0%2AAhqKdK0J88aeP9_t" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F500%2F0%2AAhqKdK0J88aeP9_t" width="500" height="680"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Example: Creating a New Custom Resource
&lt;/h4&gt;

&lt;p&gt;Define a new &lt;strong&gt;Widget&lt;/strong&gt; resource:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: widgets.example.com
spec:
  group: example.com
  names:
    kind: Widget
    plural: widgets
  scope: Namespaced
  versions:
  - name: v1
    served: true
    storage: true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now Kubernetes knows what a &lt;strong&gt;Widget&lt;/strong&gt; is! Next, let’s create a controller to manage them.&lt;/p&gt;

&lt;h4&gt;
  
  
  Running the Custom Controller
&lt;/h4&gt;

&lt;p&gt;Once your custom controller is running, you can interact with it just like built-in Kubernetes resources!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create a Widget Instance&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl apply -f widget-crd.yaml
kubectl apply -f example-widget.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Check the Custom Resource&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get widgets
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Describe a Specific Widget&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl describe widget example-widget
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your controller will make sure your widgets are always in the desired state, just like how Kubernetes keeps pods running.&lt;/p&gt;

&lt;h3&gt;
  
  
  🚀 Wrapping Up
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F168%2F0%2AQfufcj7qFSSLIFn8" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F168%2F0%2AQfufcj7qFSSLIFn8" width="168" height="300"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Mastering the Kubernetes API unlocks endless possibilities. Whether you’re:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Using kubectl for quick commands,&lt;/li&gt;
&lt;li&gt;Writing scripts that make direct API calls,&lt;/li&gt;
&lt;li&gt;Building &lt;strong&gt;custom clients&lt;/strong&gt; , or&lt;/li&gt;
&lt;li&gt;Creating &lt;strong&gt;custom controllers&lt;/strong&gt; to extend Kubernetes itself…&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;…you now have the skills to &lt;strong&gt;talk to Kubernetes like a pro!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;🔗 &lt;strong&gt;Want more Kubernetes fun?&lt;/strong&gt; Follow me for more DevOps &amp;amp; Cloud insights! 🚀&lt;/p&gt;

</description>
      <category>kubernetesengine</category>
      <category>kubernetesoperator</category>
      <category>kubernetesapi</category>
      <category>golangdevelopment</category>
    </item>
    <item>
      <title>How to Write Your Own Terraform Provider: A Step-by-Step Guide 🛠️ ️</title>
      <dc:creator>Devang Tomar</dc:creator>
      <pubDate>Fri, 31 Jan 2025 18:31:02 +0000</pubDate>
      <link>https://forem.com/devangtomar/how-to-write-your-own-terraform-provider-a-step-by-step-guide-g0i</link>
      <guid>https://forem.com/devangtomar/how-to-write-your-own-terraform-provider-a-step-by-step-guide-g0i</guid>
      <description>&lt;p&gt;Terraform has become the go-to tool for infrastructure as code (IaC), enabling developers to define and provision infrastructure using a declarative configuration language. While Terraform supports a wide range of cloud providers and services out of the box, there may come a time when you need to manage a custom resource or integrate with a proprietary API. That’s where writing your own Terraform provider comes in! 🌟&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F24gw2kxbof43donwevu0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F24gw2kxbof43donwevu0.png" width="800" height="250"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this article, we’ll walk through the process of creating your very own Terraform provider from scratch. Whether you’re managing a niche cloud service or an internal tool, this guide will help you get started. Let’s dive in! 💻&lt;/p&gt;

&lt;h4&gt;
  
  
  🤔 Why Write a Custom Terraform Provider?
&lt;/h4&gt;

&lt;p&gt;Before we jump into the *how*, let’s talk about the *why*. Here are a few reasons you might want to create your own Terraform provider:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Custom Resources&lt;/strong&gt; : You have a unique service or tool that isn’t supported by existing providers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Proprietary APIs&lt;/strong&gt; : Your organization uses internal APIs that need to be managed as infrastructure.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Extending Terraform&lt;/strong&gt; : You want to add functionality to Terraform that aligns with your specific workflows.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If any of these resonate with you, it’s time to roll up your sleeves and start building! 🛠️&lt;/p&gt;

&lt;h4&gt;
  
  
  🧰 Prerequisites
&lt;/h4&gt;

&lt;p&gt;Before we begin, make sure you have the following tools installed:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Go (Golang)&lt;/strong&gt;: Terraform providers are written in Go. Install it from &lt;a href="[https://golang.org/](https://golang.org/)"&gt;golang.org&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Terraform&lt;/strong&gt; : You’ll need Terraform installed to test your provider. Download it from &lt;a href="[https://www.terraform.io/](https://www.terraform.io/)"&gt;terraform.io&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Git&lt;/strong&gt; : For version control and managing your provider’s code.&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  🚀 Step 1: Set Up Your Go Environment
&lt;/h4&gt;

&lt;p&gt;First, let’s set up your Go workspace. Create a new directory for your provider and initialize a Go module:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir terraform-provider-myprovider
cd terraform-provider-myprovider
go mod init github.com/yourusername/terraform-provider-myprovider
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will create a go.mod file, which manages your project’s dependencies.&lt;/p&gt;

&lt;h4&gt;
  
  
  🛠️ Step 2: Create the Provider Skeleton
&lt;/h4&gt;

&lt;p&gt;Terraform providers follow a specific structure. Start by creating the basic files and directories:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create the main.go file:
This is the entry point for your provider.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package main

import (
    "github.com/hashicorp/terraform-plugin-sdk/v2/plugin"
    "github.com/yourusername/terraform-provider-myprovider/myprovider"
)

func main() {
    plugin.Serve(&amp;amp;plugin.ServeOpts{
        ProviderFunc: myprovider.Provider,
    })
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Create the provider file:
In a new directory called myprovider, create a file named provider.go.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package myprovider

import (
    "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

func Provider() *schema.Provider {
    return &amp;amp;schema.Provider{
        ResourcesMap: map[string]*schema.Resource{},
        DataSourcesMap: map[string]*schema.Resource{},
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This sets up the basic structure of your provider. Right now, it doesn’t do much, but we’ll add resources and data sources soon.&lt;/p&gt;

&lt;h4&gt;
  
  
  🔧 Step 3: Define Your First Resource
&lt;/h4&gt;

&lt;p&gt;A Terraform provider is useless without resources. Let’s define a simple resource. For example, let’s say we’re creating a provider to manage “widgets” in a fictional API.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a resource file:
In the myprovider directory, create a file named resource_widget.go.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package myprovider

import (
    "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

func resourceWidget() *schema.Resource {
    return &amp;amp;schema.Resource{
        Create: resourceWidgetCreate,
        Read: resourceWidgetRead,
        Update: resourceWidgetUpdate,
        Delete: resourceWidgetDelete,

        Schema: map[string]*schema.Schema{
            "name": {
                Type: schema.TypeString,
                Required: true,
            },
            "description": {
                Type: schema.TypeString,
                Optional: true,
            },
        },
    }
}

func resourceWidgetCreate(d *schema.ResourceData, m interface{}) error {
    // Implement logic to create a widget.
    d.SetId("widget-id") // Set a dummy ID for now.
    return nil
}

func resourceWidgetRead(d *schema.ResourceData, m interface{}) error {
    // Implement logic to read a widget.
    return nil
}

func resourceWidgetUpdate(d *schema.ResourceData, m interface{}) error {
    // Implement logic to update a widget.
    return nil
}

func resourceWidgetDelete(d *schema.ResourceData, m interface{}) error {
    // Implement logic to delete a widget.
    return nil
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Register the resource:
Update the provider.go file to include the new resource.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;func Provider() *schema.Provider {
    return &amp;amp;schema.Provider{
        ResourcesMap: map[string]*schema.Resource{
            "myprovider_widget": resourceWidget(),
        },
        DataSourcesMap: map[string]*schema.Resource{},
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  🧪 Step 4: Test Your Provider
&lt;/h4&gt;

&lt;p&gt;Now that you’ve defined a resource, it’s time to test your provider. First, build the provider:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;go build -o terraform-provider-myprovider
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, create a Terraform configuration file (main.tf) to test the provider:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;provider "myprovider" {}

resource "myprovider_widget" "example" {
  name = "example-widget"
  description = "This is an example widget."
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, initialize and apply your Terraform configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;terraform init
terraform apply
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  🚀 Step 5: Publish and Share Your Provider
&lt;/h4&gt;

&lt;p&gt;Once your provider is working, you can publish it to the Terraform Registry or share it with your team. To publish it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Tag your release:
Use Git to tag your release.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git tag v1.0.0
git push origin v1.0.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Submit to the Terraform Registry:
Follow the &lt;a href="https://www.terraform.io/docs/registry/providers/publishing.html" rel="noopener noreferrer"&gt;Terraform Registry documentation&lt;/a&gt; to publish your provider.&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  🎉 Congratulations! You’ve Built a Terraform Provider!
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2svy6g7vl6ngvvhkn1jt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2svy6g7vl6ngvvhkn1jt.png" width="800" height="328"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Writing a custom Terraform provider might seem daunting at first, but once you break it down into steps, it’s entirely manageable. By following this guide, you’ve learned how to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Set up a Go project for your provider.
&lt;/li&gt;
&lt;li&gt;Define resources and data sources.
&lt;/li&gt;
&lt;li&gt;Test and publish your provider.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>customprovider</category>
      <category>terraform</category>
      <category>terraformprovider</category>
      <category>terraformmodules</category>
    </item>
    <item>
      <title>The $10 Data Trick That Makes AI Assistants Sound Human</title>
      <dc:creator>Devang Tomar</dc:creator>
      <pubDate>Sat, 28 Dec 2024 05:51:30 +0000</pubDate>
      <link>https://forem.com/devangtomar/the-10-data-trick-that-makes-ai-assistants-sound-human-1g16</link>
      <guid>https://forem.com/devangtomar/the-10-data-trick-that-makes-ai-assistants-sound-human-1g16</guid>
      <description>&lt;p&gt;AI assistants are impressive, but let’s be honest — sometimes they come across as robotic, overly formal, or downright clueless. What if I told you there’s a simple, &lt;strong&gt;$10 data trick&lt;/strong&gt; that can make your AI assistant sound remarkably human, as if it’s &lt;em&gt;actually&lt;/em&gt; paying attention to you?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F640%2F0%2Amee5xZcS4gl9YfLL" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F640%2F0%2Amee5xZcS4gl9YfLL" width="640" height="640"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Spoiler alert: It’s not about fancy models or expensive APIs. It’s about &lt;strong&gt;structured personalization&lt;/strong&gt;  — a small but powerful hack that turns generic responses into tailored, human-like interactions.&lt;/p&gt;

&lt;p&gt;Let’s dive into how you can implement this trick, why it works, and how it can make your AI assistant shine.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Why AI Assistants Feel Robotic 🦾&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Most AI assistants rely on massive datasets to generate responses, but these datasets are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Generic&lt;/strong&gt; : They don’t reflect individual user preferences.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Unstructured&lt;/strong&gt; : The assistant can’t efficiently connect the dots between bits of information.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This means your assistant might sound smart in a general sense but fails to deliver the nuanced, personalized tone that human conversations require.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;The $10 Data Trick: Structured Personalization 🤖&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;The trick is simple: &lt;strong&gt;combine unstructured natural language inputs with structured user data.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Structured data refers to information stored in organized formats like databases or spreadsheets. Think of data like:&lt;/p&gt;

&lt;p&gt;• A user’s &lt;strong&gt;name&lt;/strong&gt; , &lt;strong&gt;location&lt;/strong&gt; , and &lt;strong&gt;preferences&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;Interaction history&lt;/strong&gt; , such as past questions or purchases.&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;Contextual metadata&lt;/strong&gt; , like the time of day or device being used.&lt;/p&gt;

&lt;p&gt;When paired with an LLM, this data enables the assistant to craft responses that feel personal and relevant.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;How It Works 🏋🏻‍♀️&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;1. Collect User Data (Ethically!)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Start by gathering &lt;strong&gt;basic, consented information&lt;/strong&gt; about your users. For example:&lt;/p&gt;

&lt;p&gt;• Name&lt;/p&gt;

&lt;p&gt;• Favorite topics (e.g., sports, technology, or travel)&lt;/p&gt;

&lt;p&gt;• Recent interactions (e.g., last search query or support ticket)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Store It in a Structured Format&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Use a lightweight database like SQLite or Firebase to store the data. Example:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;User ID&lt;/strong&gt;  &lt;strong&gt;Name&lt;/strong&gt;  &lt;strong&gt;Last Interaction&lt;/strong&gt;  &lt;strong&gt;Preferred Style&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;001 Alice Asked about flights Casual&lt;/p&gt;

&lt;p&gt;002 Bob Purchased a laptop Formal&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Inject It into Prompts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When crafting prompts for your LLM, include relevant structured data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Before:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;“What are the cheapest flights available?”&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;After:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;“Hi Alice! I found the cheapest flights from Bangalore to Paris for you. Would you like them sorted by price or duration?”&lt;/em&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Why It Works 🤔&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;1. Context Makes Conversations Flow&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;By pulling data from a structured source, the assistant instantly becomes more aware of the user’s context. This avoids repetitive questions and creates a smoother, more intuitive experience.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Personalization Builds Trust&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When users feel their preferences are remembered, they perceive the assistant as smarter and more reliable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Structure Prevents Hallucination&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Structured data anchors the AI, reducing the likelihood of generating inaccurate or overly generic responses.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Real-Life Examples 📖&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;1. E-Commerce:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Without personalization:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;“Here are some laptops under $1,000.”&lt;/p&gt;

&lt;p&gt;&lt;em&gt;With personalization:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;“Hi Bob! Based on your recent purchase, here are laptops under $1,000 that are compatible with the accessories you bought.”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Travel Assistants:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Without personalization:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;“Flights to Paris start at $500.”&lt;/p&gt;

&lt;p&gt;&lt;em&gt;With personalization:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;“Hi Alice, flights from Bangalore to Paris next Thursday start at $500. Want me to check hotel deals too?”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Customer Support:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Without personalization:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;“How can I help you today?”&lt;/p&gt;

&lt;p&gt;&lt;em&gt;With personalization:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;“Hi Alice, I see your last support request was about payment issues. Are you following up on that, or is this about something new?”&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Cost Breakdown 💰&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Here’s how you can implement this trick for &lt;strong&gt;under $10&lt;/strong&gt; :&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Database Setup&lt;/strong&gt; : Free options like SQLite or Firebase for small-scale projects.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Embedding API Costs&lt;/strong&gt; : A few cents per query using OpenAI, Hugging Face, or similar services.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Time Investment&lt;/strong&gt; : A few hours to integrate structured data into your pipeline.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That’s it. A small investment for a massive impact.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;The Big Payoff 🧾&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Companies that use structured personalization have seen:&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;20–40% higher customer satisfaction scores.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;30% increase in task completion rates for AI assistants.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;Significant revenue boosts&lt;/strong&gt; from improved user retention.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;How to Get Started Today 🎬&lt;/strong&gt;
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Identify Key User Data&lt;/strong&gt; : Decide what details are most relevant for your assistant’s purpose.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Set Up a Database&lt;/strong&gt; : Use a simple spreadsheet or cloud database to organize and store data.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Enhance Your Prompts&lt;/strong&gt; : Experiment with injecting structured data into your AI prompts.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Final Thoughts 💭&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;The human touch isn’t magic — it’s structure. By integrating structured user data into your AI assistant, you can move from cold, robotic responses to meaningful, engaging conversations. All for less than $10.&lt;/p&gt;

&lt;h4&gt;
  
  
  Connect with Me on Social Media
&lt;/h4&gt;

&lt;p&gt;🐦 Follow me on Twitter: &lt;a href="https://twitter.com/devangtomar7" rel="noopener noreferrer"&gt;devangtomar7&lt;/a&gt;&lt;br&gt;&lt;br&gt;
🔗 Connect with me on LinkedIn: &lt;a href="https://www.linkedin.com/in/devangtomar" rel="noopener noreferrer"&gt;devangtomar&lt;/a&gt;&lt;br&gt;&lt;br&gt;
📷 Check out my Instagram: &lt;a href="https://instagram.com/be_ayushmann" rel="noopener noreferrer"&gt;be_ayushmann&lt;/a&gt;&lt;br&gt;&lt;br&gt;
Ⓜ️ Checkout my blogs on Medium: &lt;a href="https://medium.com/@devangtomar" rel="noopener noreferrer"&gt;Devang Tomar&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;strong&gt;#️⃣&lt;/strong&gt; Checkout my blogs on Hashnode: &lt;a href="https://devangtomar.hashnode.dev/" rel="noopener noreferrer"&gt;devangtomar&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;strong&gt;🧑‍💻&lt;/strong&gt; Checkout my blogs on Dev.to: &lt;a href="https://dev.to/devangtomar"&gt;devangtomar&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aitricks</category>
      <category>aihumor</category>
      <category>humanaiinteraction</category>
      <category>aihumanizer</category>
    </item>
    <item>
      <title>How a Sneaky AI Hack Turned 5 Lines of Code into a $1M Search Engine Upgrade</title>
      <dc:creator>Devang Tomar</dc:creator>
      <pubDate>Fri, 20 Dec 2024 05:31:33 +0000</pubDate>
      <link>https://forem.com/devangtomar/how-a-sneaky-ai-hack-turned-5-lines-of-code-into-a-1m-search-engine-upgrade-21nh</link>
      <guid>https://forem.com/devangtomar/how-a-sneaky-ai-hack-turned-5-lines-of-code-into-a-1m-search-engine-upgrade-21nh</guid>
      <description>&lt;p&gt;Search engines power the world — whether it’s finding the perfect recipe, the latest tech gadget, or that obscure meme template you saw last week. But beneath their sleek search bars, many engines rely on outdated systems, leading to irrelevant results, frustrated users, and lost revenue.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F640%2F0%2Aic-EDgKlTs8F_Quq" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F640%2F0%2Aic-EDgKlTs8F_Quq" width="640" height="349"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What if I told you that with just &lt;em&gt;5 lines of code&lt;/em&gt;, you could transform your search engine into a powerhouse, increasing its efficiency and even driving &lt;strong&gt;$1M+ in revenue&lt;/strong&gt;?&lt;/p&gt;

&lt;p&gt;Let’s dive into the &lt;strong&gt;sneaky AI hack&lt;/strong&gt; that’s making it possible: &lt;strong&gt;embedding-based searches&lt;/strong&gt; powered by Large Language Models (LLMs).&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;The Problem with Traditional Search Engines 😵&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Legacy search engines typically use &lt;strong&gt;keyword-based search&lt;/strong&gt;. This means they match user queries to documents by looking for literal matches. Sounds simple, right? But here’s the catch:&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;Synonyms trip them up:&lt;/strong&gt; Searching for “buy running shoes” might miss results for “purchase sneakers.”&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;Context goes over their head:&lt;/strong&gt; Searching for “python tutorial” could return snake-related content instead of programming resources.&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;Rigid ranking:&lt;/strong&gt; Results are ranked by keyword frequency rather than understanding the query’s intent.&lt;/p&gt;

&lt;p&gt;These limitations hurt &lt;strong&gt;user satisfaction&lt;/strong&gt; and &lt;strong&gt;conversion rates&lt;/strong&gt;  — a big deal for e-commerce, content platforms, and SaaS tools.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;The Sneaky Hack: Embedding-Based Searches 🕵🏻‍♂️&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Enter &lt;strong&gt;embeddings&lt;/strong&gt; , the secret sauce that’s supercharging search engines.&lt;/p&gt;

&lt;p&gt;An embedding is a numerical representation of text, capturing its &lt;strong&gt;semantic meaning&lt;/strong&gt; rather than just the words. For example, embeddings for “buy running shoes” and “purchase sneakers” would be &lt;strong&gt;close together&lt;/strong&gt; in vector space, ensuring they’re treated as similar queries.&lt;/p&gt;

&lt;p&gt;Here’s the crazy part: with &lt;strong&gt;just 5 lines of code&lt;/strong&gt; , you can integrate embeddings into your search engine. Here’s what they do:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Convert queries and documents into embeddings.&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Use vector similarity&lt;/strong&gt; (like cosine similarity) to find the closest match.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Return results ranked by relevance&lt;/strong&gt; , not just keywords.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;The 5 Lines of Code That Changed Everything 🧑🏻‍💻&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;This is how simple it can be with tools like OpenAI’s API or Hugging Face:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from openai.embeddings_utils import get_embedding, cosine_similarity
query_embedding = get_embedding("buy running shoes")
results = [cosine_similarity(query_embedding, doc_embedding) for doc_embedding in documents]
sorted_results = sorted(zip(results, documents), reverse=True)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That’s it. These 5 lines connect your search query to the most relevant results based on meaning, not just keywords.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Real-Life Magic: Embeddings in Action 🪄&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Here are some ways embedding-based searches are transforming industries:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. E-Commerce: Boosting Sales&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;An online retailer implemented embeddings to improve product searches. Instead of relying on rigid keywords, their search engine understood user intent. For example:&lt;/p&gt;

&lt;p&gt;• Query: “affordable wireless headphones”&lt;/p&gt;

&lt;p&gt;• Results: Products with descriptions like “budget-friendly Bluetooth earphones.”&lt;/p&gt;

&lt;p&gt;Result? &lt;strong&gt;25% increase in sales&lt;/strong&gt; , translating to millions in revenue.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Knowledge Management: Finding the Needle in the Haystack&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A SaaS company used embeddings to enhance its internal knowledge base. Employees could now find relevant documentation — even when they didn’t know the exact phrasing.&lt;/p&gt;

&lt;p&gt;Result? &lt;strong&gt;50% reduction in search time&lt;/strong&gt; , boosting productivity across teams.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Content Platforms: Winning the Engagement Game&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A streaming platform used embeddings to deliver personalized content recommendations. If a user searched for “feel-good movies,” they’d get curated suggestions even if “feel-good” wasn’t a keyword.&lt;/p&gt;

&lt;p&gt;Result? &lt;strong&gt;30% increase in user retention.&lt;/strong&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;The Cost vs. Impact Breakdown 💴&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;At this point, you’re probably wondering: how much does this cost?&lt;/p&gt;

&lt;p&gt;Here’s the kicker: embedding-based searches are surprisingly affordable.&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;Cost per query:&lt;/strong&gt; APIs like OpenAI or Hugging Face charge a fraction of a cent for generating embeddings.&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;Compute requirements:&lt;/strong&gt; Vector search tools like &lt;strong&gt;Pinecone&lt;/strong&gt; or &lt;strong&gt;Weaviate&lt;/strong&gt; make integration seamless, even for large datasets.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Impact:&lt;/strong&gt; Businesses report ROI in the range of &lt;strong&gt;10x–100x&lt;/strong&gt; , thanks to improved search accuracy, higher conversions, and better user retention.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Why This Hack Works So Well 🙋🏻‍♂️&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Here’s why embedding-based searches are a game-changer:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Contextual Understanding:&lt;/strong&gt; They can match “cheap hotels near me” with “budget accommodations.”&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Scalability:&lt;/strong&gt; Perfect for massive datasets with millions of entries.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Future-Proof:&lt;/strong&gt; As LLMs improve, embeddings become even more precise.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Your $1M Upgrade Starts Here 💰&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Ready to transform your search engine? Start small:&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;Step 1:&lt;/strong&gt; Use an API like OpenAI to generate embeddings.&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;Step 2:&lt;/strong&gt; Plug them into a vector database like Pinecone or FAISS.&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;Step 3:&lt;/strong&gt; Test, refine, and watch your metrics soar.&lt;/p&gt;

&lt;p&gt;With just a few lines of code and minimal upfront investment, you could unlock the full potential of your search engine — and, who knows, maybe even drive &lt;strong&gt;$1M+ in value&lt;/strong&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  Connect with Me on Social Media
&lt;/h4&gt;

&lt;p&gt;🐦 Follow me on Twitter: &lt;a href="https://twitter.com/devangtomar7" rel="noopener noreferrer"&gt;devangtomar7&lt;/a&gt;&lt;br&gt;&lt;br&gt;
🔗 Connect with me on LinkedIn: &lt;a href="https://www.linkedin.com/in/devangtomar" rel="noopener noreferrer"&gt;devangtomar&lt;/a&gt;&lt;br&gt;&lt;br&gt;
📷 Check out my Instagram: &lt;a href="https://instagram.com/be_ayushmann" rel="noopener noreferrer"&gt;be_ayushmann&lt;/a&gt;&lt;br&gt;&lt;br&gt;
Ⓜ️ Checkout my blogs on Medium: &lt;a href="https://medium.com/@devangtomar" rel="noopener noreferrer"&gt;Devang Tomar&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;strong&gt;#️⃣&lt;/strong&gt; Checkout my blogs on Hashnode: &lt;a href="https://devangtomar.hashnode.dev/" rel="noopener noreferrer"&gt;devangtomar&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;strong&gt;🧑‍💻&lt;/strong&gt; Checkout my blogs on Dev.to: &lt;a href="https://dev.to/devangtomar"&gt;devangtomar&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aihallucination</category>
      <category>hacks</category>
      <category>searchenginemarketin</category>
      <category>searchengineoptimiza</category>
    </item>
    <item>
      <title>Why Your Chatbot Will Fail Without This One Simple Fix</title>
      <dc:creator>Devang Tomar</dc:creator>
      <pubDate>Sat, 14 Dec 2024 08:59:27 +0000</pubDate>
      <link>https://forem.com/devangtomar/why-your-chatbot-will-fail-without-this-one-simple-fix-3fao</link>
      <guid>https://forem.com/devangtomar/why-your-chatbot-will-fail-without-this-one-simple-fix-3fao</guid>
      <description>&lt;p&gt;Chatbots are everywhere: from your favorite shopping app to your bank’s customer service. They promise instant answers, seamless interactions, and even a little personality. But let’s be real — how many times have you found yourself screaming at a bot for being clueless about your context after just one question?&lt;/p&gt;

&lt;p&gt;Here’s the harsh truth: &lt;strong&gt;most chatbots are doomed to fail.&lt;/strong&gt; And it’s not because they lack fancy AI models or clever prompts. It’s because they &lt;strong&gt;don’t remember.&lt;/strong&gt; That’s right — your chatbot’s memory (or lack thereof) is likely its Achilles’ heel.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqkfkhxr5spvki579x4mr.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqkfkhxr5spvki579x4mr.jpg" width="577" height="433"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this article, I’ll break down why memory is the &lt;em&gt;one simple fix&lt;/em&gt; that separates frustrating bots from truly intelligent assistants, and how you can implement it without breaking the bank.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;The Memory Problem: Bots with the Attention Span of a Goldfish 🐟&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Most chatbots today are stateless. This means they treat every user query in isolation, forgetting everything you said before. Imagine having a conversation like this:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You:&lt;/strong&gt; “What’s the weather today?”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bot:&lt;/strong&gt; “It’s sunny in Bangalore.”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You:&lt;/strong&gt; “And tomorrow?”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bot:&lt;/strong&gt; “I don’t understand. Please clarify.”&lt;/p&gt;

&lt;p&gt;Without memory, the bot can’t connect your follow-up question, “And tomorrow?” to your previous query about the weather. The result? Frustrated users and abandoned chats.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Why Context Is King 👑&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Contextual memory allows chatbots to string together a coherent conversation. Here’s why it matters:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Natural Conversations&lt;/strong&gt; : Just like humans, chatbots need to recall what was said earlier to respond intelligently.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; If you ask, “What’s the cheapest flight to Delhi?” and then, “Can I book it for next Friday?”, the bot should know “it” refers to the Delhi flight.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Personalization&lt;/strong&gt; : Memory helps bots remember user preferences.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; After you tell a food delivery bot, “I’m vegetarian,” it shouldn’t suggest chicken curry in the same session.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Efficiency&lt;/strong&gt; : Repeating yourself is annoying! Memory saves users the trouble of re-explaining their needs.&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;The Simple Fix: Add Memory to Your Chatbot 💾&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Building a chatbot with memory isn’t as hard as it sounds. Here’s how you can do it:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Session Memory (Short-Term)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;What it does&lt;/strong&gt; : Remembers user inputs during a single conversation session.&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;How to implement&lt;/strong&gt; : Use tools like &lt;strong&gt;LangChain&lt;/strong&gt; or &lt;strong&gt;Semantic Kernel&lt;/strong&gt; to create a memory object that stores context temporarily.&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;Example&lt;/strong&gt; : A bot can keep track of your travel dates, destinations, and preferences until the chat ends.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Persistent Memory (Long-Term)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;What it does&lt;/strong&gt; : Retains information across sessions for returning users.&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;How to implement&lt;/strong&gt; : Store user data securely in a database and retrieve it when they log in.&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;Example&lt;/strong&gt; : A shopping bot remembers your shoe size and preferred brands from past sessions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Dynamic Memory Updates&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;What it does&lt;/strong&gt; : Continuously updates the memory based on new inputs.&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;How to implement&lt;/strong&gt; : Use models like GPT-4 with memory augmentation to refine the context dynamically.&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;Example&lt;/strong&gt; : Updating a chatbot’s knowledge base mid-conversation to include new information the user shares.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Tools to Add Memory to Your Bots 🛠️&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Here are some frameworks that make it easy to embed memory into your chatbots:&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;LangChain&lt;/strong&gt; : Comes with pre-built modules for memory, making it a breeze to add context to LLM-powered bots.&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;Haystack&lt;/strong&gt; : Great for integrating conversational memory with knowledge bases.&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;Redis&lt;/strong&gt; : A blazing-fast database that can store session memory for real-time updates.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Real-World Success Stories 📖&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;• &lt;strong&gt;Alexa and Siri&lt;/strong&gt; : Their ability to remember your name, preferences, and past interactions keeps them ahead of the curve.&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;Booking.com’s Chatbot&lt;/strong&gt; : It saves your search history to recommend relevant hotels without asking the same questions repeatedly.&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;E-commerce Bots&lt;/strong&gt; : Brands like Sephora use memory to recall your skin type and suggest personalized skincare products.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;The Bottom Line 🎬&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;If your chatbot lacks memory, it’s like having a conversation with someone who forgets everything the moment you finish speaking. Users will get annoyed, leave, and possibly never return. Adding memory is not just a feature — it’s the foundation for making chatbots intuitive, human-like, and downright useful.&lt;/p&gt;

&lt;p&gt;Don’t let your chatbot fail because of a goldfish brain. Fix it with memory, and watch your user satisfaction skyrocket 🚀!&lt;/p&gt;

&lt;h4&gt;
  
  
  Connect with Me on Social Media
&lt;/h4&gt;

&lt;p&gt;🐦 Follow me on Twitter: &lt;a href="https://twitter.com/devangtomar7" rel="noopener noreferrer"&gt;devangtomar7&lt;/a&gt;&lt;br&gt;&lt;br&gt;
🔗 Connect with me on LinkedIn: &lt;a href="https://www.linkedin.com/in/devangtomar" rel="noopener noreferrer"&gt;devangtomar&lt;/a&gt;&lt;br&gt;&lt;br&gt;
📷 Check out my Instagram: &lt;a href="https://instagram.com/be_ayushmann" rel="noopener noreferrer"&gt;be_ayushmann&lt;/a&gt;&lt;br&gt;&lt;br&gt;
Ⓜ️ Checkout my blogs on Medium: &lt;a href="https://medium.com/@devangtomar" rel="noopener noreferrer"&gt;Devang Tomar&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;strong&gt;#️⃣&lt;/strong&gt; Checkout my blogs on Hashnode: &lt;a href="https://devangtomar.hashnode.dev/" rel="noopener noreferrer"&gt;devangtomar&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;strong&gt;🧑‍💻&lt;/strong&gt; Checkout my blogs on Dev.to: &lt;a href="https://dev.to/devangtomar"&gt;devangtomar&lt;/a&gt;&lt;/p&gt;

</description>
      <category>chatbots</category>
      <category>chatbotsforbusiness</category>
      <category>aibotsoftware</category>
      <category>chatbotdevelopment</category>
    </item>
    <item>
      <title>Hidden Gems : 20 Lesser-Known VS Code Extensions to Boost Your Productivity</title>
      <dc:creator>Devang Tomar</dc:creator>
      <pubDate>Sun, 08 Dec 2024 12:01:13 +0000</pubDate>
      <link>https://forem.com/devangtomar/hidden-gems-20-lesser-known-vs-code-extensions-to-boost-your-productivity-48ml</link>
      <guid>https://forem.com/devangtomar/hidden-gems-20-lesser-known-vs-code-extensions-to-boost-your-productivity-48ml</guid>
      <description>&lt;p&gt;In this article, we uncover 20 hidden gems — VS Code extensions you’ve probably never heard of but absolutely need to try 👀 🚀&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwa36xk5h1bbkx4zgcr2o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwa36xk5h1bbkx4zgcr2o.png" width="800" height="534"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Photo by Chris Ried on Unsplash&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Visual Studio Code (VS Code) is the go-to editor for developers worldwide, offering a treasure trove of extensions to customize and enhance your workflow. While popular tools like Prettier and Live Server often steal the spotlight, there’s a whole world of lesser-known extensions that can truly supercharge your productivity.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Peacock&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt; Working with multiple VS Code instances? Peacock lets you color-code your editor windows for better context switching.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt; Easily identify your workspace when juggling multiple projects.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Install:&lt;/strong&gt; &lt;a href="https://marketplace.visualstudio.com/items?itemName=johnpapa.vscode-peacock" rel="noopener noreferrer"&gt;Peacock&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwxd63mladmert5j5z5nj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwxd63mladmert5j5z5nj.png" width="800" height="214"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Code Time&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt; Gain insights into your coding habits with this productivity tracker. It integrates seamlessly with your workflow without being intrusive.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt; Track your coding hours, focus time, and efficiency metrics.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Install:&lt;/strong&gt; &lt;a href="https://marketplace.visualstudio.com/items?itemName=softwaredotcom.swdc-vscode" rel="noopener noreferrer"&gt;Code Time&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Folvqnuyzryck26rs9yq7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Folvqnuyzryck26rs9yq7.png" width="800" height="228"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Todo Tree&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt; Automatically find and organize your TODO, FIXME, or other comments in your project.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt; Manage your tasks directly from the sidebar without losing track of them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Install:&lt;/strong&gt; &lt;a href="https://marketplace.visualstudio.com/items?itemName=Gruntfuggly.todo-tree" rel="noopener noreferrer"&gt;Todo Tree&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy4h1jspnloeor046zwyi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy4h1jspnloeor046zwyi.png" width="800" height="228"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Polacode&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt; Need to share beautiful code snippets? Polacode generates picture-perfect images of your code in seconds.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt; Create polished visuals for documentation or social media.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Install:&lt;/strong&gt; &lt;a href="https://marketplace.visualstudio.com/items?itemName=pnp.polacode" rel="noopener noreferrer"&gt;Polacode&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flwru2cqz0l5lk18rfev8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flwru2cqz0l5lk18rfev8.png" width="800" height="232"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Error Lens&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt; Supercharge your debugging process by highlighting errors and warnings inline in your code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt; Avoid flipping between the problems panel and your code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Install:&lt;/strong&gt; &lt;a href="https://marketplace.visualstudio.com/items?itemName=usernamehw.errorlens" rel="noopener noreferrer"&gt;Error Lens&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftj6vpzhvo8sw6tymyq3q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftj6vpzhvo8sw6tymyq3q.png" width="800" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. GitLens&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt; A powerful extension for visualizing and navigating your Git repository.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt; Explore commit history, file blame annotations, and branch comparisons effortlessly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Install:&lt;/strong&gt; &lt;a href="https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens" rel="noopener noreferrer"&gt;GitLens&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpfi3npqu5z84ogwlkwsb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpfi3npqu5z84ogwlkwsb.png" width="800" height="239"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. Better Comments&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt; Make your comments more readable and meaningful with color-coded categories like TODO, NOTE, and IMPORTANT.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt; Collaborate effectively with teammates using well-organized comments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Install:&lt;/strong&gt; &lt;a href="https://marketplace.visualstudio.com/items?itemName=aaron-bond.better-comments" rel="noopener noreferrer"&gt;Better Comments&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4pqezgdn8bk6j5qv9prd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4pqezgdn8bk6j5qv9prd.png" width="800" height="199"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8. Quokka.js&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt; Get real-time feedback on your JavaScript and TypeScript code with this interactive playground.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt; Test and debug snippets quickly without leaving your editor.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Install:&lt;/strong&gt; &lt;a href="https://marketplace.visualstudio.com/items?itemName=WallabyJs.quokka-vscode" rel="noopener noreferrer"&gt;Quokka.js&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjv685i1ci1e3mpuv8g8c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjv685i1ci1e3mpuv8g8c.png" width="800" height="197"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;9. CSS Peek&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt; Navigate directly to CSS definitions in your project.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt; Quickly jump between HTML elements and their corresponding CSS styles.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Install:&lt;/strong&gt; &lt;a href="https://marketplace.visualstudio.com/items?itemName=pranaygp.vscode-css-peek" rel="noopener noreferrer"&gt;CSS Peek&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9eo9bacd1cygk4kd6rax.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9eo9bacd1cygk4kd6rax.png" width="800" height="221"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;10. REST Client&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt; Test APIs without leaving VS Code. This extension is a lightweight alternative to Postman.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt; Make HTTP requests directly from your editor.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Install:&lt;/strong&gt; &lt;a href="https://marketplace.visualstudio.com/items?itemName=humao.rest-client" rel="noopener noreferrer"&gt;REST Client&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz39iyku3vo9vzuptqpht.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz39iyku3vo9vzuptqpht.png" width="800" height="224"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;11. Git Graph&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt; Visualize your Git repository’s commit graph with a simple UI.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt; Understand your project’s history and branches at a glance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Install:&lt;/strong&gt; &lt;a href="https://marketplace.visualstudio.com/items?itemName=mhutchie.git-graph" rel="noopener noreferrer"&gt;Git Graph&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxge7w82tw55uez6913qy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxge7w82tw55uez6913qy.png" width="800" height="225"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;12. Bracket Pair Color DLW&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt; Assign colors to matching brackets for better readability in complex code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt; Navigate deeply nested code structures without confusion.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Install:&lt;/strong&gt; &lt;a href="https://marketplace.visualstudio.com/items?itemName=BracketPairColorDLW.bracket-pair-color-dlw" rel="noopener noreferrer"&gt;Bracket Pair Color DLW&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmx61zsszdflemhhtdydv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmx61zsszdflemhhtdydv.png" width="800" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;13. vscode-icons&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt; Add visually appealing file and folder icons to your workspace.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt; Quickly identify file types at a glance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Install:&lt;/strong&gt; &lt;a href="https://marketplace.visualstudio.com/items?itemName=vscode-icons-team.vscode-icons" rel="noopener noreferrer"&gt;vscode-icons&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fca7v4n0k9h6wzc6mclcy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fca7v4n0k9h6wzc6mclcy.png" width="800" height="183"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;14. Highlight Matching Tag&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt; Automatically highlight matching HTML and XML tags to ensure proper nesting.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt; Avoid syntax errors in web development.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Install:&lt;/strong&gt; &lt;a href="https://marketplace.visualstudio.com/items?itemName=vincaslt.highlight-matching-tag" rel="noopener noreferrer"&gt;Highlight Matching Tag&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl7s2mmrqo0dcfii2cz1z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl7s2mmrqo0dcfii2cz1z.png" width="800" height="206"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;15. Bookmarks&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt; Bookmark lines of code and jump between them effortlessly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt; Navigate large codebases with ease.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Install:&lt;/strong&gt; &lt;a href="https://marketplace.visualstudio.com/items?itemName=alefragnani.Bookmarks" rel="noopener noreferrer"&gt;Bookmarks&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsy1qc20jq7sy36gex3cf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsy1qc20jq7sy36gex3cf.png" width="800" height="179"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;16. Excel Viewer&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt; View and edit Excel files directly in VS Code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt; Analyze data without switching to another tool.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Install:&lt;/strong&gt; &lt;a href="https://marketplace.visualstudio.com/items?itemName=GrapeCity.gc-excelviewer" rel="noopener noreferrer"&gt;Excel Viewer&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F47ak1daeuk3c7adyekbu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F47ak1daeuk3c7adyekbu.png" width="800" height="207"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;17. Path Intellisense&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt; Autocomplete file paths in your project.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt; Save time while importing or linking files.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Install:&lt;/strong&gt; &lt;a href="https://marketplace.visualstudio.com/items?itemName=christian-kohler.path-intellisense" rel="noopener noreferrer"&gt;Path Intellisense&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftd888nmpw5cnbpn8qe1g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftd888nmpw5cnbpn8qe1g.png" width="800" height="214"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;18. SQLTools&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt; A database management extension that allows you to connect to SQL databases, execute queries, and explore schemas — all within VS Code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt; Manage your backend databases without leaving your code editor.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Install:&lt;/strong&gt; &lt;a href="https://marketplace.visualstudio.com/items?itemName=mtxr.sqltools" rel="noopener noreferrer"&gt;SQLTools&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx343egrfkdddpn4fi9v4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx343egrfkdddpn4fi9v4.png" width="800" height="215"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;19. Git Blame&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt; Provides a simple interface to view git blame information directly in the VS Code editor. It shows who last modified a line of code and when, without needing to open the terminal or command line.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt; Perfect for quickly tracking down the history of a specific line of code and understanding who to approach for questions regarding that section.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Install:&lt;/strong&gt; &lt;a href="https://marketplace.visualstudio.com/items?itemName=waderyan.gitblame" rel="noopener noreferrer"&gt;Git Blame&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5tvwt0hy0v65ztvpwbyy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5tvwt0hy0v65ztvpwbyy.png" width="800" height="222"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;20. WakaTime&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt; Track your coding activity across projects and languages.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt; Gain insights into your productivity over time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Install:&lt;/strong&gt; &lt;a href="https://marketplace.visualstudio.com/items?itemName=WakaTime.vscode-wakatime" rel="noopener noreferrer"&gt;WakaTime&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdyxzdg7n6myr9styxgsq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdyxzdg7n6myr9styxgsq.png" width="800" height="206"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Final Thoughts&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;These hidden gems are powerful yet often overlooked. Integrating them into your workflow can save you time, simplify tasks, and even make coding more enjoyable. So, go ahead and give these underrated extensions a shot!&lt;/p&gt;

&lt;p&gt;Do you know of any other lesser-known yet awesome extensions? Share your favorites in the comments below.&lt;/p&gt;

&lt;h4&gt;
  
  
  Connect with Me on Social Media
&lt;/h4&gt;

&lt;p&gt;🐦 Follow me on Twitter: &lt;a href="https://twitter.com/devangtomar7" rel="noopener noreferrer"&gt;devangtomar7&lt;/a&gt;&lt;br&gt;&lt;br&gt;
🔗 Connect with me on LinkedIn: &lt;a href="https://www.linkedin.com/in/devangtomar" rel="noopener noreferrer"&gt;devangtomar&lt;/a&gt;&lt;br&gt;&lt;br&gt;
📷 Check out my Instagram: &lt;a href="https://instagram.com/be_ayushmann" rel="noopener noreferrer"&gt;be_ayushmann&lt;/a&gt;&lt;br&gt;&lt;br&gt;
Ⓜ️ Checkout my blogs on Medium: &lt;a href="https://medium.com/@devangtomar" rel="noopener noreferrer"&gt;Devang Tomar&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;strong&gt;#️⃣&lt;/strong&gt; Checkout my blogs on Hashnode: &lt;a href="https://devangtomar.hashnode.dev/" rel="noopener noreferrer"&gt;devangtomar&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;strong&gt;🧑‍💻&lt;/strong&gt; Checkout my blogs on Dev.to: &lt;a href="https://dev.to/devangtomar"&gt;devangtomar&lt;/a&gt;&lt;/p&gt;

</description>
      <category>vscodeeditor</category>
      <category>visualstudiocode</category>
      <category>vscodeextension</category>
      <category>vscode</category>
    </item>
    <item>
      <title>Setting Up a Mac for Development: A Comprehensive Guide 🧑🏻‍💻 ‍</title>
      <dc:creator>Devang Tomar</dc:creator>
      <pubDate>Sun, 24 Nov 2024 09:46:34 +0000</pubDate>
      <link>https://forem.com/devangtomar/setting-up-a-mac-for-development-a-comprehensive-guide-5j3</link>
      <guid>https://forem.com/devangtomar/setting-up-a-mac-for-development-a-comprehensive-guide-5j3</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyee4m3uu3abm08851g4p.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyee4m3uu3abm08851g4p.jpeg" width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Photo by Emile Perron on Unsplash&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Setting up a new Mac for development can be time-consuming, especially if you’re a developer who needs an efficient and tailored environment. Whether you’re setting up a work machine or a personal computer, having a checklist can save time and effort. Here’s a streamlined guide for getting your MacBook ready for development, optimized for macOS 15 (Sequoia).&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;Getting Started 🎬&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;When you turn on your Mac, the setup assistant will guide you through basic configurations like selecting your language, time zone, and Apple ID. Once done, update macOS to ensure you have the latest security patches.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Install Homebrew for App Management ☕️&lt;/li&gt;
&lt;li&gt;Installing Essential Applications 📲&lt;/li&gt;
&lt;li&gt;Setting Up the Shell&lt;/li&gt;
&lt;li&gt;Custom Brew Packages and Zsh Configuration&lt;/li&gt;
&lt;li&gt;Configuring Git&lt;/li&gt;
&lt;li&gt;Generate SSH Keys&lt;/li&gt;
&lt;li&gt;Tuning macOS Settings&lt;/li&gt;
&lt;li&gt;Application-Specific Tips&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;Install Homebrew for App Management ☕️&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://brew.sh/" rel="noopener noreferrer"&gt;Homebrew&lt;/a&gt; is a must-have package manager for macOS, simplifying the installation of software.&lt;/p&gt;

&lt;p&gt;Run the following command to install Homebrew:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After installation, ensure it’s updated:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Installing Essential Applications 📲&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Here’s a list of CLI tools and GUI applications you’ll likely need:&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Command-Line Tools&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Install these using Homebrew:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew install git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  &lt;strong&gt;Graphical Applications&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Install these with the — cask flag:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew install - cask \
visual-studio-code \
google-chrome \
firefox \
rectangle \
iterm2 \
docker \
discord \
slack \
spotify \
postgres \
obsidian \
todoist
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt; : Do not install Node.js via Homebrew. Use nvm for better version control (details below).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Setting Up the Shell&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;macOS comes with zsh as the default shell. Enhance it with &lt;strong&gt;Oh My Zsh&lt;/strong&gt; :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  &lt;strong&gt;Add Shortcuts&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Edit your ~/.zshrc file to include aliases for convenience. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;alias x86="env /usr/bin/arch -x86_64 /bin/zsh - login"
alias arm="env /usr/bin/arch -arm64 /bin/zsh - login"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Custom Brew Packages and Zsh Configuration&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;To further enhance your development environment, you can reference and use custom configurations from my personal repository.&lt;/p&gt;

&lt;p&gt;This repository contains my curated list of &lt;strong&gt;brew packages&lt;/strong&gt; , &lt;strong&gt;Zsh plugins&lt;/strong&gt; , and &lt;strong&gt;shortcuts&lt;/strong&gt; to optimize productivity.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Access the Repository&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://github.com/devangtomar/zsh-settings" rel="noopener noreferrer"&gt;GitHub - devangtomar/zsh-settings: This repository is dedicated to storing and managing my custom Zsh settings and configurations ⚙️&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From the repository, you can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Get a list of Homebrew packages I frequently use.&lt;/li&gt;
&lt;li&gt;Import my custom ~/.zshrc settings to streamline your shell experience.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Clone the repository to your local machine:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone https://github.com/devangtomar/zsh-settings.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Navigate to the directory and explore the setup:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd zsh-settings
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Feel free to fork or adapt the configurations to match your workflow!&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Configuring Git&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Set up your Git global configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;touch ~/.gitconfig
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add the following content to customize Git commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[user]
  name = Your Name
  email = your_email@example.com
[github]
  user = username
[alias]
  a = add
  cm = commit -m
  s = status
  p = push
  co = checkout
  fp = fetch --prune --all
  l = log --oneline --decorate --graph
[push]
 autoSetupRemote = true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With the above aliases, I can run git s instead of git status, for example. It will also automatically set up your remote, so you can do git push on a branch without specifying the upstream origin.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Generate SSH Keys&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Create an SSH key for authentication, Start ssh-agent and adding the key:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh-keygen -t ed25519 -C "your_email@example.com"
eval "$(ssh-agent -s)"
ssh-add - apple-use-keychain ~/.ssh/id_ed25519
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For easier management, create an SSH config file (~/.ssh/config):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Host *
  AddKeysToAgent yes
  UseKeychain yes
  IdentityFile ~/.ssh/id_ed25519

Host myssh
  HostName example.com
  User user
  IdentityFile ~/.ssh/key.pem
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now just run the alias to connect.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh myssh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Tuning macOS Settings&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;To improve productivity, adjust these macOS settings:&lt;/p&gt;

&lt;h4&gt;
  
  
  Sidebar
&lt;/h4&gt;

&lt;p&gt;To get the Home folder in the finder, press CMD + SHIFT + H and drag the home folder to the sidebar.&lt;/p&gt;

&lt;h4&gt;
  
  
  General
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Make Google Chrome default browser&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Dock
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Automatically hide and show Dock&lt;/li&gt;
&lt;li&gt;Show indicators for open applications&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Keyboard
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Key Repeat -&amp;gt; Fast&lt;/li&gt;
&lt;li&gt;Delay Until Repeat -&amp;gt; Short&lt;/li&gt;
&lt;li&gt;Disable “Correct spelling automatically”&lt;/li&gt;
&lt;li&gt;Disable “Capitalize words automatically”&lt;/li&gt;
&lt;li&gt;Disable “Add period with double-space”&lt;/li&gt;
&lt;li&gt;Disable “Use smart quotes and dashes”&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Security and Privacy
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Allow apps downloaded from App Store and identified developers&lt;/li&gt;
&lt;li&gt;Turn FileVault On (makes sure SSD is securely encrypted)&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Sharing
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Change computer name&lt;/li&gt;
&lt;li&gt;Make sure all file sharing is disabled&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Users &amp;amp; Groups
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Add “Rectangle” to Login items&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Defaults
&lt;/h4&gt;

&lt;p&gt;A few more commands to change some defaults.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Show Library folder
chflags nohidden ~/Library
# Show hidden files
defaults write com.apple.finder AppleShowAllFiles YES
# Show path bar
defaults write com.apple.finder ShowPathbar -bool true
# Show status bar
defaults write com.apple.finder ShowStatusBar -bool true
# Prevent left and right swipe through history in Chrome
defaults write com.google.Chrome AppleEnableSwipeNavigateWithScrolls -bool false
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Application-Specific Tips
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Chrome
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Install &lt;a href="https://chromewebstore.google.com/detail/ublock-origin/cjpalhdlnbpafiamejdnhcphjbkeiagm" rel="noopener noreferrer"&gt;uBlock Origin&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Install &lt;a href="https://chromewebstore.google.com/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en" rel="noopener noreferrer"&gt;React DevTools&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Install &lt;a href="https://chromewebstore.google.com/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd?hl=en" rel="noopener noreferrer"&gt;Redux DevTools&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Install &lt;a href="https://chromewebstore.google.com/detail/duplicate-tab-shortcut/klehggjefofgiajjfpoebdidnpjmljhb?hl=en" rel="noopener noreferrer"&gt;Duplicate Tab Shortcut&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Settings -&amp;gt; Set theme to “Dark”&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Visual Studio Code
&lt;/h4&gt;

&lt;p&gt;Press CMD + SHIFT + P and click "Install code command in PATH".&lt;/p&gt;

&lt;p&gt;Now you can use code {file} to open any file in VSCode.&lt;/p&gt;

&lt;h4&gt;
  
  
  Extensions
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Install &lt;a href="https://marketplace.visualstudio.com/items?itemName=DevangTomar.vscode-diverse-dye" rel="noopener noreferrer"&gt;Diverse Dye&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Install &lt;a href="https://gitlens.amod.io/" rel="noopener noreferrer"&gt;GitLens&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Install &lt;a href="https://marketplace.visualstudio.com/items?itemName=vincaslt.highlight-matching-tag" rel="noopener noreferrer"&gt;Highlight Matching Tag&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Install &lt;a href="https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint" rel="noopener noreferrer"&gt;ESLint&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Install &lt;a href="https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode" rel="noopener noreferrer"&gt;Prettier&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Rectangle
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Full Screen: CMD + SHIFT + ' (prevents messing with other commands)&lt;/li&gt;
&lt;li&gt;Left Half: CMD + OPTION + LEFT&lt;/li&gt;
&lt;li&gt;Right Half: CMD + OPTION + RIGHT&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  iTerm2
&lt;/h4&gt;

&lt;p&gt;For some reason, iTerm2 does not let you use ⌥ + ← and → to tab through words in the terminal by default. I found this article to fix it: &lt;a href="https://coderwall.com/p/h6yfda/use-and-to-jump-forwards-backwards-words-in-iterm-2-on-os-x" rel="noopener noreferrer"&gt;Use ⌥← and ⌥→ to jump forwards / backwards&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to Profiles -&amp;gt; Keys:&lt;/li&gt;
&lt;li&gt;Change ⌥← via "Send Escape Sequence" with b&lt;/li&gt;
&lt;li&gt;Change ⌥→ via "Send Escape Sequence" with f&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdfxchyqilkfmxheguxj9.jpe" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdfxchyqilkfmxheguxj9.jpe" width="608" height="471"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This guide is designed to provide a quick, repeatable process for setting up a Mac for development. By automating installations and configuring settings upfront, you can focus on coding and productivity rather than setup hassles.&lt;/p&gt;

&lt;h3&gt;
  
  
  Connect with Me on Social Media
&lt;/h3&gt;

&lt;p&gt;🐦 Follow me on Twitter: &lt;a href="https://twitter.com/devangtomar7" rel="noopener noreferrer"&gt;devangtomar7&lt;/a&gt;&lt;br&gt;&lt;br&gt;
🔗 Connect with me on LinkedIn: &lt;a href="https://www.linkedin.com/in/devangtomar" rel="noopener noreferrer"&gt;devangtomar&lt;/a&gt;&lt;br&gt;&lt;br&gt;
📷 Check out my Instagram: &lt;a href="https://instagram.com/be_ayushmann" rel="noopener noreferrer"&gt;be_ayushmann&lt;/a&gt;&lt;br&gt;&lt;br&gt;
Ⓜ️ Checkout my blogs on Medium: &lt;a href="https://medium.com/@devangtomar" rel="noopener noreferrer"&gt;Devang Tomar&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;strong&gt;#️⃣&lt;/strong&gt; Checkout my blogs on Hashnode: &lt;a href="https://devangtomar.hashnode.dev/" rel="noopener noreferrer"&gt;devangtomar&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;strong&gt;🧑‍💻&lt;/strong&gt; Checkout my blogs on Dev.to: &lt;a href="https://dev.to/devangtomar"&gt;devangtomar&lt;/a&gt;&lt;/p&gt;

</description>
      <category>macbookair</category>
      <category>macbookpro</category>
      <category>developersetup</category>
      <category>developertools</category>
    </item>
    <item>
      <title>How one line of code caused a $60 million loss 📉😓</title>
      <dc:creator>Devang Tomar</dc:creator>
      <pubDate>Tue, 30 Jan 2024 18:32:43 +0000</pubDate>
      <link>https://forem.com/devangtomar/how-one-line-of-code-caused-a-60-million-loss-ch3</link>
      <guid>https://forem.com/devangtomar/how-one-line-of-code-caused-a-60-million-loss-ch3</guid>
      <description>&lt;p&gt;60,000 people lost full phone service, half of AT&amp;amp;Ts network was down, and 500 airline flights were delayed&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdp4j53bj3q52fl1qj5tc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdp4j53bj3q52fl1qj5tc.png" alt="Image description" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On January 15th, 1990, AT&amp;amp;Ts New Jersey operations center detected a widespread system malfunction, shown by a plethora of red warnings on their network use display.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Despite attempts to rectify the situation, the network remained compromised for 9 hours, leading to a 50% failure rate in call connections.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AT&amp;amp;T lost over &lt;strong&gt;$60 million&lt;/strong&gt; as a result with &lt;strong&gt;over 60,000 of Americans left with fully disconnected phones&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw6gnvb5zo8cloqkn77wr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw6gnvb5zo8cloqkn77wr.png" width="640" height="609"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Furthermore, &lt;strong&gt;500 airline flights were delayed, affecting 85,000 people.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AT&amp;amp;Ts long-distance network was supposedly a paragon of efficiency, handling a substantial portion of the nations calls with its advanced electronic switches and signaling system. This system usually completed call routing within seconds.&lt;/p&gt;

&lt;p&gt;However, on this day, a fault originating in a New York switch cascaded through the network. &lt;strong&gt;This was due to a software bug in a recent update that contained a critical bug affecting the networks 114 switches.&lt;/strong&gt; When the New York switch reset itself and sent out signals, this bug caused a domino effect, leading to widespread network disruption.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;This software patch had already gone through layers of testing without being caught. This incident was especially surprising because AT&amp;amp;T was known for their rigorous testing.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  The Problem 😓
&lt;/h3&gt;

&lt;p&gt;The root cause was traced back to a coding error in a software update implemented across the networks switches.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6gdjgswfb1rpa4tdwyb8.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6gdjgswfb1rpa4tdwyb8.jpeg" width="640" height="470"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The error, within a C program, involved a misplaced &lt;em&gt;break&lt;/em&gt; statement within nested conditional statements, leading to data overwrites and system resets.&lt;/p&gt;

&lt;p&gt;The pseudocode :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;while (ring receive buffer not empty 
          and side buffer not empty):

  Initialize pointer to first message in side buffer
       or ring receive buffer

  get copy of buffer

  switch (message):

    case (incoming_message):

      if (sending switch is out of service):

        if (ring write buffer is empty):

          send "in service" to status map

        else:

          break // The error was here!

        END IF

      process incoming message, set up pointers to
               optional parameters

      break
    END SWITCH


do optional parameter work
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The problem:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;If the &lt;em&gt;ring write buffer is NOT empty&lt;/em&gt;, then the &lt;code&gt;if&lt;/code&gt; statement on line 7 is skipped and the &lt;em&gt;break&lt;/em&gt; statement on line 10 is hit instead.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;However, for the program to function properly, line 11 should have been hit instead.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;When the &lt;em&gt;break&lt;/em&gt; statement is hit instead of the incoming message being processed and pointers being set up to optional parameters, then data (the pointers that shouldve been held) is overwritten&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The error correction software identified the data overwrite and initiated a shutdown of the switch for a reset. This issue was compounded because this flawed software was present in all switches across the network, leading to a chain reaction of resets that ultimately crippled the entire network system.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Despite having a network designed for resilience, &lt;strong&gt;one line of code was able to bring down half the countrys main line of communication.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvs3jsfta8667tt7vo9lx.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvs3jsfta8667tt7vo9lx.jpeg" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  The Fix 🔨
&lt;/h3&gt;

&lt;p&gt;It took engineers 9 hours to get AT&amp;amp;Ts system fully back online. They did so mostly by rolling back the switches to a previous, working version of code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa4kzp0zgxtnsa5j2gen1.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa4kzp0zgxtnsa5j2gen1.jpeg" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It actually took software engineers two weeks of rigorous code reading, testing, and replication to actually understand where the bug was.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion 💭
&lt;/h3&gt;

&lt;p&gt;For AT&amp;amp;T, unfortunately, this wasnt even their biggest system crash of the 90s. They encountered many more issues later in the decade.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In reality, it wasnt one line of code that brought down a system&lt;/strong&gt;. It was a failure in processes.&lt;/p&gt;

&lt;p&gt;Todays companies have even better processes in place, and even then, bugs slip through. Google wrote a great retrospective on &lt;a href="https://sre.google/resources/practices-and-processes/twenty-years-of-sre-lessons-learned/" rel="noopener noreferrer"&gt;20 years of Site Reliability Engineering&lt;/a&gt;, where they reflect on YouTubes first global outage in 2016.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpddu067rt2865v8fttur.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpddu067rt2865v8fttur.jpeg" width="800" height="886"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The scale of an outage for companies is huge and there are lessons to be learned from each outage. For most, however, outages come down to human error and gaps in processes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Connect with Me on social media 📲
&lt;/h3&gt;

&lt;p&gt;🐦 Follow me on Twitter: &lt;a href="https://twitter.com/devangtomar7" rel="noopener noreferrer"&gt;devangtomar7&lt;/a&gt;&lt;br&gt;&lt;br&gt;
🔗 Connect with me on LinkedIn: &lt;a href="https://www.linkedin.com/in/devangtomar" rel="noopener noreferrer"&gt;devangtomar&lt;/a&gt;&lt;br&gt;&lt;br&gt;
📷 Check out my Instagram: &lt;a href="https://instagram.com/be_ayushmann" rel="noopener noreferrer"&gt;be_ayushmann&lt;/a&gt;&lt;br&gt;&lt;br&gt;
 Checkout my blogs on Medium: &lt;a href="https://medium.com/u/8f5e1c86129d" rel="noopener noreferrer"&gt;Devang Tomar&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;strong&gt;#&lt;/strong&gt; Checkout my blogs on Hashnode: &lt;a href="https://devangtomar.hashnode.dev/" rel="noopener noreferrer"&gt;devangtomar&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;strong&gt;🧑💻&lt;/strong&gt; Checkout my blogs on Dev.to: &lt;a href="https://dev.to/devangtomar"&gt;devangtomar&lt;/a&gt;&lt;/p&gt;

</description>
      <category>codehorror</category>
      <category>badcode</category>
      <category>codereviews</category>
      <category>coding</category>
    </item>
    <item>
      <title>How Facebook Keeps Millions of Servers Synced 🕰️⏰</title>
      <dc:creator>Devang Tomar</dc:creator>
      <pubDate>Fri, 26 Jan 2024 05:31:44 +0000</pubDate>
      <link>https://forem.com/devangtomar/how-facebook-keeps-millions-of-servers-synced-3j</link>
      <guid>https://forem.com/devangtomar/how-facebook-keeps-millions-of-servers-synced-3j</guid>
      <description>&lt;p&gt;If youre running a distributed system, its &lt;em&gt;incredibly&lt;/em&gt; important to keep the system clocks of the machines synchronized. If the machines are off by a few seconds, this will cause a huge variety of different issues.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu435r8f5o1obafkzaquo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu435r8f5o1obafkzaquo.png" alt="Image description" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can probably imagine why unsynchronized clocks would be a big issue, but just to beat a dead horse&lt;/p&gt;

&lt;p&gt;Today, lets dive into the intricate world of time synchronization at Meta. Buckle up, its not just about ticking clocks; its about the heartbeat of millions of servers! 💻🌐&lt;/p&gt;

&lt;h4&gt;
  
  
  Why Sync Matters
&lt;/h4&gt;

&lt;p&gt;Running a distributed system? Syncing system clocks is crucial! 🔄 Unsynchronized clocks? Brace yourself for data inconsistency, log chaos, security issues, and more! Facebook knows this too well.&lt;/p&gt;

&lt;h4&gt;
  
  
  🌐 Meet NTP and PTP
&lt;/h4&gt;

&lt;p&gt;NTP: Old but gold. Syncs computers within milliseconds. How? Clients talk to NTP servers, adjusting internal time based on roundtrip delays.&lt;/p&gt;

&lt;p&gt;PTP: The shiny new kid. Precision to nanoseconds or even picoseconds! It tackles network delays with hardware timestamping. But, watch out for the load it places on network hardware! 💽&lt;/p&gt;

&lt;h4&gt;
  
  
  🌟 Facebooks Sync Symphony
&lt;/h4&gt;

&lt;p&gt;NTP Days: Facebook danced with Ntpd and Chrony. Chrony brought nanoseconds to the party, but the story doesnt end there.&lt;/p&gt;

&lt;p&gt;PTP Era: In 2022, Facebook waved goodbye to NTP, embracing Precision Time Protocol for superior precision and scalability. Say hello to nanosecond accuracy! 🚀&lt;/p&gt;

&lt;p&gt;Absolutely, lets break down the details of Metas pursuit of nanosecond accuracy using Precision Time Protocol (PTP) and the key components involved:&lt;/p&gt;

&lt;h4&gt;
  
  
  🏹 Aim: Nanoseconds! 🎯
&lt;/h4&gt;

&lt;p&gt;Metas shift to PTP comes with the ambitious goal of achieving nanosecond-level accuracy in time synchronization. This precision is crucial in the fast-paced world of distributed systems where every second matters.&lt;/p&gt;

&lt;h3&gt;
  
  
  🌐 Components Leading the Charge
&lt;/h3&gt;

&lt;h4&gt;
  
  
  PTP Rack
&lt;/h4&gt;

&lt;p&gt;The PTP Rack is the nerve center, housing the hardware and software responsible for serving time to clients. Heres what makes it tick:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;GNSS Antenna&lt;/strong&gt; : This critical component communicates with the Global Navigation Satellite System (GNSS). It ensures that the PTP system is in sync with the global positioning signals, enhancing accuracy.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Time Appliance:&lt;/strong&gt; A dedicated piece of hardware residing in the PTP Rack. It combines a GNSS receiver and a miniaturized atomic clock. This combination ensures that even in scenarios where GNSS connectivity is lost, the Time Appliance can maintain accurate timekeeping independently.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The PTP Rack, with its GNSS synchronization and atomic clock precision, sets the stage for achieving the nanosecond goal.&lt;/p&gt;

&lt;h4&gt;
  
  
  The Network
&lt;/h4&gt;

&lt;p&gt;The network plays a pivotal role in transmitting PTP messages from the PTP Rack to clients. Meta employs unicast transmission, a communication method where information flows from one sender (PTP Rack) to a single recipient (PTP Client). This choice simplifies network design and enhances scalability.&lt;/p&gt;

&lt;p&gt;Unicast transmission ensures that each client receives the necessary time synchronization information directly from the PTP Rack, reducing the complexity that could arise in a multicast setup.&lt;/p&gt;

&lt;h4&gt;
  
  
  PTP Client
&lt;/h4&gt;

&lt;p&gt;Running on individual machines, the PTP Client is the endpoint that actively communicates with the PTP network. Meta uses an open-source PTP client called ptp4l for this purpose. However, the implementation wasnt without its challenges, especially when dealing with edge cases.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Open Source Client:&lt;/strong&gt; Ptp4l is an open-source implementation, reflecting Metas commitment to transparency and community collaboration. Its a tool that facilitates communication between the PTP Rack and individual servers, allowing them to synchronize their clocks with nanosecond precision.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Challenges with Edge Cases:&lt;/strong&gt; While ptp4l is a robust tool, Meta acknowledges challenges faced in specific scenarios or with certain types of network cards. These edge cases required additional attention to ensure the seamless functioning of the PTP system.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  🌟 Benefits of the PTP System
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Higher Precision and Accuracy:&lt;/strong&gt; The PTP system allows Meta to achieve precision within nanoseconds, a significant leap from the millisecond-level synchronization provided by traditional methods like NTP.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Better Scalability:&lt;/strong&gt; Unicast transmission reduces the frequency of check-ins required for synchronization, enabling smoother network operation as the system scales. A single source of truth for timing enhances overall scalability.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Mitigation of Network Delays and Errors:&lt;/strong&gt; PTPs focus on hardware timestamping and transparent clocks helps reduce the impact of network delays and errors, contributing to a more robust and reliable synchronization process.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In essence, the PTP trioPTP Rack, The Network, and PTP Clientembodies Metas commitment to precision, scalability, and overcoming challenges in the pursuit of nanosecond-level accuracy in time synchronization.&lt;/p&gt;

&lt;h3&gt;
  
  
  🌐 Network Time Strata Explained:
&lt;/h3&gt;

&lt;p&gt;NTP organizes computers into hierarchical layers called strata based on their proximity to highly accurate time sources, typically atomic clocks or GPS receivers. Each stratum represents a level in the hierarchy, and the lower the stratum number, the closer a device is to the primary time source.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Stratum 0: Atomic Clock or GPS Receiver:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;At the top of the hierarchy are devices with direct access to incredibly precise timekeeping mechanisms, such as atomic clocks or GPS receivers.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Stratum 0 devices serve as the primary time source for the entire synchronization network.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Stratum 1: Directly Synced with Stratum 0:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Stratum 1 devices are directly synchronized with Stratum 0 devices. These could be servers or systems that have a direct connection to the primary time source.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Stratum 1 devices act as secondary time sources for the next level of devices in the hierarchy.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. Stratum 2: Syncs with Stratum 1:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Stratum 2 devices synchronize their clocks with Stratum 1 devices. These devices are one step further away from the primary time source.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Stratum 2 devices act as time sources for devices in the subsequent stratum.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4. and so on, until Stratum 15: Indicating Unsynced Devices:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The strata continue in a cascading manner, with each stratum representing a level of hierarchy further away from the primary time source.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;As the stratum number increases, the accuracy of time synchronization decreases.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;5. Stratum 16: Unsynced Devices:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Stratum 16 is a special designation used to indicate devices that are not synchronized with any source. It represents the highest stratum number and signifies unsynchronization.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  🔄 How Synchronization Works
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Computers in lower strata synchronize their clocks with devices in higher strata. For example, Stratum 2 devices synchronize with Stratum 1 devices, and so on.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Multiple devices in the same stratum can be synchronized with different devices in a higher stratum, introducing redundancy and fault tolerance.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  🔍 Why the Hierarchy Matters
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The hierarchical structure ensures that not every device needs to directly synchronize with the most accurate time source. This arrangement prevents overloading a single time server with numerous synchronization requests.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The hierarchy allows for redundancy and fault tolerance. If a device in a lower stratum loses synchronization, it can quickly switch to another source in the same stratum or a higher one.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  🌟 Benefits
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Efficient Synchronization: Devices in lower strata benefit from the accuracy of those in higher strata, optimizing the synchronization process.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Scalability: The hierarchical structure scales well, allowing for the expansion of the synchronization network without overwhelming primary time sources.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Understanding Network Time Strata provides insights into how NTP organizes and maintains time synchronization across a distributed system, ensuring accuracy and efficiency in timekeeping.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flrpwek5zjt5w3qbywjrb.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flrpwek5zjt5w3qbywjrb.jpeg" width="552" height="367"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  🚀 Conclusion
&lt;/h4&gt;

&lt;p&gt;Syncing clocks isnt just about ticking seconds; its the heartbeat of a well-functioning system. Facebooks journey from NTP to PTP showcases the relentless pursuit of precision and scalability. Time, after all, waits for no server! 💡&lt;/p&gt;

&lt;p&gt;What are your thoughts on Metas clockwork precision? Share your views! 👇&lt;/p&gt;

&lt;p&gt;Happy Syncing! 🌐🚀&lt;/p&gt;

&lt;h4&gt;
  
  
  Connect with Me on social media 📲
&lt;/h4&gt;

&lt;p&gt;🐦 Follow me on Twitter: &lt;a href="https://twitter.com/devangtomar7" rel="noopener noreferrer"&gt;devangtomar7&lt;/a&gt;&lt;br&gt;&lt;br&gt;
🔗 Connect with me on LinkedIn: &lt;a href="https://www.linkedin.com/in/devangtomar" rel="noopener noreferrer"&gt;devangtomar&lt;/a&gt;&lt;br&gt;&lt;br&gt;
📷 Check out my Instagram: &lt;a href="https://instagram.com/be_ayushmann" rel="noopener noreferrer"&gt;be_ayushmann&lt;/a&gt;&lt;br&gt;&lt;br&gt;
 Checkout my blogs on Medium: &lt;a href="https://medium.com/u/8f5e1c86129d" rel="noopener noreferrer"&gt;Devang Tomar&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;strong&gt;#&lt;/strong&gt; Checkout my blogs on Hashnode: &lt;a href="https://devangtomar.hashnode.dev/" rel="noopener noreferrer"&gt;devangtomar&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;strong&gt;🧑💻&lt;/strong&gt; Checkout my blogs on Dev.to: &lt;a href="https://dev.to/devangtomar"&gt;devangtomar&lt;/a&gt;&lt;/p&gt;

</description>
      <category>facebook</category>
      <category>softwaredesign</category>
      <category>architecture</category>
      <category>systemdesign</category>
    </item>
    <item>
      <title>How Cloudflare Achieved 55 Million Requests per Second with Just 15 PostgreSQL Clusters! 💻</title>
      <dc:creator>Devang Tomar</dc:creator>
      <pubDate>Fri, 19 Jan 2024 05:32:15 +0000</pubDate>
      <link>https://forem.com/devangtomar/how-cloudflare-achieved-55-million-requests-per-second-with-just-15-postgresql-clusters-3mm8</link>
      <guid>https://forem.com/devangtomar/how-cloudflare-achieved-55-million-requests-per-second-with-just-15-postgresql-clusters-3mm8</guid>
      <description>&lt;p&gt;In the vast landscape of the internet, Cloudflare emerged in July 2009, founded by a group of visionaries with the goal of making the internet faster and more reliable. The challenges they faced were immense, but their growth was nothing short of spectacular. Fast forward to today, and Cloudflare serves a whopping 20% of the internets traffic, handling a staggering 55 million HTTP requests per second. The most incredible part? They achieved this feat with only 15 PostgreSQL clusters. Lets dive into the magic behind this impressive system design!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp2ddc3sjdbthc3k24mwk.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp2ddc3sjdbthc3k24mwk.jpeg" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  PostgreSQL Scalability: The Core 🚀
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Resource Usage Optimization with PgBouncer 🔄
&lt;/h4&gt;

&lt;p&gt;Handling Postgres connections efficiently is crucial, and Cloudflare uses PgBouncer as a TCP proxy to manage a pool of connections to Postgres.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1dic052rn0ibr8gh3eoc.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1dic052rn0ibr8gh3eoc.jpeg" width="800" height="494"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This not only prevents connection starvation but also tackles the challenge of diverse workloads from different tenants within a cluster.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx27r6tcb252lcrm2tyty.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx27r6tcb252lcrm2tyty.png" width="743" height="478"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Thundering Herd Problem Solved! 🐘
&lt;/h4&gt;

&lt;p&gt;The infamous Thundering Herd Problem, where many clients query a server concurrently, was addressed by Cloudflare using PgBouncer. It smartly throttles the number of Postgres connections created by a specific tenant, preventing degradation of database performance during high traffic.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsvu4obl2syxkm8bt0ypc.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsvu4obl2syxkm8bt0ypc.jpeg" width="800" height="629"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Performance Boost with Bare Metal Servers and HAProxy
&lt;/h4&gt;

&lt;p&gt;Cloudflare opts for bare metal servers without virtualization, ensuring high performance. They leverage HAProxy as an L4 load balancer, distributing traffic across primary and secondary database read replicas, providing a robust solution for performance enhancement.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fubhzoj0exo4zyszkmmzx.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fubhzoj0exo4zyszkmmzx.jpeg" width="800" height="291"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Congestion Avoidance Algorithm for Concurrency 🚧
&lt;/h4&gt;

&lt;p&gt;To manage concurrent queries and avoid performance degradation, Cloudflare employs the TCP Vegas congestion avoidance algorithm.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F210l8ltgabk20hotnps3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F210l8ltgabk20hotnps3.png" width="800" height="493"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This algorithm samples each tenants transaction round-trip time to Postgres, dynamically adjusting the connection pool size to throttle traffic before resource starvation occurs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmvs5atnzgcde8j39amdi.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmvs5atnzgcde8j39amdi.jpeg" width="500" height="529"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Ordering Queries Strategically with Priority Queues 📊
&lt;/h4&gt;

&lt;p&gt;Cloudflare tackles query latency by ranking queries at the PgBouncer layer using queues based on historical resource consumption.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbjro2d7bw7hb3lpf874y.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbjro2d7bw7hb3lpf874y.jpeg" width="800" height="404"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Enabling priority queuing only during peak traffic ensures that queries needing more resources are handled efficiently without causing resource starvation.&lt;/p&gt;

&lt;h4&gt;
  
  
  High Availability with Stolon Cluster Manager 🌐
&lt;/h4&gt;

&lt;p&gt;Ensuring high availability is a top priority for Cloudflare. They employ the Stolon cluster manager, replicating data across Postgres instances, and performing failovers seamlessly in peak traffic. With data replication across regions and proactive network testing, Cloudflare ensures a robust and resilient system.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuqo1oyp35bnos9unutlc.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuqo1oyp35bnos9unutlc.jpeg" width="800" height="165"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Conclusion 🌈
&lt;/h4&gt;

&lt;p&gt;Cloudflares journey to handling 55 million requests per second with just 15 PostgreSQL clusters is a testament to their ingenious system design. From smart connection pooling to tackling concurrency and ensuring high availability, theyve navigated the complexities of scaling with finesse. Subscribe to our newsletter for more simplified case studies and unravel the secrets behind the tech giants success! 🚀🔍&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm6rqv0hutyo49t3n58t8.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm6rqv0hutyo49t3n58t8.jpeg" width="460" height="458"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Connect with Me on social media 📲
&lt;/h4&gt;

&lt;p&gt;🐦 Follow me on Twitter: &lt;a href="https://twitter.com/devangtomar7" rel="noopener noreferrer"&gt;devangtomar7&lt;/a&gt;&lt;br&gt;&lt;br&gt;
🔗 Connect with me on LinkedIn: &lt;a href="https://www.linkedin.com/in/devangtomar" rel="noopener noreferrer"&gt;devangtomar&lt;/a&gt;&lt;br&gt;&lt;br&gt;
📷 Check out my Instagram: &lt;a href="https://instagram.com/be_ayushmann" rel="noopener noreferrer"&gt;be_ayushmann&lt;/a&gt;&lt;br&gt;&lt;br&gt;
 Checkout my blogs on Medium: &lt;a href="https://medium.com/u/8f5e1c86129d" rel="noopener noreferrer"&gt;Devang Tomar&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;strong&gt;#&lt;/strong&gt; Checkout my blogs on Hashnode: &lt;a href="https://devangtomar.hashnode.dev/" rel="noopener noreferrer"&gt;devangtomar&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;strong&gt;🧑💻&lt;/strong&gt; Checkout my blogs on Dev.to: &lt;a href="https://dev.to/devangtomar"&gt;devangtomar&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cloudfare</category>
      <category>systemdesign</category>
      <category>systemarchitecture</category>
      <category>highavailability</category>
    </item>
  </channel>
</rss>
