<?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[Yatharth's Blog]]></title><description><![CDATA[Yatharth's Blog]]></description><link>https://blog.yatharthverma.dev</link><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Apr 2026 15:56:59 GMT</lastBuildDate><atom:link href="https://blog.yatharthverma.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[How Discord scaled search from billions to TRILLIONS of messages 🔍]]></title><description><![CDATA[Ever used the search bar in Discord to find an old message?
Maybe you searched "meeting link" in your work server. Or tried to find that meme someone shared 2 years ago. Or looked for a conversation with a friend from months back.
That simple search ...]]></description><link>https://blog.yatharthverma.dev/how-discord-scaled-search-from-billions-to-trillions-of-messages</link><guid isPermaLink="true">https://blog.yatharthverma.dev/how-discord-scaled-search-from-billions-to-trillions-of-messages</guid><category><![CDATA[System Design]]></category><category><![CDATA[distributed systems]]></category><category><![CDATA[elasticsearch]]></category><category><![CDATA[Software Engineering]]></category><category><![CDATA[backend]]></category><category><![CDATA[Scalable Systems]]></category><category><![CDATA[discord]]></category><category><![CDATA[lucene]]></category><category><![CDATA[data-engineering]]></category><dc:creator><![CDATA[Yatharth Verma]]></dc:creator><pubDate>Tue, 03 Feb 2026 12:50:27 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1770121059912/126dad6c-1fb7-495f-9cbe-8c771dc4f67f.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Ever used the search bar in Discord to find an old message?</p>
<p>Maybe you searched "meeting link" in your work server. Or tried to find that meme someone shared 2 years ago. Or looked for a conversation with a friend from months back.</p>
<p>That simple search bar is querying <strong>trillions of messages</strong> across millions of servers. And recently, Discord completely rebuilt how it works.</p>
<p>Let me break down what happened.</p>
<hr />
<h3 id="heading-first-some-context"><strong>First, Some Context</strong></h3>
<h3 id="heading-what-happens-when-you-search-on-discord"><strong>What happens when you search on Discord?</strong></h3>
<p>When you type "project deadline" in a Discord server:</p>
<ol>
<li><p>Your query hits Discord's search infrastructure</p>
</li>
<li><p>It finds the right partition (called an "index") for that server</p>
</li>
<li><p>Scans through all messages to find matches</p>
</li>
<li><p>Returns results sorted by relevance</p>
</li>
</ol>
<p>Simple enough. But now imagine doing this for:</p>
<ul>
<li><p>200+ million monthly active users</p>
</li>
<li><p>Millions of servers</p>
</li>
<li><p>Some servers with <strong>billions</strong> of messages</p>
</li>
</ul>
<p>That's a different beast entirely.</p>
<hr />
<h3 id="heading-what-is-elasticsearch-and-lucene"><strong>What is Elasticsearch and Lucene?</strong></h3>
<p>Discord uses <strong>Elasticsearch</strong> for search. But what is it?</p>
<p>Think of it like this:</p>
<ul>
<li><p><strong>Lucene</strong> is the core search engine - the actual code that scans through text, builds search indexes, and finds matching documents. It's like the engine of a car.</p>
</li>
<li><p><strong>Elasticsearch</strong> is a wrapper around Lucene that makes it distributed and scalable. It handles splitting data across multiple servers, replication, and coordination. It's like the car itself - steering wheel, transmission, everything that makes the engine usable.</p>
</li>
</ul>
<p>When you search on Discord, Elasticsearch receives your query and uses Lucene under the hood to find matches.</p>
<hr />
<h3 id="heading-what-is-indexing"><strong>What is "indexing"?</strong></h3>
<p>Every message you send on Discord needs to be <strong>indexed</strong> - converted into a searchable format.</p>
<p>Raw message: "Hey, are we meeting tomorrow at 3pm?"</p>
<p>Indexed format: The words "hey", "meeting", "tomorrow", "3pm" get stored in a special data structure that makes them fast to search.</p>
<p>Without indexing, Discord would have to scan every single message character by character. With indexing, it can jump directly to messages containing your search terms.</p>
<hr />
<h3 id="heading-what-is-bulk-indexing"><strong>What is "bulk indexing"?</strong></h3>
<p>Discord doesn't index messages one by one. That would be painfully slow.</p>
<p>Instead, they collect messages in batches (say, 50 at a time) and index them together. This is <strong>bulk indexing</strong>.</p>
<p>Analogy:</p>
<ul>
<li><p>❌ Going to the post office 50 times for 50 letters</p>
</li>
<li><p>✅ Going once with all 50 letters</p>
</li>
</ul>
<p>Way more efficient.</p>
<hr />
<h3 id="heading-how-discords-old-system-worked"><strong>How Discord's Old System Worked</strong></h3>
<p>Here's the flow when you sent a message:</p>
<pre><code class="lang-plaintext">You send message
      ↓
Message enters Redis queue (waiting line)
      ↓
Worker picks up 50 messages from queue
      ↓
Worker bulk-indexes all 50 to Elasticsearch
      ↓
Messages stored across different nodes
</code></pre>
<p>Discord had <strong>2 large Elasticsearch clusters</strong> with <strong>200+ nodes each</strong>. Different Discord servers lived on different nodes.</p>
<p>This worked fine for years. Until it didn't.</p>
<hr />
<h3 id="heading-the-problems"><strong>The Problems</strong></h3>
<h3 id="heading-problem-1-one-bad-node-40-failure-rate"><strong>Problem 1: One Bad Node = 40% Failure Rate</strong></h3>
<p>Here's where things got ugly.</p>
<p>When a worker picked up 50 messages, those messages belonged to different Discord servers. So they went to different Elasticsearch nodes:</p>
<pre><code class="lang-plaintext">Batch of 50 messages:
├── Message 1 (Gaming server)    → Node 23
├── Message 2 (Study group)      → Node 87
├── Message 3 (Friend's DM)      → Node 45
├── Message 4 (Work server)      → Node 12
└── ... spread across ~50 nodes
</code></pre>
<p>Now, what happens if Node 45 crashes?</p>
<p>Elasticsearch marks the <strong>entire batch</strong> as failed. All 50 messages go back to the queue to retry.</p>
<p>Even though 49 out of 50 operations succeeded, one failure meant everything retried.</p>
<p>Let's do the math:</p>
<ul>
<li><p>Discord had ~100 nodes</p>
</li>
<li><p>Batch touches ~50 random nodes</p>
</li>
<li><p>Probability of at least one node being down ≈ <strong>40%</strong></p>
</li>
</ul>
<p>So a single node failure caused <strong>40% of all indexing operations to fail</strong>. Those failed batches went back to the queue, creating more load, causing more failures. A vicious cycle.</p>
<hr />
<h3 id="heading-problem-2-redis-dropped-messages-permanently"><strong>Problem 2: Redis Dropped Messages Permanently</strong></h3>
<p>Because so many batches were failing and retrying, the Redis queue got massively backed up.</p>
<p>Redis is an in-memory database. It's incredibly fast, but it has limits. When millions of messages piled up:</p>
<ol>
<li><p>Redis CPU maxed out trying to manage the queue</p>
</li>
<li><p>To survive, Redis started <strong>dropping messages</strong></p>
</li>
<li><p>Those messages were lost forever</p>
</li>
</ol>
<p>The result? Some messages were never indexed. Users would search for something they definitely said, and it wouldn't show up. Because it was never made searchable.</p>
<hr />
<h3 id="heading-problem-3-lucenes-2-billion-document-limit"><strong>Problem 3: Lucene's 2 Billion Document Limit</strong></h3>
<p>Remember Lucene, the search engine under Elasticsearch?</p>
<p>It has a hard limit: <strong>maximum 2 billion documents per index</strong>.</p>
<p>This sounds like a lot. But Discord servers like:</p>
<ul>
<li><p>Fortnite Official</p>
</li>
<li><p>Minecraft</p>
</li>
<li><p>Large gaming/streaming communities</p>
</li>
</ul>
<p>These servers have <strong>billions of messages</strong>. They hit the limit.</p>
<p>When that happened, new messages in that server stopped being indexed. Search completely broke for their largest communities.</p>
<p>Discord's temporary fix? Work with the Safety team to find spam servers and delete them to free up space. Not exactly a scalable solution.</p>
<hr />
<h3 id="heading-problem-4-couldnt-do-software-updates"><strong>Problem 4: Couldn't Do Software Updates</strong></h3>
<p>Because the system was so fragile (one node down = 40% failure), Discord couldn't do rolling restarts.</p>
<p>Normally, you update software by:</p>
<ol>
<li><p>Take down Node 1, update it, bring it back</p>
</li>
<li><p>Take down Node 2, update it, bring it back</p>
</li>
<li><p>Repeat for all nodes</p>
</li>
</ol>
<p>But with Discord's system, taking down even one node caused chaos.</p>
<p>When the <strong>Log4Shell vulnerability</strong> hit (a critical security issue affecting most Java applications), Discord had to take the <strong>entire search system offline</strong> to patch it.</p>
<p>Other companies patched in minutes. Discord needed a maintenance window.</p>
<hr />
<h3 id="heading-problem-5-no-cross-dm-search"><strong>Problem 5: No Cross-DM Search</strong></h3>
<p>This one affected users directly.</p>
<p>Messages were organized (sharded) by server or DM channel. All messages from "Gaming Server" lived together. All messages from your DM with Alex lived together.</p>
<p>But what if you wanted to search across <strong>all your DMs</strong>?</p>
<p>"Where's that flight confirmation someone sent me?"</p>
<p>Discord would need to query every single DM channel you've ever had. If you've messaged 200 people, that's 200 separate queries. Too slow and expensive.</p>
<p>So cross-DM search simply didn't exist.</p>
<hr />
<h3 id="heading-the-solutions"><strong>The Solutions</strong></h3>
<p>Discord didn't just patch these issues. They rebuilt the entire system.</p>
<hr />
<h3 id="heading-solution-1-cell-architecture-40-small-clusters"><strong>Solution 1: Cell Architecture (40 Small Clusters)</strong></h3>
<p><strong>Old:</strong> 2 massive clusters with 200+ nodes each</p>
<p><strong>New:</strong> 40 smaller clusters grouped into "cells"</p>
<p>Each small cluster has:</p>
<ul>
<li><p><strong>3 Master nodes</strong> - coordinate the cluster (one per availability zone)</p>
</li>
<li><p><strong>3+ Ingest nodes</strong> - receive and preprocess data (stateless, can scale up/down)</p>
</li>
<li><p><strong>Multiple Data nodes</strong> - store the actual messages (replicated across zones)</p>
</li>
</ul>
<p>Why is this better?</p>
<p>If one cluster has problems, <strong>39 others are completely unaffected</strong>. The blast radius of any failure is now much smaller.</p>
<p>It's like having 40 small libraries instead of 2 giant ones. One library floods? The other 39 still work fine.</p>
<hr />
<h3 id="heading-solution-2-smart-batching-by-destination"><strong>Solution 2: Smart Batching by Destination</strong></h3>
<p><strong>Old:</strong> Batch 50 random messages → send to 50 different nodes → one failure kills the batch</p>
<p><strong>New:</strong> Group messages by destination <strong>before</strong> batching</p>
<pre><code class="lang-plaintext">Messages for Node 23: [msg1, msg4, msg12, msg38] → Batch A
Messages for Node 45: [msg2, msg7, msg29]        → Batch B
Messages for Node 87: [msg3, msg15, msg41, msg50] → Batch C
</code></pre>
<p>Now if Node 45 crashes:</p>
<ul>
<li><p>Batch A ✅ succeeds</p>
</li>
<li><p>Batch B ❌ fails and retries</p>
</li>
<li><p>Batch C ✅ succeeds</p>
</li>
</ul>
<p>One node failure only affects that node's messages. Not 40% of everything.</p>
<p>Discord built a "Message Router" in Rust that:</p>
<ol>
<li><p>Streams messages from the queue</p>
</li>
<li><p>Groups them by destination (cluster + index)</p>
</li>
<li><p>Spawns a separate task for each destination</p>
</li>
<li><p>Each task collects and bulk-indexes its own messages</p>
</li>
</ol>
<hr />
<h3 id="heading-solution-3-redis-google-pubsub"><strong>Solution 3: Redis → Google PubSub</strong></h3>
<p><strong>Old:</strong> Redis queue drops messages when overwhelmed</p>
<p><strong>New:</strong> Google PubSub with guaranteed delivery</p>
<p>PubSub is a managed message queue service. Its key property: <strong>messages are never dropped</strong>.</p>
<p>If indexing slows down, messages wait in the queue. They might wait for minutes or hours. But they're never lost.</p>
<p>The tradeoff: during failures, search results might be delayed. But they'll never be permanently missing.</p>
<hr />
<h3 id="heading-solution-4-bfgs-get-dedicated-clusters"><strong>Solution 4: BFGs Get Dedicated Clusters</strong></h3>
<p>BFG = <strong>Big Freaking Guilds</strong> (Discord's internal term 😄)</p>
<p>For servers approaching the 2 billion limit, Discord now:</p>
<ol>
<li><p>Creates a dedicated cluster just for that server</p>
</li>
<li><p>Uses <strong>multiple shards</strong> instead of one (spreads data across multiple Lucene indexes)</p>
</li>
<li><p>Migrates messages with zero downtime</p>
</li>
</ol>
<p>The migration flow:</p>
<pre><code class="lang-plaintext">Step 1: Create new index with 2x shards
Step 2: Dual-write (new messages go to OLD and NEW index)
Step 3: Backfill historical messages to NEW index
Step 4: Switch queries to NEW index
Step 5: Stop writing to OLD index
Step 6: Clean up OLD index
</code></pre>
<p>Users notice nothing. Search keeps working throughout.</p>
<p>This is similar to how Stripe does zero-downtime database migrations - dual-write, backfill, switch, cleanup.</p>
<hr />
<h3 id="heading-solution-5-dms-sharded-by-user"><strong>Solution 5: DMs Sharded by User</strong></h3>
<p><strong>Old:</strong> DMs sharded by channel</p>
<ul>
<li><p>DM with Alex → Index A</p>
</li>
<li><p>DM with Jordan → Index B</p>
</li>
<li><p>DM with Sam → Index C</p>
</li>
</ul>
<p>Searching across all DMs = querying A + B + C + hundreds more</p>
<p><strong>New:</strong> DMs sharded by user</p>
<ul>
<li>All YOUR DMs → Your personal index</li>
</ul>
<p>Searching across all DMs = querying ONE index</p>
<p>This required re-indexing every DM message. But since Discord was already rebuilding everything, they took the opportunity.</p>
<p>Now you can search "flight confirmation" and find it instantly, no matter who sent it.</p>
<hr />
<h3 id="heading-key-takeaways"><strong>Key Takeaways</strong></h3>
<p><strong>1. Reduce blast radius</strong></p>
<p>The old system had a tiny blast radius for each failure (one node), but the impact was massive (40% of operations). The new system contains failures to small, isolated areas.</p>
<p><strong>2. Never drop data</strong></p>
<p>Switching from Redis to PubSub meant accepting slower recovery for guaranteed durability. That's almost always the right tradeoff.</p>
<p><strong>3. Batch intelligently</strong></p>
<p>Batching is great for performance. But batch by destination, not randomly. This prevents one bad destination from affecting everything.</p>
<p><strong>4. Plan for outliers</strong></p>
<p>Most Discord servers are small. But the huge ones (BFGs) need special handling. Design your system to handle the 99% efficiently while having escape hatches for the 1%.</p>
<p><strong>5. Migrations can enable features</strong></p>
<p>Discord had to re-index everything anyway. They used that opportunity to re-shard DMs by user, enabling a completely new feature (cross-DM search).</p>
<hr />
<h3 id="heading-wrapping-up"><strong>Wrapping Up</strong></h3>
<p>Discord's search infrastructure went from "barely holding together" to "trillions of messages, 5x faster."</p>
<p>The key insight: <strong>the best systems aren't ones that never fail. They're ones where failure doesn't cascade.</strong></p>
<p>One node failing should be that node's problem. Not a 40% catastrophe.</p>
<p>That's resilience engineering.</p>
<hr />
<p><em>Full technical details:</em> <a target="_blank" href="https://discord.com/blog/how-discord-indexes-trillions-of-messages"><strong><em>Discord Engineering Blog</em></strong></a></p>
]]></content:encoded></item><item><title><![CDATA[Top 5 IT skills in 2024]]></title><description><![CDATA[IT landscape is evolving faster than ever. Whether you're a seasoned professional or just starting your journey, staying ahead of the curve is crucial. Join me, Yatharth, a senior software engineer at a dynamic remote startup, as we explore the top 5...]]></description><link>https://blog.yatharthverma.dev/top-5-it-skills-in-2024</link><guid isPermaLink="true">https://blog.yatharthverma.dev/top-5-it-skills-in-2024</guid><category><![CDATA[topskills]]></category><category><![CDATA[trendingskills]]></category><category><![CDATA[skills]]></category><category><![CDATA[Software Engineering]]></category><dc:creator><![CDATA[Yatharth Verma]]></dc:creator><pubDate>Sun, 25 Aug 2024 12:02:41 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1724574925935/52c600ce-a056-4700-b1d6-134529b0b0bc.avif" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>IT landscape is evolving faster than ever. Whether you're a seasoned professional or just starting your journey, staying ahead of the curve is crucial. Join me, Yatharth, a senior software engineer at a dynamic remote startup, as we explore the top 5 IT skills that are really domintating this year and will keep dominating for upcoming years. From Artificial Intelligence to Cyber Security, discover the skills that will keep you at the forefront of innovation and success. Let's dive in!</p>
<ol>
<li><p><strong>AI (Artificial Intelligence).</strong></p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1724573313778/ad4982b3-48be-4ab9-936c-56b9da4ac64b.avif" alt class="image--center mx-auto" /></p>
<p> Artificial Intelligence is a field of computer science that focuses on creating systems capable of performing tasks that normally require human intelligence. These tasks include learning, reasoning, problem-solving, understanding natural language, and perception.</p>
<p> Some common examples of AI include:</p>
<ol>
<li><p><strong>Virtual Assistants</strong>: AI-powered assistants like Siri, Alexa, and Google Assistant help users with tasks like setting reminders, playing music, and answering questions.</p>
</li>
<li><p><strong>Recommendation Systems</strong>: Platforms like Netflix, Amazon, and YouTube use AI to suggest content based on user preferences and behavior.</p>
</li>
<li><p><strong>Self-Driving Cars</strong>: Companies like Tesla and Waymo are developing autonomous vehicles that use AI to navigate and make driving decisions.</p>
</li>
<li><p><strong>Healthcare</strong>: AI is used in medical diagnosis, personalized treatment plans, and even in robotic surgeries.</p>
</li>
<li><p><strong>Chatbots</strong>: AI chatbots like ChatGPT, Claude AI, and V0.dev can engage in conversations, answer queries, and provide customer support.</p>
</li>
<li><p><strong>Fraud Detection</strong>: Banks and financial institutions use AI to detect and prevent fraudulent activities by analyzing transaction patterns.</p>
</li>
</ol>
</li>
</ol>
<p>    If you're interested in upskilling yourself in AI, I want to share a great GitHub repository that includes tons of resources:</p>
<ul>
<li><a target="_blank" href="https://github.com/mrsaeeddev/free-ai-resources?tab=readme-ov-file">https://github.com/mrsaeeddev/free-ai-resources?tab=readme-ov-file</a></li>
</ul>
<p>    Want to share some other links as well which are really great if u want to learn more about AI and deep dive into it</p>
<ul>
<li><p><a target="_blank" href="https://www.deeplearning.ai/courses/">https://www.deeplearning.ai/courses/</a></p>
</li>
<li><p><a target="_blank" href="https://cloud.google.com/learn/training/machinelearning-ai">https://cloud.google.com/learn/training/machinelearning-ai</a></p>
</li>
</ul>
<ol start="2">
<li><p><strong>Cloud Computing and DevOps:</strong></p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1724573669068/f13cbfda-49fe-4204-b195-c7224f70043c.avif" alt class="image--center mx-auto" /></p>
<p> Cloud computing and DevOps are crucial in today's tech landscape. Cloud computing allows businesses to store and access data over the internet, providing scalability, flexibility, and cost savings. DevOps, on the other hand, is a set of practices that combines software development (Dev) and IT operations (Ops) to shorten the development lifecycle and deliver high-quality software continuously.</p>
<p> <strong>Why is it important?</strong></p>
<ol>
<li><p><strong>Efficiency</strong>: Cloud computing and DevOps streamline workflows, making it easier to manage resources and deploy applications quickly.</p>
</li>
<li><p><strong>Scalability</strong>: Businesses can scale their operations up or down based on demand without investing in physical infrastructure.</p>
</li>
<li><p><strong>Collaboration</strong>: DevOps fosters a culture of collaboration between development and operations teams, leading to better communication and faster problem-solving.</p>
</li>
<li><p><strong>Cost Savings</strong>: By using cloud services, companies can reduce the costs associated with maintaining physical servers and data centers.</p>
</li>
</ol>
</li>
</ol>
<p>    <strong>How to improve it?</strong></p>
<ol>
<li><p><strong>Automation</strong>: Implement automation tools for continuous integration and continuous deployment (CI/CD) to reduce manual errors and speed up processes.</p>
</li>
<li><p><strong>Monitoring and Logging</strong>: Use monitoring tools to keep track of system performance and logs to diagnose issues quickly.</p>
</li>
<li><p><strong>Security</strong>: Integrate security practices into the DevOps pipeline to ensure that applications are secure from the start.</p>
</li>
<li><p><strong>Training</strong>: Invest in training for your team to keep them updated with the latest tools and best practices in cloud computing and DevOps.</p>
</li>
</ol>
<p>    <strong>Resources:</strong></p>
<ul>
<li><p><a target="_blank" href="https://aws.amazon.com/training/">AWS Training and Certification</a></p>
</li>
<li><p><a target="_blank" href="https://cloud.google.com/training">Google Cloud Training</a></p>
</li>
<li><p><a target="_blank" href="https://docs.microsoft.com/en-us/azure/devops/?view=azure-devops">Azure DevOps Documentation</a></p>
</li>
<li><p><a target="_blank" href="https://www.amazon.com/DevOps-Handbook-World-Class-Reliability-Organizations/dp/1942788002">DevOps Handbook</a></p>
</li>
</ul>
<ol start="3">
<li><p><strong>Full Stack Development</strong></p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1724573961796/699adda8-369a-4e88-ad49-a0c0cfc29877.avif" alt class="image--center mx-auto" /></p>
<p> Full stack development involves working on both the front-end and back-end parts of a web application. This means a full stack developer can handle everything from designing user interfaces to managing databases and server configurations.</p>
<p> <strong>Why is Full Stack Development Important?</strong></p>
<ol>
<li><p><strong>Versatility</strong>: Full stack developers can work on various parts of a project, making them highly versatile and valuable to any team.</p>
</li>
<li><p><strong>Cost-Effective</strong>: Hiring a full stack developer can be more cost-effective than hiring separate front-end and back-end developers.</p>
</li>
<li><p><strong>Better Collaboration</strong>: Full stack developers understand the entire project, which leads to better communication and collaboration within the team.</p>
</li>
<li><p><strong>Faster Development</strong>: With the ability to handle multiple tasks, full stack developers can speed up the development process.</p>
</li>
</ol>
</li>
</ol>
<p>    <strong>Tech Stack Examples:</strong></p>
<ol>
<li><p><strong>MERN Stack</strong>: MongoDB, Express.js, React, Node.js</p>
</li>
<li><p><strong>MEAN Stack</strong>: MongoDB, Express.js, Angular, Node.js</p>
</li>
<li><p><strong>LAMP Stack</strong>: Linux, Apache, MySQL, PHP</p>
</li>
<li><p><strong>Django Stack</strong>: Python, Django, PostgreSQL</p>
</li>
</ol>
<p>    <strong>Resources:</strong></p>
<ol>
<li><p><a target="_blank" href="https://www.freecodecamp.org/">freeCodeCamp</a></p>
</li>
<li><p><a target="_blank" href="https://developer.mozilla.org/">MDN Web Docs</a></p>
</li>
<li><p><a target="_blank" href="https://www.codecademy.com/">Codecademy</a></p>
</li>
<li><p><a target="_blank" href="https://www.coursera.org/">Coursera</a></p>
</li>
<li><p><a target="_blank" href="https://fullstackopen.com/">Full Stack Open</a></p>
</li>
</ol>
<ol start="4">
<li><p><strong>Data science and Analytics</strong></p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1724573998073/f90f3ae1-da61-43d0-bd07-d92fca584cdf.avif" alt class="image--center mx-auto" /></p>
<p> Data science and analytics are crucial in today's data-driven world. They help organizations make informed decisions by analyzing large sets of data to uncover patterns, trends, and insights. Here are some reasons why data science and analytics are important:</p>
<ul>
<li><p><strong>Informed Decision-Making:</strong> Data science enables businesses to make decisions based on data rather than intuition. For example, a retail company can analyze customer purchase data to determine which products are most popular and adjust their inventory accordingly.</p>
</li>
<li><p><strong>Improved Efficiency:</strong> By analyzing operational data, companies can identify bottlenecks and inefficiencies in their processes. For instance, a manufacturing firm can use data analytics to optimize their production line, reducing downtime and increasing output.</p>
</li>
<li><p><strong>Personalized Customer Experiences:</strong> Data science allows companies to tailor their products and services to individual customer preferences. For example, streaming services like Netflix use data analytics to recommend shows and movies based on a user's viewing history.</p>
</li>
<li><p><strong>Competitive Advantage:</strong> Companies that leverage data science can gain a competitive edge by identifying market trends and consumer behavior before their competitors. For example, financial institutions use data analytics to predict stock market trends and make strategic investment decisions.</p>
</li>
</ul>
</li>
</ol>
<p>    Here are some popular data science tools:</p>
<ul>
<li><p><strong>Python</strong>: A versatile programming language widely used for data analysis and machine learning.</p>
</li>
<li><p><strong>R</strong>: A statistical programming language that is great for data manipulation and visualization.</p>
</li>
<li><p><strong>Jupyter Notebooks</strong>: An open-source web application that allows you to create and share documents containing live code, equations, visualizations, and narrative text.</p>
</li>
<li><p><strong>Pandas</strong>: A Python library providing high-performance, easy-to-use data structures and data analysis tools.</p>
</li>
<li><p><strong>TensorFlow</strong>: An open-source platform for machine learning developed by Google.</p>
</li>
<li><p><strong>Tableau</strong>: A powerful data visualization tool that helps in creating interactive and shareable dashboards.</p>
</li>
<li><p><strong>Apache Spark</strong>: An open-source unified analytics engine for large-scale data processing.</p>
</li>
<li><p><strong>SQL</strong>: A standard language for managing and manipulating databases.</p>
</li>
<li><p><strong>Hadoop</strong>: An open-source framework that allows for the distributed processing of large data sets across clusters of computers.</p>
</li>
<li><p><strong>Power BI</strong>: A business analytics service by Microsoft that provides interactive visualizations and business intelligence capabilities.</p>
</li>
</ul>
<p>    <strong>Resources:</strong></p>
<ul>
<li><p><strong>Coursera:</strong> Offers courses on data science and analytics from top universities and companies.</p>
</li>
<li><p><strong>Kaggle:</strong> A platform for data science competitions and a rich source of datasets.</p>
</li>
<li><p><strong>edX:</strong> Provides online courses from institutions like Harvard and MIT on data science.</p>
</li>
<li><p><strong>DataCamp:</strong> Offers interactive courses on data science and programming.</p>
</li>
<li><p><strong>Udacity:</strong> Provides nanodegree programs in data science and related fields.</p>
</li>
</ul>
<ol start="5">
<li><p><strong>Cyber security</strong></p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1724574041010/dbbdd58e-4114-455e-a1ee-c7d6c479f0a3.avif" alt class="image--center mx-auto" /></p>
<p> Cyber security is the practice of protecting systems, networks, and programs from digital attacks. These attacks are usually aimed at accessing, changing, or destroying sensitive information, extorting money from users, or interrupting normal business processes.</p>
<h3 id="heading-examples-of-cyber-security-threats">Examples of Cyber Security Threats</h3>
<ol>
<li><p><strong>Phishing</strong>: Fraudulent attempts to obtain sensitive information by pretending to be a trustworthy entity in electronic communications.</p>
</li>
<li><p><strong>Malware</strong>: Malicious software designed to harm, exploit, or otherwise compromise a computer system.</p>
</li>
<li><p><strong>Ransomware</strong>: A type of malware that threatens to publish the victim's data or block access to it unless a ransom is paid.</p>
</li>
<li><p><strong>Denial-of-Service (DoS) Attacks</strong>: Attacks intended to shut down a machine or network, making it inaccessible to its intended users.</p>
</li>
</ol>
</li>
</ol>
<h3 id="heading-why-cyber-security-is-important">Why Cyber Security is Important</h3>
<ul>
<li><p><strong>Protection of Sensitive Data</strong>: Ensures that personal and business information remains confidential and secure.</p>
</li>
<li><p><strong>Prevention of Financial Loss</strong>: Protects against financial fraud and theft, which can have severe economic impacts.</p>
</li>
<li><p><strong>Maintaining Business Continuity</strong>: Helps in keeping business operations running smoothly by preventing disruptions caused by cyber attacks.</p>
</li>
<li><p><strong>Building Trust</strong>: Ensures that customers and clients feel safe doing business with you, knowing their data is protected.</p>
</li>
</ul>
<h3 id="heading-resources-for-learning-cyber-security">Resources for Learning Cyber Security</h3>
<ul>
<li><p><strong>Coursera</strong>: Offers courses on cyber security from top universities and companies.</p>
</li>
<li><p><strong>Cybrary</strong>: Provides free and paid courses on various cyber security topics.</p>
</li>
<li><p><strong>edX</strong>: Offers online courses from institutions like MIT and Harvard on cyber security.</p>
</li>
</ul>
<p>    In conclusion, the tech landscape is rapidly evolving, and staying ahead requires continuous learning and adaptation. The top 5 IT skills in 2024—Artificial Intelligence, Cloud Computing and DevOps, Full Stack Development, Data Science and Analytics, and Cyber Security—are essential for anyone looking to thrive in the industry. By investing time in mastering these skills and utilizing the resources provided, you can position yourself for success in the ever-changing world of technology. Happy learning! 😇</p>
]]></content:encoded></item><item><title><![CDATA[Scaling - System Design 01]]></title><description><![CDATA[Scaling is an important part of system design. Without scaling, no application can survive. In this blog, I will explain scaling with a real-world example, making it easy to understand, so everyone can learn the concept quickly.
Let's consider an exa...]]></description><link>https://blog.yatharthverma.dev/scaling-system-design-01</link><guid isPermaLink="true">https://blog.yatharthverma.dev/scaling-system-design-01</guid><category><![CDATA[scaling]]></category><category><![CDATA[System Design]]></category><category><![CDATA[architecture]]></category><dc:creator><![CDATA[Yatharth Verma]]></dc:creator><pubDate>Sat, 22 Jun 2024 13:02:20 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1719061313232/70a82a67-bba8-4930-97bb-54f252dbd4b1.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Scaling is an important part of system design. Without scaling, no application can survive. In this blog, I will explain scaling with a real-world example, making it easy to understand, so everyone can learn the concept quickly.</p>
<p>Let's consider an example of an entrepreneur named Yash. He built a social media platform called "ConnectWithWorld."</p>
<p>His initial setup is as following:</p>
<ol>
<li><p><strong>Technology:</strong> He is using MERN stack for the backend and frontend.</p>
</li>
<li><p><strong>Single Server:</strong> His application is hosted on single server.</p>
</li>
<li><p><strong>Traffic:</strong> Initially the traffic is not much. Its low to moderate most of the times. So single server is easily able to handle the load right now.</p>
</li>
</ol>
<p>One day he shared his application on Linkedin and Twitter. His post went viral and lots of users started coming to his social media platform. They started using it daily and posting lots of videos, threads etc.</p>
<p>One day what happened is the platform started getting slow. Because it was not able to handle the amount of users who were using the platform and posting stuff, it went really slow. So Yash started researching about it and found out about Scaling.</p>
<p>Approaches which he did to handle the slowness:</p>
<ol>
<li><p><strong>Vertical Scaling:</strong></p>
<ol>
<li><p>Currently his application is running on a single server hosted on some cloud provider (AWS / GCP).</p>
</li>
<li><p>He upgraded the server and bought more RAM, more CPU and more Storage to handle the load.</p>
</li>
<li><p>With the upgrade, performance improved a lot and users were really happy with how fast the application was working.</p>
</li>
<li><p>One day, something bad happened, because of the huge load and lots of users posting threads and videos, server hit the limit and all its storage was full, RAM was full and eventually server got shut down. This led to a very big downtime for the application and all the users were really frustrated because of this.</p>
</li>
</ol>
</li>
<li><p><strong>Horizontal Scaling:</strong></p>
<ol>
<li><p>To ensure reliability and availability of the platform, he decided to do horizontal scaling.</p>
</li>
<li><p>He bought more servers from the cloud provider (AWS / GCP) and deployed his application code in all those servers.</p>
<ol>
<li>Because of this, now there is no single point of failure and even if one application goes down, we have another server which can serve the requests now</li>
</ol>
</li>
<li><p>Yash setup one load balancer as well, because now we have multiple servers and multiple users who are using the platform. So we need to divide the requests to all the machines, so that there is no high load on a single machine at a given time.</p>
</li>
</ol>
</li>
</ol>
<p>After doing both vertical and horizontal scaling, finally Yash was able to make the platform stable and serve lots of users with good speed.</p>
<p>There are other things involved as well as even after horizontal scaling like load balancing, database replication / sharding, CDNs etc. We will discuss that in coming blogs.</p>
<p>I hope this blog was really helpful and you all learnt something new.</p>
<p>Thank you all for reading this blog. Cheers 🍻</p>
]]></content:encoded></item><item><title><![CDATA[FormVibe - Create Beautiful Forms with Ease]]></title><description><![CDATA[Team Members

Yatharth Verma

Description
Introducing FormVibe - Create Beautiful Forms with Ease
In the digital era, forms are a vital tool for gathering information and engaging with users. However, designing visually appealing and user-friendly fo...]]></description><link>https://blog.yatharthverma.dev/formvibe</link><guid isPermaLink="true">https://blog.yatharthverma.dev/formvibe</guid><category><![CDATA[Appwrite]]></category><category><![CDATA[Appwrite Hackathon]]></category><category><![CDATA[#appwrite #AppwriteHackathon]]></category><dc:creator><![CDATA[Yatharth Verma]]></dc:creator><pubDate>Tue, 13 Jun 2023 18:44:26 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1686672770525/baa82c6c-b9fc-4bc0-8c06-b00708fed5ec.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3 id="heading-team-members">Team Members</h3>
<ul>
<li><a target="_blank" href="https://yatharthverma.dev">Yatharth Verma</a></li>
</ul>
<h3 id="heading-description">Description</h3>
<p>Introducing <a target="_blank" href="https://form-vibe.vercel.app/"><strong>FormVibe</strong></a> - Create Beautiful Forms with Ease</p>
<p>In the digital era, forms are a vital tool for gathering information and engaging with users. However, designing visually appealing and user-friendly forms can be a daunting task that requires technical expertise and consumes valuable time. That's where FormVibe comes to the rescue.</p>
<p>Simplicity and flexibility are at the heart of FormVibe. With its intuitive drag-and-drop interface, creating stunning forms has never been easier. Select from a variety of form elements and arrange them according to your needs, all with complete customization options. Whether you're creating a basic contact form or a complex survey, FormVibe has you covered.</p>
<p>Choose from a wide range of form elements, including text fields, dates, phone numbers, file uploads, yes/no options, and rating scales. FormVibe's diverse collection of elements ensures that you can capture the desired data accurately, no matter what your form requirements are.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686681591797/18b4e79a-a517-4361-9874-47cd249eb3eb.png" alt class="image--center mx-auto" /></p>
<p>One of the key highlights of FormVibe is its collection of custom templates. These templates serve as a starting point for users, offering pre-designed forms tailored to specific purposes such as job applications or surveys.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686689783976/99bb3bae-3df4-498e-89c7-b517f09ca7c0.png" alt class="image--center mx-auto" /></p>
<p>Once a form is created, FormVibe provides users with a preview of how the form will appear to the end users. This feature allows creators to ensure that their forms look and function exactly as intended before sharing them with their target audience.</p>
<p>FormVibe takes it a step further by generating a shareable URL for each form, enabling users to seamlessly distribute their forms through various channels such as email, social media, or embedded on websites. By providing a convenient and accessible way to share forms, FormVibe empowers users to reach their intended respondents effortlessly.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686673717549/6a98b169-1089-4c0a-8b3a-8e8b3cccadfd.png" alt class="image--center mx-auto" /></p>
<p>To help users stay organized and informed, FormVibe offers a comprehensive dashboard that displays all form responses in one centralized location.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686673934342/b923251c-fcf1-4410-baa6-14632817e5cb.png" alt class="image--center mx-auto" /></p>
<p>FormVibe goes beyond the conventional form-building experience by offering users the freedom to select the preferred form rendering type for their audience. By providing choices such as Airtable or Typeform.</p>
<p><strong>Airtable Form Type Preview</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686673854688/b2d4574a-b8a9-41ba-a4bc-a43a13da4c09.png" alt class="image--center mx-auto" /></p>
<p><strong>Typeform Type Preview</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686690045164/a6a2e848-3d01-4db2-a482-1abfc66cab23.png" alt class="image--center mx-auto" /></p>
<p>Recognizing the importance of branding, FormVibe allows users to personalize their forms by adding their own banner and icon images. By incorporating these visual elements, users can reinforce their brand identity and create a cohesive experience for their respondents.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686673998534/698a85cb-e130-44da-ad8f-8071601bc175.png" alt class="image--center mx-auto" /></p>
<p>FormVibe doesn't stop at form creation and data collection; it aims to deliver an exceptional user experience throughout the entire form-building process. The platform's user-friendly interface and intuitive features make it accessible to both seasoned developers and those with limited technical expertise. FormVibe's commitment to improving the developer experience and user experience is evident in its streamlined workflows and extensive customization options, enabling users to create forms that are not only functional but also visually stunning.</p>
<p>In conclusion, FormVibe empowers users to create beautiful forms with ease.</p>
<h3 id="heading-how-i-started-this-project">How I Started This Project</h3>
<p>I spent my first week thinking about the idea. Then the second week I started making designs of how my actual web app will look when users will be using it.</p>
<p>Spent three to five days on the designs in the second week.</p>
<p>You can find all my wireframes and designs for the project here at the below link</p>
<p><a target="_blank" href="https://www.figma.com/file/LlaVLipDZOOjVmmj8XmVIW/Appwrite-Hackathon---Project-Idea---Form-Management?type=design&amp;node-id=0%3A1&amp;t=wz5pOaAI1WMoc1yu-1">Figma link</a></p>
<p>Attaching a small screenshot of my Figma designs</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686690414662/13140fc0-fe97-42f8-b2b0-b2387e153075.png" alt class="image--center mx-auto" /></p>
<p>Then after finalizing the designs, Mid 2nd week I started analysing all the tech stack which I will be using for this project. I finalized the following tech stack.</p>
<h3 id="heading-tech-stack-i-used">Tech Stack I Used</h3>
<ul>
<li><p><a target="_blank" href="http://appwrite.io/">Appwrite</a></p>
</li>
<li><p><a target="_blank" href="https://nextjs.org/">NextJS</a></p>
</li>
<li><p><a target="_blank" href="https://nextjs.org/">Tailwind CSS</a> - for Styling</p>
</li>
<li><p><a target="_blank" href="https://github.com/react-dnd/react-dnd">React-DND</a> - for drag and drop functionality</p>
</li>
<li><p><a target="_blank" href="https://formik.org/">Formik and yup</a> - for forms and validation</p>
</li>
<li><p><a target="_blank" href="https://lucide.dev/">Lucide</a> icons</p>
</li>
<li><p><a target="_blank" href="https://ui.shadcn.com/">Shadcn UI</a> Components</p>
</li>
</ul>
<p>In the third week, I started developing the project. I started with the authentication first. It was a really good experience learning Appwrite and integrating it into the project.</p>
<p>After authentication, I started making my dashboard and builder page according to the designs. Following are some of the challenges I faced while making this web app.</p>
<h3 id="heading-challenges-faced">Challenges Faced</h3>
<p>Building FormVibe was an exhilarating journey filled with numerous challenges and learning opportunities. Throughout the development process, I encountered a series of obstacles that required careful analysis, innovative solutions, and the utilization of cutting-edge technologies.</p>
<ul>
<li><p>One of the initial challenges I faced was implementing drag-and-drop functionality. As an integral feature of FormVibe, it was crucial to find an efficient and reliable solution. After thorough research and experimentation, I discovered React DnD, a powerful library that enabled the seamless integration of drag-and-drop capabilities into the application. Leveraging this library, I successfully incorporated intuitive drag-and-drop interactions, allowing users to effortlessly create their customized forms within FormVibe.</p>
</li>
<li><p>Another significant challenge I encountered revolved around rendering the forms and making them editable for customization. Achieving a dynamic and user-friendly interface was paramount. I delved into exploring various techniques and patterns to accomplish this goal. By leveraging React's component-based architecture and state management, I devised an ingenious solution that allowed users to manipulate and customize their forms with ease. The ability to add, edit, and remove form elements became a seamless and intuitive process, empowering users to tailor their forms to their unique needs.</p>
</li>
<li><p>In addition to form creation, handling user responses was yet another obstacle I had to overcome. It was imperative to design a robust mechanism that would efficiently collect, store, and manage the data submitted by users.</p>
</li>
<li><p>Furthermore, offering full customization of forms was a critical aspect of FormVibe. I strived to provide users with an extensive range of customization options, allowing them to create forms that aligned precisely with their branding and aesthetic preferences. Implementing this level of flexibility required meticulous planning and a comprehensive understanding of user requirements. By leveraging a combination of CSS frameworks, design libraries, and flexible component architectures, I enabled users to personalize their forms extensively, making FormVibe a versatile tool for a wide array of use cases.</p>
</li>
</ul>
<p>Building FormVibe was undoubtedly an enjoyable and rewarding project, albeit filled with challenges that pushed the boundaries of my knowledge and skills.</p>
<h3 id="heading-how-appwrite-helped-in-this-project">How Appwrite Helped in this Project</h3>
<p>As a developer who has explored various BaaS and cloud solutions, I can confidently say that Appwrite stands out from the crowd with its exceptional simplicity and user-friendly experience. Having used platforms like Firebase in the past, I have come to appreciate Appwrite's seamless integration process and intuitive console, making it my top choice for backend development.</p>
<p>During my journey with Appwrite, I had the opportunity to integrate various services, each of which proved to be a valuable addition to my projects.</p>
<ul>
<li><p>The Authentication service provided a secure and straightforward way to implement login and signup functionality, ensuring that user data remains protected. With just a few lines of code, I was able to incorporate robust authentication features into my applications, saving me valuable time and effort.</p>
</li>
<li><p>Appwrite's Databases service offers a reliable and scalable solution for storing forms, user data, and responses. Its ease of use and powerful querying capabilities allowed me to efficiently manage and retrieve data, providing a seamless experience for both developers and end-users.</p>
</li>
<li><p>When it came to storing files or images, Appwrite's Storage service proved to be a game-changer. Uploading and retrieving files was a breeze, thanks to the simple API integration and robust infrastructure behind the scenes.</p>
</li>
</ul>
<p>In conclusion, Appwrite has undoubtedly revolutionized the way I approach backend development and integrate cloud services.</p>
<h3 id="heading-code-repository-link">Code Repository Link</h3>
<p>FormVibe is proudly an open-source project, welcoming contributions from the community.</p>
<p>If you're passionate about FormVibe and would like to contribute to its development, I encourage you to visit my GitHub repository at</p>
<p><a target="_blank" href="https://github.com/yatharth1706/FormVibe">FormVibe Github Repository</a></p>
<p>By exploring the repository, you can delve into the codebase, propose improvements, report issues, and even submit your pull requests. Your contributions will help shape the future of FormVibe and make it even more remarkable.</p>
<p>Together, let's make FormVibe an exceptional web application for creating beautiful forms with ease and efficiency.</p>
<h3 id="heading-demo-recording-of-project">Demo Recording of Project</h3>
<p>You can watch a demo of my project on the below link. I have uploaded it to my youtube channel.</p>
<p><a target="_blank" href="https://youtu.be/FRMfz-3pbi0">https://youtu.be/FRMfz-3pbi0</a></p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://youtu.be/FRMfz-3pbi0">https://youtu.be/FRMfz-3pbi0</a></div>
<p> </p>
<p>This was all about my project. It was fun building this project. Also got to learn a lot about <a target="_blank" href="https://appwrite.io">Appwrite</a>.</p>
<p>Do checkout FormVibe here:</p>
<p><a target="_blank" href="https://form-vibe.vercel.app/">https://form-vibe.vercel.app/</a></p>
<p><strong>Test credentials which you can use to test the website</strong></p>
<p>email: <a target="_blank" href="mailto:testuser@gmail.com">testuser@gmail.com</a></p>
<p>password: Test123@</p>
<p>Thank you <a target="_blank" href="https://hashnode.com"><strong>hashnode</strong></a> and <a target="_blank" href="https://appwrite.io/"><strong>appwrite</strong></a> for this hackathon opportunity.</p>
]]></content:encoded></item><item><title><![CDATA[NPM vs Yarn vs Pnpm]]></title><description><![CDATA[Hi all, in this blog we are going to learn some differences between npm, yarn and pnpm. I guess everyone is aware of all these package managers.
Let's first understand what exactly is package manager just in a brief.
Package Manager
Package manager l...]]></description><link>https://blog.yatharthverma.dev/npm-vs-yarn-vs-pnpm</link><guid isPermaLink="true">https://blog.yatharthverma.dev/npm-vs-yarn-vs-pnpm</guid><category><![CDATA[npm]]></category><category><![CDATA[Yarn]]></category><category><![CDATA[pnpm]]></category><dc:creator><![CDATA[Yatharth Verma]]></dc:creator><pubDate>Tue, 02 May 2023 15:36:06 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1683041107944/c0343ce4-3196-41db-8901-6f70a7d1dbf1.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hi all, in this blog we are going to learn some differences between npm, yarn and pnpm. I guess everyone is aware of all these package managers.</p>
<p>Let's first understand what exactly is package manager just in a brief.</p>
<h3 id="heading-package-manager">Package Manager</h3>
<p>Package manager lets you install and manage dependencies your javascript project requires to work. Before moving forward lets learn little history about npm how it came and all.</p>
<h3 id="heading-history">History</h3>
<p>npm (Node Package Manager) is the first package manager. It was released in 2010. It comes prebuilt with NodeJS. You don't have to download it explicitly. Earlier before npm, developers had to manually download the dependencies and manage them in their projects. But it became difficult to manage them as projects grew. That's where npm came in and helped developers easily manage the dependencies under a single folder named node_modules in your project. Over time, the tool evolved to include features like versioning, dependency resolution, and a package publishing system.</p>
<p>In 2015, NPM was acquired by Joyent, the company that created Node.js. This acquisition brought additional resources to the NPM project and helped it become a critical part of the Node.js ecosystem.</p>
<p>In 2016, NPM faced a significant security incident where a malicious package was published to the repository. The package was able to steal sensitive information from developers who installed it, highlighting the importance of package security. Since then, NPM has implemented additional security measures, including two-factor authentication and automatic vulnerability scanning.</p>
<h3 id="heading-why-other-package-managers-came-in-the-market">Why other package managers came in the market?</h3>
<p>On October 2016, Facebook announced a collaborative effort with Google and a few others to develop a new package manager that would solve the issues with consistency, security, and performance problems that npm had at the time. They named the alternative Yarn, which stands for Yet Another Resource Negotiator.</p>
<p>Yarn's architectural design is almost similar to npm, but it's much faster than npm as it parallelly installs all the packages and their dependencies. But still from the disk efficiency parameter it's not good as its using the same underlying structure as npm.</p>
<p>That's where pnpm helps. Let's understand that in the next section.</p>
<h3 id="heading-pnpm-and-its-benefits">Pnpm and its benefits</h3>
<p>Version 1 of pnpm was released in 2017 by Zoltan Kochan. It is a drop-in replacement for npm, so if you have an npm project, you can use pnpm right away!</p>
<p>It solved the major problem that yarn and npm both face is the <strong>flat dependency</strong> <strong>structure</strong> in <strong>node_modules</strong> meaning it stores all the dependencies and interdependencies in node_modules in a flat hierarchy. The main problem with this is disk storage fills up as for every project flat node_modules will be created and also it takes time to install all of these again and again for every project</p>
<p>pnpm solves this problem using <strong>content addressable storage</strong> (single source of truth) where it keeps all the dependencies folders at a single place. It uses hard links and symbolic links. In node_modules pnpm only keeps the parent dependencies or the main dependencies which your project depends on and all the other interdependencies will be stored as symbolic links (which means a reference to the files in content addressable storage)</p>
<p>So because of all these pnpm installs packages much faster and uses less disk space in comparison to npm and yarn</p>
<p>All these were some differences between yarn, npm and pnpm. Let me know in the comments which one you use and what you like most about that package manager.</p>
<p>Have a nice day</p>
<p>Regards,</p>
<p>Yatharth Verma</p>
<p>Software Engineer</p>
<p><a target="_blank" href="https://www.yatharthverma.dev/">Do checkout my portfolio</a></p>
]]></content:encoded></item><item><title><![CDATA[SQL Procedures Security Access Control]]></title><description><![CDATA[Hello All,
In this thread we will learn about access control security for procedures. Recently I was working on one project in my company where I needed one procedure in the production database along with permissions to execute it with my custom user...]]></description><link>https://blog.yatharthverma.dev/sql-procedures-security-access-control</link><guid isPermaLink="true">https://blog.yatharthverma.dev/sql-procedures-security-access-control</guid><category><![CDATA[SQL]]></category><category><![CDATA[security access controls in sql]]></category><dc:creator><![CDATA[Yatharth Verma]]></dc:creator><pubDate>Tue, 14 Feb 2023 06:06:35 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/iIJrUoeRoCQ/upload/a65ce884546c70d48901acb4b0e1aed5.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hello All,</p>
<p>In this thread we will learn about access control security for procedures. Recently I was working on one project in my company where I needed one procedure in the production database along with permissions to execute it with my custom user.</p>
<p>But I was not able to execute it. It was throwing an error access denied for some other user which I was not even using to connect to database and execute procedure.</p>
<p>Then I researched about this a lot. And found out that all stored programs like SQL Procedures, Views, Triggers and events they execute within <strong>Definer</strong> context. What does this mean ?</p>
<p>It means whoever creates the procedure, execution always happen in that user context. If that user does not have all the privileges for operations which procedure is performing, other users who are trying to invoke the procedure will also not be able to execute the procedure. It does not matter whether that user has full permission or not.</p>
<p>Two solutions are there to solve this</p>
<ol>
<li><p>Either get the procedure created from root user who has all the privileges.</p>
</li>
<li><p>Second solution is to define <strong>SQL Security Invoker</strong> keyword while procedure creation</p>
</li>
</ol>
<p>Example:</p>
<pre><code class="lang-sql"><span class="hljs-keyword">CREATE</span> DEFINER = <span class="hljs-string">'admin'</span>@<span class="hljs-string">'localhost'</span> <span class="hljs-keyword">PROCEDURE</span> p2()
<span class="hljs-keyword">SQL</span> <span class="hljs-keyword">SECURITY</span> INVOKER
<span class="hljs-keyword">BEGIN</span>
  <span class="hljs-keyword">UPDATE</span> t1 <span class="hljs-keyword">SET</span> counter = counter + <span class="hljs-number">1</span>;
<span class="hljs-keyword">END</span>;
</code></pre>
<p>For learning about this in more details, I would recommend everyone to check the article here as well. It has everything in detail</p>
<p>Link: <a target="_blank" href="https://dev.mysql.com/doc/refman/5.6/en/stored-objects-security.html">https://dev.mysql.com/doc/refman/5.6/en/stored-objects-security.html</a></p>
<p>Thank you all for reading this.</p>
]]></content:encoded></item><item><title><![CDATA[How to use svgs in nextjs ?]]></title><description><![CDATA[I use nextjs a lot whenever I build something. In Nextjs you can't directly use svgs and use it according to your convenience. When I was building one project where I had to import svg and show it in component, Nextjs was not able to show it in the w...]]></description><link>https://blog.yatharthverma.dev/how-to-use-svgs-in-nextjs</link><guid isPermaLink="true">https://blog.yatharthverma.dev/how-to-use-svgs-in-nextjs</guid><category><![CDATA[Next.js]]></category><category><![CDATA[SVG]]></category><dc:creator><![CDATA[Yatharth Verma]]></dc:creator><pubDate>Sun, 05 Feb 2023 13:49:12 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1675603944420/828d33b9-2c0f-4968-9223-099047a4cf6a.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I use nextjs a lot whenever I build something. In Nextjs you can't directly use svgs and use it according to your convenience. When I was building one project where I had to import svg and show it in component, Nextjs was not able to show it in the web browser.</p>
<p>The two best solutions which are available online and can help import svgs properly are listed below. You can use any method listed below to import svgs properly and use in Nextjs</p>
<h2 id="heading-solution-1">Solution 1</h2>
<p>Use SVGR. Install it by running the below command</p>
<pre><code class="lang-javascript">npm i @svgr/webpack
</code></pre>
<p>Add the following code in next.config.js file and you are all done</p>
<pre><code class="lang-javascript"><span class="hljs-built_in">module</span>.exports = {
  webpack(config) {
    config.module.rules.push({
      <span class="hljs-attr">test</span>: <span class="hljs-regexp">/\.svg$/</span>,
      use: [<span class="hljs-string">"@svgr/webpack"</span>]
    });

    <span class="hljs-keyword">return</span> config;
  }
};
</code></pre>
<p>Restart the nextjs server, as next.config.js file is created / updated.</p>
<p>After that, you can use svgs without any issues. Below is one simple example to import svg and use in your code</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">import</span> React <span class="hljs-keyword">from</span> <span class="hljs-string">'react'</span>;
<span class="hljs-keyword">import</span> SVGBackground <span class="hljs-keyword">from</span> <span class="hljs-string">"./Background.svg"</span>;

<span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> AppComponent = <span class="hljs-function">() =&gt;</span> (
  <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">SVGBackground</span> /&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></span>
);
</code></pre>
<h2 id="heading-solution-2">Solution 2</h2>
<p>Use babel-plugin-react-svg. Install it first</p>
<pre><code class="lang-javascript">npm install --save-dev babel-plugin-inline-react-svg
</code></pre>
<p>Create / Update .babelrc file in the root of your project with the below code</p>
<pre><code class="lang-javascript">{
  <span class="hljs-string">"presets"</span>: [<span class="hljs-string">"next/babel"</span>],
  <span class="hljs-string">"plugins"</span>: [<span class="hljs-string">"inline-react-svg"</span>]
}
</code></pre>
<p>And you are done. You can now use svg as components in Nextjs properly without any hassle.</p>
<p>These two are my favourite methods to use svgs in Nextjs. There are other available methods also which can be found in the internet which you can also use.</p>
<p>Thanks for reading this article. I hope it was useful.</p>
<p>Keep learning and keep rocking 🚀</p>
]]></content:encoded></item><item><title><![CDATA[Polyfills]]></title><description><![CDATA[What are exactly polyfills?
New built in functions or new syntaxes in javascript, they might not work in outdated browsers. Some javascript engines might not be supporting them. To solve this problem, polyfills comes into the picture.
Pollyfill is li...]]></description><link>https://blog.yatharthverma.dev/polyfills</link><guid isPermaLink="true">https://blog.yatharthverma.dev/polyfills</guid><category><![CDATA[JavaScript]]></category><category><![CDATA[polyfills]]></category><dc:creator><![CDATA[Yatharth Verma]]></dc:creator><pubDate>Thu, 29 Sep 2022 17:12:42 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1664439957281/jdkRa0T-o.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>What are exactly polyfills?</p>
<p>New built in functions or new syntaxes in javascript, they might not work in outdated browsers. Some javascript engines might not be supporting them. To solve this problem, polyfills comes into the picture.</p>
<p>Pollyfill is like a code snippet that helps browser to support javascript new or native functions as well as new syntaxes to work properly.</p>
<p>Lets discuss a very simple example.</p>
<p>Lets say in some outdated browsers Array.filter function is not working. So lets create a polyfill of filter function which will work in all the browsers which does not support filter function</p>
<p>Example Code:</p>
<pre><code>    <span class="hljs-built_in">Array</span>.prototype.filter = <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">callbackFn</span>) </span>{
      <span class="hljs-keyword">let</span> outputArr = [];

      <span class="hljs-built_in">this</span>.forEach(<span class="hljs-function">(<span class="hljs-params">el, index</span>) =&gt;</span> {
        <span class="hljs-keyword">if</span> (callbackFn(el, index, <span class="hljs-built_in">this</span>)) {
          outputArr.push(el);
      }
    });

    <span class="hljs-keyword">return</span> outputArr;
  };

  <span class="hljs-built_in">console</span>.log([<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>, <span class="hljs-number">6</span>, <span class="hljs-number">7</span>].filter(<span class="hljs-function">(<span class="hljs-params">el</span>) =&gt;</span> el % <span class="hljs-number">2</span> == <span class="hljs-number">0</span>));
</code></pre><p>So in the above example, I am creating a polyfill of filter function. I am replacing the filter function present in prototype of Array with my own polyfill function which is doing following:</p>
<ol>
<li>Creating a new array</li>
<li>Looping over the existing array and checking whether the condition is true or not. If condition is true, we are putting the elements in new array</li>
<li>Lastly we will return the array</li>
</ol>
<p>In this way polyfill can be created. </p>
<p>Lets discuss one more example. Lets create a polyfill of map function</p>
<p>Example Code:</p>
<pre><code>  <span class="hljs-built_in">Array</span>.prototype.map = <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">callbackFn</span>) </span>{
    <span class="hljs-keyword">let</span> outputArr = [];

    <span class="hljs-built_in">this</span>.forEach(<span class="hljs-function">(<span class="hljs-params">element, index</span>) =&gt;</span> {
      outputArr.push(callbackFn(element, index, <span class="hljs-built_in">this</span>));
    });

    <span class="hljs-keyword">return</span> outputArr;
  };

  <span class="hljs-built_in">console</span>.log([<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>].map(<span class="hljs-function">(<span class="hljs-params">e</span>) =&gt;</span> <span class="hljs-number">10</span> * e));
</code></pre><p>Its almost similar to the first example. Only difference is we are not checking conditions. We are executing the callbackFn on every element and pushing the result of callback function in the new array that we will return.</p>
<p>So, I hope now you understand what are polyfills and how to create one. There are other examples of polyfill as well. For every existing function in javascript you can make a polyfill to make older or outdated browsers to support them.</p>
<p>Thank you all.
Regards, Yatharth</p>
]]></content:encoded></item></channel></rss>