<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Neelayambalkar on Medium]]></title>
        <description><![CDATA[Stories by Neelayambalkar on Medium]]></description>
        <link>https://medium.com/@neelayambalkar?source=rss-9aace297ecee------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*saymlUT9MoOE7BdMtBSRcQ.jpeg</url>
            <title>Stories by Neelayambalkar on Medium</title>
            <link>https://medium.com/@neelayambalkar?source=rss-9aace297ecee------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 16:03:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@neelayambalkar/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Unlocking the Mathematics of Machine Learning(Day 5)]]></title>
            <link>https://medium.com/@neelayambalkar/unlocking-the-mathematics-of-machine-learning-day-5-a130b3f583db?source=rss-9aace297ecee------2</link>
            <guid isPermaLink="false">https://medium.com/p/a130b3f583db</guid>
            <dc:creator><![CDATA[Neelayambalkar]]></dc:creator>
            <pubDate>Sat, 18 May 2024 12:20:14 GMT</pubDate>
            <atom:updated>2024-05-18T12:20:14.352Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xNtIAJV0TEoC2aFgYRrdow.png" /></figure><p><strong>In previous blog posts,</strong> we explored techniques for differentiating any function. This can be achieved either by directly applying derivative formulas or, when required, by utilizing derivative rules such as the product rule, quotient rule, and the chain rule for composite functions.</p><p>However, up until this point, we have solely applied these differentiation concepts to explicit functions, which do not find widespread usage in practical, real-world applications. In reality, implicit functions are more commonly encountered in various domains.</p><p>An <strong>explicit function</strong> is an algebraic expression where the dependent variable is explicitly defined in terms of the independent variable(s). In other words, an explicit function is one where the functional relationship between the variables is overtly formulated and readily comprehensible.</p><p>Whereas, an implicit function in simple words is a function where we have y value on both the sides.</p><p>For example:</p><p>Implicit functions:</p><p>xy = x² +y(cos x)</p><p>xy = 1</p><p>(xy)² = ln(sin(xy)) +4y² +e³</p><p>Explicit functions:</p><p>y = x² +x -2</p><p>y = x⁴</p><p>y = x³(sin³x)</p><p><strong>To obtain the derivative of implicit functions</strong>, it is necessary to first transform them into their explicit functions through algebraic manipulation. <strong>Let us explore the process of determining the derivatives of implicit functions</strong>, both analytically through mathematical derivations and computationally with Python programming</p><p><strong>Example 1</strong> : <strong>Find dy/dx for the implicit function</strong> x² + y² = 25</p><p><strong><em>Step 1: Differentiate both sides with respect to x.</em></strong></p><p>2x + 2y(dy/dx) = 0</p><p><strong><em>Step 2: Rearrange to get dy/dx alone</em></strong></p><p>2y(dy/dx) = -2x</p><p><strong><em>Step 3: Divide both sides by 2y</em></strong></p><p>dy/dx = -x/y</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*NllQaOE_yq-h3zzv6o-SgA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/648/1*XL-97JbDbIaUPtUENidyag.png" /></figure><p><strong>Example 2 : Find dy/dx for the implicit function </strong>−𝑥−𝑦+𝑒^(𝑥²+𝑦²)</p><p><strong><em>Step 1: Take the derivative of the entire equation with respect to x.</em></strong></p><p>d/dx (−𝑥−𝑦+𝑒^(𝑥²+𝑦²)) = 0</p><p><strong><em>Step 2: Apply the sum rule and the chain rule to differentiate the individual terms.</em></strong></p><p>d/dx (-𝑥) = -1 d/dx (-𝑦) = -dy/dx (since y is treated as a function of x)</p><p>d/dx (𝑒^(𝑥²+𝑦²)) = 𝑒^(𝑥²+𝑦²) * (2x + 2y * dy/dx) (using the chain rule)</p><p><strong><em>Step 3: Combine the derivatives of the individual terms.</em></strong></p><p>-1 — dy/dx + 𝑒^(𝑥²+𝑦²) * (2x + 2y * dy/dx) = 0</p><p><strong><em>Step 4: Rearrange the equation to isolate dy/dx.</em></strong></p><p>dy/dx = (1 + 2x𝑒^(𝑥²+𝑦²)) / (2y𝑒^(𝑥²+𝑦²))</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/702/1*vZ5UxY5LAkRhGHF9KhA_1Q.png" /></figure><p><strong>Example 3 :</strong> <strong>Find dy/dx for the implicit function x³y² = 20x⁴</strong></p><p><strong><em>Step 1: Differentiate both sides of the equation with respect to x, treating y as a function of x. (Applying product rule on L.H.S)</em></strong></p><p>3x²y² + 2x³y dy/dx = 80x³</p><p><strong><em>Step 2: Rearrange the terms to get dy/dx on one side.</em></strong></p><p>dy/dx = 40/y — 3y/2x</p><p><strong><em>Step 3: Find the value of y from the original expression to put/substitute in the derivative equation.</em></strong></p><p>y = √(20x</p><p><strong><em>Step 4: Substituting value of y in the derivative equation.</em></strong></p><p>dy/dx = 40/√(20x -3(√(20x)/2x</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/1*MjvOdvc7kRsSzTEnSRbBcQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a130b3f583db" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unlocking the Mathematics of Machine Learning(Day 4)]]></title>
            <link>https://medium.com/@neelayambalkar/unlocking-the-mathematics-of-machine-learning-day-4-4012b19b9d95?source=rss-9aace297ecee------2</link>
            <guid isPermaLink="false">https://medium.com/p/4012b19b9d95</guid>
            <category><![CDATA[product-rule]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[chain-rule]]></category>
            <category><![CDATA[quotient-rule]]></category>
            <dc:creator><![CDATA[Neelayambalkar]]></dc:creator>
            <pubDate>Mon, 22 Apr 2024 11:55:00 GMT</pubDate>
            <atom:updated>2024-04-22T11:55:00.083Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xNtIAJV0TEoC2aFgYRrdow.png" /></figure><p>In my previous blogs, we covered the fundamentals of calculus, its real-world applications, and how it can be leveraged when coupled with machine learning for predictive modeling. We explored the concept of slope, its significance in determining the nature of a graph, and the underlying logic behind differentiation, and many more topics.</p><p>Today, we will delve deeper into the principles of differentiation, both from a mathematical standpoint and through the lens of Python programming language implementation.</p><p><strong>We have already acquired the knowledge of computing derivatives for individual functions, such as:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*_wX5b5q7XSCB4sEs.jpg" /></figure><p>Memorizing the derivation rules for various functions is an unnecessary burden until and unless if you are not studying in school/college. Otherwise, we can leverage the powerful SymPy library of python, which automates the process of finding derivatives. By simply providing the function as an input to Python, SymPy handles the underlying computations, alleviating the need for manual differentiation</p><p>When dealing with the differentiation of products of functions, the process can become tedious for manual computation. However, Python’s SymPy library streamlines this task, enabling us to handle such scenarios with ease. Let’s illustrate this with an example, wherein we derive the product rule both mathematically and through Python programming.</p><p>Consider the functions <strong>f(x) = x² and g(x) = cos(x)</strong>. The derivative of their product, according to the product rule, can be expressed as:</p><p><strong>d/dx (f(x) * g(x)) = (d/dx f(x)) * g(x) + (d/dx g(x)) * f(x)</strong></p><p><strong>= 2x(cos(x)) + x²(-sin(x))</strong></p><p>This expression shows the product rule, which states that the derivative of a product is the sum of the derivative of the first function multiplied by the second function and the derivative of the second function multiplied by the first function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/635/1*3LbuJsED4LIXEyBq5UXpWw.png" /></figure><p>You can also verify the output using the mathematical formula of product rule mentioned above:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*Ll8Ejyy0765Vn_ulWqvxpA.png" /></figure><p>In addition to the product rule, we also have the quotient rule, which governs the differentiation of quotients of two functions. The quotient rule states that the derivative of the quotient of two functions f(x) and g(x) is given by:</p><p><strong>d/dx (f(x)/g(x)) = (d/dx f(x) * g(x) — f(x) * d/dx g(x)) / g(x)²</strong></p><p>Revisiting our previous example with f(x) = x² and g(x) = cos(x), the derivative of f(x)/g(x) according to the quotient rule would be:</p><p><strong>2x/cos(x) + x² * sin(x) / cos²(x)</strong></p><p>This expression shows the quotient rule, which involves subtracting the product of the first function and the derivative of the second function from the product of the derivatives of the two functions, all divided by the square of the second function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/743/1*cCgKnWIOrfZYwzbFHaYiGA.png" /></figure><p>Next is chain rule.</p><p>The chain rule is a fundamental concept in calculus that governs the differentiation of composite functions, where one function is nested inside another. This rule becomes indispensable when we need to find the derivative of a function expressed as f(g(x)).</p><p>Let’s consider an example:</p><p>f(x) = 3x² g(x) = x³ + log(x)</p><p>Our objective is to determine d/dx(f(g(x))), which involves differentiating the composite function f(g(x)).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/702/1*e62VVgbS4gp7Bo7Oge4WFQ.png" /></figure><p>Let’s take one more example of composite function such as f(g(h(x)))</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/1*Bb-rEBn9m3DcCde5yyoyZg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4012b19b9d95" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploying Spring and Quarkus Microservices on Kubernetes: A Seamless Integration]]></title>
            <link>https://medium.com/@neelayambalkar/deploying-spring-and-quarkus-microservices-on-kubernetes-a-seamless-integration-7ad96d8950b4?source=rss-9aace297ecee------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ad96d8950b4</guid>
            <dc:creator><![CDATA[Neelayambalkar]]></dc:creator>
            <pubDate>Fri, 19 Apr 2024 11:04:07 GMT</pubDate>
            <atom:updated>2024-04-19T11:04:07.087Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*82sXZ-4AzGDs7wNZ" /></figure><h3>First, lets understand what microservices, spring and quarkus exactly are:</h3><p><strong>Microservices </strong>are an architectural approach to building applications as a collection of small, independently deployable services. In this modular design, the larger application is broken down into multiple, loosely coupled components, each focusing on a specific functionality or business capability. The self-contained nature of microservices allows them to be developed, scaled, and updated independently, promoting agility and faster time-to-market. <strong>When microservices are containerized and deployed in a Kubernetes environment</strong>, they can leverage Kubernetes powerful orchestration capabilities, such as automatic scaling, load balancing, and self-healing, making it an ideal platform for running and managing a distributed, microservices-based application architecture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OETHq6nf1i3YYVnCoqrcow.jpeg" /></figure><p><strong>Spring and Kubernetes: A Harmonious Partnership</strong></p><ul><li>Spring is a robust Java-based application framework, widely adopted for developing modern, scalable microservices.</li><li>When you package your Spring-built microservices into containerized artifacts, they become seamlessly deployable within a Kubernetes infrastructure.</li><li>Spring provides first-class integration with Kubernetes, offering built-in capabilities like service discovery and load balancing. This allows your Spring microservices to effortlessly communicate and scale within the Kubernetes environment.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4Q4J5T0_GxCgIL11.png" /></figure><p><strong>Quarkus: The Kubernetes-Native Java Solution</strong></p><ul><li>Quarkus is an innovative Java framework designed from the ground up for cloud-native, container-based deployments, such as those powered by Kubernetes.</li><li>Quarkus applications can be compiled into lightweight, lightning-fast native executables, making them exceptionally well-suited for running inside Kubernetes containers.</li><li>Quarkus natively integrates with Kubernetes, providing out-of-the-box features like health checks, metrics reporting, and configuration management. This streamlines the process of deploying Quarkus-built microservices to a Kubernetes cluster.</li><li>The Quarkus-Kubernetes combination offers a highly efficient and optimized platform for running your Java-based microservices in a modern, containerized infrastructure.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*XtGAFYAfN2oZiFsF" /></figure><h3>Now, let’s launch all 3 of them on top of kubernetes:</h3><p><strong>Set up Kubernetes Cluster</strong>:</p><ul><li>Install a Kubernetes distribution, such as minikube, kind, or a cloud-based Kubernetes service like GKE, AKS, or EKS.</li><li>Ensure you have the necessary Kubernetes CLI tools installed, such as <em>kubectl.</em></li></ul><p><strong>Containerize your Spring and Quarkus Applications</strong>:</p><ol><li><strong>Dockerfile Creation:</strong></li></ol><ul><li>Construct Dockerfiles for your Spring-based and Quarkus-based microservices.</li><li>Ensure the Dockerfiles encompass all the necessary dependencies and configurations to build and run your applications within Docker containers.</li><li><strong><em>Or you can also get the readymade prebuilt images on dockerhub or in any container registry.</em></strong></li></ul><p><strong>Create Kubernetes Manifests(YAML File)</strong>:</p><ul><li>Define Kubernetes deployment and service YAML files for your Spring and Quarkus applications.</li><li>Include details like container image, environment variables, resource requests/limits, and any necessary Kubernetes configuration.</li><li>Create a Kubernetes namespace for your microservices.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T9BwvteHLeMg6RvsgVTYqw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FXETcVIeLrG5Ocdv9g90-g.png" /></figure><p><strong>Deploy to Kubernetes</strong>:</p><ul><li>Apply the Kubernetes manifests using kubectl apply -f &lt;yaml_file&gt;.</li><li>Verify the deployment and service using kubectl get deployment,service.</li></ul><p><strong>Expose Microservices</strong>:</p><ul><li>Create Kubernetes service to expose your Spring and Quarkus applications.</li><li>Configure service using NodePort service type which provides a straightforward way to expose your Spring and Quarkus applications, making them accessible from outside the Kubernetes cluster using the node&#39;s IP address and the assigned port.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*1eMuXTizc1y-ICY6U6kOoA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*2stPDLxB17Oh_O9Ai87NBw.png" /></figure><p><strong>Scale Microservices</strong>:</p><ul><li>Scale your microservices up or down based on demand by adjusting the replica count in the Kubernetes deployment manifests.</li></ul><p><strong>Implement CI/CD</strong>:</p><ul><li>Set up a continuous integration (CI) pipeline to automatically build, test, and deploy your microservices to Kubernetes.</li><li>Consider using tools like Jenkins, GitLab CI, or GitHub Actions for your CI/CD workflow.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ad96d8950b4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hosting a multi tier website using multi node Kubernetes cluster]]></title>
            <link>https://medium.com/@neelayambalkar/hosting-a-multi-tier-website-using-multi-node-kubernetes-cluster-b74ef6a0b3b0?source=rss-9aace297ecee------2</link>
            <guid isPermaLink="false">https://medium.com/p/b74ef6a0b3b0</guid>
            <dc:creator><![CDATA[Neelayambalkar]]></dc:creator>
            <pubDate>Fri, 19 Apr 2024 10:47:46 GMT</pubDate>
            <atom:updated>2024-04-19T10:47:46.895Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZJV4QshLeiJza5a3l0HjrQ.png" /></figure><h3><strong>There are multiple methods to deploy and configure a Kubernetes cluster:</strong></h3><ol><li><strong>Managed Kubernetes Services</strong>: Cloud service providers offer managed Kubernetes offerings, allowing you to provision a pre-configured Kubernetes cluster with a few clicks or through their respective APIs. These managed services abstract away the underlying infrastructure and cluster management tasks, providing a ready-to-use Kubernetes environment.</li><li><strong>Local Kubernetes Tools</strong>: Various tools like Minikube, Kind, and K3s are available to quickly set up a single-node Kubernetes cluster locally on your machine. These tools are primarily used for development, testing, and learning purposes, as they provision a simplified, lightweight Kubernetes environment on a single host.</li></ol><p><strong>But, to deploy and manage a multi-node Kubernetes cluster</strong> for production or advanced scenarios, it is recommended to use a more robust and flexible approach. This involves setting up and configuring the cluster components manually or through automation tools, tailoring the deployment to specific requirements. One such tool designed for this purpose is <strong>kubeadm</strong>.</p><p><strong>kubeadm</strong> is a officially supported tool for bootstrapping and managing Kubernetes clusters. It is part of the Kubernetes project and provides a consistent way to create and manage Kubernetes clusters across various platforms and environments.</p><h3>Why do we need multi-node cluster?</h3><p><strong>A single-node Kubernetes cluster introduces a single point of failure (SPOF),</strong> which poses a significant risk for mission-critical applications or services that require high availability. In a single-node setup, if the sole node fails due to hardware issues, software bugs, resource exhaustion, or any other unforeseen circumstances, the entire Kubernetes cluster and the applications running on it will become unavailable, resulting in service disruption.</p><p>On the other hand, <strong>a multi-node Kubernetes cluster mitigates this risk by distributing the workload across multiple nodes</strong>, providing inherent redundancy and failover capabilities. In a multi-node cluster, the control plane components (kube-apiserver, kube-controller-manager, kube-scheduler) and the worker nodes (kubelet, kube-proxy) are deployed across multiple physical or virtual machines, ensuring high availability.</p><p><strong>If one of the worker nodes fails, the remaining nodes can continue to run the scheduled Pods, ensuring uninterrupted service delivery.</strong> Additionally, Kubernetes offers built-in mechanisms for automatic rescheduling and self-healing, where Pods from the failed node are automatically rescheduled onto healthy nodes, minimizing downtime.</p><p><strong>Moreover, a multi-node cluster allows for better resource utilization and scalability.</strong> Workloads can be distributed across multiple nodes, enabling efficient use of computing resources and preventing resource contention on a single node. As the demand for resources increases, additional nodes can be added to the cluster, providing seamless horizontal scaling capabilities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/1*Op1W7Ql1LrsRzlfK7zCmVw.png" /></figure><p>To set up a multi node cluster or let’s say to install the kubeadm tool, we need to be ready with few things in our system:</p><pre>For best performance, Kubernetes requires that swap is disabled on the master/slave system, edit the /etc/fstab file To make the changes persistent<br>$ swapoff -a<br><br>install the traffic control utility package<br>$ dnf install -y iproute-tc<br><br>installing the required drivers<br>$ modprobe overlay<br>$ modprobe br_netfilter<br><br><br>Above commands to install the drivers will work as a temporary installer. <br>To make our installation permanenet, we need to mention these drivers in <br>kubernetes config file<br>$ cat &lt;&lt;EOF | sudo tee /etc/modules-load.d/k8s.conf<br>overlay<br>br_netfilter<br>EOF<br><br>To start using the above drivers and to enable the cnnectivity between any 2 containers<br>$ cat &lt;&lt;EOF | sudo tee /etc/sysctl.d/k8s.conf<br>net.bridge.bridge-nf-call-iptables  = 1<br>net.ipv4.ip_forward                 = 1<br>net.bridge.bridge-nf-call-ip6tables = 1<br>EOF<br><br>This command will activate the things you mentioned in the config file<br>$ sysctl --system<br><br>Set SELinux in permissive mode (effectively disabling it)<br>disable SELinux and set it to ‘permissive’ in order to allow smooth communication between the nodes and the pods.<br>$ setenforce 0<br>$ sed -i &#39;s/^SELINUX=enforcing$/SELINUX=permissive/&#39; /etc/selinux/config<br><br><br>Container Runtime is an application that supports running containers, we will install CRI-O<br>$ export VERSION=1.26<br>$ curl -L -o /etc/yum.repos.d/devel:kubic:libcontainers:stable.repo https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/CentOS_8/devel:kubic:libcontainers:stable.repo<br>$ curl -L -o /etc/yum.repos.d/devel:kubic:libcontainers:stable:cri-o:$VERSION.repo https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable:cri-o:$VERSION/CentOS_8/devel:kubic:libcontainers:stable:cri-o:$VERSION.repo<br><br>$ dnf install cri-o<br>$ systemctl enable crio<br>$ systemctl start crio<br><br><br><br><br>This overwrites any existing configuration in /etc/yum.repos.d/kubernetes.repo<br>$ cat &lt;&lt;EOF | sudo tee /etc/yum.repos.d/kubernetes.repo<br>[kubernetes]<br>name=Kubernetes<br>baseurl=https://pkgs.k8s.io/core:/stable:/v1.29/rpm/<br>enabled=1<br>gpgcheck=1<br>gpgkey=https://pkgs.k8s.io/core:/stable:/v1.29/rpm/repodata/repomd.xml.key<br>exclude=kubelet kubeadm kubectl cri-tools kubernetes-cni<br>EOF<br><br><br>$ sudo yum install -y kubelet kubeadm kubectl --disableexcludes=kubernetes<br>$ sudo systemctl enable --now kubelet<br><br>initialize a Kubernetes cluster using the kubeadm command as follows. This initializes a control plane in the master node., use network range of kube server below cidr<br>this command to be run only in one system which you want to make as a master node.<br>$ kubeadm init --pod-network-cidr=192.168.0.0/16</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SalDmf869KqmY7k9AjXYhA.png" /></figure><p><strong>In a multi-node Kubernetes cluster, the nodes need to communicate with each other to facilitate seamless operations and workload distribution.</strong> However, the nodes may not necessarily be part of the same network or subnet, which can hinder direct communication between them. To overcome this networking challenge, Kubernetes employs overlay networks.</p><p><strong>An overlay network is a virtual network that is built on top of an underlying physical network infrastructure.</strong> It allows logical communication paths to be established between nodes, regardless of their physical network topology or location. This is achieved by encapsulating the cluster networking traffic within an additional networking protocol layer, enabling seamless communication across different networks or subnets. There are many tools through which we can do this such as Calico, flannel, weave, AWS Overlay etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*NAeyqMQDlEVqA53D2o5EPg.png" /></figure><p>When initializing the Kubernetes control plane using kubeadm, it generates a series of commands that must be executed on the nodes joining the cluster as well as in the master node itself to start using the cluster. These commands, we are able to see in the screenshots.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VaGvKk6QpaXqgUGEyoPHQA.png" /></figure><p>To join the other worker nodes to the master node, we use above join command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1yjIxV_1L2qYwtVjhmf1hg.png" /></figure><p>To label the nodes, we use above command.</p><p><strong>Note that, </strong>the process of setting up a multi-node Kubernetes cluster remains largely the same, regardless of the cloud providers used to provision the nodes. These nodes can be sourced from different cloud providers (e.g., AWS, Google Cloud, Azure), or even from on-premises virtualization platforms.</p><p><strong>Irrespective of the source or provider of these nodes, the process of bootstrapping and configuring the Kubernetes cluster components remains consistent.</strong> <strong>The core components, such as the control plane (API server, scheduler, controller manager) and the worker nodes (kubelet, kube-proxy), need to be installed and configured on the respective instances following the standard Kubernetes setup procedures.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1yjIxV_1L2qYwtVjhmf1hg.png" /></figure><p>To verify that, the worker nodes have joined the master node, we use above command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*svNTZgZWwqvnFT0bLDiD4w.png" /></figure><p>You will be able to see this output, once your worker node joins the master node.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*thUpZLCJhvyKEmE5s1mdCA.png" /></figure><p><strong>Through this command you will see that the essential control plane services or components that must be running for a Kubernetes cluster to function correctly.</strong> These services are typically deployed as containerized applications or Pods on the control plane nodes.</p><p>Some of the key services that need to be up and running for a Kubernetes cluster to operate properly include:</p><ol><li><strong>kube-apiserver</strong>: The Kubernetes API server is the central management component that exposes the Kubernetes API and serves as the primary interface for communication and control within the cluster.</li><li><strong>kube-controller-manager</strong>: This component runs various controller processes that regulate the state of the cluster, such as the Node Controller, Replication Controller, and others.</li><li><strong>kube-scheduler</strong>: The scheduler is responsible for scheduling Pods onto appropriate nodes based on resource requirements, constraints, and other policies.</li><li><strong>etcd</strong>: etcd is a distributed key-value store that persists the cluster’s configuration data and state.</li><li><strong>kube-proxy</strong>: This network proxy runs on each node and facilitates communication between Pods across the cluster by performing tasks like load balancing and network address translation (NAT).</li><li><strong>Network Add-on</strong>: A networking solution like Calico, Flannel, or Weave Net is typically deployed to enable communication between Pods running on different nodes.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*VGIiLUv6HuPolnJSaeczVw.png" /></figure><p>Here, we are ensuring that the overlay network solution, in this case, Calico, has been correctly established and is ready for use within the Kubernetes cluster. <strong>Note</strong> that calico will also be launched as pods as explained above:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*x4SNr6k7KN5Wl_L7VpbXIQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AntW83Ywm2Pxlmg0NDA3LQ.png" /></figure><p>Now, we are good to launch our deployment. Note that in my case I am launching a image in which environmental variables need to be set due to which you can see I am unable to launch the pods. Environment variables are often used to pass configuration data or sensitive information (like database credentials, API keys, etc.) to the containers within a Pod. After setting the environmental variables, I was able to launch the pods successfully.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J0j2eIQTVYtJI3z0rswUXw.png" /></figure><p>In Kubernetes, when you create a Deployment resource, you can specify the desired number of replicas (instances) of the application Pods that should be running(you can see it in the previous image).</p><p><strong>Once the Deployment is applied, the Kubernetes scheduler, responsible for assigning Pods to nodes, distributes the requested number of Pods across the available worker nodes in the cluster. </strong>The scheduler takes into account various factors, such as resource availability, node affinity/anti-affinity rules, and other constraints, to ensure efficient and balanced distribution of the workload.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*xUWiwRHtMtDQJ0qek23HKg.png" /></figure><p>Launching the wordpress deployment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DUJ45ug1q87a1sELLiFGYg.png" /></figure><p>This output indicates that there are now 10 Pods running in the Kubernetes cluster, <strong>consisting of two different types of workloads or applications:</strong> 5 Pods for a MySQL database and 5 Pods for a WordPress application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*Sifj2aKFIECYpgXBzGhGEw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*aQ8r8qza2bkymX-eWka0cg.png" /></figure><p><strong>Note that, </strong>It’s a good practice to establish service-to-service connections, particularly in a multi-tier architecture deployed through Kubernetes. When integrating a WordPress deployment service with an SQL deployment service, failure to establish communication between pods may result in data loss and service downtime.</p><p>After exposing both deployments, they can be utilized as services. It’s important to note that for the MySQL deployment, exposing it with ClusterIP is preferred, whereas for the WordPress deployment, NodePort is used. This choice is made to direct customer traffic towards the frontend, which is the WordPress site deployment, while restricting direct external access to the MySQL deployment. The MySQL deployment is intended for internal cluster usage, ensuring data security and limiting exposure to the external environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sou4ewZEz7C_aflWnWyP-w.png" /></figure><p>And now, the WordPress website is launched by accessing the public IP and port number provided by the wpdeploy service on any available node. This step finalizes the deployment, enabling external access to the WordPress site.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7Oc19ZR5QfRohQO2dBSjng.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d-ikkEj7hOLFeLzvrFAy0g.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b74ef6a0b3b0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes in Action: Inside the Infrastructure of Canva and Netflix]]></title>
            <link>https://medium.com/@neelayambalkar/kubernetes-in-action-inside-the-infrastructure-of-canva-and-netflix-40e832ea65c7?source=rss-9aace297ecee------2</link>
            <guid isPermaLink="false">https://medium.com/p/40e832ea65c7</guid>
            <dc:creator><![CDATA[Neelayambalkar]]></dc:creator>
            <pubDate>Wed, 17 Apr 2024 11:26:57 GMT</pubDate>
            <atom:updated>2024-04-17T11:26:57.685Z</atom:updated>
            <content:encoded><![CDATA[<p>As leading companies in their respective industries, Canva and Netflix have both embraced Kubernetes as a crucial part of their infrastructure. Explore how these giants benefit from container orchestration at scale.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OFp5SM3Ab8WRZuMMwHReLg.png" /></figure><h3><strong>Canva:</strong></h3><p><strong>Canva, the popular online design platform,</strong> has been a prominent of Kubernetes since 2018. As their business grew and their infrastructure became more complex, they recognized the need for a robust container orchestration solution to manage their microservices-based architecture.</p><p><strong>Kubernetes Adoption at Canva:</strong> Canva started by adopting Kubernetes on the AWS cloud, leveraging the managed Kubernetes service offered by AWS, known as Amazon EKS (Elastic Kubernetes Service). This allowed Canva to focus on running their applications, without having to worry about the underlying Kubernetes cluster management tasks.</p><p>Later, as Canva expanded its infrastructure, they also set up Kubernetes clusters on Google Cloud, using the Google Kubernetes Engine (GKE) service. This multi-cloud Kubernetes strategy gave Canva the flexibility to distribute their workloads across different cloud providers, ensuring redundancy and better overall resilience.</p><p><strong>Benefits of Kubernetes for Canva:</strong></p><p><strong><em>Scalability and Elasticity:</em></strong></p><ul><li>With Kubernetes, Canva can easily scale their containerized microservices up or down based on fluctuating user demands. This allows them to efficiently utilize their cloud resources and ensure their platform remains responsive and performant, even during periods of high traffic.</li></ul><p><strong><em>Improved Deployment Efficiency:</em></strong></p><ul><li>Kubernetes has enabled Canva to automate their application deployment processes, reducing the time and effort required to roll out new features, updates, or bug fixes. This streamlined deployment process has helped Canva deliver new value to their users faster.</li></ul><p><strong><em>Increased Reliability and Availability:</em></strong></p><ul><li>Kubernetes’ built-in features, such as self-healing and load balancing, have helped Canva achieve high availability and fault tolerance for their critical applications. This has resulted in fewer service disruptions and a more reliable user experience.</li></ul><p><strong><em>Cost Optimization:</em></strong></p><ul><li>By effectively managing their container resources with Kubernetes, Canva has been able to optimize their cloud infrastructure costs. Kubernetes’ intelligent resource scheduling and autoscaling capabilities have allowed Canva to scale their infrastructure up and down as needed, avoiding over-provisioning and unnecessary cloud spending.</li></ul><p><strong><em>Developer Productivity:</em></strong></p><ul><li>Kubernetes has become a core part of Canva’s engineering culture, empowering their developers to focus on building and deploying applications, rather than worrying about the underlying infrastructure. This has increased their developers’ productivity and enabled them to innovate faster.</li></ul><p>Furthermore, Canva has integrated Kubernetes with other cloud-native tools and technologies, such as Istio (service mesh), Prometheus (monitoring), and Fluentd (logging), to create a comprehensive and streamlined platform for managing their containerized applications.</p><p>Canva’s successful Kubernetes adoption and the resulting benefits have made the platform an integral part of their infrastructure, allowing them to scale their business, enhance their reliability, and optimize their cloud costs — all while enabling their engineering team to deliver innovative features and improvements to their users.</p><h3>Netflix:</h3><p><strong>Netflix, the global streaming giant, </strong>has been at the forefront of adopting and contributing to the Kubernetes ecosystem. As Netflix’s infrastructure and application landscape grew increasingly complex, they recognized the need for a powerful container orchestration platform to manage their distributed, microservices-based architecture.</p><p><strong>Kubernetes Adoption at Netflix:</strong> Netflix’s journey with Kubernetes began in the early days of the project’s development. They were actively involved in the Kubernetes community, contributing code, sharing their use cases, and helping shape the direction of the platform. This deep engagement allowed Netflix to be an early adopter of Kubernetes and tailor it to their specific requirements.</p><p>Netflix has deployed Kubernetes across multiple cloud providers, including Amazon Web Services (AWS) and Google Cloud Platform (GCP). They have created their own distribution of Kubernetes, called “Netflix Titus,” which integrates seamlessly with their in-house tools and platforms, providing a highly customized Kubernetes experience.</p><p><strong>Benefits of Kubernetes for Netflix:</strong></p><p><strong><em>Scalability and Elasticity:</em></strong></p><ul><li>Kubernetes has enabled Netflix to effortlessly scale their microservices-based application landscape up and down, ensuring their platform can handle the massive fluctuations in user traffic during peak viewing hours and popular content releases.</li></ul><p><strong><em>Improved Reliability and Resilience:</em></strong></p><ul><li>Kubernetes’ self-healing capabilities, load balancing, and service discovery features have helped Netflix achieve a high degree of reliability and fault tolerance for their critical streaming services. This translates to a more stable and uninterrupted viewing experience for their users.</li></ul><p><strong><em>Efficient Resource Utilization:</em></strong></p><ul><li>By leveraging Kubernetes’ intelligent scheduling and autoscaling capabilities, Netflix has been able to optimize their cloud resource usage, reducing over-provisioning and minimizing their overall infrastructure costs.</li></ul><p><strong><em>Accelerated Innovation:</em></strong></p><ul><li>Kubernetes has empowered Netflix’s engineering teams to focus on developing and deploying new features, rather than worrying about the underlying infrastructure management tasks. This has enabled them to innovate and iterate at a faster pace, delivering new value to their customers more quickly.</li></ul><p><strong><em>Seamless Multi-Cloud Capabilities:</em></strong></p><ul><li>Netflix’s adoption of Kubernetes has provided them with the flexibility to run their workloads across multiple cloud providers, leveraging the best-of-breed services and offerings from each platform. This multi-cloud strategy has increased their infrastructure resilience and reduced vendor lock-in.</li></ul><p>Furthermore, Netflix has integrated Kubernetes with their own in-house tools and platforms, such as their chaos engineering framework “Chaos Monkey,” to ensure their applications can withstand unexpected failures and remain highly available.</p><p>Netflix’s deep involvement in the Kubernetes community, coupled with their successful implementation of the platform, has made them a prime example of how a large-scale, distributed application can benefit from the power of Kubernetes. Their innovative use of Kubernetes has set the bar for other enterprises looking to modernize their infrastructure and deliver reliable, scalable, and cost-effective services.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=40e832ea65c7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unlocking the Mathematics of Machine Learning (Day 3)]]></title>
            <link>https://medium.com/@neelayambalkar/unlocking-the-mathematics-of-machine-learning-day-3-64f0ff1260d0?source=rss-9aace297ecee------2</link>
            <guid isPermaLink="false">https://medium.com/p/64f0ff1260d0</guid>
            <category><![CDATA[slope]]></category>
            <category><![CDATA[logic-of-differentiation]]></category>
            <dc:creator><![CDATA[Neelayambalkar]]></dc:creator>
            <pubDate>Mon, 15 Apr 2024 10:48:55 GMT</pubDate>
            <atom:updated>2024-04-15T11:05:23.201Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xNtIAJV0TEoC2aFgYRrdow.png" /></figure><h3>Slope:</h3><p>To determine the Euclidean distance between any two points in a coordinate system, the formula is:</p><p><strong>distance = √[(x2 — x1)² + (y2 — y1)²]</strong></p><p>Similarly, in any graph, the slope between two points is calculated using the following formula:</p><p><strong>slope = (y2 — y1) / (x2 — x1)</strong></p><p>In the context of a distance-time graph, the slope, denoted as ‘m’, can be expressed as:</p><p><strong>Slope (m) = (Change in Distance) / (Change in Time)</strong></p><p><strong>or</strong></p><p><strong>Slope (m) = (d2 — d1) / (t2 — t1)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*k4NCYrjKSBo2SgNeYSsOVw.png" /></figure><p>This slope formula can also be written as:</p><p><strong>m = (Δd) / (Δt)</strong></p><p>where Δd represents the change in distance, and Δt represents the change in time between the two points on the graph.</p><h3>Logic behind Differentiation:</h3><p>From the preceding graphical illustrations, it is evident that the slope, which represents the speed, is constant. However, in real-world scenarios, speed is rarely constant; it is continuously increasing or decreasing at every instant of time. If you see the real world graph of distance vs time where we plot the speed:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/707/1*mXx4Q7w6lafASM7DLJtkxg.png" /></figure><p>When observing a distance-time graph where speed appears constant, upon closer, microscopic examination, the speed is actually fluctuating at every nanosecond or millisecond. Let’s see this graph:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/1*WhCuSCz8pSCdXxomU8o7uw.png" /></figure><p>For instance, if we examine the behavior at a specific time point, such as 1 second, and then proceed to observe, the speed changes at increasingly smaller time intervals, such as 1/2 second, 1/4 second, 1/8 second, 1/16 second, and so on this sequence approaches 1/infinity. And we know that 1/infinity tends to zero. That means, we need to observe the speed so microscopically that our time tends to 0. In simple language, the time which is just after 0 which can be 0.00000000……….000000111 or maybe more smaller than this.</p><p>This concept underlies the fundamental principle of differentiation, which allows us to quantify the rate of change, or the instantaneous change in speed with respect to time. Since human observation is limited in its ability to perceive such microscopic changes, differentiation provides a mathematical framework to analyze the continuous variation of speed at every infinitesimal instant.</p><p>In our zoomed graph, it shows that how graph is changing at every instant of time i.e at every 1/infinity of time. In fact, if you keep zooming it more, you will see more drastic changes in your graph with respect to the time.</p><p>For example, if we wish to examine the behavior at a specific time, such as 13:41, we would need to consider the time increments of 13:41:05, 13:41:05:0001, 13:41:05:0001:00001, and so on, approaching the limit of 1/infinity.</p><p><strong>This is the essence of differentiation. It will go in so detail and observe the changes at microscopic level. In simple language, it will cut the function f(t) into so small tiny microscopic pieces and observe how each microscopic piece is performing with respect to time. And, if machine learning is deployed here, the model will learn from this tiny microscopic pieces and will help us to predict something new or something big based on whatever experience it has gained.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=64f0ff1260d0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unlocking the Mathematics of Machine Learning (Day 2)]]></title>
            <link>https://medium.com/@neelayambalkar/unlocking-the-mathematics-of-machine-learning-day-2-6509afae5b77?source=rss-9aace297ecee------2</link>
            <guid isPermaLink="false">https://medium.com/p/6509afae5b77</guid>
            <dc:creator><![CDATA[Neelayambalkar]]></dc:creator>
            <pubDate>Tue, 09 Apr 2024 12:14:04 GMT</pubDate>
            <atom:updated>2024-04-09T12:14:04.453Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xNtIAJV0TEoC2aFgYRrdow.png" /></figure><p>In the previous discussion, we examined the application of calculus in addressing real-world problems. Through the principles of differential calculus, we are able to decompose a primary function into its constituent components and analyze the rate of change of the derivative function with respect to the independent variable, typically time. Subsequently, by employing the techniques of integral calculus, we can aggregate these derivative functions to either solve a more complex problem or to facilitate the development of new innovations. The process of differentiation allows us to scrutinize the local behavior of a function, revealing its instantaneous rate of change at a specific point. This granular analysis enables us to better understand the underlying dynamics of the system being studied. Conversely, the integration process facilitates the synthesis of these localized derivative functions, enabling us to derive a more holistic understanding of the system’s global behavior. This synergistic approach, combining differentiation and integration, is a powerful tool for modeling, analyzing, and optimizing a wide range of real-world phenomena, from engineering design to financial forecasting.</p><p><strong>Let’s go some more deep into it:</strong></p><p>Let’s consider a practical application of calculus in the context of website data transfer analysis. In the past, we have been able to gather historical data on the amount of data, measured in bytes, that has been transferred through our website on a day-to-day basis. For instance, we know the specific volume of data transferred on April 4th. Now, we want to use this historical data to predict and analyze the future pattern of data transfer on our website. By employing the principles of calculus, we can approach this problem in a systematic manner. <strong>First, we can use differential calculus to examine the rate of change in data transfer over time. This will allow us to identify any trends, fluctuations, or irregularities in the data transfer behavior. Next, we can leverage integral calculus to integrate these derivative functions, enabling us to construct a more comprehensive model of the overall data transfer patterns. </strong>Let’s say our graph looks something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/501/1*cEH797saG7ax251_XlxuRA.png" /></figure><p>As you have rightly pointed out, the graph depicting the past data transfer patterns on the website can be accurately drawn based on the historical dataset. However, when it comes to forecasting the future data transfer graph, relying solely on calculus may not be sufficient. This is where machine learning, particularly Recurrent Neural Networks (RNNs), play a crucial role. RNNs are well-suited for time-series data analysis, allowing us to identify and learn from the underlying patterns in the historical data. <strong>By combining the analytical capabilities of calculus with the predictive power of machine learning, we can construct a more accurate and reliable model for forecasting future data transfer patterns.</strong> It’s important to note that the <strong>function used to draw both the past and future data graphs cannot be obtained without the application of machine learning.</strong> The machine learning models are responsible for learning and approximating the complex, non-linear relationships within the data, which traditional mathematical functions may struggle to capture effectively.</p><p><strong>Let me summarize the two crucial contributions of machine learning in this context:</strong></p><ol><li>To frame a function based on the dataset.</li><li>It will also help to predict the future graph based on the algorithm’s learning.</li></ol><h3>Differentiation:</h3><p>Let’s explore another example to further illustrate the concept more easily:</p><p>let’s consider a scenario where you want to travel from your home to the office, a distance of 1 km, in 10 minutes. We can use a graph to visualize and analyze this journey:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/455/1*JKHj9AgCjmQHkl5dVnm33A.png" /></figure><p>This graph is similar to the equation y=x. Let’s consider the case where the graph is defined by the equation y = 2x, which represents a linear relationship with a different rate of change.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/407/1*WnYMRyYKMxyyvMEZz9DryQ.png" /></figure><p>In both these graphs, the graphs were both straight lines, but the angles of the lines were different, reflecting the varying rates of change.</p><p>So, in case of y=2x, here 2 is the number, which is deciding the angle, that’s why we also call it as <strong>slope/coefficient.</strong> Coming back to our example if we compare this equation with distance = speed * time, now our slope/coefficient becomes the speed. So, in the first graph, we can also say that the reason for angle is nothing but the slope i.e. speed in our case. In the mathematical context, the equation y = mx is a standard representation of a linear function, where ‘m’ denotes the slope or rate of change.</p><p>Now, let’s explore a different way of visualizing the relationship between distance, speed, and time by plotting the graph with speed on the y-axis and time on the x-axis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/441/1*TbZAMaT-hsO6bvD8PxzfIQ.png" /></figure><p>This graph shows that, our speed remains constant at each and every point of time. The graph we plotted with speed on the y-axis and time on the x-axis can be interpreted as a <strong>slope-time graph</strong>. <strong>This is because the speed, which is the rate of change of distance with respect to time, remains constant throughout the journey.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/437/1*SwWTt_Ln07oquvf0WefwKw.png" /></figure><p>This graph is, in fact,<strong> the derivative graph of the original distance-time function. </strong>The constant speed represented on the y-axis is the derivative or the instantaneous rate of change of the distance function. This is the magical nature about graphical representation.</p><p>Now, you might wonder that from this graph, how can one determine the distance travelled. However, there is a method to extract this information. Suppose you wish to find the distance within a specific domain or range as depicted in the graph.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/435/1*WlN3_V2-Ixf6Q3h8L8XllQ.png" /></figure><p>As observed, the provided graph depicts a rectangular shape. <strong>In this case, the area of the rectangle can be used to determine the distance travelled.</strong> We can verify this approach by comparing it to the information presented in a original distance-vs-time graph. For instance, if we want to find the distance traveled from 0 to 4 minutes, we can calculate the area of the rectangle on the slope-versus-time graph. The width of the rectangle is 4 minutes, and the height is 2 units of slope. Therefore, the area of the rectangle is 4 × 2 = 8 km. Alternatively, if we refer to the distance-vs-time graph, the relationship is given as d = 2t, where d represents the distance and t represents the time. Put in the time of 4 minutes, we again obtain a distance of 8 km.</p><p>But, <strong>It is not always the case that the graph will present a simple, easily calculable shape to determine the distance traveled.</strong> In real-world scenarios, the graph may depict more complex functions and their derivatives. For example, if we draw the main function graph and the derivative graph for y=x²:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/558/1*EhbnmojAcFd1JP0aWqxkOA.png" /></figure><p>So, in such cases we need to somehow find the area of the shape which will ease our work. Otherwise, as shown in above graph if we want to find the sum of the derivative functions as highlighted by red, it is possible but its slightly tedious job. By finding the area, we can do it real quick.</p><p>If the graph depicts a curve rather than a simple geometric shape, finding the area under the curve becomes a challenging task without the appropriate analytical methods. <strong>In such cases, the application of integral calculus proves to be invaluable.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/303/1*i-iPMImP1Yo7fUiE23LjxA.png" /></figure><p>The primary purpose of <strong>integral calculus is precisely to facilitate the calculation of the area under curves</strong>, which is often the key to determining quantities like distance traveled from derivative graphs. By employing integration techniques, we can efficiently and accurately compute the area under the curve, even if the shape is not a simple polygon or other easily measurable form.</p><p>So, in this way, <strong>by using integral calculus to find the area under the curve in derivative function graph, we can quickly find the output of the main function in a given time interval.</strong></p><p>To summarize, it actually depends upon the use case what we are serving. If we only need to find the critical point i.e. maxima or minima of any use case, then we might use only differential calculus. If we want to sum all the derivative functions to solve some big innovation, then we might use differential as well as integral calculus.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6509afae5b77" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Chaos to Control: Leveraging Ansible for Seamless Infrastructure Management (Day 1)]]></title>
            <link>https://medium.com/@neelayambalkar/from-chaos-to-control-leveraging-ansible-for-seamless-infrastructure-management-day-1-b035f5e521c5?source=rss-9aace297ecee------2</link>
            <guid isPermaLink="false">https://medium.com/p/b035f5e521c5</guid>
            <dc:creator><![CDATA[Neelayambalkar]]></dc:creator>
            <pubDate>Sun, 07 Apr 2024 13:34:12 GMT</pubDate>
            <atom:updated>2024-04-08T02:33:15.429Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9AKwPX04gdFktkd-3y_F-w.png" /></figure><h3>The best example to understand what ansible exactly is:</h3><p>Consider a software company with an innovative idea that requires implementation through the development of a website or application. To realize this idea, the developer will need a minimum of three core components: physical hardware, an operating system, and the necessary software configuration. However, the implementation of these three components involves a multitude of manual tasks that the developer must undertake such as:</p><ol><li>To buy a physical hardware</li><li>Install the O.S into it</li><li>Configure it according to the use case [configuration means that the developer will require a software to run the program, other software to deploy the program….and to install these software what all additional software/drivers are needed, the libraries to compile the program, type of connection, type of security, troubleshooting techniques and many more………..]</li></ol><p>All these manual things can be replaced by automation also. How? Let’s see:</p><ol><li>The need of physical hardware can be eliminated just by using the cloud computing technology.</li><li>The need of O.S can also be eliminated by the clous technology.</li><li>And all the configuration in our system to successfully implement that software company’s idea as quickly as possible. This configuration will be managed by <strong>Ansible. This is the reason that Ansible is widely known for its Configuration Management capability.</strong></li></ol><h3>Configuration Management:</h3><p>Configuration management can be done in 2 ways:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/587/1*tpdTBX_euCIbzS8mERQv-A.png" /></figure><p>In today’s world we rely mostly on the automation way, because it gives us rapid developments in any use case and <strong>most importantly it reduces the time to market(TTM) of any company which is the very crucial for every software company to survive in today’s world.</strong></p><p>Let’s understand this with a quick example:</p><p>Let’s consider a scenario where Zomato, a prominent food delivery platform, introduces a new Augmented Reality (AR) feature in their app or website. This feature allows users to visualize a particular food dish on any surface their phone’s camera is pointed at, providing an immersive and interactive experience. Concurrently, Swiggy, a competing food delivery service, is also working on implementing a similar AR feature for their own platform. However, in Swiggy’s case, the development process involves a manual, human-centric approach, where an engineer is seated at a desk, writing code and configuring the necessary systems to bring this feature to life. Swiggy’s AR feature is launched approximately 7–8 days after Zomato’s implementation. This delay in time-to-market results in Swiggy losing a significant number of customers, who have migrated to Zomato to take advantage of the newly introduced AR functionality. The financial impact of this delayed launch is substantial, with Swiggy potentially bearing a loss of billions of dollars in business revenue. <strong>This scenario highlights the critical importance of time-to-market, where the ability to rapidly develop, deploy, and deliver innovative features can be a decisive factor in maintaining a competitive edge and retaining a loyal customer base.</strong></p><p>But now, even Automation can be done in 2 different ways:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/542/1*hSIBTETUT7-bV221_ZIl8Q.png" /></figure><p><strong>Imperative Language:</strong> Imperative programming languages focus on describing the step-by-step instructions or the “how” of a computation, telling the computer what actions to take to achieve a desired outcome. (e.g. Java, C, Python)</p><p><strong>Declarative Language:</strong> Declarative programming languages focus on describing the desired result or the “what” of a computation, expressing the logic of a program without specifying the exact steps to get there. (e.g.YAML)</p><p>This is the power of Ansible. It says that hey you just tell me what do you want to do, don’t worry for how to do it(configuration).</p><p>Let’s take another example to have more clarity:</p><p>“Suppose we want to provision and configure an Apache web server on our local system. In this scenario, we would simply inform Ansible that we require an Apache web server to be set up on the local host. Ansible, as the configuration management tool, will then take responsibility for determining and executing the necessary steps to achieve this desired state.Specifically, Ansible will first identify the appropriate package management commands required to install the Apache HTTP Server software on the local operating system. This may involve running package installation utilities like yum, apt-get, depending on the underlying system. Beyond just installing the base Apache package, Ansible will also handle the configuration of any supporting services, dependencies, and system-level settings needed to ensure a fully functional and operational web server environment. This could include tasks such as: Configuring network ports and firewall rules, Setting up directory permissions and ownership, Enabling and starting the Apache service, Validating the web server’s functionality.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*rrKSrchjcN2NsYxEK_H05g.png" /></figure><h3>Working of Ansible:</h3><p>Ansible works on a client-server model, where the master node (the “control node”) manages the target nodes (the “managed nodes”). The control node is the system from which Ansible commands are executed, and it communicates with the managed nodes over a secure connection, typically SSH irrespective of the O.S type and the changes to be made. The managed nodes are the remote systems on which the desired configurations or tasks are to be applied. When an Ansible playbook (a set of instructions) is executed on the control node, Ansible uses SSH to establish connections with the managed nodes, transfer the necessary files and data, and then execute the specified tasks on those nodes. This allows for centralized management and automation of infrastructure and applications across multiple systems, making it easier to deploy, configure, and maintain complex environments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*V5vogrl_12suTO2Z8c4SLA.png" /></figure><p>We don’t need to tell the ansible about the type of O.S. That work will be done by the Ansible Intelligence. We just need to tell the location of other O.S or the I.P of the O.S for which we make a small database in which we store all the I.P’s. In ansible, this database is technically known as inventory. Inventory can be made statically as well as dynamically. Static inventory means manually typing the I.P’s into the inventory and dynamically means our I.P’s will be fetched automatically.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b035f5e521c5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unlocking the Mathematics of Machine Learning (Day 1)]]></title>
            <link>https://medium.com/@neelayambalkar/unlocking-the-mathematics-of-machine-learning-day-1-7ca4662c5b11?source=rss-9aace297ecee------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ca4662c5b11</guid>
            <dc:creator><![CDATA[Neelayambalkar]]></dc:creator>
            <pubDate>Sat, 06 Apr 2024 11:50:08 GMT</pubDate>
            <atom:updated>2024-04-06T12:09:19.283Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xNtIAJV0TEoC2aFgYRrdow.png" /></figure><h3><strong>Why Calculus?</strong></h3><p>In the academic setting, many students often view the study of calculus as a means to pass examinations, without fully grasping its practical applications in the real world. However, the reality is that calculus is a fundamental tool that is extensively utilized to address a wide range of real-world problems. To develop innovative solutions or invent new technologies, a deep understanding of calculus is often a prerequisite. This is because calculus provides the mathematical framework to analyze the rate of change, optimization, and the behavior of complex systems — all of which are critical in solving real-world challenges.Whether it’s modelling the growth of a business, optimizing the design of an engineering system, or predicting the trajectory of a satellite, calculus serves as the foundation for leveraging technology to address these problems. By studying the principles of differentiation, integration, and the analysis of functions, practitioners can derive insights that lead to optimized, data-driven solutions. Let me explain it with the help of some examples:</p><ol><li>Let’s say that there is a company known as Netflix who is paying to AWS Cloud for taking 100GB of Storage daily, and let’s say for this Netflix is paying to AWS around 100$(Just an example). But through calculus, what we found is that at some point of time the data written will never exceed some critical point i.e the maxima. Let me make it simple. Data which will be written to the storage provided by AWS, will have certain speed with which it is being written. <strong>So, if we find the derivative of this speed with respect to time, through the resulting equation we will be able to analyze what exactly is happening in the storage at that exact point of time. This is the beauty of calculus.</strong> <strong>It can tell us that any point of time, how is something changing with respect to the time.</strong> And through this, we can identify the maximum storage required at any point of time i.e the maxima. And let’s say the maxima comes out to be less than 100GB storage at any point of time, automatically the cost which Netflix was paying to AWS will get reduced. This is the optimal solution which netflix required.</li><li>In the market, we already have a chat model available through which we are chatting with each other and now the market has reached to the another level of chatting i.e the chatgpt. Here, calculus has optimized this thing to such a way that we are spending our valuable amount of time with a chatbot where not much of our time is wasted and we invest our time in a more efficient and a quick way in our daily life.</li></ol><h3>But, before implementing calculus using python, we need to understand some algebra in mathematics as well as in python.</h3><p>I will be using Sympy library of python to understand the basic algebra required for Calculus.</p><p>Let’s first understand a function in terms of mathematics as well as python.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/472/1*vLU6krzrmc-YWuvxIaOm5g.png" /></figure><p>In the above equation, we know that we will get the value of y by substituting some value of x due to which y is known as dependent variable and x is known as independent variable. Also, y is directly proportional to x. But in python, till the time we don’ t import sympy library, python will interpret these variable as a programming language variable and not a mathematical expression variable. Ofcourse, any programming language wont understand mathematical expression or it’s variables, this is the reason we are using sympy library in our case.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*N9OuIO5_Ym3mcqNjk4wEBw.png" /></figure><p>As, we know that for the above equation, y is the output variable and we also know that the above equation can be solved only with respect to x, which is the reason we can also write y as f(x). But, in programming language such as python, () these brackets act as parentheses so we dont write f(x), instead we write only fx.</p><p>Let’s have a look at some other use of sympy library:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/697/1*owxE9Om3tKVXGudhyvKZMQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3NbcSQmKA2yqbEWjISQsig.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BACRHAPgGiyRNs0RWubb8A.png" /></figure><p>Let’s also plot some graphs:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*m1oh8W_KH1A4qt1pOM3tKQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*SU3wcLD5hlcVzHVgxxfskQ.png" /></figure><p>In the above example of graph, I have provided a <strong>domain of values to t</strong> for which <strong>f(t) is getting some range of values. </strong>And this range of values or domain of vlues is known as <strong>limit in calculus.</strong></p><p>But,note that it’s not a good practice to use sympy library to plot graphs. Generally, in real world use cases, we use matplotlib.</p><h3>Now, let’s get back to calculus again with another amazing example:</h3><p>Let’s say we have an app, and day by day the traffic to the app is increasing exponentially. Some day our app might crash due to the excessive load. To prevent this, we will take help of calculus again. We will say to the calculus that, hey calculus will you pls tell me that any point of time how is the traffic to my app changing with respect to the time. Calculus will tell us and thus we will improve our app’s capability to sustain the load. Again, calculus provided us with an optimal solution.</p><p>Now, that we have got some brief idea that how calculus is helping us to invent something new or to innovative the things, let’s see how actually the calculus does it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/517/1*-eHmznKqZ8hvMcLercrLmQ.png" /></figure><p>Calculus, basically does it in 2 ways. First, it will break the mathematical function[f(t)] into small pieces[f’(t),f’’(t)…..] and observe how that smaller piece of function is behaving or how is it changing with respect to time i.e called as the <strong>derivative function</strong> and then finally it will integrate all the small pieces and solve some bigger and complex problem. This method can also be said as <strong>Divide and Conquer</strong> method of solving problems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OPv_7Y9bKEzJlpJMFVmOUw.png" /></figure><p>Derivative function is also known as prime function. Derivative function has a very important property of finding out the critical point i.e the maxima. This is the reason it is important to differentiate the main function first.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ca4662c5b11" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS cloud & its benefits to some companies]]></title>
            <link>https://medium.com/@neelayambalkar/aws-cloud-its-benefits-to-some-companies-ad683ad1a22c?source=rss-9aace297ecee------2</link>
            <guid isPermaLink="false">https://medium.com/p/ad683ad1a22c</guid>
            <category><![CDATA[benefits-to-companies]]></category>
            <category><![CDATA[meta]]></category>
            <category><![CDATA[use-cases]]></category>
            <category><![CDATA[canvas]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Neelayambalkar]]></dc:creator>
            <pubDate>Thu, 03 Aug 2023 02:58:04 GMT</pubDate>
            <atom:updated>2023-08-03T02:58:04.392Z</atom:updated>
            <content:encoded><![CDATA[<p>Amazon Web Services (AWS) is a cloud computing platform provided by Amazon. It offers a wide range of cloud services that cater to businesses of all sizes, from startups to large enterprises.</p><p>Some of the key benefits AWS brings to companies include:</p><ol><li>Cost Savings: AWS operates on a pay-as-you-go model, allowing companies to only pay for the resources they use. This eliminates the need for large upfront capital investments in hardware and infrastructure, reducing operational costs.</li><li>Scalability: AWS offers the ability to scale up or down resources based on demand. This elasticity allows companies to handle fluctuations in traffic, ensuring optimal performance during peak periods while minimizing costs during low-activity periods.</li><li>Flexibility and Customization: With a vast array of services and configurations, companies can tailor their infrastructure to meet specific needs. This flexibility empowers businesses to create customized solutions and experiment with different technologies easily.</li><li>Global Reach: AWS has a widespread global network of data centers, enabling companies to deploy their applications and services close to their users worldwide. This reduces latency and improves the overall user experience.</li><li>Reliability and High Availability: AWS boasts a robust infrastructure with built-in redundancy and backup mechanisms. This ensures high availability and reliability for critical applications, minimizing the risk of downtime and data loss.</li><li>Security: AWS adheres to stringent security protocols, including encryption, access controls, and compliance certifications. This helps companies safeguard their data and applications, meeting regulatory requirements and industry standards.</li><li>Managed Services: AWS provides a wide range of managed services, allowing companies to focus on their core competencies while leaving tasks like database management, machine learning, and content delivery to AWS experts.</li><li>Innovation and Speed: AWS constantly introduces new services and features, providing companies with access to the latest technologies without the need for extensive research and development efforts.</li><li>Easy Integration: AWS services are designed to work well together, facilitating seamless integration and allowing companies to build complex architectures with ease.</li><li>Developer-Friendly: AWS offers extensive documentation, SDKs, and tools that make it easy for developers to work with their services and speed up the development process.</li></ol><p>I have listed about 2 companies which use AWS to provide their service to customers:</p><p><strong>Canva in AWS</strong></p><p>Introduction:<br>The global visual communication platform Canva launched in Australia in 2013. It makes professional quality design accessible to over 85 million users in 190 countries via a simple-to-use interface, templates, stock content, and drag-and-drop options. Canva builds on Amazon Web Services (AWS) to scale and deliver a consistent, personalized application experience for its millions of users, enhance enterprise security and compliance, and improve global collaboration. AWS has been its preferred cloud for its free and Pro versions since its inception. In 2022 using AWS, it launched Canva for Teams to empower teams of all sizes to create and collaborate more effectively. Leveraging storage, compute, machine learning, and security solutions from AWS, Canva continues to scale seamlessly to meet rising global user demand and fulfill its mission to democratize design.</p><p>Canva relies on Amazon Elastic Compute Cloud (Amazon EC2) G3 instances for image processing. G3 instances are optimized for graphics-intensive applications, with powerful GPU capacity. In Canva’s case, G3 instances support the app’s filtering function, to prepare filtered images for export. “We couldn’t run Canva without these instances,” Tyrrell says. “The users wouldn’t be able to download their designs containing filtered images.”</p><p>Amazon Simple Storage Service (Amazon S3) is another cornerstone product in Canva’s operation. The company stores a huge amount of data in Amazon S3, which also serves as a data lake. Recently, engineers have begun developing machine learning functions as part of the application, and having a central storage area simplifies the flow of data for analysis. “Amazon S3 is an incredibly reliable service,” says Tyrrell. “It does what it says, and you don’t need to think about storage or growing it. You just write files and it reliably clears them. Having a massive storage area in Amazon S3 and being able to quickly process that data in one place has been very useful for us.”</p><p>Canva also takes advantage of Amazon Mechanical Turk (MTurk) to train its machine learning models, which are developed using open source technology such as Spark or Presto running on AWS. The company uses machine learning to provide recommendations for image search results within the Canva app, as well as to bump up Canva images during searches on other sites. Tyrrell explains, “For example, when someone does a search for a dog on another site, we want to make sure that Canva has the best image of that dog. We have been using Amazon Mechanical Turk to rate and score those images.”</p><p><strong>META</strong></p><p>Before deploying their services on AWS (Amazon Web Services), Meta Platforms, Inc. operated their infrastructure through their own data centers and server farms. They maintained and managed their hardware and software systems, which required a substantial investment in terms of time, resources, and expertise.</p><p>Operating their infrastructure independently was manageable when they were smaller, but as their user base and service demands grew exponentially, it became challenging to efficiently scale and manage their resources. To address these challenges, many tech companies, including Meta Platforms, eventually transitioned to cloud computing platforms like AWS.</p><p>AWS offers a range of scalable and flexible cloud services, including computing power, storage, and databases, which companies can utilize on a pay-as-you-go basis. This allows businesses to focus more on their core services and applications rather than spending time and resources on infrastructure management.</p><p>Transitioning to AWS or any cloud service provider allows companies to take advantage of a more reliable, scalable, and cost-effective infrastructure. It also enables them to quickly adapt to changing demands and easily expand their services to cater to a global user base.</p><p>Meta was founded as Facebook Inc. in 2004, and the company owns Facebook, WhatsApp, and Instagram, as well as other products and services, and has more than 3.6 billion active users. Meta has close to 1,000 AWS accounts and over 100 workloads ranging from artificial intelligence workloads to running websites, all done in the cloud. The company has a robust internal infrastructure to support its applications, but for some custom workloads, its developers needed the cloud.</p><p>In April 2020, Meta created its Cloud Foundation team, a centralized management team for the large variety of workloads. A major goal of Meta’s Cloud Foundation team was to provide service and product developers with the same experience, whether developing on internal infrastructure or AWS. Meta started its AWS journey while it worked to standardize purposeful security for developers regardless of their workloads.</p><p>To gain visibility into diverse developer workloads, Meta uses AWS Config, which continually assesses, audits, and evaluates the configurations and relationships of resources on AWS, on premises, and on other clouds. Using AWS Config, the company validates the configuration of its resources. Meta wanted to create a secure-by-design framework to handle threat detection, security, and compliance across these diverse teams and did so in a four-step process using AWS. “We solve a lot of security needs for all our users by default, which saves them a lot of time,” says Ekansh Grover, security engineer and tech lead for the Cloud Foundation Platform Team at Meta.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ad683ad1a22c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>