<?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"><channel><title><![CDATA[Vishnu's Blog]]></title><description><![CDATA[Technology and startup enthusiastic. Learning to lead optimised life.
I write about system design, databases, microservices, backend development, developer tool]]></description><link>https://vishnuc.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Fri, 25 Sep 2026 03:14:43 GMT</lastBuildDate><atom:link href="https://vishnuc.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Merge PDF Files Free in Your Browser (No Uploads)]]></title><description><![CDATA[Every few weeks I need to merge PDFs. Last month it was an invoice and its payment receipt; this week it was three chapters of a spec someone emailed me separately. And every time, the top search resu]]></description><link>https://vishnuc.hashnode.dev/merge-pdf-files-free-in-your-browser-no-uploads</link><guid isPermaLink="true">https://vishnuc.hashnode.dev/merge-pdf-files-free-in-your-browser-no-uploads</guid><category><![CDATA[tools]]></category><category><![CDATA[Developer]]></category><category><![CDATA[pdf]]></category><category><![CDATA[Productivity]]></category><category><![CDATA[privacy]]></category><dc:creator><![CDATA[vishnu chilamakuru]]></dc:creator><pubDate>Sun, 06 Sep 2026 16:36:56 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/5f3017c91f45b574e72453bd/d52beb2b-defa-454a-8322-b6e5e2e2be27.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Every few weeks I need to merge PDFs. Last month it was an invoice and its payment receipt; this week it was three chapters of a spec someone emailed me separately. And every time, the top search results are sites that want me to upload my documents to their server, solve a CAPTCHA, and then wait while a "free tier" progress bar decides my fate.</p>
<p>I built a merge PDF tool that does the opposite: <a href="https://ilovedevtools.com/merge-pdf">ilovedevtools.com/merge-pdf</a> runs entirely in your browser. Your files never leave your machine. Let me show you how it works and why I think that matters.</p>
<h2>What it does</h2>
<p>It's the classic merge: you add two or more PDFs, arrange them in the order you want, and get one combined PDF out. Under the hood it uses pdf-lib, a JavaScript library, running locally in your browser tab. There's no backend. Check your browser's network tab while you use it if you don't believe me — nothing goes out.</p>
<h2>How to merge two PDFs (invoice + receipt example)</h2>
<p>Say you're expensing a purchase and finance wants one file: invoice first, receipt second.</p>
<ol>
<li><p>Open <a href="https://ilovedevtools.com/merge-pdf">ilovedevtools.com/merge-pdf</a>.</p>
</li>
<li><p>Drag both PDFs onto the drop zone. Only <code>application/pdf</code> files are accepted, so you can't accidentally mix in a stray screenshot.</p>
</li>
<li><p>Drag the file previews to reorder them. Files merge left to right in the order shown, so put the invoice first.</p>
</li>
<li><p>Hit <strong>Merge PDFs</strong>. You'll see a summary like "2 files merged into one 4-page PDF" before anything downloads.</p>
</li>
<li><p>Confirm and download <code>merged.pdf</code>.</p>
</li>
</ol>
<p>That confirmation step is small but I've grown to like it. You see exactly what you're about to save before it lands in your Downloads folder.</p>
<h2>Why client-side matters for this tool</h2>
<p>Merging is the tool people reach for with their most sensitive documents. Think about what actually gets merged:</p>
<ul>
<li><p><strong>Contracts and NDAs</strong> with terms you're legally bound to.</p>
</li>
<li><p><strong>Invoices and receipts</strong> that contain your name, address, and payment details.</p>
</li>
<li><p><strong>Application packets</strong> — scans of IDs, payslips, bank statements for a rental or visa application.</p>
</li>
</ul>
<p>The last one is the scary one. People routinely email combined ID-and-payslip packets to strangers, and then turn around and upload those same files to a random PDF website with no idea where the servers are or how long files are retained. Some sites delete after an hour. Some say they do, and you have no way to verify it.</p>
<p>With a client-side tool, there's nothing to trust. The file is read into memory with the File API, merged with pdf-lib, and written back out as a Blob your browser downloads. The page doesn't even have a server to send it to. It works offline once the page has loaded, and it works on a plane.</p>
<h2>Use cases I actually hit</h2>
<ul>
<li><p><strong>Combining scanned pages</strong> from a flatbed scanner that saves each page as a separate PDF (why do they all do this?).</p>
</li>
<li><p><strong>Assembling a job application</strong>: cover letter, CV, portfolio excerpt, one file instead of three attachments.</p>
</li>
<li><p><strong>Monthly bookkeeping</strong>: merge that month's receipts into a single PDF named after the month, attach to one email, done.</p>
</li>
</ul>
<h2>Honest limitations</h2>
<ul>
<li><p>Password-protected PDFs can't be read, so you'll need to unlock or remove the password first (my Unlock PDF tool handles the restriction-only kind — more below).</p>
</li>
<li><p>Corrupted or oddly-structured PDFs may fail to load; the tool will tell you rather than produce a broken file.</p>
</li>
<li><p>There's no per-page selection or interleaving. If you need page 3 of file A between pages 1 and 2 of file B, extract those pages first with the Extract PDF Pages tool, then merge.</p>
</li>
<li><p>Everything runs in your browser's memory, so merging a few hundred megabytes of scans at once depends on your machine. A modern laptop handles a lot, but it's not a server farm.</p>
</li>
<li><p>Output is always named <code>merged.pdf</code> — rename it yourself after download.</p>
</li>
</ul>
<h2>More free browser tools</h2>
<p>All of these run 100% client-side too:</p>
<ul>
<li><p><a href="https://ilovedevtools.com/split-pdf">Split PDF</a> — break a merged document back into parts, as a zip.</p>
</li>
<li><p><a href="https://ilovedevtools.com/sign-pdf">Sign PDF</a> — draw or type a signature and place it on any page.</p>
</li>
<li><p><a href="https://ilovedevtools.com/unlock-pdf">Unlock PDF</a> — remove restriction-only protection from PDFs that open without a password.</p>
</li>
</ul>
<p>No accounts, no uploads, no watermarks stamped on your output. That's the whole deal.</p>
]]></content:encoded></item><item><title><![CDATA[Unlocking the Power of Generative AI: Transforming Multiple Domains with Intelligent Creativity]]></title><description><![CDATA[Introduction
Generative AI is more than just a buzzword, it's a groundbreaking technology that's reshaping the way we interact with the world. From creating stunning artworks to diagnosing diseases, Generative AI is making waves across multiple domai...]]></description><link>https://vishnuc.hashnode.dev/power-of-generative-ai</link><guid isPermaLink="true">https://vishnuc.hashnode.dev/power-of-generative-ai</guid><category><![CDATA[generative ai]]></category><category><![CDATA[llm]]></category><category><![CDATA[AI]]></category><category><![CDATA[Artificial Intelligence]]></category><category><![CDATA[creativity]]></category><dc:creator><![CDATA[vishnu chilamakuru]]></dc:creator><pubDate>Sat, 20 Jul 2024 05:56:46 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1721453979469/8fab2841-dbf3-45a9-b9d9-fab45c0ba5e5.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-introduction">Introduction</h2>
<p>Generative AI is more than just a buzzword, it's a groundbreaking technology that's reshaping the way we interact with the world. From creating stunning artworks to diagnosing diseases, Generative AI is making waves across multiple domains. In this blog post, we'll explore what Generative AI is and delve into its transformative applications in various industries.</p>
<h2 id="heading-what-is-generative-ai"><strong>What is Generative AI?</strong></h2>
<p>Generative AI refers to a subset of artificial intelligence that focuses on creating new content. Unlike traditional AI, which is designed to recognise patterns and make decisions based on existing data, Generative AI can produce new data that mimics the characteristics of the original dataset.</p>
<p>It can create new, original content, such as text, images, music, or videos, based on patterns and structures learned from existing data. These systems use algorithms to generate novel outputs that are often indistinguishable from those created by humans, making them useful for applications like art, entertainment, and even scientific discovery.This is achieved through advanced algorithms like Generative Adversarial Networks (GANs) and Variational Auto encoders (VAEs).</p>
<p>Generative AI works by training two neural networks: a generator and a discriminator. The generator creates new data, while the discriminator evaluates it against real data. Through this adversarial process, the generator improves its ability to produce realistic data over time. This technology has opened up new possibilities in various fields, from generating realistic images and videos to creating synthetic data for research and development.</p>
<h3 id="heading-large-language-models-llms"><strong>Large Language Models (LLMs)</strong></h3>
<p>Large Language Models (LLMs) are a specific type of Generative AI designed to understand and generate human-like text. These models, such as OpenAI's GPT-4, are trained on vast amounts of text data and can perform a wide range of language-related tasks, including</p>
<ul>
<li><p>Text translation</p>
</li>
<li><p>Text summarisation</p>
</li>
<li><p>Content creation</p>
</li>
<li><p>Text Categorisation</p>
</li>
<li><p>Image/Video Content Extraction</p>
</li>
</ul>
<p>LLMs have revolutionised natural language processing (NLP) and are being used in numerous applications across different industries.</p>
<h2 id="heading-applications-of-generative-ai-in-various-domains"><strong>Applications of Generative AI in Various Domains</strong></h2>
<h3 id="heading-healthcare"><strong>Healthcare</strong></h3>
<p>Generative AI is revolutionising healthcare by enabling the creation of synthetic medical data, which can be used for research and training without compromising patient privacy. It also aids in drug discovery by simulating molecular structures and predicting their interactions.</p>
<p><strong>Example 1:</strong> Researchers at Insilico Medicine used Generative AI to identify potential new drugs for fibrosis, significantly speeding up the drug discovery process.</p>
<p><strong>Example 2:</strong> IBM Watson Health employs Generative AI to create synthetic patient data for training machine learning models, enhancing the accuracy of diagnostic tools.</p>
<h3 id="heading-finance">Finance</h3>
<p>In the financial sector, Generative AI is used to detect fraudulent activities by generating synthetic transaction data to train more robust fraud detection systems. It also helps in algorithmic trading by simulating market conditions and testing trading strategies.</p>
<p><strong>Example 1:</strong> JPMorgan uses Generative AI to create synthetic data for stress testing financial models, ensuring they can withstand various economic scenarios.</p>
<p><strong>Example 2:</strong> Mastercard uses Generative AI to generate synthetic transaction data, improving the accuracy of their fraud detection algorithms.</p>
<h3 id="heading-art-and-entertainment">Art and Entertainment</h3>
<p>Generative AI is making a significant impact in the creative industries by generating music, art, and even scripts. Artists and creators use these tools to push the boundaries of their creativity and produce unique works.</p>
<p><strong>Example 1:</strong> The AI-generated painting <em>"Portrait of Edmond de Belamy"</em> was auctioned at Christie's for $432,500, showcasing the potential of AI in the art world.</p>
<p><strong>Example 2:</strong> OpenAI's MuseNet can compose original music in various styles, from classical to contemporary, demonstrating the creative potential of Generative AI in music.</p>
<h3 id="heading-marketing-and-advertising">Marketing and Advertising</h3>
<p>In marketing, Generative AI is used to create personalised content and advertisements. By analysing consumer data, AI can generate tailored marketing messages that resonate with individual preferences, leading to higher engagement rates.</p>
<p><strong>Example 1:</strong> Coca-Cola used Generative AI to create personalised video ads for its "Share a Coke" campaign, resulting in a significant increase in customer engagement.</p>
<p><strong>Example 2:</strong> The North Face leverages Generative AI to create personalised product recommendations and marketing content, enhancing the customer shopping experience.</p>
<h3 id="heading-education">Education</h3>
<p>Generative AI is transforming education by creating personalized learning experiences. It can generate customized educational content, quizzes, and even tutor students based on their learning pace and style.</p>
<p><strong>Example 1:</strong> Duolingo uses Generative AI to create personalized language exercises, helping users learn more effectively.</p>
<p><strong>Example 2:</strong> Squirrel AI, an adaptive learning platform, employs Generative AI to tailor educational content to individual student needs, improving learning outcomes.</p>
<h3 id="heading-information-technology">Information Technology</h3>
<p>In the tech industry, Generative AI is used to automate code generation, enhance cybersecurity, and create realistic simulations for training and development.</p>
<p><strong>Example 1:</strong> GitHub Copilot, powered by OpenAI's Codex, assists developers by generating code snippets and suggesting improvements, streamlining the coding process.</p>
<p><strong>Example 2:</strong> NVIDIA uses Generative AI to create realistic virtual environments for training autonomous vehicles, improving the safety and efficiency of self-driving technology.</p>
<h2 id="heading-conclusion"><strong>Conclusion</strong></h2>
<p>Generative AI is a powerful tool that's transforming various industries by enabling the creation of new, innovative solutions. From healthcare to entertainment, its applications are vast and varied, offering endless possibilities for the future. As we continue to explore and develop this technology, the potential for Generative AI to revolutionise our world is truly limitless.</p>
]]></content:encoded></item><item><title><![CDATA[Kubernetes for Beginners: Nginx Deployment with Minikube]]></title><description><![CDATA[Introduction
Kubernetes is the go-to orchestration system for managing containerized applications across multiple hosts. It provides tools to deploy applications, scale them as needed, manage changes to existing containerized applications, and helps ...]]></description><link>https://vishnuc.hashnode.dev/kubernetes-for-beginners-nginx-deployment-with-minikube</link><guid isPermaLink="true">https://vishnuc.hashnode.dev/kubernetes-for-beginners-nginx-deployment-with-minikube</guid><category><![CDATA[Kubernetes]]></category><category><![CDATA[deployment]]></category><category><![CDATA[Docker]]></category><category><![CDATA[nginx]]></category><category><![CDATA[scalability]]></category><category><![CDATA[SRE]]></category><category><![CDATA[Beginner Developers]]></category><dc:creator><![CDATA[vishnu chilamakuru]]></dc:creator><pubDate>Fri, 24 Nov 2023 17:24:15 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1700845124057/a6795815-52ae-4c54-90ca-6eee221bbed1.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-introduction">Introduction</h1>
<p>Kubernetes is the go-to orchestration system for managing containerized applications across multiple hosts. It provides tools to deploy applications, scale them as needed, manage changes to existing containerized applications, and helps optimize the use of underlying hardware beneath your containers. Minikube is a tool that makes it easy to run Kubernetes locally. In this blog post, we'll walk through deploying a simple "Hello World" application using Nginx on Kubernetes with Minikube.</p>
<h1 id="heading-prerequisites">Prerequisites</h1>
<p>Before starting, ensure you have the following installed:</p>
<ul>
<li><p>Docker, for creating container images and running containers.</p>
</li>
<li><p>Minikube, for a local Kubernetes cluster.</p>
</li>
<li><p>kubectl, the command-line tool for interacting with Kubernetes.</p>
</li>
</ul>
<h1 id="heading-step-1-setting-up-minikube">Step 1: Setting Up Minikube</h1>
<p>Minikube simplifies the initial setup of a Kubernetes cluster:</p>
<pre><code class="lang-bash">minikube start
</code></pre>
<p>Verify that Minikube is properly set up by running:</p>
<pre><code class="lang-bash">minikube status
</code></pre>
<h1 id="heading-step-2-creating-your-nginx-container">Step 2: Creating Your Nginx Container</h1>
<p>Create a Dockerfile for your Nginx "Hello World" application.</p>
<pre><code class="lang-dockerfile"><span class="hljs-keyword">FROM</span> nginx:alpine
<span class="hljs-keyword">COPY</span><span class="bash"> ./index.html /usr/share/nginx/html/index.html</span>
</code></pre>
<p>Here's a simple <code>index.html</code> to serve:</p>
<pre><code class="lang-bash">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Hello World&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Hello World from Nginx!&lt;/h1&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
<p>Build and tag the Docker image, then push it to your Docker registry</p>
<pre><code class="lang-bash">docker build -t hello-nginx:latest .
</code></pre>
<p>Note: If using Minikube's Docker daemon, you don't need to push the image to a registry.</p>
<h1 id="heading-step-3-writing-the-kubernetes-deployment-file">Step 3: Writing the Kubernetes Deployment File</h1>
<p>Create a <strong>deployment.yaml</strong> file that tells Kubernetes how to create and manage your application's instances.</p>
<pre><code class="lang-yaml"><span class="hljs-attr">apiVersion:</span> <span class="hljs-string">apps/v1</span>
<span class="hljs-attr">kind:</span> <span class="hljs-string">Deployment</span>
<span class="hljs-attr">metadata:</span>
  <span class="hljs-attr">name:</span> <span class="hljs-string">hello-nginx</span>
<span class="hljs-attr">spec:</span>
  <span class="hljs-attr">replicas:</span> <span class="hljs-number">2</span>
  <span class="hljs-attr">selector:</span>
    <span class="hljs-attr">matchLabels:</span>
      <span class="hljs-attr">run:</span> <span class="hljs-string">hello-nginx</span>
  <span class="hljs-attr">template:</span>
    <span class="hljs-attr">metadata:</span>
      <span class="hljs-attr">labels:</span>
        <span class="hljs-attr">run:</span> <span class="hljs-string">hello-nginx</span>
    <span class="hljs-attr">spec:</span>
      <span class="hljs-attr">containers:</span>
      <span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">hello-nginx</span>
        <span class="hljs-attr">image:</span> <span class="hljs-string">hello-nginx:latest</span>
        <span class="hljs-attr">ports:</span>
        <span class="hljs-bullet">-</span> <span class="hljs-attr">containerPort:</span> <span class="hljs-number">80</span>
</code></pre>
<p>Deploy your application to Kubernetes using <code>kubectl</code>.</p>
<pre><code class="lang-bash">kubectl apply -f deployment.yaml
</code></pre>
<h1 id="heading-step-4-accessing-your-application">Step 4: Accessing Your Application</h1>
<p>To make your application accessible, expose it via a service.</p>
<pre><code class="lang-bash">kubectl expose deployment hello-nginx --<span class="hljs-built_in">type</span>=NodePort --port=80
</code></pre>
<p>Retrieve the URL to access your Nginx application:</p>
<pre><code class="lang-bash">minikube service hello-nginx --url
</code></pre>
<h1 id="heading-step-5-scaling-your-deployment">Step 5: Scaling Your Deployment</h1>
<p>You can easily scale the number of replicas in your deployment:</p>
<pre><code class="lang-bash">kubectl scale deployment hello-nginx --replicas=3
</code></pre>
<p>Check the status of your scaled deployment:</p>
<pre><code class="lang-bash">kubectl get deployment hello-nginx
</code></pre>
<h1 id="heading-step-6-cleaning-up">Step 6: Cleaning Up</h1>
<p>Once you are done, you can delete the service and deployment:</p>
<pre><code class="lang-bash">kubectl delete service hello-nginx
</code></pre>
<p>And stop Minikube with:</p>
<pre><code class="lang-bash">minikube stop
</code></pre>
<h1 id="heading-conclusion">Conclusion</h1>
<p>This guide provided a straightforward walkthrough for setting up a Kubernetes cluster with Minikube, deploying a simple "Hello World" Nginx application, and scaling it. Kubernetes’ ability to handle this deployment process showcases the power and flexibility of the platform. Whether you're a developer new to containerization or an operations engineer looking to automate your deployments, Kubernetes and Minikube together offer a robust toolset for managing containerized applications.</p>
<h2 id="heading-local-development-vs-production-environments">Local Development vs. Production Environments</h2>
<p>It's important to note that Minikube is intended for local development, learning, and testing purposes. Its ease of setup and use provides a great sandbox for individuals to experiment with Kubernetes and understand its features without the overhead of a full-scale deployment.</p>
<p>For production environments, where reliability, scalability, and security are paramount, enterprise-grade solutions are recommended. Services like AWS Elastic Kubernetes Service (EKS), Google Kubernetes Engine (GKE), or Azure Kubernetes Service (AKS) offer managed Kubernetes experiences which handle much of the complexity and operational overhead. These services provide robust, scalable, and secure infrastructure to run your containerized applications in the cloud.</p>
<p>By starting with Minikube, you build a solid foundation that will aid in understanding how Kubernetes operates at a larger scale in a cloud environment. As you transition from a local to a production environment, you'll be able to appreciate the full potential of Kubernetes and how it can be leveraged to meet the demands of your applications and services.</p>
<p>Remember, the journey into Kubernetes is as rewarding as it is challenging. The skills you develop while managing and scaling your applications will be invaluable as you move towards cloud-native development and operations</p>
]]></content:encoded></item><item><title><![CDATA[Everything You Should Know About How Kubernetes Works]]></title><description><![CDATA[Introduction
‍Kubernetes is an open-source orchestration software for deploying, managing, and scaling containers. Modern applications are increasingly built using containers, which are microservices packaged with their dependencies and configuration...]]></description><link>https://vishnuc.hashnode.dev/kubernetes-fundamentals-every-developer-should-know</link><guid isPermaLink="true">https://vishnuc.hashnode.dev/kubernetes-fundamentals-every-developer-should-know</guid><category><![CDATA[Kubernetes]]></category><category><![CDATA[containers]]></category><category><![CDATA[Devops]]></category><category><![CDATA[Developer]]></category><category><![CDATA[scalability]]></category><category><![CDATA[Docker]]></category><dc:creator><![CDATA[vishnu chilamakuru]]></dc:creator><pubDate>Thu, 23 Nov 2023 16:44:53 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1700757683646/ef9f0754-ebc2-4a8e-84c3-1a0e5da10a5e.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-introduction">Introduction</h1>
<p>‍<a target="_blank" href="https://kubernetes.io/">Kubernetes</a> is an open-source orchestration software for deploying, managing, and scaling containers. Modern applications are increasingly built using containers, which are microservices packaged with their dependencies and configurations. Kubernetes (pronounced "koo-ber-net-ees") is open-source software for deploying and managing those containers at scale and it’s also the Greek word for helmsmen of a ship or pilot. Build, deliver, and scale containerized apps faster with Kubernetes sometimes referred to as "<strong>k8s</strong>" or "<strong>k-eights</strong>".</p>
<h1 id="heading-what-is-container-orchestration">What is container orchestration?</h1>
<p>Container orchestration is the automation of much of the operational effort required to run containerized workloads and services. This includes a wide range of things software teams need to manage a container’s lifecycle, including provisioning, deployment, scaling (up and down), networking, load balancing, and more.</p>
<p>While containers are a very effective way of running your applications, there is one major challenge associated with them which is container orchestration. They need a solution to run in a production environment. The idea is to continuously monitor and manage these containers to ensure continuity of services. Some of the checks involved with this management include ensuring that the system is fine and is not experiencing any downtime. This process of running and scaling containers in the production environment becomes quite a tricky option.</p>
<p>Kubernetes was introduced as a solution to this particular complex problem. It helps you manage the distributed container system effectively, running and scaling the containers while taking care of downtime easily. It provides advantages based on load balancing, storage orchestration, configuration management, automated rollouts, etc...</p>
<p>In this article, we will discuss the core functionality of Kubernetes and how effectively it can be used as a service for orchestrating and managing many containers.</p>
<h1 id="heading-why-do-you-need-to-understand-kubernetes">Why do you need to understand Kubernetes?</h1>
<p>Kubernetes or K8S provides several key features that allow us to run immutable infrastructure. Containers can be killed, replaced, and self-heal automatically, and the new container gets access to those support volumes, secrets, configurations, etc., that make it function.</p>
<p>The following features of K8S help to manage containers and also make your containerized application scale efficiently:</p>
<ul>
<li><p><strong>Service discovery and load balancing</strong> - Containers get their own IP so you can put a set of containers behind a single DNS name for load balancing.</p>
</li>
<li><p><strong>Storage orchestration</strong> - Automatically mount local or public cloud or network storage.</p>
</li>
<li><p><strong>Secret and configuration management</strong> - Create and update secrets and configs without rebuilding your image.</p>
</li>
<li><p><strong>Self-healing</strong> - The platform heals many problems like restarting failed containers, replacing and rescheduling containers as nodes die, killing containers that don’t respond to your user-defined health check, and waiting to advertise containers to clients until they’re ready.</p>
</li>
<li><p><strong>Batch execution</strong> - Manage your batch and Continuous Integration workloads and replace failed containers.</p>
</li>
<li><p><strong>Automatic bin packing</strong> - Automatically schedules containers based on resource requirements and other constraints.</p>
</li>
<li><p><strong>Automated rollouts and rollbacks</strong> - Roll out changes that monitor the health of your application thereby ensuring all instances don't go down simultaneously. If something goes wrong, K8S automatically rolls back the change.</p>
</li>
<li><p><strong>Horizontal scaling</strong> - Scale your application by launching more instances of your application as needed from the command line or UI.</p>
</li>
</ul>
<h1 id="heading-kubernetes-core-components">Kubernetes Core Components</h1>
<p>Kubernetes gives you the platform to schedule and run containers on clusters of physical or virtual machines. Kubernetes architecture divides a cluster into components that work together to maintain the cluster's defined state.</p>
<p><img src="https://d33wubrfki0l68.cloudfront.net/2475489eaf20163ec0f54ddc1d92aa8d4c87c96b/e7c81/images/docs/components-of-kubernetes.svg" alt="Kubernetes Architecture" /></p>
<h2 id="heading-clusters">Clusters</h2>
<p>A Kubernetes cluster is a set of node machines for running containerized applications. You can visualize a Kubernetes cluster as two parts:</p>
<ol>
<li><p>The control plane</p>
</li>
<li><p>The compute machines or nodes.</p>
</li>
</ol>
<p>Each node is its own Linux environment and could be either a physical or virtual machine. Each node runs pods, which are made up of containers.</p>
<h3 id="heading-control-plane">Control Plane</h3>
<p>The control plane's components make global decisions about the cluster (for example, scheduling), as well as detecting and responding to cluster events (for example, starting up a new pod when a deployment's replicas field is unsatisfied). Below are the components of the Control Plane.</p>
<p><strong>API Server</strong></p>
<p>The API server is a component of the Kubernetes control plane that exposes the Kubernetes API. The API server is the front end for the Kubernetes control plane.</p>
<p>The main implementation of a Kubernetes API server is <a target="_blank" href="https://kubernetes.io/docs/reference/generated/kube-apiserver/">kube-apiserver</a>. kube-apiserver is designed to scale horizontally-that is, it scales by deploying more instances. You can run several instances of kube-apiserver and balance traffic between those instances.</p>
<p><strong>Etcd</strong></p>
<p><code>etcd</code> is the consistent and highly available key-value store used as Kubernetes backing store for all cluster data. If your Kubernetes cluster uses <code>etcd</code> as its backing store, make sure you have a backup plan for those data.</p>
<p>You can find in-depth information about etcd in the official <a target="_blank" href="https://etcd.io/docs/">documentation</a>.</p>
<p><strong>Kube Controller Manager</strong></p>
<p>This Control plane component runs the controller processes. Logically, each controller is a separate process, but to reduce complexity, they are all compiled into a single binary and run in a single process. Some types of these controllers are:</p>
<ul>
<li><p><strong>Node controller</strong> - Responsible for noticing and responding when nodes go down.</p>
</li>
<li><p><strong>Job controller</strong> - Watches for Job objects that represent one-off tasks, then creates Pods to run those tasks to completion.</p>
</li>
<li><p><strong>Endpoints controller</strong> - Populates the Endpoints object (that is, joins Services &amp; Pods).</p>
</li>
<li><p><strong>Service Account &amp; Token controllers</strong> - Create default accounts and API access tokens for new namespaces.</p>
</li>
</ul>
<p><strong>Cloud Controller Manager</strong></p>
<p>This control plane component embeds cloud-specific control logic. The cloud controller manager lets you link your cluster into your cloud provider's API, and separates out the components that interact with that cloud platform from components that only interact with your cluster.</p>
<p>The cloud-controller-manager only runs controllers that are specific to your cloud provider. If you are running Kubernetes on your own premises, or in a learning environment inside your own PC, the cluster does not have a cloud controller manager. The following controllers can have cloud provider dependencies:</p>
<ul>
<li><p><strong>Node controller</strong> - This is used for checking the cloud provider to determine if a node has been deleted in the cloud after it stops responding</p>
</li>
<li><p><strong>Route controller</strong> - This is used for setting up routes in the underlying cloud infrastructure</p>
</li>
<li><p><strong>Service controller</strong> - This is used for creating, updating, and deleting cloud provider load balancers</p>
</li>
</ul>
<h3 id="heading-nodes">Nodes</h3>
<p>Node components run on every node, maintaining running pods and providing the Kubernetes runtime environment</p>
<p><strong>kubelet</strong></p>
<p>An agent that runs on each node in the cluster. It makes sure that containers are running in a Pod. It ensures that the containers described are running and healthy.</p>
<p><strong>kube-proxy</strong></p>
<p>It maintains network rules on nodes. These network rules allow network communication to your Pods from network sessions inside or outside of your cluster.</p>
<h2 id="heading-deploying-an-application">Deploying an Application</h2>
<p>A Kubernetes deployment is a resource object in Kubernetes that provides declarative updates to applications. A deployment allows you to describe an application’s life cycle, such as which images to use for the app, the number of pods there should be, and the way in which they should be updated.</p>
<p>The process of manually updating containerized applications can be time-consuming and tedious. A Kubernetes deployment makes this process automated and repeatable. Deployments are entirely managed by the Kubernetes backend, and the whole update process is performed on the server-side without client interaction.</p>
<p>The Kubernetes deployment object lets you:</p>
<ul>
<li><p>Deploy a replica set or pod</p>
</li>
<li><p>Update pods and replica sets</p>
</li>
<li><p>Rollback to previous deployment versions</p>
</li>
<li><p>Scale a deployment</p>
</li>
<li><p>Pause or continue a deployment</p>
</li>
</ul>
<h2 id="heading-access-control">Access Control</h2>
<p><img src="https://d33wubrfki0l68.cloudfront.net/673dbafd771491a080c02c6de3fdd41b09623c90/50100/images/docs/admin/access-control-overview.svg" alt="Controlling Access to Kubernetes API" /></p>
<p>Users access the Kubernetes API using <code>kubectl</code>, client libraries, or by making REST requests. Both human users and Kubernetes service accounts can be authorized for API access. When a request reaches the API, it goes through the following stages</p>
<p><strong>Authentication</strong></p>
<p>The input to the authentication step is the entire HTTP request; however, it typically examines the headers and/or client certificates. Authentication modules include client certificates, passwords, and plain tokens, bootstrap tokens, and JSON Web Tokens. Multiple authentication modules can be specified, in which case each one is tried in sequence until one of them succeeds.</p>
<p>If the request cannot be authenticated, it is rejected with HTTP status code 401. Otherwise, the user is authenticated as a specific <code>username</code> for further stages.</p>
<p><strong>Authorization</strong></p>
<p>A request must include the <code>username</code> of the requester, the requested action, and the object affected by the action. The request is authorized if an existing policy declares that the user has permission to complete the requested action.</p>
<p>Example :</p>
<ul>
<li><p>If Bob makes a request to write (create or update) to the objects in the <code>development</code> namespace, his authorization is denied if his role is not allowed in the update/create policy.</p>
</li>
<li><p>If Bob makes a request to read (get) objects in a different namespace such as <code>production</code>, then his authorization is denied.</p>
</li>
</ul>
<p>Kubernetes supports multiple authorization modules, such as ABAC mode, RBAC (Role-Based Access Control) Mode, and Webhook mode. If all of the modules deny the request, then the request is denied (HTTP status code 403).</p>
<p><strong>Admission control</strong></p>
<p>Admission Control modules are software modules that can modify or reject requests. In addition to the attributes available to Authorization modules, Admission Control modules can access the contents of the object that is being created or modified. Unlike Authentication and Authorization modules, if any admission controller module rejects, then the request is immediately rejected.</p>
<h2 id="heading-secret-management">Secret Management</h2>
<p>Kubernetes Secrets are secure objects which store sensitive data, such as passwords, OAuth tokens, and SSH keys, etc. with encryption in your clusters. Using Secrets gives you more flexibility in a Pod Life cycle definition and control over how sensitive data is used. It reduces the risk of exposing the data to unauthorized users.</p>
<p>Kubernetes <code>etcd</code> is the consistent and highly available key-value store used for storing Kubernetes secrets. Below are few characteristics of Kubernetes Secret</p>
<ul>
<li><p>Secrets are namespaced objects.</p>
</li>
<li><p>Secrets can be mounted as data volumes or environment variables to be used by a container in a pod.</p>
</li>
<li><p>Secret data is stored in <code>tmpfs</code> in nodes</p>
</li>
<li><p>API server stores secrets as plain text in <code>etcd</code></p>
</li>
<li><p>A per-secret size limit of 1MB</p>
</li>
</ul>
<h2 id="heading-scheduler">Scheduler</h2>
<p><code>kube-scheduler</code> is the control plane component that watches for newly created Pods with no assigned node, and selects a node for them to run on. The Scheduler is responsible for the scheduling of containers across the nodes in the cluster.</p>
<p>Factors taken into account for scheduling decisions include</p>
<ul>
<li><p>Individual and collective resource requirements</p>
</li>
<li><p>Hardware/Software/policy constraints like CPU, Memory, etc...</p>
</li>
<li><p>Data locality</p>
</li>
<li><p>Inter-workload interference</p>
</li>
</ul>
<h2 id="heading-minikube">Minikube</h2>
<p>Minikube is a tool that lets you run Kubernetes locally. <code>minikube</code> runs a single-node Kubernetes cluster on your personal computer (including Windows, macOS, and Linux PCs) so that you can try out Kubernetes, or for daily development work.</p>
<p>You can follow the official <a target="_blank" href="https://minikube.sigs.k8s.io/docs/start/">Get Started!</a> guide if you want to install this tool. Once minikube is installed you are now ready to run a virtualized single-node cluster on your local machine.</p>
<p>You can start your <code>minikube</code> cluster with</p>
<pre><code class="lang-shell">minikube start
</code></pre>
<p>Interacting with Kubernetes clusters is mostly done via the kubectl CLI. You can install the kubectl CLI on your machine by using the <a target="_blank" href="https://kubernetes.io/docs/tasks/tools/install-kubectl/">official installation instructions</a>.</p>
<h1 id="heading-conclusion">Conclusion</h1>
<p>Even though containers are a very effective way of running your applications, container orchestration is the major challenge associated with them. Kubernetes exactly addresses this challenge and simplifies the container orchestration with features like Service discovery and load balancing, Horizontal scaling, Ease of deployment, Configuration and secrets management, Scheduler, Network rules management, providing access control based on different environments, users, and roles.</p>
<p>Companies across the world are now putting in a lot of effort to run their apps on the Kubernetes platform. One of the primary reasons for this is that with this platform, you can reduce the time it takes to deploy on the market. This can be attributed to more efficient app development efficiencies. In effect, it also paves the way for IT cost optimization. Another important reason why companies are putting in an effort to run their application on Kubernetes is its improved scalability as it is known for automatically scaling and improving app performances.</p>
]]></content:encoded></item><item><title><![CDATA[Using Geospatial Queries in MySQL]]></title><description><![CDATA[Introduction
Geospatial data, or data that represents a location on the Earth's surface, is becoming increasingly prevalent in today's data-driven world. To effectively work with geospatial data, databases need to have the ability to perform geospati...]]></description><link>https://vishnuc.hashnode.dev/using-geospatial-queries-in-mysql</link><guid isPermaLink="true">https://vishnuc.hashnode.dev/using-geospatial-queries-in-mysql</guid><category><![CDATA[Programming Blogs]]></category><category><![CDATA[Databases]]></category><category><![CDATA[MySQL]]></category><category><![CDATA[Geospatial]]></category><category><![CDATA[Beginner Developers]]></category><dc:creator><![CDATA[vishnu chilamakuru]]></dc:creator><pubDate>Thu, 02 Feb 2023 11:16:10 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1675336433607/c04e572e-15c7-4da8-a90d-d7fe710e7871.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-introduction">Introduction</h2>
<p>Geospatial data, or data that represents a location on the Earth's surface, is becoming increasingly prevalent in today's data-driven world. To effectively work with geospatial data, databases need to have the ability to perform geospatial queries, which allow users to search, filter and analyze this data based on location. In this blog post, we will focus on implementing geospatial queries in MySQL, one of the most popular open-source relational databases.</p>
<h3 id="heading-1enabling-geospatial-support-in-mysql">1.Enabling Geospatial Support in MySQL</h3>
<p>MySQL does not have built-in geospatial support, but it can be enabled through the installation of a plugin called "MySQL Spatial Extensions." This plugin adds a set of geospatial data types and functions that allow for the creation and querying of geospatial data. To install the plugin, you can run the following command:</p>
<pre><code class="lang-sql"><span class="hljs-keyword">INSTALL</span> <span class="hljs-keyword">PLUGIN</span> mysql_no_login <span class="hljs-keyword">SONAME</span> <span class="hljs-string">'libgeometry.so'</span>;
</code></pre>
<h3 id="heading-2creating-a-geospatial-table-in-mysql">2.Creating a Geospatial Table in MySQL</h3>
<p>To create a geospatial table in MySQL, you will need to specify the geospatial data type for each column that will contain geospatial data. Some common geospatial data types in MySQL include POINT, LINESTRING, and POLYGON.</p>
<p>Here is an example of how you can create a table to store restaurant locations:</p>
<pre><code class="lang-sql"><span class="hljs-keyword">CREATE</span> <span class="hljs-keyword">TABLE</span> restaurants (
  <span class="hljs-keyword">id</span> <span class="hljs-built_in">INT</span> PRIMARY <span class="hljs-keyword">KEY</span> AUTO_INCREMENT,
  <span class="hljs-keyword">name</span> <span class="hljs-built_in">VARCHAR</span>(<span class="hljs-number">255</span>),
  location POINT
);
</code></pre>
<h3 id="heading-3indexing-geospatial-data-in-mysql">3.Indexing Geospatial Data in MySQL</h3>
<p>To improve query performance, it is recommended to create a spatial index on the geospatial column. This can be done by using the following syntax:</p>
<pre><code class="lang-sql"><span class="hljs-keyword">ALTER</span> <span class="hljs-keyword">TABLE</span> restaurants <span class="hljs-keyword">ADD</span> SPATIAL <span class="hljs-keyword">INDEX</span> (location);
</code></pre>
<h3 id="heading-4performing-geospatial-queries-in-mysql">4.Performing Geospatial Queries in MySQL</h3>
<p>Once the geospatial data has been indexed, it can be queried using geospatial functions. Some common geospatial functions in MySQL include ST_Distance, ST_Within, and ST_Contains.</p>
<p>Here is an example of how you can find all restaurants within a certain radius of a location:</p>
<pre><code class="lang-sql"><span class="hljs-keyword">SELECT</span> * <span class="hljs-keyword">FROM</span> restaurants <span class="hljs-keyword">WHERE</span> ST_DWithin(location, POINT(longitude, latitude), radius);
</code></pre>
<h3 id="heading-5other-databases-supporting-geospatial-queries">5.Other Databases Supporting Geospatial Queries</h3>
<p>MySQL is not the only database that supports geospatial queries. Other popular databases that support geospatial queries include:</p>
<ul>
<li><p>PostgreSQL with PostGIS extension</p>
</li>
<li><p>Microsoft SQL Server with spatial data types and functions</p>
</li>
<li><p>Oracle with Spatial and Graph option</p>
</li>
<li><p>MongoDB with native support for geospatial data and indexing</p>
</li>
</ul>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Geospatial queries allow databases to effectively work with geospatial data, enabling users to perform location-based analysis and search operations. Implementing geospatial queries in MySQL requires enabling geospatial support through the installation of a plugin and creating a geospatial table with the proper data types and indexes. Whether you are working with real estate data, tracking delivery trucks, or mapping out locations, geospatial queries provide a powerful tool for analyzing and understanding location-based data.</p>
]]></content:encoded></item><item><title><![CDATA[Mastering Database Indexing: A Comprehensive Guide]]></title><description><![CDATA[Introduction
Database indexing is a fundamental concept for optimizing the performance of database queries. It enables faster data retrieval by providing a quick way to look up specific rows of data in a table. In this blog post, we will take a deep ...]]></description><link>https://vishnuc.hashnode.dev/mastering-database-indexing-a-comprehensive-guide</link><guid isPermaLink="true">https://vishnuc.hashnode.dev/mastering-database-indexing-a-comprehensive-guide</guid><category><![CDATA[Beginner Developers]]></category><category><![CDATA[Databases]]></category><category><![CDATA[indexing]]></category><category><![CDATA[MySQL]]></category><category><![CDATA[Developer]]></category><dc:creator><![CDATA[vishnu chilamakuru]]></dc:creator><pubDate>Wed, 25 Jan 2023 09:15:38 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1674638054485/bc4df0e1-4a61-4030-bc88-c1a22bebcc7a.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-introduction">Introduction</h2>
<p>Database indexing is a fundamental concept for optimizing the performance of database queries. It enables faster data retrieval by providing a quick way to look up specific rows of data in a table. In this blog post, we will take a deep dive into the world of database indexing, including the different types of indexes, the benefits of indexing, and best practices for indexing your database.</p>
<h2 id="heading-what-is-an-index">What is an Index?</h2>
<p>An index is a data structure that improves the performance of database queries by providing quick access to specific rows of data in a table. It works by creating a copy of the data in a specific order, making it easy to find specific rows of data. Indexes can be thought of as an extra layer of organization on top of the data stored in a table.</p>
<h2 id="heading-why-use-indexes">Why Use Indexes?</h2>
<p>Without an index, a database must scan the entire table to find the specific rows of data requested in a query. This can be slow when the table has a large number of rows. Indexes improve the performance of queries by allowing the database to quickly find the specific rows of data requested in a query without having to scan the entire table. This can lead to significant performance improvements, especially for large tables or tables with a large number of rows.</p>
<h2 id="heading-types-of-indexes">Types of Indexes</h2>
<p>Several types of indexes can be used in a database. The most common types of indexes are:</p>
<ul>
<li><p><strong>B-tree index</strong>: This is the most common type of index and is used in most relational databases. B-tree indexes are efficient for both small and large tables and are well-suited for equality and range queries.</p>
</li>
<li><p><strong>Hash index</strong>: This type of index is used primarily for equality queries on a small number of columns. Hash indexes are faster than B-tree indexes for equality queries but are not efficient for range queries.</p>
</li>
<li><p><strong>Bitmap index</strong>: This type of index is used to efficiently find specific rows of data in a table with a large number of columns. Bitmap indexes are efficient for both equality and range queries but are not well-suited for large tables.</p>
</li>
<li><p><strong>Clustered index</strong>: This type of index determines the physical order of the data in a table. Each table can have only one clustered index.</p>
</li>
</ul>
<h2 id="heading-creating-indexes">Creating Indexes</h2>
<p>To create an index in a database, you must specify the name of the index, the name of the table that the index will be created on, and the columns that will be included in the index. The syntax for creating an index will vary depending on the type of database you are using. Here is an example of how to create an index in a MySQL database:</p>
<pre><code class="lang-bash">CREATE INDEX index_name ON table_name (column1, column2);
</code></pre>
<p>It is important to note that indexing can also hurt performance if done excessively or inappropriately, so it's crucial to carefully select the columns that need to be indexed and avoid indexing columns that are rarely used in queries.</p>
<h2 id="heading-maintenance">Maintenance</h2>
<p>Indexes require maintenance to keep them up-to-date and efficient. When a table is modified (rows are inserted, updated, or deleted), the corresponding index must be updated as well. This is known as index maintenance. If the index is not maintained properly, it can lead to poor performance.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>In this blog post, we've discussed the basics of database indexing and why it's an important aspect of database management. We've also shown how to implement an index and the importance of proper index selection. By understanding and implementing proper indexing, you can greatly improve the performance of your database queries and ensure efficient data retrieval.</p>
]]></content:encoded></item><item><title><![CDATA[Chmod Command Cheatsheet: Understanding and Using File Permissions in Linux]]></title><description><![CDATA[Introduction:
One of the most important concepts in Linux is file permissions. It's what allows you to control who can read, write, and execute files and directories on your system. The chmod (change mode) command is used to change the permissions of...]]></description><link>https://vishnuc.hashnode.dev/chmod-command-cheatsheet-understanding-and-using-file-permissions-in-linux</link><guid isPermaLink="true">https://vishnuc.hashnode.dev/chmod-command-cheatsheet-understanding-and-using-file-permissions-in-linux</guid><category><![CDATA[Developer]]></category><category><![CDATA[Beginner Developers]]></category><category><![CDATA[Linux]]></category><category><![CDATA[Programming Blogs]]></category><category><![CDATA[Devops]]></category><dc:creator><![CDATA[vishnu chilamakuru]]></dc:creator><pubDate>Sat, 21 Jan 2023 19:19:19 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1674328456467/151f9bd9-5ebe-4ddc-bcc1-05864dd270c8.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-introduction">Introduction:</h2>
<p>One of the most important concepts in Linux is file permissions. It's what allows you to control who can read, write, and execute files and directories on your system. The <code>chmod</code> (change mode) command is used to change the permissions of files and directories in Linux. It's a powerful command, and mastering it can be a bit tricky, especially for new Linux users. In this post, we'll go over a <code>chmod</code> command cheatsheet with examples to help you understand and use file permissions in Linux.</p>
<h3 id="heading-what-is-chmod">What is <code>chmod</code>?</h3>
<p>The <code>chmod</code> command is used to change the permissions of files and directories in Linux. It allows you to specify which users and groups can read, write, and execute a file or directory. The <code>chmod</code> command works by changing the mode of a file or directory. The mode is a set of three octal (numeric) digits that specify the permissions for the file's owner, group, and others.</p>
<h3 id="heading-permission-types">Permission Types:</h3>
<ul>
<li><p>r: read</p>
</li>
<li><p>w: write</p>
</li>
<li><p>x: execute</p>
</li>
</ul>
<h3 id="heading-permission-classes"><strong>Permission Classes:</strong></h3>
<ul>
<li><p>u: user (owner)</p>
</li>
<li><p>g: group</p>
</li>
<li><p>o: other</p>
</li>
<li><p>a: all (user, group, and other)</p>
</li>
</ul>
<h3 id="heading-syntax">Syntax:</h3>
<p>The basic syntax for <code>chmod</code> is:</p>
<pre><code class="lang-bash">chmod [permission] [file or directory]
</code></pre>
<p><strong>Numeric Notation:</strong></p>
<ul>
<li><p>The first digit represents the owner's permissions</p>
</li>
<li><p>The second digit represents the group's permissions</p>
</li>
<li><p>The third digit represents the permissions for others</p>
</li>
<li><p>Each digit can have a value between 0 and 7</p>
</li>
</ul>
<p>Examples:</p>
<pre><code class="lang-bash">chmod 755 file.txt  <span class="hljs-comment"># grants owner read, write and execute permissions and read, execute permissions for group and other</span>
chmod 744 file.txt  <span class="hljs-comment"># grants owner read, write permissions and read permissions for group and other</span>
chmod 700 file.txt  <span class="hljs-comment"># grants owner read, write and execute permissions, no permissions for group and other</span>
</code></pre>
<h3 id="heading-symbolic-notation">Symbolic Notation:</h3>
<ul>
<li><p>"+" adds a permission</p>
</li>
<li><p>"-" removes a permission</p>
</li>
<li><p>"=" sets the exact permissions</p>
</li>
</ul>
<p>Examples:</p>
<pre><code class="lang-bash">chmod u+rwx file.txt <span class="hljs-comment"># grants owner read, write, and execute permissions</span>
chmod g+rw file.txt <span class="hljs-comment"># grants group read and write permissions</span>
chmod o-r file.txt  <span class="hljs-comment"># removes read permissions for others</span>
chmod a=rw file.txt <span class="hljs-comment"># sets read and write permissions for owner, group and others</span>
</code></pre>
<h2 id="heading-conclusion">Conclusion:</h2>
<p>In this post, we've covered the basics of the <code>chmod</code> command, including its syntax, numeric notation, and symbolic notation. We've also provided examples of how to use the command to change file permissions in Linux. Remember that changing the permissions of important system files can cause issues with your system, so it's always recommended to back up any important files before modifying their permissions. With this cheat sheet, you should have a better understanding of how to use the <code>chmod</code> command to manage file permissions in Linux.</p>
]]></content:encoded></item><item><title><![CDATA[MongoDB vs MySQL: Which one is the best fit for your application?]]></title><description><![CDATA[Introduction:
When choosing a database management system, two of the most popular options are MongoDB and MySQL. Both are widely used and have their own strengths and weaknesses. In this post, we'll explore the differences between MongoDB and MySQL a...]]></description><link>https://vishnuc.hashnode.dev/mongodb-vs-mysql-which-one-is-the-best-fit-for-your-application</link><guid isPermaLink="true">https://vishnuc.hashnode.dev/mongodb-vs-mysql-which-one-is-the-best-fit-for-your-application</guid><category><![CDATA[Databases]]></category><category><![CDATA[MySQL]]></category><category><![CDATA[MongoDB]]></category><category><![CDATA[NoSQL]]></category><category><![CDATA[Developer]]></category><dc:creator><![CDATA[vishnu chilamakuru]]></dc:creator><pubDate>Thu, 19 Jan 2023 18:30:42 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1674151140331/3dd55b15-fc7a-46a7-be0c-3a9279f39ab6.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-introduction">Introduction:</h2>
<p>When choosing a database management system, two of the most popular options are MongoDB and MySQL. Both are widely used and have their own strengths and weaknesses. In this post, we'll explore the differences between MongoDB and MySQL and help you determine which one is the best fit for your needs.</p>
<h3 id="heading-1-data-modeling">1. Data Modeling</h3>
<p>One of the main differences between MongoDB and MySQL is the way they handle data modeling. MongoDB is a document-oriented database management system, which means that it stores data in a semi-structured format, similar to JSON.</p>
<p>On the other hand, MySQL is a relational database management system, which means that it stores data in a structured format using tables, rows, and columns.</p>
<h3 id="heading-2-scalability">2. Scalability</h3>
<p>Another important difference between MongoDB and MySQL is scalability. MongoDB is designed to scale horizontally, which means that it can easily handle a large amount of data by adding more servers to the database.</p>
<p>MySQL can also scale horizontally, but it may require more complex configuration and management. MongoDB also supports sharding, which allows you to split large collections of data across multiple servers.</p>
<h3 id="heading-3-performance">3. Performance</h3>
<p>When it comes to performance, both MongoDB and MySQL have their own strengths. MongoDB is known for its high performance when it comes to read and write operations on large datasets. This is because it stores data in a single document, which allows for faster querying and indexing.</p>
<p>MySQL, on the other hand, is known for its high performance when it comes to complex queries and joins. This is because it stores data in multiple tables, which allows for more efficient querying and indexing of structured data.</p>
<h3 id="heading-4-indexing">4. Indexing</h3>
<p>MongoDB supports indexing on any field in a document, and it also supports full-text search. MySQL supports indexing on any column in a table, and it also supports full-text search. However, MongoDB's indexing is more flexible, as it allows for indexing on any field, whereas MySQL's indexing is more structured, as it only allows for indexing on specific columns.</p>
<h3 id="heading-5-acid-compliance">5. ACID Compliance</h3>
<p>MySQL is fully ACID (Atomicity, Consistency, Isolation, Durability) compliant, which means that it guarantees that database transactions will be atomic, consistent, isolated, and durable. MongoDB, on the other hand, is not fully ACID compliant, but it does support atomic transactions at the document level.</p>
<h3 id="heading-6-data-types">6. Data Types</h3>
<p>MySQL supports a wide range of data types, such as integers, strings, and dates, whereas MongoDB only supports a limited set of data types, such as strings and numbers.</p>
<h3 id="heading-7-replication">7. Replication</h3>
<p>Both MongoDB and MySQL support replication, which allows you to create multiple copies of your data for redundancy and high availability. However, MongoDB's replication is more flexible, as it allows you to create a replica set, which is a group of servers that maintain copies of the same data.</p>
<p>MySQL's replication is more structured, as it only allows you to create a master-slave setup, where one server acts as the master and one or more servers act as slaves.</p>
<h3 id="heading-8-sharding">8. Sharding</h3>
<p>MongoDB supports sharding, which allows for horizontal scaling by splitting large collections of data across multiple servers. MySQL does not support sharding.</p>
<h3 id="heading-9-auto-sharding">9. Auto-Sharding</h3>
<p>MongoDB supports auto-sharding, which automatically distributes data across multiple servers. MySQL does not support auto-sharding.</p>
<h3 id="heading-10-geospatial-indexing">10. Geospatial Indexing</h3>
<p>MongoDB supports geospatial indexing, which allows for efficient querying of data based on geographic location. MySQL does not support geospatial indexing.</p>
<h2 id="heading-conclusion">Conclusion:</h2>
<p>MongoDB and MySQL are both powerful and popular database management systems, but they have their own strengths and weaknesses. MongoDB excels in flexible data modeling, scalability, and read and write operations on large datasets. MySQL is better for complex queries and joins, and is fully ACID compliant. By understanding the differences between MongoDB and MySQL, you can choose the right database management system for your needs and optimize your development process.</p>
]]></content:encoded></item><item><title><![CDATA[5 Open Source Code Editors for Enhancing Productivity]]></title><description><![CDATA[Choose the right code editor to enhance your productivity as a developer
A code editor is a must-have tool for any developer, and there are many open-source options available. These editors can enhance your productivity by providing features such as ...]]></description><link>https://vishnuc.hashnode.dev/5-open-source-code-editors-for-enhancing-productivity</link><guid isPermaLink="true">https://vishnuc.hashnode.dev/5-open-source-code-editors-for-enhancing-productivity</guid><category><![CDATA[Visual Studio Code]]></category><category><![CDATA[Sublime Text]]></category><category><![CDATA[Developer Tools]]></category><category><![CDATA[Developer]]></category><category><![CDATA[Beginner Developers]]></category><dc:creator><![CDATA[vishnu chilamakuru]]></dc:creator><pubDate>Thu, 19 Jan 2023 05:59:16 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1674107848754/726dbff1-6813-4d87-991a-fe5a892c3f0e.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Choose the right code editor to enhance your productivity as a developer</p>
<p>A code editor is a must-have tool for any developer, and there are many open-source options available. These editors can enhance your productivity by providing features such as syntax highlighting, code completion, and debugging tools. In this post, we'll explore the top 5 open-source code editors that can help you improve your productivity as a developer.</p>
<h3 id="heading-1-visual-studio-code">1. Visual Studio Code</h3>
<p>Visual Studio Code (VSCode) is a popular open-source code editor that is highly customizable and extendable. It has a wide range of features including syntax highlighting, code completion, and debugging tools. VSCode also has a large collection of extensions available that can add additional functionality, such as support for specific programming languages or debugging tools.</p>
<h3 id="heading-2-sublime-text">2. Sublime Text</h3>
<p>Sublime Text is a powerful and lightweight code editor that is known for its speed and ease of use. It has a minimalist user interface and offers features such as syntax highlighting, code completion, and multiple selections. Sublime Text also has a large collection of plugins and packages available that can add additional functionality.</p>
<h3 id="heading-3-atom">3. Atom</h3>
<p>Atom is a modern and open-source code editor that is highly customizable and extendable. It has a sleek and intuitive user interface, and it offers features such as syntax highlighting, code completion, and built-in package manager. Atom also has a large collection of packages available that can add additional functionality, such as support for specific programming languages or debugging tools.</p>
<h3 id="heading-4-notepad">4. Notepad++</h3>
<p>Notepad++ is a popular open-source code editor that is known for its speed and efficiency. It has a minimalist user interface and offers features such as syntax highlighting, code completion, and built-in support for multiple languages. Notepad++ also has a large collection of plugins available that can add additional functionality.</p>
<h3 id="heading-5-gnu-emacs">5. GNU Emacs</h3>
<p>GNU Emacs is a highly extensible and customizable code editor that has been around for decades. It offers features such as syntax highlighting, code completion, and built-in support for multiple languages. GNU Emacs also has a large collection of packages available that can add additional functionality, such as support for specific programming languages or debugging tools.</p>
<p><strong>Conclusion:</strong></p>
<p>Choosing the right code editor can greatly enhance your productivity as a developer. Visual Studio Code, Sublime Text, Atom, Notepad++ and GNU Emacs are some of the top open-source code editors that can help you work more efficiently and effectively. By mastering these editors, you can streamline your development process and deliver high-quality software on time.</p>
]]></content:encoded></item><item><title><![CDATA[Git Show Command Cheat Sheet]]></title><description><![CDATA[A Beginner's Guide for the 'git show' command
Git is a powerful version control system that allows developers to track and manage changes to their code. One of the most useful Git commands is git show, which allows you to view the details of a specif...]]></description><link>https://vishnuc.hashnode.dev/git-show-command-cheat-sheet</link><guid isPermaLink="true">https://vishnuc.hashnode.dev/git-show-command-cheat-sheet</guid><category><![CDATA[Git]]></category><category><![CDATA[GitHub]]></category><category><![CDATA[Beginner Developers]]></category><category><![CDATA[Developer]]></category><category><![CDATA[Git Commands]]></category><dc:creator><![CDATA[vishnu chilamakuru]]></dc:creator><pubDate>Wed, 18 Jan 2023 10:30:42 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1674025702234/509aeeba-5853-4fb4-a313-f94719fd2fc8.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>A Beginner's Guide for the 'git show' command</p>
<p>Git is a powerful version control system that allows developers to track and manage changes to their code. One of the most useful Git commands is <code>git show</code>, which allows you to view the details of a specific commit. In this post, we'll explore the <code>git show</code> command and provide a cheat sheet of some of the most commonly used options.</p>
<h3 id="heading-1-basic-usage">1. Basic Usage</h3>
<p>The basic usage of the <code>git show</code> command is to display the details of a specific commit. You can use the following syntax to view the details of a commit:</p>
<pre><code class="lang-bash">git show &lt;commit-hash&gt;
</code></pre>
<p>This command will display the commit message, the author, the date, and the changes made in the commit.</p>
<h3 id="heading-2-showing-changes">2. Showing Changes</h3>
<p>One of the most useful options of the <code>git show</code> command is the ability to view the changes made in a specific commit. You can use the following syntax to view the changes made in a commit:</p>
<pre><code class="lang-bash">git show &lt;commit-hash&gt; --<span class="hljs-built_in">stat</span>
</code></pre>
<p>This command will display a summary of the changes made in the commit, including the number of files changed and the number of lines added or removed.</p>
<h3 id="heading-3-showing-diffs">3. Showing Diffs</h3>
<p>Another useful option of the <code>git show</code> command is the ability to view the actual diffs (differences) made in a specific commit. You can use the following syntax to view the diffs made in a commit:</p>
<pre><code class="lang-bash">git show &lt;commit-hash&gt; --patch
</code></pre>
<p>This command will display the actual diffs made in the commit, including the lines added and removed.</p>
<h3 id="heading-4-showing-file-changes">4. Showing File Changes</h3>
<p>You can also use the <code>git show</code> command to view the changes made to a specific file in a specific commit. You can use the following syntax to view the changes made to a file:</p>
<pre><code class="lang-bash">git show &lt;commit-hash&gt; &lt;file-path&gt;
</code></pre>
<p>This command will display the changes made to the specified file in the specified commit.</p>
<h3 id="heading-5-showing-branch"><strong>5. Showing Branch</strong></h3>
<p>you can also use <code>git show</code> command to see the latest commit on a branch, you can use the following syntax</p>
<pre><code>git show &lt;branch-name&gt;
</code></pre><p><strong>Conclusion:</strong></p>
<p>The <code>git show</code> command is a powerful Git command that allows you to view the details of a specific commit. It's a useful tool for understanding the changes made to your code and for debugging. The basic usage, showing changes, showing diffs, showing file changes, and showing branch are some of the most commonly used options of the <code>git show</code> command. By mastering these options, you can quickly and easily view the details of specific commits in your Git repository.</p>
]]></content:encoded></item><item><title><![CDATA[Understanding the Fundamentals of System Design]]></title><description><![CDATA[System design is a crucial aspect of software development that involves the process of defining the architecture, components, interfaces, and data for a system to satisfy the specified requirements. It's essential to have a solid understanding of sys...]]></description><link>https://vishnuc.hashnode.dev/understanding-the-fundamentals-of-system-design</link><guid isPermaLink="true">https://vishnuc.hashnode.dev/understanding-the-fundamentals-of-system-design</guid><category><![CDATA[Developer]]></category><category><![CDATA[System Architecture]]></category><category><![CDATA[System Design]]></category><category><![CDATA[Beginner Developers]]></category><category><![CDATA[backend]]></category><dc:creator><![CDATA[vishnu chilamakuru]]></dc:creator><pubDate>Wed, 18 Jan 2023 06:08:21 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1674022017643/c839a287-d982-4e98-a085-c36e58e01b8b.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>System design is a crucial aspect of software development that involves the process of defining the architecture, components, interfaces, and data for a system to satisfy the specified requirements. It's essential to have a solid understanding of system design principles to create scalable, maintainable, and efficient systems. In this post, we'll explore the fundamentals of system design and some of the key considerations to keep in mind when designing a system.</p>
<h3 id="heading-1-identifying-the-requirements">1. Identifying the Requirements</h3>
<p>The first step in designing a system is to identify the requirements. This includes understanding the problem that the system is trying to solve, the users that will be interacting with the system, and the constraints that the system must operate within. It's essential to have a clear understanding of the problem to ensure that the system is designed to address it effectively.</p>
<h3 id="heading-2-scalability">2. Scalability</h3>
<p>Scalability is one of the most important considerations in system design. A system that can handle an increasing number of users and transactions without significant performance degradation is considered scalable. It's essential to design systems that can handle an increasing load without requiring significant changes to the underlying architecture.</p>
<h3 id="heading-3-high-availability">3. High availability</h3>
<p>High availability refers to the ability of a system to provide uninterrupted service to its users even in the event of failures. This is especially important in systems that need to be available 24/7, such as online retailers or financial systems. To achieve high availability, it's essential to design systems that can handle failures at different levels, such as hardware failures, network failures, and software bugs.</p>
<h3 id="heading-4-performance">4. Performance</h3>
<p>Performance is another critical consideration in system design. A system that can handle a high number of transactions or requests per second is considered to have good performance. It's essential to design systems that can handle the expected load in a timely manner to ensure a good user experience.</p>
<h3 id="heading-5-security">5. Security</h3>
<p>Security is an essential aspect of system design. Systems must be designed to protect against unauthorized access and data breaches. This includes implementing secure communication protocols, access controls, and encryption. It's essential to design systems that can prevent unauthorized access and protect sensitive data.</p>
<h3 id="heading-conclusion">Conclusion:</h3>
<p>System design is a complex process that involves understanding the problem that the system is trying to solve, the users that will be interacting with the system, and the constraints that the system must operate within. Scalability, high availability, performance, and security are some of the key considerations to keep in mind when designing a system. By keeping these principles in mind, you can create scalable, maintainable, and efficient systems that provide a good user experience.</p>
]]></content:encoded></item><item><title><![CDATA[4 NoSql document databases For your next application]]></title><description><![CDATA[The era of NoSql databases started in the late 2000s and since then the usage of NoSql databases gained support from multiple tech communities across the world starting from tech giants like Google, Amazon, Microsoft, etc... The usage of NoSql databa...]]></description><link>https://vishnuc.hashnode.dev/4-nosql-document-databases-for-your-next-application</link><guid isPermaLink="true">https://vishnuc.hashnode.dev/4-nosql-document-databases-for-your-next-application</guid><category><![CDATA[Open Source]]></category><category><![CDATA[Databases]]></category><category><![CDATA[MongoDB]]></category><category><![CDATA[Developer]]></category><category><![CDATA[NoSQL]]></category><dc:creator><![CDATA[vishnu chilamakuru]]></dc:creator><pubDate>Thu, 13 Oct 2022 14:43:51 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1665672099220/AIzvWlEbX.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The era of NoSql databases started in the late 2000s and since then the usage of NoSql databases gained support from multiple tech communities across the world starting from tech giants like Google, Amazon, Microsoft, etc... The usage of NoSql databases evolved very much over almost 2 decades mainly because of the following unique features</p>
<ol>
<li>Flexible Schema</li>
<li>Fast &amp; Flexible Querying</li>
<li>Horizontal Scalability</li>
<li>Ease of use </li>
</ol>
<h2 id="heading-what-is-a-document-database">What is a Document Database?</h2>
<p>There are four types of NoSQL databases like Document Databases, Wide-column databases, Key-Value databases &amp; Graph databases.</p>
<p><strong>Document Databases</strong> store data in a similar structure as JSON objects. Each document is equivalent to a database row in a traditional SQL database. </p>
<p>Each document contains keys and values. Value can be of any type ranging from <em>string, number, boolean, array, or another nested object</em>. In this article, I will list 4 popular NoSQL document databases which can be used to evaluate for your next application.</p>
<ul>
<li><a class="post-section-overview" href="#mongodb">MongoDB</a></li>
<li><a class="post-section-overview" href="#amazon-dynamodb">Amazon DynamoDB</a></li>
<li><a class="post-section-overview" href="#couchdb">CouchDB</a></li>
<li><a class="post-section-overview" href="#couchbase">Couchbase</a></li>
</ul>
<h2 id="heading-mongodb">MongoDB</h2>
<p><img src="https://webimages.mongodb.com/_com_assets/cms/kuzt9r42or1fxvlq2-Meta_Generic.png" alt="mongodb" /></p>
<p><a target="_blank" href="https://www.mongodb.com/">MongoDB</a> is one of the most popular NoSQL document databases which stores data in the form of <em>collections</em> and <em>documents</em>, instead of using tables and rows as in relational databases. It is completely implemented in C++ and developed by MongoDB, Inc in 2009. It has Open Source License. </p>
<p>Below are some of the key features of MongoDB</p>
<ul>
<li>Document Oriented - collections are equivalent to tables in a relational database. 
Each collection has a set of documents equivalent to a record in a relational database.</li>
<li>Schemaless Database - Documents do not need to have a schema defined beforehand and fields can be created instantly.</li>
<li>Indexing -  It supports primary and secondary indices on document fields which makes it easier to search and takes less time to fetch the data</li>
<li>Replication - It supports master/slave replication as well as Cluster mode replication. </li>
<li>Sharding - Supports data sharding </li>
<li>Load Balancing - Supports automatic load balancing based on the data stored in shards</li>
<li>Aggregation and Map reduce tools - Supports operations to query the grouped data and fetch the computed result.</li>
<li>Spatial DBMS - It has support for geo-spatial queries like radius search, bounding box search, etc...</li>
<li>Backup &amp; restore support</li>
<li>Security - Supports Role-Based Authorization</li>
</ul>
<h2 id="heading-amazon-dynamodb">Amazon DynamoDB</h2>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/01/dynamodb.png" alt="amazon dynamodb" /></p>
<p><a target="_blank" href="https://aws.amazon.com/dynamodb/">Amazon DynamoDB</a> is a NoSQL database that supports both Document oriented and Key Value data models. It is developed by Amazon in 2012 and has a commercial license. </p>
<p>Below are some of the key features of DynamoDB</p>
<ul>
<li>Document Oriented</li>
<li>Supports Key-Value storage</li>
<li>Schemaless Database</li>
<li>Sharding - Supports sharding via partitions</li>
<li>Indexing -  It supports primary and secondary indices on document fields</li>
<li>AWS ecosystem Support - Good Integration support with other AWS components like Lambda, AWS streams, Redshift, etc...</li>
<li>Backup &amp; restore support</li>
<li>Security - Supports Role-Based Authorization</li>
</ul>
<h2 id="heading-couchdb">CouchDB</h2>
<p><img src="https://blog.desdelinux.net/wp-content/uploads/2020/03/CouchDB-logo-1.png.webp" alt="couchdb" /></p>
<p><a target="_blank" href="https://couchdb.apache.org/">CouchDB</a> is a NoSQL Document data store developed by Apache Software Foundation in 2005 and has Open Source License. </p>
<p>Each document that is stored in the database is given a document-level unique identifier <code>_id</code> as well as a revision <code>_rev</code> number for each change that is made and saved to the database.</p>
<p>Below are some of the key features of CouchDB</p>
<ul>
<li>Document Oriented</li>
<li>Schemaless Database</li>
<li>Sharding</li>
<li>Indexing -  It supports primary and secondary indices on document fields</li>
<li>Aggregation and Map reduce tools - Supports operations to query the grouped data and fetch the computed result.</li>
<li>Spatial DBMS - It has support for geo-spatial queries like radius search, bounding box search, etc...</li>
<li>Browser-Based GUI - It has GUI called <code>Futon</code> which enables a browser-based GUI to handle your data, permission, and configurations.</li>
<li>Backup &amp; restore support</li>
<li>Security - Supports Role-Based Authorization</li>
</ul>
<h2 id="heading-couchbase">Couchbase</h2>
<p><img src="https://www.drupal.org/files/project-images/couchbasecicularlogoformarketing.gif" alt="couchbase" /></p>
<p><a target="_blank" href="https://www.couchbase.com/">Couchbase</a> is a NoSQL database that supports both Document oriented and Key Value data models. It is developed by Couchbase, Inc in 2011 and has Open Source License.</p>
<p>The data is stored in a Couchbase cluster using buckets. Buckets are isolated group records within a cluster. A bucket is the equivalent of a database. They provide a secure mechanism for organizing, managing, and analyzing data storage.</p>
<p>Documents are distributed uniformly across the cluster and stored in the buckets.</p>
<p>Couchbase has a built-in managed cache to enable a memory-first architecture. Read and write operations run at the speed of RAM.</p>
<p>Below are some of the key features of Couchbase</p>
<ul>
<li>Document Oriented</li>
<li>Schemaless Database</li>
<li>Sharding</li>
<li>Replication</li>
<li>Indexing -  It supports primary and secondary indices on document fields</li>
<li>Spatial DBMS - It has support for geo-spatial queries like radius search, bounding box search, etc...</li>
<li>Automatic Failover support in case any of the nodes in the cluster goes down</li>
<li>Backup &amp; restore support</li>
<li>Security - Supports Role-Based Authorization</li>
</ul>
<hr />

<h2 id="heading-thank-you-for-reading">Thank you for reading</h2>
<p>Hope you find these resources useful. If you like what you read and want to see more about system design, microservices, and other technology-related stuff... You can follow me on </p>
<ul>
<li><h4 id="heading-twitter-follow-vishnuchi">Twitter - <a href="https://twitter.com/vishnuchi?ref_src=twsrc%5Etfw" class="twitter-follow-button">Follow @vishnuchi</a></h4>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Binged: Your Movie Watch Tracker Built Using Ruby On Rails]]></title><description><![CDATA[I personally do watch Movies, Web series, TV shows, Sports, etc... The consumption of online video content increased drastically, especially during the pandemic considering more people working from home. In this post, I will explain how to build a ba...]]></description><link>https://vishnuc.hashnode.dev/binged-your-movie-watch-tracker-built-using-ruby-on-rails</link><guid isPermaLink="true">https://vishnuc.hashnode.dev/binged-your-movie-watch-tracker-built-using-ruby-on-rails</guid><category><![CDATA[Ruby on Rails]]></category><category><![CDATA[Ruby]]></category><category><![CDATA[Tutorial]]></category><category><![CDATA[Web Development]]></category><category><![CDATA[software development]]></category><dc:creator><![CDATA[vishnu chilamakuru]]></dc:creator><pubDate>Thu, 19 Aug 2021 08:19:18 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1629361718444/yrUXqSP-p.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I personally do watch Movies, Web series, TV shows, Sports, etc... The consumption of online video content increased drastically, especially during the pandemic considering more people working from home. In this post, I will explain how to build a basic Binge-Watch Tracker to track the progress of all your movies.</p>
<p>For this tutorial, I will be using</p>
<ul>
<li>Ruby 2.6.3</li>
<li>Rails 5.2.6</li>
<li>Bootstrap 5</li>
<li>SQLite Database</li>
</ul>
<p>But this step-by-step tutorial should work for the latest Ruby &amp; Rails versions as well.</p>
<h2 id="index">Index</h2>
<ul>
<li><a class="post-section-overview" href="#create-a-project">Create a project</a></li>
<li><a class="post-section-overview" href="#start-server">Start server</a></li>
<li><a class="post-section-overview" href="#create-model-controller-and-views">Create Model, Controller and Views</a></li>
<li><a class="post-section-overview" href="#database-migration">Database Migration</a></li>
<li><a class="post-section-overview" href="#change-application-root">Change Application Root</a></li>
<li><a class="post-section-overview" href="#integrate-bootstrap">Integrate Bootstrap</a></li>
<li><a class="post-section-overview" href="#add-navigation-bar">Add Navigation Bar</a></li>
<li><a class="post-section-overview" href="#add-movie-status-select-option">Add Movie status Select option</a></li>
<li><a class="post-section-overview" href="#styling-course-forms">Styling Course Forms</a></li>
</ul>
<h2 id="create-a-project">Create a project</h2>
<ul>
<li>Let's name our project as <code>binged</code> - The Binge-Watch Tracker</li>
</ul>
<pre><code class="lang-shell">rails new binged
</code></pre>
<p>This command will create a project <code>binged</code> with the following structure.</p>
<pre><code class="lang-shell">cd binged/
</code></pre>
<pre><code class="lang-shell">.
├── Gemfile
├── Gemfile.lock
├── README.md
├── Rakefile
├── app
├── bin
├── config
├── config.ru
├── db
├── lib
├── log
├── package.json
├── public
├── storage
├── test
├── tmp
└── vendor

11 directories, 6 files
</code></pre>
<h2 id="start-server">Start server</h2>
<ul>
<li>Run <code>rails server</code> or <code>rails s</code> (shortcut) to start the server and visit <a target="_blank" href="http://localhost:3000"><code>http://localhost:3000</code></a> in your browser. If there are no errors you will see the following screen.</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1622114422070/J3jCp5Oo8.png" alt="rails-start-server" /></p>
<h2 id="create-model-controller-and-views">Create Model, Controller, and Views</h2>
<p>Let's create a <code>Movie</code> Model and corresponding Controller using <code>rails scaffold</code>.</p>
<p>A scaffold in Rails is a full set of models, database migration for that model, a controller to manipulate it, views to view and manipulate the data, and a test suite for each of the above. Our <code>Movie</code> model will have the following fields</p>
<ul>
<li>title - string </li>
<li>image_url - string</li>
<li>trailer_url - string</li>
<li>movie_url - string</li>
<li>status - integer (As this will be an enum with values <code>yet_to_watch</code>, <code>watching</code>, <code>watched</code>)</li>
<li>release_date - datetime</li>
<li>watched_date - datetime</li>
</ul>
<pre><code class="lang-shell">rails g scaffold Movie title:string image_url:string trailer_url:string movie_url:string status:integer release_date:datetime watched_date:datetime
</code></pre>
<p>This will generate the following files with Course Model, Views &amp; Controller.</p>
<pre><code class="lang-shell">      invoke  active_record
      create    db/migrate/20210819042947_create_movies.rb
      create    app/models/movie.rb
      invoke    test_unit
      create      test/models/movie_test.rb
      create      test/fixtures/movies.yml
      invoke  resource_route
       route    resources :movies
      invoke  scaffold_controller
      create    app/controllers/movies_controller.rb
      invoke    erb
      create      app/views/movies
      create      app/views/movies/index.html.erb
      create      app/views/movies/edit.html.erb
      create      app/views/movies/show.html.erb
      create      app/views/movies/new.html.erb
      create      app/views/movies/_form.html.erb
      invoke    test_unit
      create      test/controllers/movies_controller_test.rb
      create      test/system/movies_test.rb
      invoke    helper
      create      app/helpers/movies_helper.rb
      invoke      test_unit
      invoke    jbuilder
      create      app/views/movies/index.json.jbuilder
      create      app/views/movies/show.json.jbuilder
      create      app/views/movies/_movie.json.jbuilder
      invoke  assets
      invoke    coffee
      create      app/assets/javascripts/movies.coffee
      invoke    scss
      create      app/assets/stylesheets/movies.scss
      invoke  scss
      create    app/assets/stylesheets/scaffolds.scss
</code></pre>
<h2 id="database-migration">Database Migration</h2>
<ul>
<li>Scaffold command also generated database migration for creating <code>Movie</code> table at <code>db/migrate/20210819042947_create_movies.rb</code></li>
</ul>
<pre><code class="lang-ruby"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">CreateMovies</span> &lt; ActiveRecord::Migration[5.2]</span>
  <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">change</span></span>
    create_table <span class="hljs-symbol">:movies</span> <span class="hljs-keyword">do</span> <span class="hljs-params">|t|</span>
      t.string <span class="hljs-symbol">:title</span>
      t.string <span class="hljs-symbol">:image_url</span>
      t.string <span class="hljs-symbol">:trailer_url</span>
      t.string <span class="hljs-symbol">:movie_url</span>
      t.integer <span class="hljs-symbol">:status</span>
      t.datetime <span class="hljs-symbol">:release_date</span>
      t.datetime <span class="hljs-symbol">:watched_date</span>

      t.timestamps
    <span class="hljs-keyword">end</span>
  <span class="hljs-keyword">end</span>
<span class="hljs-keyword">end</span>
</code></pre>
<ul>
<li>Let's execute database migration using <code>rails db:migrate</code> command.</li>
</ul>
<pre><code class="lang-shell">➜  binged git:(master) ✗ rails db:migrate
== 20210819042947 CreateMovies: migrating =====================================
-- create_table(:movies)
   -&gt; 0.0008s
== 20210819042947 CreateMovies: migrated (0.0008s) ============================
</code></pre>
<h2 id="change-application-root">Change Application Root</h2>
<ul>
<li>Now our migration is completed. Let's point our application home page to the <code>Movie#Index</code> page. </li>
<li>Update <code>config/routes.rb</code> to point root to course controller index action.</li>
</ul>
<pre><code class="lang-ruby">Rails.application.routes.draw <span class="hljs-keyword">do</span>
  resources <span class="hljs-symbol">:movies</span>
  root <span class="hljs-string">'movies#index'</span>
<span class="hljs-keyword">end</span>
</code></pre>
<h2 id="integrate-bootstrap">Integrate Bootstrap</h2>
<ul>
<li>Import Bootstrap CSS and dependent js files in <code>app/views/layouts/application.html.erb</code> </li>
</ul>
<pre><code class="lang-html"><span class="hljs-meta">&lt;!DOCTYPE <span class="hljs-meta-keyword">html</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">html</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">head</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">csrf_meta_tags</span> %&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">csp_meta_tag</span> %&gt;</span>

    <span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">stylesheet_link_tag</span>    '<span class="hljs-attr">application</span>', <span class="hljs-attr">media:</span> '<span class="hljs-attr">all</span>', '<span class="hljs-attr">data-turbolinks-track</span>'<span class="hljs-attr">:</span> '<span class="hljs-attr">reload</span>' %&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">javascript_include_tag</span> '<span class="hljs-attr">application</span>', '<span class="hljs-attr">data-turbolinks-track</span>'<span class="hljs-attr">:</span> '<span class="hljs-attr">reload</span>' %&gt;</span>

    <span class="hljs-comment">&lt;!-- Required meta tags --&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">meta</span> <span class="hljs-attr">charset</span>=<span class="hljs-string">"utf-8"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">meta</span> <span class="hljs-attr">name</span>=<span class="hljs-string">"viewport"</span> <span class="hljs-attr">content</span>=<span class="hljs-string">"width=device-width, initial-scale=1"</span>&gt;</span>

    <span class="hljs-comment">&lt;!-- Bootstrap CSS --&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">link</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css"</span> <span class="hljs-attr">rel</span>=<span class="hljs-string">"stylesheet"</span> <span class="hljs-attr">integrity</span>=<span class="hljs-string">"sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x"</span> <span class="hljs-attr">crossorigin</span>=<span class="hljs-string">"anonymous"</span>&gt;</span>

    <span class="hljs-tag">&lt;<span class="hljs-name">title</span>&gt;</span>Binged - Movie Tracker<span class="hljs-tag">&lt;/<span class="hljs-name">title</span>&gt;</span>

  <span class="hljs-tag">&lt;/<span class="hljs-name">head</span>&gt;</span>

  <span class="hljs-tag">&lt;<span class="hljs-name">body</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"container"</span>&gt;</span>
     <span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">yield</span> %&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
    <span class="hljs-comment">&lt;!-- Option 1: Bootstrap Bundle with Popper --&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/js/bootstrap.bundle.min.js"</span> <span class="hljs-attr">integrity</span>=<span class="hljs-string">"sha384-gtEjrD/SeCtmISkJkNUaaKMoLD0//ElJ19smozuHV6z3Iehds+3Ulb9Bn9Plx0x4"</span> <span class="hljs-attr">crossorigin</span>=<span class="hljs-string">"anonymous"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">body</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">html</span>&gt;</span>
</code></pre>
<h2 id="add-navigation-bar">Add Navigation Bar</h2>
<ul>
<li><p>Let's add a navigation bar to all pages. Adding this in the application layout will take care of loading the navigation bar on all web pages.</p>
</li>
<li><p>create file <code>app/views/layouts/_navbar.html.erb</code> with the following HTML content.</p>
</li>
</ul>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">style</span>&gt;</span><span class="css">
  <span class="hljs-selector-class">.theme-color</span> {
    <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#800080</span>;
  }
  <span class="hljs-selector-class">.theme-btn</span> {
    <span class="hljs-attribute">border-color</span>: <span class="hljs-number">#800080</span>;
  }
</span><span class="hljs-tag">&lt;/<span class="hljs-name">style</span>&gt;</span>

<span class="hljs-tag">&lt;<span class="hljs-name">nav</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"navbar navbar-expand-lg navbar-dark theme-color"</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"container-fluid"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"navbar-brand"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"/"</span>&gt;</span>Binged<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"navbar-toggler"</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"button"</span> <span class="hljs-attr">data-bs-toggle</span>=<span class="hljs-string">"collapse"</span> <span class="hljs-attr">data-bs-target</span>=<span class="hljs-string">"#navbarNavAltMarkup"</span> <span class="hljs-attr">aria-controls</span>=<span class="hljs-string">"navbarNavAltMarkup"</span> <span class="hljs-attr">aria-expanded</span>=<span class="hljs-string">"false"</span> <span class="hljs-attr">aria-label</span>=<span class="hljs-string">"Toggle navigation"</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"navbar-toggler-icon"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"collapse navbar-collapse"</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"navbarNavAltMarkup"</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"navbar-nav"</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-link active"</span> <span class="hljs-attr">aria-current</span>=<span class="hljs-string">"page"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"/movies"</span>&gt;</span>Movies<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
      <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">nav</span>&gt;</span>
</code></pre>
<ul>
<li>Now render this <code>navbar</code> in <code>app/views/layouts/application.html.erb</code> . Add <code>&lt;%= render 'layouts/navbar' %&gt;</code> in application layout <code>&lt;body&gt;</code> as follows.</li>
</ul>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">body</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">render</span> '<span class="hljs-attr">layouts</span>/<span class="hljs-attr">navbar</span>' %&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"container"</span>&gt;</span>
     <span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">yield</span> %&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
    ..
    ..
<span class="hljs-tag">&lt;/<span class="hljs-name">body</span>&gt;</span>
</code></pre>
<h2 id="add-movie-status-select-option">Add Movie status Select option</h2>
<p>We have the <code>status</code> field in the <code>Movie</code> Model. Now we want this to have only 2 values for this.</p>
<ul>
<li><code>yet_to_watch</code> - use this status if u are yet to watch the movie and it is on your wishlist.</li>
<li><code>watching</code> - use this status if u are currently watching the movie.</li>
<li><p><code>watched</code> - use this status if u already watched the movie.</p>
</li>
<li><p>Let's add <code>status</code> enum in <code>app/models/movie.rb</code> as follows.</p>
</li>
</ul>
<pre><code class="lang-ruby"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Movie</span> &lt; ApplicationRecord</span>
  enum <span class="hljs-symbol">status:</span> [<span class="hljs-symbol">:yet_to_watch</span>, <span class="hljs-symbol">:watching</span>, <span class="hljs-symbol">:watched</span>]
<span class="hljs-keyword">end</span>
</code></pre>
<ul>
<li>After adding the <code>status</code> field as <code>enum</code> now you can query <code>Movies</code> by <code>status</code> as follows which will query movies by status.</li>
</ul>
<pre><code class="lang-ruby">➜  binged <span class="hljs-symbol">git:</span>(master) ✗ rails c
Running via Spring preloader <span class="hljs-keyword">in</span> process <span class="hljs-number">78801</span>
Loading development environment (Rails <span class="hljs-number">5.2</span>.<span class="hljs-number">6</span>)
<span class="hljs-meta">irb(main):001:0&gt;</span> Movie.yet_to_watch
  Movie Load (<span class="hljs-number">0</span>.<span class="hljs-number">4</span>ms)  SELECT  <span class="hljs-string">"movies"</span>.* FROM <span class="hljs-string">"movies"</span> WHERE <span class="hljs-string">"movies"</span>.<span class="hljs-string">"status"</span> = ? LIMIT ?  [[<span class="hljs-string">"status"</span>, <span class="hljs-number">0</span>], [<span class="hljs-string">"LIMIT"</span>, <span class="hljs-number">11</span>]]
=&gt; #&lt;ActiveRecord::Relation []&gt;
<span class="hljs-meta">irb(main):002:0&gt;</span> Movie.watched
  Movie Load (<span class="hljs-number">0</span>.<span class="hljs-number">1</span>ms)  SELECT  <span class="hljs-string">"movies"</span>.* FROM <span class="hljs-string">"movies"</span> WHERE <span class="hljs-string">"movies"</span>.<span class="hljs-string">"status"</span> = ? LIMIT ?  [[<span class="hljs-string">"status"</span>, <span class="hljs-number">2</span>], [<span class="hljs-string">"LIMIT"</span>, <span class="hljs-number">11</span>]]
=&gt; #&lt;ActiveRecord::Relation []&gt;
</code></pre>
<ul>
<li>Update the <code>status</code> form field to <code>select</code> in <code>app/views/movies/_form.html.erb</code></li>
</ul>
<pre><code class="lang-ruby">  &lt;div <span class="hljs-class"><span class="hljs-keyword">class</span>="<span class="hljs-title">field</span>"&gt;</span>
    &lt;%= form.label <span class="hljs-symbol">:status</span> %&gt;
    &lt;%= form.select <span class="hljs-symbol">:status</span>, Movie.statuses.keys.map { <span class="hljs-params">|s|</span> [s.humanize, s]} %&gt;
  &lt;<span class="hljs-regexp">/div&gt;</span>
</code></pre>
<ul>
<li>After adding the above changes your create form will look like this <a target="_blank" href="http://localhost:3000/movies/new"><code>http://localhost:3000/movies/new</code></a></li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1629355270416/pPGO5l3FW.png" alt="create-new-movie.png" /></p>
<h2 id="styling-course-forms">Styling Course Forms</h2>
<p>Now we will add styling to our Movie Index, Create, Edit forms.</p>
<h3 id="1-add-styles-to-editcreate-form">1. Add Styles to Edit/Create Form</h3>
<ul>
<li>Change <code>app/views/movies/_form.html.erb</code> to the following HTML.</li>
</ul>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">form_with</span>(<span class="hljs-attr">model:</span> <span class="hljs-attr">movie</span>, <span class="hljs-attr">local:</span> <span class="hljs-attr">true</span>) <span class="hljs-attr">do</span> |<span class="hljs-attr">form</span>| %&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">%</span> <span class="hljs-attr">if</span> <span class="hljs-attr">movie.errors.any</span>? %&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"error_explanation"</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">h2</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">pluralize</span>(<span class="hljs-attr">movie.errors.count</span>, "<span class="hljs-attr">error</span>") %&gt;</span> prohibited this movie from being saved:<span class="hljs-tag">&lt;/<span class="hljs-name">h2</span>&gt;</span>

      <span class="hljs-tag">&lt;<span class="hljs-name">ul</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">%</span> <span class="hljs-attr">movie.errors.full_messages.each</span> <span class="hljs-attr">do</span> |<span class="hljs-attr">message</span>| %&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">li</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">message</span> %&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">%</span> <span class="hljs-attr">end</span> %&gt;</span>
      <span class="hljs-tag">&lt;/<span class="hljs-name">ul</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">%</span> <span class="hljs-attr">end</span> %&gt;</span>

  <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"field"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">form.label</span> <span class="hljs-attr">:title</span> %&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">form.text_field</span> <span class="hljs-attr">:title</span> , <span class="hljs-attr">class:</span> "<span class="hljs-attr">form-control</span>" %&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>

  <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"field"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">form.label</span> <span class="hljs-attr">:image_url</span> %&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">form.text_field</span> <span class="hljs-attr">:image_url</span>, <span class="hljs-attr">class:</span> "<span class="hljs-attr">form-control</span>"  %&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>

  <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"field"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">form.label</span> <span class="hljs-attr">:trailer_url</span> %&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">form.text_field</span> <span class="hljs-attr">:trailer_url</span>, <span class="hljs-attr">class:</span> "<span class="hljs-attr">form-control</span>"  %&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>

  <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"field"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">form.label</span> <span class="hljs-attr">:movie_url</span> %&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">form.text_field</span> <span class="hljs-attr">:movie_url</span> , <span class="hljs-attr">class:</span> "<span class="hljs-attr">form-control</span>" %&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>

  <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"field"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">form.label</span> <span class="hljs-attr">:status</span> %&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">form.select</span> <span class="hljs-attr">:status</span>, <span class="hljs-attr">Movie.statuses.keys.map</span> { |<span class="hljs-attr">s</span>| [<span class="hljs-attr">s.humanize</span>, <span class="hljs-attr">s</span>]} , <span class="hljs-attr">class:</span> "<span class="hljs-attr">form-select</span>" %&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>

  <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"field"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">form.label</span> <span class="hljs-attr">:release_date</span> %&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">form.datetime_select</span> <span class="hljs-attr">:release_date</span> , <span class="hljs-attr">class:</span> "<span class="hljs-attr">form-control</span>"  %&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>

  <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"field"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">form.label</span> <span class="hljs-attr">:watched_date</span> %&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">form.datetime_select</span> <span class="hljs-attr">:watched_date</span> , <span class="hljs-attr">class:</span> "<span class="hljs-attr">form-control</span>" %&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>

  <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"actions"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">form.submit</span> '<span class="hljs-attr">Submit</span>' , <span class="hljs-attr">class:</span> "<span class="hljs-attr">btn</span> <span class="hljs-attr">btn-primary</span> <span class="hljs-attr">theme-color</span>" %&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">%</span> <span class="hljs-attr">end</span> %&gt;</span>
</code></pre>
<ul>
<li>Change <code>app/views/movies/edit.html.erb</code> to the following HTML.</li>
</ul>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">h1</span>&gt;</span>Editing Movie<span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span>

<span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">render</span> '<span class="hljs-attr">form</span>', <span class="hljs-attr">movie:</span> @<span class="hljs-attr">movie</span> %&gt;</span>

<span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">link_to</span> '<span class="hljs-attr">Show</span>', @<span class="hljs-attr">movie</span> , <span class="hljs-attr">class:</span> "<span class="hljs-attr">btn</span> <span class="hljs-attr">btn-primary</span> <span class="hljs-attr">theme-color</span>"%&gt;</span> |
<span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">link_to</span> '<span class="hljs-attr">Back</span>', <span class="hljs-attr">movies_path</span> , <span class="hljs-attr">class:</span> "<span class="hljs-attr">btn</span> <span class="hljs-attr">btn-primary</span> <span class="hljs-attr">theme-color</span>"%&gt;</span>
</code></pre>
<p>After styling, Edit Movie Form Looks like this.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1629359356299/Fnx7lFi7a.png" alt="edit-movie.png" /></p>
<h3 id="2-add-styles-to-show-form">2. Add Styles to Show Form</h3>
<ul>
<li>Change <code>app/views/movies/show.html.erb</code> to the following HTML.</li>
</ul>
<pre><code class="lang-ruby">&lt;p id=<span class="hljs-string">"notice"</span>&gt;&lt;%= notice %&gt;&lt;<span class="hljs-regexp">/p&gt;

&lt;br/</span>&gt; &lt;br/&gt;

&lt;div <span class="hljs-class"><span class="hljs-keyword">class</span>="<span class="hljs-title">card</span>"&gt;</span>
  &lt;div <span class="hljs-class"><span class="hljs-keyword">class</span>="<span class="hljs-title">card</span>-<span class="hljs-title">header</span>"&gt;</span>
    &lt;%= @movie.title %&gt;  
  &lt;<span class="hljs-regexp">/div&gt;

  &lt;div class="card-body"&gt;
    &lt;p&gt;      
      &lt;h5 class="card-title"&gt;
        &lt;strong&gt;Title:&lt;/strong</span>&gt;
        &lt;%= @movie.title %&gt;
      &lt;<span class="hljs-regexp">/h5&gt;
    &lt;/p</span>&gt;

    &lt;p&gt;      
      &lt;h5 <span class="hljs-class"><span class="hljs-keyword">class</span>="<span class="hljs-title">card</span>-<span class="hljs-title">title</span>"&gt;</span>
        &lt;strong&gt;<span class="hljs-symbol">Status:</span>&lt;<span class="hljs-regexp">/strong&gt;
        &lt;%= @movie.status.humanize %&gt;
      &lt;/h</span>5&gt;
    &lt;<span class="hljs-regexp">/p&gt;

    &lt;p&gt;      
      &lt;h5 class="card-title"&gt;
        &lt;strong&gt;Released On:&lt;/strong</span>&gt;
        &lt;%= @movie.release_date.to_formatted_s %&gt;
      &lt;<span class="hljs-regexp">/h5&gt;
    &lt;/p</span>&gt;

    &lt;% <span class="hljs-keyword">if</span> @movie.watched? %&gt;
      &lt;p&gt;      
        &lt;h5 <span class="hljs-class"><span class="hljs-keyword">class</span>="<span class="hljs-title">card</span>-<span class="hljs-title">title</span>"&gt;</span>
          &lt;strong&gt;Watched <span class="hljs-symbol">On:</span>&lt;<span class="hljs-regexp">/strong&gt;
          &lt;%= @movie.watched_date.to_formatted_s %&gt;
        &lt;/h</span>5&gt;
      &lt;<span class="hljs-regexp">/p&gt;
    &lt;% end %&gt;

    &lt;p&gt;
      &lt;strong&gt;Trailer : &lt;/strong</span>&gt;
      &lt;h5 <span class="hljs-class"><span class="hljs-keyword">class</span>="<span class="hljs-title">card</span>-<span class="hljs-title">title</span>"&gt;        </span>
          &lt;iframe width=<span class="hljs-string">"560"</span> height=<span class="hljs-string">"315"</span> src=<span class="hljs-string">"&lt;%= @movie.trailer_url %&gt;"</span> title=<span class="hljs-string">"YouTube video player"</span> frameborder=<span class="hljs-string">"0"</span> allow=<span class="hljs-string">"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"</span> allowfullscreen&gt;&lt;<span class="hljs-regexp">/iframe&gt;
      &lt;/h</span>5&gt;
    &lt;<span class="hljs-regexp">/p&gt;

    &lt;p&gt;
      &lt;strong&gt;Image : &lt;/strong</span>&gt;
      &lt;h5 <span class="hljs-class"><span class="hljs-keyword">class</span>="<span class="hljs-title">card</span>-<span class="hljs-title">title</span>"&gt;        </span>
        &lt;img  width=<span class="hljs-string">"600"</span> height=<span class="hljs-string">"600"</span> src=<span class="hljs-string">"&lt;%= @movie.image_url %&gt;"</span>/&gt;
      &lt;<span class="hljs-regexp">/h5&gt;
    &lt;/p</span>&gt;

  &lt;<span class="hljs-regexp">/div&gt;
&lt;/div</span>&gt;  

&lt;br/&gt;

&lt;%= link_to <span class="hljs-string">'Edit'</span>, edit_movie_path(@movie) , <span class="hljs-class"><span class="hljs-keyword">class</span>: "<span class="hljs-title">btn</span> <span class="hljs-title">btn</span>-<span class="hljs-title">outline</span>-<span class="hljs-title">primary</span> <span class="hljs-title">theme</span>-<span class="hljs-title">btn</span>"%&gt; |</span>
&lt;%= link_to <span class="hljs-string">'Back'</span>, movies_path , <span class="hljs-class"><span class="hljs-keyword">class</span>: "<span class="hljs-title">btn</span> <span class="hljs-title">btn</span>-<span class="hljs-title">outline</span>-<span class="hljs-title">primary</span> <span class="hljs-title">theme</span>-<span class="hljs-title">btn</span>"%&gt;</span>

&lt;br/&gt;&lt;br/&gt;
</code></pre>
<ul>
<li>After styling, Show Movie Form Looks like this.</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1629358103218/S7t9LCRR9.png" alt="show-movie-details.png" /></p>
<h3 id="3-add-styles-to-the-movies-list-page">3. Add Styles to the movies List page</h3>
<ul>
<li><p>Now we reached the final stage of our project. We just need to style our Home page. i.e Movies Listing Page.</p>
</li>
<li><p>Create a new file <code>app/views/movies/_card_section_title.html.erb</code> with the following HTML.</p>
</li>
</ul>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"row"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"card border-light"</span> &gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"card-body"</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">h3</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"card-title"</span> <span class="hljs-attr">style</span>=<span class="hljs-string">"color: #800080;"</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">section</span> %&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">h3</span>&gt;</span>
      <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">br</span>/&gt;</span>
</code></pre>
<ul>
<li>Create a new file <code>app/views/movies/_movie_cards.html.erb</code> with the following HTML.</li>
</ul>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"row row-cols-1 row-cols-md-4 g-4"</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">%</span> <span class="hljs-attr">movies.each</span> <span class="hljs-attr">do</span> |<span class="hljs-attr">movie</span>| %&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"card border-dark"</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"&lt;%= movie.image_url %&gt;"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"card-img-top"</span> <span class="hljs-attr">alt</span>=<span class="hljs-string">"&lt;%= movie.title %&gt;"</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"card-body"</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">h5</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"card-title"</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"&lt;%= movie.movie_url%&gt;"</span> <span class="hljs-attr">style</span>=<span class="hljs-string">"color: #800080;"</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">movie.title</span> %&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">h5</span>&gt;</span>
      <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">ul</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"list-group list-group-flush"</span>&gt;</span>
          <span class="hljs-tag">&lt;<span class="hljs-name">li</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"list-group-item"</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">strong</span>&gt;</span>Release Date : <span class="hljs-tag">&lt;/<span class="hljs-name">strong</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">movie.release_date.strftime</span>('%<span class="hljs-attr">d-</span>%<span class="hljs-attr">b-</span>%<span class="hljs-attr">Y</span>') %&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span>
          <span class="hljs-tag">&lt;<span class="hljs-name">%</span> <span class="hljs-attr">if</span> <span class="hljs-attr">movie.watched</span>? %&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">li</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"list-group-item"</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">strong</span>&gt;</span>Watched On : <span class="hljs-tag">&lt;/<span class="hljs-name">strong</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">movie.watched_date.strftime</span>('%<span class="hljs-attr">d-</span>%<span class="hljs-attr">b-</span>%<span class="hljs-attr">Y</span>') %&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span>
          <span class="hljs-tag">&lt;<span class="hljs-name">%</span> <span class="hljs-attr">end</span> %&gt;</span>
      <span class="hljs-tag">&lt;/<span class="hljs-name">ul</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"card-body"</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">link_to</span> '<span class="hljs-attr">Show</span>', <span class="hljs-attr">movie</span>, <span class="hljs-attr">class:</span> "<span class="hljs-attr">card-link</span>", <span class="hljs-attr">style:</span> "<span class="hljs-attr">color:</span> #<span class="hljs-attr">800080</span>;" %&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">link_to</span> '<span class="hljs-attr">Edit</span>', <span class="hljs-attr">edit_movie_path</span>(<span class="hljs-attr">movie</span>) , <span class="hljs-attr">class:</span> "<span class="hljs-attr">card-link</span>", <span class="hljs-attr">style:</span> "<span class="hljs-attr">color:</span> #<span class="hljs-attr">800080</span>;" %&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">link_to</span> '<span class="hljs-attr">Delete</span>', <span class="hljs-attr">movie</span>, <span class="hljs-attr">method:</span> <span class="hljs-attr">:delete</span>, <span class="hljs-attr">data:</span> { <span class="hljs-attr">confirm:</span> '<span class="hljs-attr">Are</span> <span class="hljs-attr">you</span> <span class="hljs-attr">sure</span>?' }, <span class="hljs-attr">class:</span> "<span class="hljs-attr">card-link</span>" , <span class="hljs-attr">style:</span> "<span class="hljs-attr">color:</span> #<span class="hljs-attr">800080</span>;" %&gt;</span>

      <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">%</span> <span class="hljs-attr">end</span> %&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>

<span class="hljs-tag">&lt;<span class="hljs-name">br</span>/&gt;</span>
</code></pre>
<ul>
<li>Update file <code>app/views/movies/index.html.erb</code> to the following HTML.</li>
</ul>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">p</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"notice"</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">notice</span> %&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>

<span class="hljs-tag">&lt;<span class="hljs-name">%</span> <span class="hljs-attr">if</span> <span class="hljs-attr">Movie.yet_to_watch.length</span> &gt;</span> 0 %&gt;
  <span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">render</span> '<span class="hljs-attr">movies</span>/<span class="hljs-attr">card_section_title</span>', <span class="hljs-attr">section:</span> "<span class="hljs-attr">Your</span> <span class="hljs-attr">Movies</span> <span class="hljs-attr">Watchlist</span>" %&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">render</span> '<span class="hljs-attr">movies</span>/<span class="hljs-attr">movie_cards</span>', <span class="hljs-attr">movies:</span> <span class="hljs-attr">Movie.yet_to_watch</span> %&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">%</span> <span class="hljs-attr">end</span> %&gt;</span>

<span class="hljs-tag">&lt;<span class="hljs-name">%</span> <span class="hljs-attr">if</span> <span class="hljs-attr">Movie.watching.length</span> &gt;</span> 0 %&gt;
  <span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">render</span> '<span class="hljs-attr">movies</span>/<span class="hljs-attr">card_section_title</span>', <span class="hljs-attr">section:</span> "<span class="hljs-attr">Movies</span> <span class="hljs-attr">You</span> <span class="hljs-attr">Are</span> <span class="hljs-attr">Watching</span> <span class="hljs-attr">Now</span>" %&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">render</span> '<span class="hljs-attr">movies</span>/<span class="hljs-attr">movie_cards</span>', <span class="hljs-attr">movies:</span> <span class="hljs-attr">Movie.watching</span> %&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">%</span> <span class="hljs-attr">end</span> %&gt;</span>

<span class="hljs-tag">&lt;<span class="hljs-name">%</span> <span class="hljs-attr">if</span> <span class="hljs-attr">Movie.watched.length</span> &gt;</span> 0 %&gt;
  <span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">render</span> '<span class="hljs-attr">movies</span>/<span class="hljs-attr">card_section_title</span>', <span class="hljs-attr">section:</span> "<span class="hljs-attr">Movies</span> <span class="hljs-attr">You</span> <span class="hljs-attr">Watched</span>" %&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">render</span> '<span class="hljs-attr">movies</span>/<span class="hljs-attr">movie_cards</span>', <span class="hljs-attr">movies:</span> <span class="hljs-attr">Movie.watched</span> %&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">%</span> <span class="hljs-attr">end</span> %&gt;</span>


<span class="hljs-tag">&lt;<span class="hljs-name">br</span>&gt;</span>

<span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">link_to</span> '<span class="hljs-attr">New</span> <span class="hljs-attr">Movie</span>', <span class="hljs-attr">new_movie_path</span> , <span class="hljs-attr">class:</span> "<span class="hljs-attr">btn</span> <span class="hljs-attr">theme-btn</span>" %&gt;</span>
</code></pre>
<ul>
<li>Add <code>Create New Movie</code> link in navigation bar <code>app/views/layouts/_navbar.html.erb</code></li>
</ul>
<pre><code><span class="hljs-tag">&lt;<span class="hljs-name">style</span>&gt;</span><span class="css">
  <span class="hljs-selector-class">.theme-color</span> {
    <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#800080</span>;
  }
  <span class="hljs-selector-class">.theme-btn</span> {
    <span class="hljs-attribute">border-color</span>: <span class="hljs-number">#800080</span>;
  }
  <span class="hljs-selector-class">.theme-font</span> {
    <span class="hljs-attribute">color</span>: <span class="hljs-number">#800080</span>;
  }
</span><span class="hljs-tag">&lt;/<span class="hljs-name">style</span>&gt;</span>

<span class="hljs-tag">&lt;<span class="hljs-name">nav</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"navbar navbar-expand-lg navbar-dark theme-color"</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"container-fluid"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"navbar-brand"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"/"</span>&gt;</span>Binged<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"navbar-toggler"</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"button"</span> <span class="hljs-attr">data-bs-toggle</span>=<span class="hljs-string">"collapse"</span> <span class="hljs-attr">data-bs-target</span>=<span class="hljs-string">"#navbarNavAltMarkup"</span> <span class="hljs-attr">aria-controls</span>=<span class="hljs-string">"navbarNavAltMarkup"</span> <span class="hljs-attr">aria-expanded</span>=<span class="hljs-string">"false"</span> <span class="hljs-attr">aria-label</span>=<span class="hljs-string">"Toggle navigation"</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"navbar-toggler-icon"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"collapse navbar-collapse"</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"navbarNavAltMarkup"</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"navbar-nav"</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-link active"</span> <span class="hljs-attr">aria-current</span>=<span class="hljs-string">"page"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"/movies"</span>&gt;</span>Movies<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-link active"</span> <span class="hljs-attr">aria-current</span>=<span class="hljs-string">"page"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"/movies/new"</span>&gt;</span>New Movie<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
      <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">nav</span>&gt;</span>
</code></pre><ul>
<li>After Styling Movies Index Page, It finally looks like this :)</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1629360322938/8PDR3zgFYm.png" alt="movie-tracker-home-page.png" /></p>
<p>Hope you enjoyed this tutorial...!!</p>
<p>Find out the complete code in <a target="_blank" href="https://github.com/vishnuchilamakuru/binged">Github here</a>. If you like this, please give star for this Github repository.</p>
<hr />

<h2 id="thank-you-for-reading">Thank you for reading</h2>
<p>Hope you find these resources useful. If you like what you read and want to see more about system design, microservices, and other technology-related stuff... You can follow me on </p>
<ul>
<li><h4 id="twitter-lessa-hrefhttpstwittercomvishnuchirefsrctwsrc5etfw-classtwitter-follow-button-data-sizelarge-data-show-countfalsegreaterfollow-vishnuchilessagreaterlessscript-async-srchttpsplatformtwittercomwidgetsjs-charsetutf-8greaterlessscriptgreater">Twitter - <a href="https://twitter.com/vishnuchi?ref_src=twsrc%5Etfw" class="twitter-follow-button">Follow @vishnuchi</a></h4>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[4 Service Discovery Patterns for your Microservice]]></title><description><![CDATA[Let's say you’re writing some code that invokes a service that has a REST API. In order to make a request, your code needs to know the network location (IP address and port)
of a service instance. In a traditional application, the network locations o...]]></description><link>https://vishnuc.hashnode.dev/4-service-discovery-patterns-for-your-microservice</link><guid isPermaLink="true">https://vishnuc.hashnode.dev/4-service-discovery-patterns-for-your-microservice</guid><category><![CDATA[Microservices]]></category><category><![CDATA[Developer]]></category><category><![CDATA[System Architecture]]></category><category><![CDATA[design patterns]]></category><dc:creator><![CDATA[vishnu chilamakuru]]></dc:creator><pubDate>Sat, 31 Jul 2021 06:19:39 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1627710176088/MT-WZBsKX.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Let's say you’re writing some code that invokes a service that has a REST API. In order to make a request, your code needs to know the network location (IP address and port)
of a service instance. In a traditional application, the network locations of service instances are usually static. </p>
<p>For example, your code could read the network locations from a configuration file that’s occasionally updated. But in a modern, cloud-based microservices application, it’s usually not that simple. It is much more dynamic.</p>
<p>Service instances have dynamically assigned network locations. Moreover, the set of
service instances changes dynamically because of autoscaling, failures, and upgrades.
Consequently, your client code must use service discovery.</p>
<h2 id="what-is-service-discovery">What is Service Discovery?</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1627707198767/iyKATW_Dg.png" alt="Service Discovery For Microservices.png" /></p>
<p>From the above image you can see, you can’t statically configure a client with the IP addresses of the services. Instead, an application must use a dynamic service discovery mechanism. </p>
<p><strong><em>Service discovery is conceptually quite simple:</em></strong> its key component is a service registry, which is a database of the network locations of an application’s service instances.</p>
<p>The service discovery mechanism updates the service registry when service instances
start and stop. When a client invokes a service, the service discovery mechanism queries the service registry to obtain a list of available service instances and routes the
request to one of them.</p>
<p>In this article, I will mention about 4 service discovery patterns that you should consider for your microservices.</p>
<ul>
<li><a class="post-section-overview" href="#1-self-registration-pattern">1. Self Registration Pattern</a></li>
<li><a class="post-section-overview" href="#2-client-side-discovery-pattern">2. Client Side Discovery Pattern</a></li>
<li><a class="post-section-overview" href="#3-server-side-discovery-pattern">3. Server Side Discovery Pattern</a></li>
<li><a class="post-section-overview" href="#4-3rd-party-registration-pattern">4. 3rd Party Registration Pattern</a></li>
</ul>
<h3 id="the-services-and-their-clients-interact-directly-with-the-service-registry">The services and their clients interact directly with the service registry:</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1627710400234/O_qjswyGo.png" alt="Service discovery client and service with service registry.png" /></p>
<h2 id="1-self-registration-pattern">1. Self Registration Pattern</h2>
<p>The first pattern is the Self Registration pattern. A service instance invokes the service registry’s registration API to register its network location. It may also supply a health check URL. </p>
<p>The health check URL is an API end-point that the service registry invokes periodically to verify that the service instance is healthy and available to handle requests. </p>
<p>A service registry may require a service instance to periodically invoke a “heartbeat” API in order to prevent its registration from expiring. </p>
<p>A service instance registers itself with the service registry. Find out more details <a target="_blank" href="http://microser-vices.io/patterns/self-registration.html">here</a>.</p>
<h2 id="2-client-side-discovery-pattern">2. Client Side Discovery Pattern</h2>
<p>The second pattern is the Client-side discovery pattern. When a service client wants to
invoke a service, it queries the service registry to obtain a list of the service’s instances.</p>
<p>To improve performance, a client might cache the service instances. The service client then uses a load-balancing algorithm, such as a round-robin or random, to select a ser-
vice instance. It then makes a request to a select service instance.</p>
<p>Find out more details <a target="_blank" href="http://microservices.io/patterns/client-
side-discovery.html">here</a></p>
<h3 id="the-deployment-infrastructure-handles-service-discovery">The deployment infrastructure handles service discovery:</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1627711333552/yUTFYCnjl.png" alt="Service discovery via deployment infrastructure with service registry.png" /></p>
<h2 id="3-server-side-discovery-pattern">3. Server Side Discovery Pattern</h2>
<p>In this pattern, Instead of a client querying the service registry, it makes a request to a DNS name, which resolves to a request router that queries the service registry and load-balances requests.</p>
<p>A client makes a request to a router, which is responsible for service discovery. Find out more details <a target="_blank" href="http://microservices.io/patterns/server-side-discovery.html">here</a>.</p>
<h2 id="4-3rd-party-registration-pattern">4. 3rd Party Registration Pattern</h2>
<p>In this pattern, Instead of a service registering itself with the service registry, a third party called the <em>registrar</em>, which is typically part of the <em>deployment platform</em>, handles the registration.</p>
<p>Service instances are automatically registered with the service registry by a third party.
Find out more details <a target="_blank" href="http://microservices.io/patterns/3rd-party-registration.html">here</a>.</p>
<h4 id="advantages-of-platform-provided-service-discovery">Advantages of platform-provided service discovery:</h4>
<p>The key benefit of platform-provided service discovery is that all aspects of service discovery are entirely handled by the deployment platform. Neither the services nor the
clients contain any service discovery code. Consequently, the service discovery mechanism is readily available to all services and clients regardless of which language or framework they’re written in.</p>
<h4 id="disadvantages-of-platform-provided-service-discovery">Disadvantages of platform-provided service discovery:</h4>
<p>One drawback of platform-provided service discovery is that it only supports the
discovery of services that have been deployed using the platform. For example, Kubernetes-based discovery only works for services running on Kubernetes.</p>
<hr />

<h2 id="thank-you-for-reading">Thank you for reading</h2>
<p>Hope you find these resources useful. If you like what you read and want to see more about system design, microservices, and other technology-related stuff... You can follow me on </p>
<ul>
<li><h4 id="twitter-lessa-hrefhttpstwittercomvishnuchirefsrctwsrc5etfw-classtwitter-follow-button-data-sizelarge-data-show-countfalsegreaterfollow-vishnuchilessagreaterlessscript-async-srchttpsplatformtwittercomwidgetsjs-charsetutf-8greaterlessscriptgreater">Twitter - <a href="https://twitter.com/vishnuchi?ref_src=twsrc%5Etfw" class="twitter-follow-button">Follow @vishnuchi</a></h4>
</li>
<li><h4 id="subscribe-to-my-weekly-newsletter-herehttpswwwgetrevuecoprofilevishnuch">Subscribe to my weekly newsletter <a target="_blank" href="https://www.getrevue.co/profile/vishnuch">here</a>.</h4>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Kubernetes Cheatsheet]]></title><description><![CDATA[Kubernetes is a portable, extensible, open-source platform for managing containerized workloads and services, that facilitates both declarative configuration and automation. It has a large, rapidly growing ecosystem. Kubernetes services, support, and...]]></description><link>https://vishnuc.hashnode.dev/kubernetes-cheatsheet</link><guid isPermaLink="true">https://vishnuc.hashnode.dev/kubernetes-cheatsheet</guid><category><![CDATA[Kubernetes]]></category><category><![CDATA[Devops]]></category><category><![CDATA[cheatsheet]]></category><category><![CDATA[Beginner Developers]]></category><category><![CDATA[containers]]></category><dc:creator><![CDATA[vishnu chilamakuru]]></dc:creator><pubDate>Thu, 22 Jul 2021 09:17:52 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1626942628342/q1Klwzauu.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Kubernetes is a portable, extensible, open-source platform for managing containerized workloads and services, that facilitates both declarative configuration and automation. It has a large, rapidly growing ecosystem. Kubernetes services, support, and tools are widely available. Kubernetes provides you with a framework to run distributed systems resiliently. It takes care of scaling and failover for your application, provides deployment patterns, canary deployments, and more. In this blog post, I will mention Kubernetes commands which we need for most of the use-cases.</p>
<p>I will list down <code>kubectl</code> commands in the sections below as a quick reference to work with Kubernetes.</p>
<ul>
<li><a class="post-section-overview" href="#list-resources">List Resources</a></li>
<li><a class="post-section-overview" href="#create-resources">Create Resources</a></li>
<li><a class="post-section-overview" href="#update-resources">Update Resources</a></li>
<li><a class="post-section-overview" href="#display-the-state-of-resources">Display the State of Resources</a></li>
<li><a class="post-section-overview" href="#delete-resources">Delete Resources</a></li>
<li><a class="post-section-overview" href="#execute-command">Execute Command</a></li>
<li><a class="post-section-overview" href="#print-container-logs">Print Container Logs</a></li>
<li><a class="post-section-overview" href="#modify-kubeconfig-files">Modify Kubeconfig Files</a></li>
</ul>
<h2 id="list-resources">List Resources</h2>
<ul>
<li><p>Get list of all namespaces</p>
<pre><code class="lang-kubernetes">kubectl get namespaces
</code></pre>
</li>
<li><p>Get list of all pods</p>
<pre><code class="lang-kubernetes">kubectl get pods
</code></pre>
</li>
<li><p>Get list of all pods with detailed information like IP, Node Name etc...</p>
<pre><code class="lang-kubernetes">kubectl get pods -o wide
</code></pre>
</li>
<li><p>Get list of all pods running on a particular node server</p>
<pre><code class="lang-kubernetes">kubectl get pods --field-selector=spec.nodeName=[server-name]
</code></pre>
</li>
<li><p>Get list of all replication controllers and services</p>
<pre><code class="lang-kubernetes">kubectl get replicationcontroller,services
</code></pre>
</li>
<li><p>Get list of daemonsets</p>
<pre><code class="lang-kubernetes">kubectl get daemonset
</code></pre>
</li>
</ul>
<h2 id="create-resources">Create Resources</h2>
<ul>
<li><p>Create a new namespace</p>
<pre><code class="lang-kubernetes">kubectl create namespace [namespace-name]
</code></pre>
</li>
<li><p>Create a new namespace from JSON or YAML file.</p>
<pre><code class="lang-kubernetes">kubectl create –f [filename]
</code></pre>
</li>
</ul>
<h2 id="update-resources">Update Resources</h2>
<p>To apply or update a resource use the <code>kubectl apply</code> command.</p>
<ul>
<li><p>Create a new service with the definition contained in [service-config].yaml</p>
<pre><code class="lang-kubernetes">kubectl apply -f [service-config].yaml
</code></pre>
</li>
<li><p>Create a new replication controller with the definition contained in [controller-config].yaml</p>
<pre><code class="lang-kubernetes">kubectl apply -f [controller-config].yaml
</code></pre>
</li>
<li><p>Create the objects defined in any .yaml, .yml, or .json file in a directory</p>
<pre><code class="lang-kubernetes">kubectl apply -f [yaml-file/directory-name]
</code></pre>
</li>
<li><p>Edit a service config</p>
<pre><code class="lang-kubernetes">kubectl edit svc/[service-name]
</code></pre>
<p>Above command opens the file in your default editor. To choose another editor, specify it in front of the command:</p>
<pre><code class="lang-kubernetes">KUBE_EDITOR=”[editor-name]” kubectl edit svc/[service-name]
</code></pre>
</li>
</ul>
<h2 id="display-the-state-of-resources">Display the State of Resources</h2>
<ul>
<li><p>Get Details about Particular Node</p>
<pre><code class="lang-kubernetes">kubectl describe nodes [node-name]
</code></pre>
</li>
<li><p>Get Details about a Particular pod</p>
<pre><code class="lang-kubernetes">kubectl describe pods [pod-name]
</code></pre>
</li>
<li><p>Get Details about a Particular pod whose name and type are listed in <code>pod.json</code></p>
<pre><code class="lang-kubernetes">kubectl describe –f pod.json
</code></pre>
</li>
<li><p>Get Details about a Particular pod managed by a specific replication controller</p>
<pre><code class="lang-kubernetes">kubectl describe pods [replication-controller-name]
</code></pre>
</li>
<li><p>Get Details about all pods</p>
<pre><code class="lang-kubernetes">kubectl describe pods
</code></pre>
</li>
</ul>
<h2 id="delete-resources">Delete Resources</h2>
<ul>
<li><p>Delete a pod using the name and type mentioned in pod.yaml</p>
<pre><code class="lang-kubernetes">kubectl delete -f pod.yaml
</code></pre>
</li>
<li><p>Delete all pods and services with a specific label</p>
<pre><code class="lang-kubernetes">kubectl delete pods,services -l [label-key]=[label-value]
</code></pre>
</li>
<li><p>Delete all pods</p>
<pre><code class="lang-kubernetes">kubectl delete pods --all
</code></pre>
</li>
</ul>
<h2 id="execute-command">Execute Command</h2>
<ul>
<li><p>Get output from a command run on the first container in a pod</p>
<pre><code class="lang-kubernetes">kubectl exec [pod-name] -- [command]
</code></pre>
</li>
<li><p>Get output from a command run on a specific container in a pod</p>
<pre><code class="lang-kubernetes">kubectl exec [pod-name] -c [container-name] -- [command]
</code></pre>
</li>
<li><p>Run /bin/bash from a specific pod. The received output comes from the first container</p>
<pre><code class="lang-kubernetes">kubectl exec -ti [pod-name] -- /bin/bash
</code></pre>
</li>
</ul>
<h2 id="print-container-logs">Print Container Logs</h2>
<ul>
<li><p>Print Logs from Pod</p>
<pre><code class="lang-kubernetes">kubectl logs [pod-name]
</code></pre>
</li>
<li><p>Stream Logs from Pod</p>
<pre><code class="lang-kubernetes">kubectl logs -f [pod-name]
</code></pre>
</li>
<li><p>Tail Logs from Pod (Print last 200 logs from pod)</p>
<pre><code class="lang-kubernetes">kubectl logs --tail=200 [pod-name]
</code></pre>
</li>
</ul>
<h2 id="modify-kubeconfig-files">Modify Kubeconfig Files</h2>
<p><code>kubectl config</code> command lets you view and modify kubeconfig files.</p>
<ul>
<li><p>Get Current Context</p>
<pre><code class="lang-kubernetes">kubectl config current-context
</code></pre>
</li>
<li><p>Set cluster entry in kubeconfig</p>
<pre><code class="lang-kubernetes">kubectl config set-cluster [cluster-name] --server=[server-name]
</code></pre>
</li>
<li><p>Unset an entry in kubeconfig</p>
<pre><code class="lang-kubernetes">kubectl config unset [property-name]
</code></pre>
</li>
</ul>
<hr />

<h2 id="thank-you-for-reading">Thank you for reading</h2>
<p>Hope you find these resources useful. If you like what you read and want to see more about system design, microservices, and other technology-related stuff... You can follow me on </p>
<ul>
<li><h4 id="twitter-lessa-hrefhttpstwittercomvishnuchirefsrctwsrc5etfw-classtwitter-follow-button-data-sizelarge-data-show-countfalsegreaterfollow-vishnuchilessagreaterlessscript-async-srchttpsplatformtwittercomwidgetsjs-charsetutf-8greaterlessscriptgreater">Twitter - <a href="https://twitter.com/vishnuchi?ref_src=twsrc%5Etfw" class="twitter-follow-button">Follow @vishnuchi</a></h4>
</li>
<li><h4 id="subscribe-to-my-weekly-newsletter-herehttpswwwgetrevuecoprofilevishnuch">Subscribe to my weekly newsletter <a target="_blank" href="https://www.getrevue.co/profile/vishnuch">here</a>.</h4>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[6 Observable Patterns to consider for your Microservice]]></title><description><![CDATA[When any Microservice is deployed to production, you most probably want
to know what the application is doing like 

No of requests per second
Memory Utilization of application instances
CPU utilization of application instances 
Disk Utilization of a...]]></description><link>https://vishnuc.hashnode.dev/6-observable-patterns-to-consider-for-your-microservice</link><guid isPermaLink="true">https://vishnuc.hashnode.dev/6-observable-patterns-to-consider-for-your-microservice</guid><category><![CDATA[Microservices]]></category><category><![CDATA[Developer]]></category><category><![CDATA[System Architecture]]></category><category><![CDATA[design patterns]]></category><dc:creator><![CDATA[vishnu chilamakuru]]></dc:creator><pubDate>Fri, 16 Jul 2021 09:10:16 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1626426404707/71wxg8fbw.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>When any Microservice is deployed to production, you most probably want
to know what the application is doing like </p>
<ul>
<li>No of requests per second</li>
<li>Memory Utilization of application instances</li>
<li>CPU utilization of application instances </li>
<li>Disk Utilization of application instances etc...</li>
</ul>
<p>You also need to be alerted if there’s a problem, such as a failed service instance
or a disk filling up, ideally before it impacts a user. If there’s a problem, you
need to be able to troubleshoot and identify the root cause.</p>
<p>Many aspects of managing an application in production are outside the scope of
the developer, such as monitoring hardware availability and utilization. These are
clearly the responsibility of operations. But there are several patterns that you, as a service developer must implement to make your service easier to manage and troubleshoot. Below are 6 key Observable patterns that you need to consider for your Microservice</p>
<ul>
<li><a class="post-section-overview" href="#health-check-api">Health Check API</a></li>
<li><a class="post-section-overview" href="#log-aggregation">Log Aggregation</a></li>
<li><a class="post-section-overview" href="#distributed-tracing">Distributed Tracing</a></li>
<li><a class="post-section-overview" href="#exception-tracking">Exception Tracking</a></li>
<li><a class="post-section-overview" href="#application-metrics">Application Metrics</a></li>
<li><a class="post-section-overview" href="#audit-logging">Audit Logging</a></li>
</ul>
<h2 id="health-check-api">Health Check API</h2>
<p><strong><em>Expose an endpoint that returns the health of the service.</em></strong></p>
<p>A service instance needs to be able to tell the deployment infrastructure whether or
not it’s able to handle requests. A good solution is for a service to implement a health
check endpoint.</p>
<p>For example, implement a <code>GET /health</code> endpoint, which returns 200 if and
only if the service is healthy, and 503 otherwise.</p>
<p>The deployment infrastructure periodically invokes this endpoint to determine the health of the service instance and takes the appropriate action if it’s unhealthy.</p>
<h2 id="log-aggregation">Log Aggregation</h2>
<p><strong><em>Log service activity and write logs into a centralized logging server, which provides searching and alerting.</em></strong></p>
<p>Logs are a valuable troubleshooting tool. If you want to know what’s wrong with your application, a good place to start is the log files. But using logs in a microservice architecture is challenging. </p>
<p>Most of the time, the log entries you need are scattered across the log files of the API gateway and several services. The solution is to use log aggregation.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1626425209339/L9Xd0yIXM.png" alt="log-aggregation-pipeline.png" /></p>
<p>The log aggregation pipeline sends the logs of all of the service instances to a centralized logging server. Once the logs are stored by the logging server, you can view, search, and analyze them. You can also configure alerts that are triggered when certain messages appear in the logs.</p>
<h2 id="distributed-tracing">Distributed Tracing</h2>
<p><strong><em>Assign each external request a unique ID and trace requests as they flow between services.</em></strong></p>
<p>A good way to get insight into what your application is doing is to use distributed tracing. Distributed tracing is analogous to a performance profiler in a monolithic application. It records information (Ex: start time and end time) about the tree of service calls that are made when handling a request.</p>
<h2 id="exception-tracking">Exception Tracking</h2>
<p><strong><em>Report exceptions to an exception tracking service, which de-duplicates exceptions, alerts developers and tracks the resolution of each
exception.</em></strong></p>
<p>A service should rarely log an exception, and when it does, it’s important that you identify the root cause. The exception might be a symptom of a failure or a programming bug. The traditional way to view exceptions is to look in the logs. You might even configure the logging server to alert you if an exception appears in the log file. A better approach is to use an exception tracking service.</p>
<h2 id="application-metrics">Application Metrics</h2>
<p><strong><em>Services maintain metrics, such as counters and gauges, and expose them to a metrics server</em></strong></p>
<p>A key part of the production environment is monitoring and alerting. So it's important to have a monitoring system that gathers metrics, which provide critical information
about </p>
<ul>
<li>Health of an application, from every part of the technology stack.</li>
<li>Metrics range from infrastructure-level metrics, such as CPU, memory, and disk utilization, to application-level metrics, such as service request latency and a number of requests executed, etc...</li>
</ul>
<p>Ex: <a target="_blank" href="https://newrelic.com/">Newrelic</a>, <a target="_blank" href="https://www.datadoghq.com/product/apm/">Datadog</a>, etc...</p>
<h2 id="audit-logging">Audit Logging</h2>
<p><strong><em>Log user actions</em></strong></p>
<p>The purpose of audit logging is to record each user’s actions. An audit log is typically
used to help customer support, ensure compliance, and detect suspicious behavior.
Each audit log entry records the identity of the user, the action they performed, and
the business objects.</p>
<hr />

<h2 id="thank-you-for-reading">Thank you for reading</h2>
<p>Hope you find these resources useful. If you like what you read and want to see more about system design, microservices, and other technology-related stuff... You can follow me on </p>
<ul>
<li><h4 id="twitter-lessa-hrefhttpstwittercomvishnuchirefsrctwsrc5etfw-classtwitter-follow-button-data-sizelarge-data-show-countfalsegreaterfollow-vishnuchilessagreaterlessscript-async-srchttpsplatformtwittercomwidgetsjs-charsetutf-8greaterlessscriptgreater">Twitter - <a href="https://twitter.com/vishnuchi?ref_src=twsrc%5Etfw" class="twitter-follow-button">Follow @vishnuchi</a></h4>
</li>
<li><h4 id="subscribe-to-my-weekly-newsletter-herehttpswwwgetrevuecoprofilevishnuch">Subscribe to my weekly newsletter <a target="_blank" href="https://www.getrevue.co/profile/vishnuch">here</a>.</h4>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Interprocess Communication in Microservices]]></title><description><![CDATA[There are lots of different technologies available to choose from that can be used to communicate between your microservices. In this blog post, I will explain a few important ways that can be used to communicate between microservices. 
The communica...]]></description><link>https://vishnuc.hashnode.dev/interprocess-communication-in-microservices</link><guid isPermaLink="true">https://vishnuc.hashnode.dev/interprocess-communication-in-microservices</guid><category><![CDATA[Microservices]]></category><category><![CDATA[General Programming]]></category><category><![CDATA[APIs]]></category><category><![CDATA[AWS]]></category><category><![CDATA[System Architecture]]></category><dc:creator><![CDATA[vishnu chilamakuru]]></dc:creator><pubDate>Mon, 12 Jul 2021 09:43:06 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1626082681980/QfE9pB5Qi.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>There are lots of different technologies available to choose from that can be used to communicate between your microservices. In this blog post, I will explain a few important ways that can be used to communicate between microservices. </p>
<p>The communication between microservices can be one of the following two ways.</p>
<ul>
<li><a class="post-section-overview" href="#synchronous-communication">Synchronous  Communication</a></li>
<li><a class="post-section-overview" href="#asynchronous-communication">Asynchronous  Communication</a></li>
</ul>
<h2 id="synchronous-communication">Synchronous  Communication</h2>
<p>Synchronous Communication is real-time communication between two services. The caller service will wait until it gets the response from the invoked service within the configured timeout threshold.</p>
<p>Services can use synchronous request/response-based HTTP communication mechanisms, such as</p>
<ul>
<li>REST</li>
<li>gRPC</li>
</ul>
<h3 id="rest">REST</h3>
<p><strong>REST</strong> is an acronym for <strong>RE</strong>presentational <strong>S</strong>tate <strong>T</strong>ransfer. It is an architectural style for distributed hypermedia systems and was first presented by Roy Fielding in 2000.</p>
<p>REST also does have it's own 6 guiding constraints which must be satisfied if an interface needs to be referred to as RESTful. </p>
<ul>
<li><strong>1. Uniform interface</strong> - A resource in the system should have only one logical URI, and that should provide a way to fetch related or additional data.</li>
<li><strong>2. Client-server </strong> - This constraint essentially means that client application and server application MUST be able to evolve separately without any dependency on each other. A client should know only resource URIs, and that’s all.</li>
<li><strong>3. Stateless</strong> - Make all client-server interactions stateless. The server will not store anything about the latest HTTP request the client made. It will treat every request as new. No session, no history.</li>
<li><strong>4. Cacheable</strong> - In REST, caching shall be applied to resources when applicable, and then these resources MUST declare themselves cacheable. Caching can be implemented on the server or client-side</li>
<li><strong>5. Layered system</strong> - REST allows you to use a layered system architecture where you deploy the APIs on server A, and store data on server B and authenticate requests in Server C, for example. A client cannot ordinarily tell whether it is connected directly to the end server or an intermediary along the way.</li>
<li><strong>6. Code on demand (optional)</strong> - Most of the time, you will be sending the static representations of resources in the form of XML or JSON. But when you need to, you are free to return executable code. 
e.g., clients may call your API to get a UI widget rendering code. It is permitted.</li>
</ul>
<p>Find out more details about REST constraints <a target="_blank" href="https://restfulapi.net/rest-architectural-constraints/">here</a>.</p>
<h3 id="grpc">gRPC</h3>
<p>gRPC is a modern, open-source, high-performance remote procedure call (RPC) framework that can run anywhere. gRPC enables client and server applications to communicate transparently and simplifies the building of connected systems. It was initially developed at Google in 2015 as the next generation of the RPC infrastructure Stubby.</p>
<p><img src="https://grpc.io/img/landing-2.svg" alt="grpc-architecture" /></p>
<p>In gRPC, a client application can directly call a method on a server application on a different machine as if it were a local object, making it easier for you to create distributed applications and services.</p>
<p>On the server-side, the server implements this interface and runs a gRPC server to handle client calls. On the client-side, the client has a stub (referred to as just a client in some languages) that provides the same methods as the server.</p>
<p>By default, gRPC uses <a target="_blank" href="https://developers.google.com/protocol-buffers/docs/overview">Protocol Buffers</a>, Google’s mature open source mechanism for serializing structured data (although it can be used with other data formats such as JSON). </p>
<p>Find out more details about gRPC <a target="_blank" href="https://grpc.io/docs/what-is-grpc/introduction/">here</a>.</p>
<h2 id="asynchronous-communication">Asynchronous  Communication</h2>
<p>Asynchronous Communication is when you send a message without expecting an immediate response from the invoked service. The caller service will just send the request and invoked service will queue the request and process it. </p>
<p>Services can use asynchronous, message-based communication mechanisms such as </p>
<ul>
<li>Message Queues </li>
<li>Pub/Sub</li>
</ul>
<h3 id="message-queues">Message Queues</h3>
<p>A message queue is an architecture that provides asynchronous communication, allowing microservices to interact with each other without coupling. These messages are then stored (in memory or persisted) in a queue and processed by another microservice (called the Consumer).</p>
<p><img src="https://res.cloudinary.com/practicaldev/image/fetch/s--N8xIKEcs--/c_imagga_scale,f_auto,fl_progressive,h_420,q_auto,w_1000/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rzk2zcsmsfa9fmmcz40a.png" alt="message-queues" /></p>
<p>Below are the few popular Messaging Queues that can be used for your application.</p>
<ul>
<li><a target="_blank" href="https://www.rabbitmq.com/">RabbitMQ</a></li>
<li><a target="_blank" href="https://activemq.apache.org/">Apache ActiveMQ</a></li>
<li><a target="_blank" href="https://www.ibm.com/in-en/products/mq">IBM MQ</a></li>
</ul>
<h3 id="pubsub">Pub/Sub</h3>
<p><img src="https://dashbird.io/wp-content/uploads/2021/01/pub-sub-messaging.png" alt="pub-sub-architecture" /></p>
<p>Pub/Sub enables you to create systems of event producers and consumers, called publishers and subscribers. Publishers communicate with subscribers asynchronously by broadcasting events, rather than by synchronous calls.</p>
<p>Publishers send events to the Pub/Sub service, without regard to how or when these events will be processed. Pub/Sub then delivers events to all services that need to react to them. </p>
<p>Compared to synchronous communication through REST or RPCs, where publishers must wait for subscribers to receive the data, such asynchronous integration increases the flexibility and robustness of the system overall.</p>
<p>Below are the few popular pub/sub services that can be used for your application.</p>
<ul>
<li><a target="_blank" href="https://kafka.apache.org/">Apache Kafka</a></li>
<li><a target="_blank" href="https://cloud.google.com/pubsub">Google pub/sub</a></li>
<li><a target="_blank" href="https://aws.amazon.com/sns/">AWS SNS</a></li>
<li><a target="_blank" href="https://redis.io/topics/pubsub">Redis pub/sub</a></li>
</ul>
<h2 id="references">References:</h2>
<ul>
<li>https://restfulapi.net/rest-architectural-constraints/</li>
<li>https://grpc.io/docs/what-is-grpc/introduction/</li>
</ul>
<hr />

<h2 id="thank-you-for-reading">Thank you for reading</h2>
<p>Hope you find these resources useful. If you like what you read and want to see more about system design, microservices, and other technology-related stuff... You can follow me on </p>
<ul>
<li><h4 id="twitter-lessa-hrefhttpstwittercomvishnuchirefsrctwsrc5etfw-classtwitter-follow-button-data-sizelarge-data-show-countfalsegreaterfollow-vishnuchilessagreaterlessscript-async-srchttpsplatformtwittercomwidgetsjs-charsetutf-8greaterlessscriptgreater">Twitter - <a href="https://twitter.com/vishnuchi?ref_src=twsrc%5Etfw" class="twitter-follow-button">Follow @vishnuchi</a></h4>
</li>
<li><h4 id="subscribe-to-my-weekly-newsletter-herehttpswwwgetrevuecoprofilevishnuch">Subscribe to my weekly newsletter <a target="_blank" href="https://www.getrevue.co/profile/vishnuch">here</a>.</h4>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[5 Open-Source Search Engines For your Website]]></title><description><![CDATA[A search engine is a software program that helps people find the information they are looking for online using search queries containing keywords or phrases.
Search engines are able to return results quickly even with millions of records by indexing ...]]></description><link>https://vishnuc.hashnode.dev/5-open-source-search-engines-for-your-website</link><guid isPermaLink="true">https://vishnuc.hashnode.dev/5-open-source-search-engines-for-your-website</guid><category><![CDATA[Open Source]]></category><category><![CDATA[elasticsearch]]></category><category><![CDATA[apache]]></category><category><![CDATA[Web Development]]></category><category><![CDATA[Developer]]></category><dc:creator><![CDATA[vishnu chilamakuru]]></dc:creator><pubDate>Mon, 05 Jul 2021 08:22:32 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1625473196826/Ea1ImK3r5.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>A <strong>search engine</strong> is a software program that helps people find the information they are looking for online using search queries containing keywords or phrases.</p>
<p>Search engines are able to return results quickly even with millions of records by indexing every data record they find. In this blog post, I will list 5 popular open-source search engines which can be used to build search functionality in your website.</p>
<ul>
<li><a class="post-section-overview" href="#apache-lucene">Apache Lucene</a></li>
<li><a class="post-section-overview" href="#apache-solr">Apache Solr</a></li>
<li><a class="post-section-overview" href="#elasticsearch">Elasticsearch</a></li>
<li><a class="post-section-overview" href="#meilisearch">MeiliSearch</a></li>
<li><a class="post-section-overview" href="#typesense">Typesense</a></li>
</ul>
<h2 id="apache-lucene">Apache Lucene</h2>
<p><img src="https://i2.wp.com/www.cmsbestpractices.com/wp-content/uploads/2014/04/lucene-logo.png?ssl=1" alt="apache-lucene" /></p>
<p><a target="_blank" href="https://lucene.apache.org/">Apache Lucene</a> is a free and open-source search engine software library, originally written completely in Java. It is supported by the Apache Software Foundation and is released under the Apache Software License.
It is a technology suitable for nearly any application that requires full-text search, especially cross-platform.</p>
<p>Below are some of the key features of Apache Lucene.</p>
<ul>
<li>Data Indexing</li>
<li>Search</li>
<li>Spellchecking</li>
<li>Keyword Highlighting </li>
<li>Advanced analysis/tokenization capabilities.</li>
</ul>
<h2 id="apache-solr">Apache Solr</h2>
<p><img src="https://norconex.com/wp-content/uploads/Solr_Logo_on_white_web.png" alt="apache-solr" /></p>
<p><a target="_blank" href="https://solr.apache.org/">Apache Solr</a> is the popular, blazing-fast, open-source enterprise search platform built on Apache Lucene. Solr is a standalone search server with a REST-like API. You can put documents in it (called "indexing") via JSON, XML, CSV, or binary over HTTP. You query it via HTTP GET and receive JSON, XML, CSV, or binary results. </p>
<p>Below are some of the key features of Solr.</p>
<ul>
<li><p><strong>Advanced Full-Text Search Capabilities </strong>: Solr enables powerful matching capabilities including phrases, wildcards, joins, grouping, and much more across any data type.</p>
</li>
<li><p><strong>Optimized for High Volume Traffic</strong>: Solr is proven at extremely large scales the world over</p>
</li>
<li><p><strong>Comprehensive Administration Interfaces</strong>: Solr provides a responsive administrative user interface to make it easy to control your Solr instances.</p>
</li>
<li><p><strong>Easy Monitoring</strong>: Solr publishes loads of metric data via JMX which helps to get more insights about your Solr instances.</p>
</li>
</ul>
<h2 id="elasticsearch">Elasticsearch</h2>
<p><img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTAy3mYnTuHNa6Rb1OFOq6y3bnu4RcjTHgOvebV2ksmaqTHiPbIqUAjsuKMPNACaNbmLxA&amp;usqp=CAU" alt="elasticsearch" /></p>
<p><a target="_blank" href="https://www.elastic.co/elasticsearch/">Elasticsearch</a> is a distributed, RESTful search and analytics engine capable of addressing a growing number of use cases. It is built based on the Lucene library. It provides a distributed, multitenant-capable full-text search engine with an HTTP web interface and schema-free JSON documents.</p>
<p>Elasticsearch provides key features like Advanced Full-Text Search Capabilities like Data indexing, Search capabilities including phrases, wildcards, auto suggestions, filters &amp; facets, etc... Elasticsearch can also be used for other use-cases like</p>
<ul>
<li>Logs - Storing logs via ELK (Elasticsearch, Logstash, Kibana)</li>
<li>Metrics - Monitor and Visualise your system metrics</li>
<li>APM - Get insights into your application performance</li>
<li>App Search - Search across your documents, geodata, and more.</li>
</ul>
<h2 id="meilisearch">MeiliSearch</h2>
<p><img src="https://pbs.twimg.com/profile_images/1083373459839832066/umk6BM0F_400x400.jpg" alt="meiliSearch" /></p>
<p><a target="_blank" href="https://www.meilisearch.com/">MeiliSearch</a> is an open-source, blazingly fast and hyper-relevant search engine that will improve your search experience. It provides an extensive toolset for customization. It works out-of-the-box with a preset that easily answers the needs of most applications. Communication is done with a RESTful API because most developers are already familiar with its norms.</p>
<p>Below are the few key features of MeiliSearch.</p>
<ul>
<li><strong>Synonyms </strong>: Ability to create synonyms for a better search experience.</li>
<li><strong>Highlight</strong>: With highlight, users understand their search results and act upon them.</li>
<li><strong>Custom Relevancy</strong>: It gives you the possibility to add new sorting rules. You can order results by date, likes, whatever suits your dataset.</li>
<li><strong>Filters</strong>: Improve your search query by adding custom filters.</li>
<li><strong>Faceting</strong>: Empower users to drill down on search results and find what they need faster.</li>
</ul>
<h2 id="typesense">Typesense</h2>
<p><img src="https://pbs.twimg.com/profile_images/1392352271111888901/5vvtoxsS_400x400.jpg" alt="typesense" /></p>
<p><a target="_blank" href="https://typesense.org/">Typesense</a> is a fast, typo-tolerant search engine for building delightful search experiences. It claims that it is an Easier-to-Use ElasticSearch Alternative &amp; an Open Source Algolia Alternative.</p>
<p>Below are few key features of Typesense</p>
<ul>
<li><strong>Typo Tolerance</strong>: Handles typographical errors elegantly, out-of-the-box.</li>
<li><strong>Simple and Delightful</strong>: Simple to set up, integrate with, operate, and scale.
-⚡<strong> Blazing Fast</strong>: Built-in C++. Meticulously architected from the ground-up for low-latency (&lt;50ms) instant searches.</li>
<li><strong>Tunable Ranking</strong>: Easy to tailor your search results to perfection.
Sorting: Sort results based on a particular field at query time (helpful for features like "Sort by Price").</li>
<li><strong>Faceting &amp; Filtering</strong>: Drill down and refine results.</li>
<li><strong>Grouping &amp; Distinct</strong>: Group similar results together to show more variety.</li>
<li><strong>Federated Search</strong>: Search across multiple collections (indices) in a single HTTP request.</li>
<li><strong>Synonyms</strong>: Define words as equivalents of each other, so searching for a word will also return results for the synonyms defined.</li>
<li><strong>Geo search</strong> - Search and sort by results around a geographic location </li>
</ul>
<h2 id="other-popular-enterprise-search-engines">Other Popular Enterprise Search Engines</h2>
<p>Below are a few other popular Enterprise Search Engines that are not free</p>
<ul>
<li><a target="_blank" href="https://www.algolia.com/">Algolia</a></li>
<li><a target="_blank" href="https://swiftype.com/">Swiftype</a></li>
<li><a target="_blank" href="https://www.klevu.com/">Klevu</a></li>
</ul>
<hr />

<h2 id="thank-you-for-reading">Thank you for reading</h2>
<p>Hope you find these resources useful. If you like what you read and want to see more about system design, microservices, and other technology-related stuff... You can follow me on </p>
<ul>
<li><h4 id="twitter-lessa-hrefhttpstwittercomvishnuchirefsrctwsrc5etfw-classtwitter-follow-button-data-sizelarge-data-show-countfalsegreaterfollow-vishnuchilessagreaterlessscript-async-srchttpsplatformtwittercomwidgetsjs-charsetutf-8greaterlessscriptgreater">Twitter - <a href="https://twitter.com/vishnuchi?ref_src=twsrc%5Etfw" class="twitter-follow-button">Follow @vishnuchi</a></h4>
</li>
<li><h4 id="subscribe-to-my-weekly-newsletter-herehttpswwwgetrevuecoprofilevishnuch">Subscribe to my weekly newsletter <a target="_blank" href="https://www.getrevue.co/profile/vishnuch">here</a>.</h4>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Docker Cheatsheet]]></title><description><![CDATA[Docker is an open platform for developing, shipping, and running applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly. With Docker, you can manage your infrastructure in the same ...]]></description><link>https://vishnuc.hashnode.dev/docker-cheatsheet</link><guid isPermaLink="true">https://vishnuc.hashnode.dev/docker-cheatsheet</guid><category><![CDATA[Docker]]></category><category><![CDATA[cheatsheet]]></category><category><![CDATA[Beginner Developers]]></category><category><![CDATA[Devops]]></category><category><![CDATA[containers]]></category><dc:creator><![CDATA[vishnu chilamakuru]]></dc:creator><pubDate>Sat, 26 Jun 2021 08:41:04 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1624696778407/Mgb2V21XFr.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Docker is an open platform for developing, shipping, and running applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly. With Docker, you can manage your infrastructure in the same ways you manage your applications. By taking advantage of Docker’s methodologies for shipping, testing, and deploying code quickly, you can significantly reduce the delay between writing code and running it in production. In this post, I will mention docker commands which we need or most of the use-cases.</p>
<ul>
<li><a class="post-section-overview" href="#lifecycle-commands">Lifecycle Commands</a></li>
<li><a class="post-section-overview" href="#starting-and-stopping-containers">Starting and Stopping Containers</a></li>
<li><a class="post-section-overview" href="#docker-image-commands">Docker Image Commands</a></li>
<li><a class="post-section-overview" href="#docker-container-and-image-information">Docker Container And Image Information</a></li>
<li><a class="post-section-overview" href="#network-commands">Network Commands</a></li>
</ul>
<h2 id="lifecycle-commands">Lifecycle Commands</h2>
<ul>
<li><p>Create a container (without starting it):</p>
<pre><code class="lang-docker">docker create [IMAGE]
</code></pre>
</li>
<li><p>Rename an existing container</p>
<pre><code class="lang-docker">docker rename [CONTAINER_NAME] [NEW_CONTAINER_NAME]
</code></pre>
</li>
<li><p>Run a command in a new container</p>
<pre><code class="lang-docker">docker run [IMAGE] [COMMAND]
</code></pre>
</li>
<li><p>Remove container after it exits</p>
<pre><code class="lang-docker">docker run --rm [IMAGE]
</code></pre>
</li>
<li><p>Start a container and keep it running</p>
<pre><code class="lang-docker">docker run -td [IMAGE]
</code></pre>
</li>
<li><p>Start a container and creates an interactive bash shell in the container</p>
<pre><code class="lang-docker">docker run -it [IMAGE]
</code></pre>
</li>
<li><p>Create, Start, and run a command inside the container and remove the container after executing command.</p>
<pre><code class="lang-docker">docker run -it-rm [IMAGE]
</code></pre>
</li>
<li><p>Execute command inside already running container.</p>
<pre><code class="lang-docker">docker exec -it [container]
</code></pre>
</li>
<li><p>Delete a container (if it is not running)</p>
<pre><code class="lang-docker">docker rm [CONTAINER]
</code></pre>
</li>
<li><p>Update the configuration of the container</p>
<pre><code class="lang-docker">docker update [CONTAINER]
</code></pre>
</li>
</ul>
<h2 id="starting-and-stopping-containers">Starting and Stopping Containers</h2>
<ul>
<li><p>Start Container</p>
<pre><code class="lang-docker">docker start [CONTAINER]
</code></pre>
</li>
<li><p>Stop running Container</p>
<pre><code class="lang-docker">docker stop [CONTAINER]
</code></pre>
</li>
<li><p>Stop running Container and start it again</p>
<pre><code class="lang-docker">docker restart [CONTAINER]
</code></pre>
</li>
<li><p>Pause processes in a running container</p>
<pre><code class="lang-docker">docker pause [CONTAINER]
</code></pre>
</li>
<li><p>Unpause processes in a running container</p>
<pre><code class="lang-docker">docker unpause [CONTAINER]
</code></pre>
</li>
<li><p>Block a container until others stop </p>
<pre><code class="lang-docker">docker wait [CONTAINER]
</code></pre>
</li>
<li><p>Kill a container by sending a SIGKILL to a running container</p>
<pre><code class="lang-docker">docker kill [CONTAINER]
</code></pre>
</li>
<li><p>Attach local standard input, output, and error streams to a running container</p>
<pre><code class="lang-docker">docker attach [CONTAINER]
</code></pre>
</li>
</ul>
<h2 id="docker-image-commands">Docker Image Commands</h2>
<ul>
<li><p>Create an image from a Dockerfile</p>
<pre><code class="lang-docker">docker build [URL/FILE]
</code></pre>
</li>
<li><p>Create an image from a Dockerfile with Tags</p>
<pre><code class="lang-docker">docker build -t &lt;tag&gt; [URL/FILE]
</code></pre>
</li>
<li><p>Pull an image from a registry</p>
<pre><code class="lang-docker">docker pull [IMAGE]
</code></pre>
</li>
<li><p>Push an image to a registry</p>
<pre><code class="lang-docker">docker push [IMAGE]
</code></pre>
</li>
<li><p>Create an image from a tarball</p>
<pre><code class="lang-docker">docker import [URL/FILE]
</code></pre>
</li>
<li><p>Create an image from a container</p>
<pre><code class="lang-docker">docker commit [CONTAINER] [NEW_IMAGE_NAME]
</code></pre>
</li>
<li><p>Remove an image</p>
<pre><code class="lang-docker">docker rmi [IMAGE]
</code></pre>
</li>
<li><p>Load an image from a tar archive or stdin</p>
<pre><code class="lang-docker">docker load [TAR_FILE/STDIN_FILE]
</code></pre>
</li>
<li><p>Save an image to a tar archive</p>
<pre><code class="lang-docker">docker save [IMAGE] &gt; [TAR_FILE]
</code></pre>
</li>
</ul>
<h2 id="docker-container-and-image-information">Docker Container And Image Information</h2>
<ul>
<li><p>List running containers</p>
<pre><code class="lang-docker">docker ps
</code></pre>
</li>
<li><p>Lists both running containers and ones that have stopped</p>
<pre><code class="lang-docker">docker ps -a
</code></pre>
</li>
<li><p>List the logs from a running container</p>
<pre><code class="lang-docker">docker logs [CONTAINER]
</code></pre>
</li>
<li><p>List low-level information on Docker objects</p>
<pre><code class="lang-docker">docker inspect [OBJECT_NAME/ID]
</code></pre>
</li>
<li><p>List real-time events from a container</p>
<pre><code class="lang-docker">docker events [CONTAINER]
</code></pre>
</li>
<li><p>Show port mapping for a container</p>
<pre><code class="lang-docker">docker port [CONTAINER]
</code></pre>
</li>
<li><p>Show running processes in a container</p>
<pre><code class="lang-docker">docker top [CONTAINER]
</code></pre>
</li>
<li><p>Show live resource usage statistics of container</p>
<pre><code class="lang-docker">docker stats [CONTAINER]
</code></pre>
</li>
<li><p>Show changes to files (or directories) on a filesystem</p>
<pre><code class="lang-docker">docker diff [CONTAINER]
</code></pre>
</li>
<li><p>List all images that are locally stored with the docker engine</p>
<pre><code class="lang-docker">docker [image] ls
</code></pre>
</li>
<li><p>Show the history of an image</p>
<pre><code class="lang-docker">docker history [IMAGE]
</code></pre>
</li>
</ul>
<h2 id="network-commands">Network Commands</h2>
<ul>
<li><p>List networks</p>
<pre><code class="lang-docker">docker network ls
</code></pre>
</li>
<li><p>Remove one or more networks</p>
<pre><code class="lang-docker">docker network rm [NETWORK]
</code></pre>
</li>
<li><p>Show information on one or more networks</p>
<pre><code class="lang-docker">docker network inspect [NETWORK]
</code></pre>
</li>
<li><p>Connects a container to a network</p>
<pre><code class="lang-docker">docker network connect [NETWORK] [CONTAINER]
</code></pre>
</li>
<li><p>Disconnect a container from a network</p>
<pre><code class="lang-docker">docker network disconnect [NETWORK] [CONTAINER]
</code></pre>
</li>
</ul>
<hr />

<h2 id="thank-you-for-reading">Thank you for reading</h2>
<p>Hope you find these resources useful. If you like what you read and want to see more about system design, microservices, and other technology-related stuff... You can follow me on </p>
<ul>
<li><h4 id="twitter-lessa-hrefhttpstwittercomvishnuchirefsrctwsrc5etfw-classtwitter-follow-button-data-sizelarge-data-show-countfalsegreaterfollow-vishnuchilessagreaterlessscript-async-srchttpsplatformtwittercomwidgetsjs-charsetutf-8greaterlessscriptgreater">Twitter - <a href="https://twitter.com/vishnuchi?ref_src=twsrc%5Etfw" class="twitter-follow-button">Follow @vishnuchi</a></h4>
</li>
<li><h4 id="subscribe-to-my-weekly-newsletter-herehttpswwwgetrevuecoprofilevishnuch">Subscribe to my weekly newsletter <a target="_blank" href="https://www.getrevue.co/profile/vishnuch">here</a>.</h4>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[10 Websites To Find Your Next Programming Course]]></title><description><![CDATA[In this blog, I will list the Top 10 Popular Websites where you can find Programming-related courses covering multiple topics including Frontend & Backend Development.
1. Freecodecamp

Freecodecamp provides multiple courses starting from Python, Resp...]]></description><link>https://vishnuc.hashnode.dev/10-websites-to-find-your-next-programming-course</link><guid isPermaLink="true">https://vishnuc.hashnode.dev/10-websites-to-find-your-next-programming-course</guid><category><![CDATA[General Programming]]></category><category><![CDATA[course]]></category><category><![CDATA[Web Development]]></category><category><![CDATA[learning]]></category><category><![CDATA[General Advice]]></category><dc:creator><![CDATA[vishnu chilamakuru]]></dc:creator><pubDate>Fri, 25 Jun 2021 08:30:36 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1624609716843/6C0QgoCJO.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In this blog, I will list the Top 10 Popular Websites where you can find Programming-related courses covering multiple topics including Frontend &amp; Backend Development.</p>
<h2 id="1-freecodecamp">1. Freecodecamp</h2>
<p><img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lfMhrPQM--/c_imagga_scale,f_auto,fl_progressive,h_900,q_auto,w_1600/https://dev-to-uploads.s3.amazonaws.com/i/rphqzfoh2cbz3zj8m8t1.png" alt="freecodecamp-logo" /></p>
<p><a target="_blank" href="https://www.freecodecamp.org/">Freecodecamp</a> provides multiple courses starting from Python, Responsive Web Design, Javascript Algorithms &amp; Data Structures, React, Machine Learning, Data Analysis, etc...</p>
<p>They also offer tutorials/courses on how to build real-world applications in multiple programming languages like Ruby on Rails, Python, Node Js, etc... in their <a target="_blank" href="https://www.youtube.com/channel/UC8butISFwT-Wl7EV0hUK0BQ">YouTube Channel</a> and its pretty popular one.</p>
<h2 id="2-coursera">2. Coursera</h2>
<p><img src="https://mms.businesswire.com/media/20210330006145/en/868463/22/coursera-logo-full-rgb_%282%29.jpg" alt="coursera-logo" /></p>
<p><a target="_blank" href="https://www.coursera.org/">Coursera</a> is a popular website where you can find courses from popular Ivy League colleges. It provides courses in multiple subjects ranging from Programming Languages, Data Engineering, Machine Learning, Mobile Development, Cloud Computing, etc...</p>
<p>It offers Paid certifications and Free courses as well. If you want to just learn the contents of the course irrespective of certification you can just Audit the course.</p>
<h2 id="3-udemy">3. Udemy</h2>
<p><img src="https://thesecurityhub.org/wp-content/uploads/2021/04/Udemy-1.jpg" alt="udemy-logo" /></p>
<p><a target="_blank" href="https://www.udemy.com/">Udemy</a> is the most popular website where most of the developers and people from the tech community refer to. Udemy is pretty much like a marketplace of courses where Instructors can signup and create courses. If you are an expert in any domain you can create a course on the same and upload it in Udemy. </p>
<p>Udemy has many great courses for almost all Programming Languages, Databases, Mobile development, Frontend, and Backend technologies.</p>
<p>Most of the Udemy Courses are paid courses. It offers great discounts on selected courses most of the time. So make sure u check out offers for your course before you purchase it.</p>
<h2 id="4-linkedin-learning">4. LinkedIn Learning</h2>
<p><img src="https://s3.amazonaws.com/media.al-fanarmedia.org/wp-content/uploads/2020/04/29065717/linkedin-learning-%D9%84%D9%8A%D9%86%D9%83%D8%AF-%D8%A5%D9%86.jpg" alt="linkedin-learning" /></p>
<p><a target="_blank" href="https://www.linkedin.com/learning">LinkedIn Learning</a> offers video courses often taught by domain and industry experts in business, leadership, creative, and software technologies. It is one of the subsidiaries of LinkedIn. Most of the courses in LinkedIn Learning fall into 3 categories.</p>
<ul>
<li>Business</li>
<li>Creative</li>
<li>Technology</li>
</ul>
<p>It offers paid courses and the first month of your LinkedIn learning is free.</p>
<h2 id="5-pluralsight">5. Pluralsight</h2>
<p><img src="https://jamiemaguire.net/wp-content/uploads/2020/02/2020-02-04_14-11-53.png" alt="pluralsight-logo" /></p>
<p><a target="_blank" href="https://www.pluralsight.com/">Pluralsight</a> offers a variety of video training courses for software developers, IT administrators, and creative professionals. It provides multiple products like </p>
<ul>
<li>Paths - Where courses are curated by Experts based on difficulty level to learn the skill. </li>
<li>Course Discussions - Where you can engage and discuss with the community and experts to discuss course-related topics.</li>
</ul>
<p>It offers paid courses and the first 10 days of free subscription on signup.</p>
<h2 id="6-udacity">6. Udacity</h2>
<p><img src="https://ideahuntr.com/wp-content/uploads/2021/03/Udacity-Running-a-Flash-Sale-75-Off-Through-the-End.png" alt="udacity-logo" /></p>
<p><a target="_blank" href="https://www.udacity.com/">Udacity</a> offers Nanodegree programs that are built in partnership with the tech companies and taught by industry leaders like</p>
<ul>
<li>Google</li>
<li>Amazon</li>
<li>IBM</li>
<li>Microsoft </li>
<li>Intel etc...</li>
</ul>
<p>It provides courses in subjects like Programming, Databases, Machine Learning, Artificial Intelligence, Robotics, Self-Driving Cars, etc...It also provides financial aid to the learners based on their merit and performance in the Nanodegree Program.</p>
<h2 id="7-futurelearn">7. FutureLearn</h2>
<p><img src="https://static.kent.ac.uk/media/news/2020/12/00_FL_Main_logo_RGB-e1607088347134.jpeg" alt="futurelearn" /></p>
<p><a target="_blank" href="https://www.futurelearn.com/">FutureLearn</a> is a UK-based digital educational platform founded in 2012. It is a Massive Open Online Course learning platform and it has almost 250 UK + International partners offering courses in multiple subjects ranging from Business, Creative Arts, Healthcare, IT &amp; Computer Science, Law, Literature, etc...</p>
<p>It offers a flexible monthly subscription plan and a 7-day free trial as well.</p>
<h2 id="8-datacamp">8. Datacamp</h2>
<p><img src="https://res.cloudinary.com/dyd911kmh/image/upload/f_auto,q_auto:best/v1603223608/DC_New_mugdv8.png" alt="datacamp" /></p>
<p><a target="_blank" href="https://www.datacamp.com/">Datacamp</a> provides specialization courses related to </p>
<ul>
<li>Data Engineering</li>
<li>Machine Learning</li>
<li>Artificial Intelligence</li>
</ul>
<p>It provides Courses, Career and Skill Tracks on Data courses with R, Python, etc...If you are someone who is looking for Data Engineering related courses, this is the best place to start. It offers Personal and Business plans with different pricing levels.</p>
<h2 id="9-educative">9. Educative</h2>
<p><img src="https://couponbarrow.com/wp-content/uploads/2020/06/educative.jpg" alt="educative" /></p>
<p><a target="_blank" href="https://www.educative.io/">Educative</a> provides technology courses where you can learn without the hassle of environment setup or videos. It is trusted by the learners working in tech giants like Microsoft, Netflix, Facebook, Google, etc... (as mentioned on the website).</p>
<p>Learners can buy a monthly/annual subscription plan or can purchase the individual course.</p>
<h2 id="10-treehouse">10. Treehouse</h2>
<p><img src="https://couponbarrow.com/wp-content/uploads/2017/06/teamtreehouse-discount-coupon.jpg" alt="treehouse" /></p>
<p><a target="_blank" href="http://teamtreehouse.com/">Treehouse</a> or is an online technology school that offers beginner to advanced courses in </p>
<ul>
<li>Web Design</li>
<li>Web Development</li>
<li>Mobile Development</li>
<li>Game Development. 
Its courses are aimed at beginners looking to learn coding skills for a career in the tech industry.</li>
</ul>
<p>It offers a 7-day free trial as well after which you need to subscribe for monthly plans.</p>
<p>Hope you like the article.</p>
<hr />

<h2 id="thank-you-for-reading">Thank you for reading</h2>
<p>Hope you find these resources useful. If you like what you read and want to see more about system design, microservices, and other technology-related stuff... You can follow me on </p>
<ul>
<li><h4 id="twitter-lessa-hrefhttpstwittercomvishnuchirefsrctwsrc5etfw-classtwitter-follow-button-data-sizelarge-data-show-countfalsegreaterfollow-vishnuchilessagreaterlessscript-async-srchttpsplatformtwittercomwidgetsjs-charsetutf-8greaterlessscriptgreater">Twitter - <a href="https://twitter.com/vishnuchi?ref_src=twsrc%5Etfw" class="twitter-follow-button">Follow @vishnuchi</a></h4>
</li>
<li><h4 id="subscribe-to-my-weekly-newsletter-herehttpswwwgetrevuecoprofilevishnuch">Subscribe to my weekly newsletter <a target="_blank" href="https://www.getrevue.co/profile/vishnuch">here</a>.</h4>
</li>
</ul>
]]></content:encoded></item></channel></rss>