<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Shruti Singh on Medium]]></title>
        <description><![CDATA[Stories by Shruti Singh on Medium]]></description>
        <link>https://medium.com/@shruti9520?source=rss-bf78be10b7a0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*EVxsdlcDFytIY6a7WYhObA.jpeg</url>
            <title>Stories by Shruti Singh on Medium</title>
            <link>https://medium.com/@shruti9520?source=rss-bf78be10b7a0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 14:21:30 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shruti9520/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[AI Without the Weeds (Part 1): Core Concepts for Tech Leadership]]></title>
            <link>https://medium.com/@shruti9520/ai-without-the-weeds-part-1-core-concepts-for-tech-leadership-38bb07ad9e64?source=rss-bf78be10b7a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/38bb07ad9e64</guid>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Shruti Singh]]></dc:creator>
            <pubDate>Mon, 12 Oct 2026 20:12:51 GMT</pubDate>
            <atom:updated>2026-10-12T20:14:29.587Z</atom:updated>
            <content:encoded><![CDATA[<p>Artificial intelligence is everywhere. If you work in tech, you probably hear the word “AI” a million times a day, and honestly, that’s not an exaggeration. You might even be using it to streamline your daily workflows. But have you ever stopped to wonder how things actually work behind the scenes?</p><p>If you are in technical leadership, you’ve likely tried to learn the core concepts of AI, only to find yourself immediately lost in the weeds. The truth is, if you’re driving high-stakes architecture or product decisions, you don’t need to know the mathematical ins and outs of a transformer model… that is a Machine Learning Engineer’s job. But you <em>do</em> need to understand the fundamental mechanics to make the right calls.</p><p>If this sounds familiar, I’ve got you covered. This series is designed specifically for tech leaders. It’s the architectural sweet spot: not too high-level, and not bogged down in code. In this first article, I’ll cover the absolute basics : what AI is, how it learns, Generative AI, LLMs, GPU, transformers…etc. In future installments, we’ll dive into the working mechanics of RAG, vector databases, semantic search, MCP…etc. Let’s jump in.</p><h3><strong>What is AI?</strong></h3><p>Artificial intelligence is technology that mimics how a human brain thinks, learns, and solves problems. Instead of just following rigid, pre-written rules, AI systems analyze massive amounts of data to learn patterns, adapt, and make decisions.</p><p>But how does that learning actually happen? There are four primary ways you should understand:</p><p><strong>1. Supervised Learning:</strong></p><p>You train the AI using a “labeled” dataset. This means the input data already comes with the correct output attached, allowing the AI to learn the relationship between the two. Once it has consumed enough labeled data, you give it new data to see if it can predict the outcome. For example, you feed the AI thousands of emails already tagged as “spam” or “not spam.” The next time a fresh email hits your inbox, the AI uses what it learned to instantly label it correctly.</p><p><strong>2. Unsupervised Learning:</strong></p><p>In this approach, you feed a massive amount of raw, unlabeled data to the machine and let it automatically find patterns and categorize items based on their characteristics. Let’s say you give the AI a massive pile of assorted buttons. Without any instructions from you, the AI will figure out how to group them by color, size, and utility.</p><p><strong>3. Semi-Supervised Learning:</strong></p><p>As the name suggests, this is a hybrid approach. In the real world, paying humans to manually label millions of data points is incredibly expensive and time-consuming. In semi-supervised learning, you use a tiny batch of labeled data to teach the AI the basics. The AI then takes what it learned and applies it to a massive mountain of unlabeled data to figure out the rest.</p><p><em>For example:</em> Imagine you have 100,000 customer reviews, but you only have the time to manually tag 500 of them as “Positive” or “Negative.” The AI learns the core sentiment patterns from those 500 reviews, and then automatically categorizes the remaining 99,500 for you. It’s the ultimate operational time-saver.</p><p><strong>4. Reinforcement Learning from Human Feedback (RLHF):</strong></p><p>This is where the AI learns through trial, reward, and human grading. It generates an output, and a “human in the loop” judges how well it did. Let’s say you are designing an AI cooking assistant. You let the machine process thousands of cookbooks to learn the basics. When it starts generating its own recipes, you bring in expert chefs to review them. The chefs rate the recipes, and based on that human feedback, the AI alters its approach to get better. This exact fine-tuning process is what powers modern AI tools like ChatGPT!</p><p>Okay, now you must be wondering: <em>These learning models are fine, but where are the buzzwords? What about Generative AI, LLMs, Transformers, Tokens, and GPUs?</em></p><p>Don’t worry, I’ve got you covered.</p><h3><strong>What is Generative AI &amp; What is an LLM?</strong></h3><p>Generative AI is a broad branch of artificial intelligence focused on creating entirely new content from scratch (text, images, audio, code).</p><p>Under that massive Generative AI umbrella sits the <strong>LLM (Large Language Model)</strong>. At its core, an LLM is simply a massive neural network trained to do one thing incredibly well: predict the next word in a sequence.</p><p><em>(Note: To be highly accurate, LLMs actually predict the next </em><strong><em>token</em></strong><em>, not just words. A token can be a single character, a chunk of a word, or an entire word. This is how the AI breaks down human language into mathematical pieces it can process).</em></p><p>To learn how to predict that next token, LLMs rely heavily on <strong>Self-Supervised Learning</strong>. This is a bridge between supervised and unsupervised learning. The model creates its own labels from massive amounts of raw, unlabeled data. For example, during training, the model will mask out a word in a sentence, try to predict it, and then check the actual hidden word to see if it was right.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*W16emg2uSmhVXQUVgV9K7Q.png" /></figure><h3><strong>What is a Transformer?</strong></h3><p>So, we know what an LLM is and how it trains. But what is a Transformer?</p><p>The Transformer is the underlying neural network architecture that acts as the “brain” behind modern LLMs like GPT, Gemini, and Claude. Whatever mind-boggling things you see AI doing today, it is fundamentally because of the Transformer architecture.</p><p>Before Transformers came along, we relied on older neural network architectures like Recurrent Neural Networks (RNNs) and LSTMs. The problem was that they processed text sequentially — word by word. If a paragraph was too long, the AI would literally “forget” the beginning of the text by the time it reached the end.</p><p>Transformers revolutionized how machines process human language by introducing two breakthrough capabilities (first published in the famous 2017 research paper, <em>“Attention Is All You Need”: </em><a href="https://proceedings.neurips.cc/paper_files/paper/2017/file/3f5ee243547dee91fbd053c1c4a845aa-Paper.pdf">https://proceedings.neurips.cc/paper_files/paper/2017/file/3f5ee243547dee91fbd053c1c4a845aa-Paper.pdf</a>):</p><ol><li><strong>Parallel Processing:</strong> Instead of reading word by word, Transformers process an entire sequence of text all at once. This makes training massive models on giant datasets incredibly fast and scalable.</li><li><strong>The Attention Mechanism:</strong> This allows the model to look at a specific word while simultaneously looking at <em>every other word</em> in the sentence to figure out the context. For example, consider the phrases <em>“the bank of the river”</em> and <em>“the bank approved the loan”</em>. A Transformer uses self-attention to mathematically calculate that in the first sentence, “bank” relates to geography (because of “river”). In the second, it relates to finance (because of “loan”).</li></ol><h3><strong>Where do GPUs come into the picture?</strong></h3><p>LLMs fundamentally run on GPUs (Graphics Processing Units). Because LLMs require massive amounts of GPU compute power for both training and inference (generating the answers), you’ve likely noticed that hardware companies like Nvidia have exploded into multi-trillion-dollar behemoths. It’s all about the supply chain!</p><p><em>(Side note: Quantum computing could theoretically be used for this in the future, but it is still highly experimental and not commercially viable right now).</em></p><p><strong>Wait, why can’t we just run models on CPUs?</strong></p><p>A standard CPU typically has anywhere from 4 to 64 cores. Each of those cores is incredibly fast and powerful. Think of a CPU like a Ferrari: it can deliver a few passengers to a destination incredibly fast, one trip at a time.</p><p>A GPU, on the other hand, has thousands of simpler, smaller cores designed to run the exact same mathematical operations on massive tracts of data simultaneously (parallel processing). Think of a GPU like a massive cargo train: it might move slower than the Ferrari, but it can transport thousands of passengers all at the exact same time.</p><p><strong>Fun Fact:</strong> While CPUs are terrible for <em>training</em> models, they are actually somewhat capable of handling <em>inference</em> (running a finished model to get an answer); just not at a massive enterprise scale. You can absolutely run smaller, open-source models on your personal laptop’s CPU using tools like Ollama or LM Studio. Furthermore, modern computer chips (like Intel Core Ultra or AMD Ryzen AI) now come with a dedicated <strong>NPU (Neural Processing Unit)</strong>. An NPU is a tiny, highly efficient slice of silicon built specifically to handle AI inference math without draining your battery or lagging your CPU!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=38bb07ad9e64" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[System Design Series: Core Concepts of Distributed Systems (Part 1)]]></title>
            <link>https://medium.com/@shruti9520/system-design-series-core-concepts-of-distributed-systems-part-1-b835727f413d?source=rss-bf78be10b7a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/b835727f413d</guid>
            <category><![CDATA[system-design-concepts]]></category>
            <dc:creator><![CDATA[Shruti Singh]]></dc:creator>
            <pubDate>Sun, 11 Oct 2026 01:42:50 GMT</pubDate>
            <atom:updated>2026-10-11T01:42:50.591Z</atom:updated>
            <content:encoded><![CDATA[<p>You can’t design a large-scale distributed system for billions of users without first mastering the basics. Having a clear understanding of core concepts helps you know exactly what tools to reach for and why they matter. To borrow a coffee analogy (since I’m currently sipping a latte): you can’t properly brew the beans until you understand what makes a true espresso! This article explores the essential building blocks of system design, touching on network essentials, API design, data modeling, database indexing, consistent hashing, the CAP theorem, sharding, and caching. If you want a granular, detailed study, you might want to look elsewhere. But if you’re ready for a quick, plain-English refresher on the core technologies, fasten your seatbelt and let’s dive in. :)</p><h4><strong>NETWORK ESSENTIALS</strong></h4><p>At its core, networking is all about getting devices to talk to each other. But how does that actually happen? Think about the last time a picture was transferred from one phone to another via AirDrop or Bluetooth — what underlying technology actually makes that possible? If you search for how networks function, you’ll immediately run into the OSI model. Don’t let the acronym intimidate you; it simply means the network is built in layers (yup, just like a croissant, hehe). While the model consists of 7 layers, system designers and developers typically only need to master three of them: <strong>the Network layer, the Transport layer, and the Application layer.</strong></p><p>Here is the breakdown from the bottom (physical hardware) to the top (software):</p><ul><li><strong>Layer 1: Physical Layer:</strong> Deals with the physical connection between devices (Ethernet cables, fiber optics, Wi-Fi radio waves). It is responsible for transmitting raw data as electrical or optical signals (0s and 1s) across the medium.</li><li><strong>Layer 2: Data Link Layer: </strong>Packages raw bits into “frames” and handles node-to-node delivery on the same local network using MAC addresses. Switches operate here, ensuring data reaches the correct physical device on the local network while performing basic error detection.</li><li><strong>Layer 3: Network Layer: </strong>Handles routing data between <em>different</em> networks. It packages frames into “packets” and uses IP addresses to calculate the fastest, most efficient physical path to the destination. Routers operate at this layer.</li><li><strong>Layer 4: Transport Layer: </strong>Ensures complete end-to-end data delivery between applications. It breaks data into “segments” and uses protocols like TCP (reliable, sequenced delivery used in 3-way handshakes) or UDP (fast, connectionless delivery). <strong>Layer 4 load balancers</strong> operate here, routing traffic based strictly on IP addresses and port numbers without inspecting the content.</li><li><strong>Layer 5: Session Layer: </strong>Establishes, maintains, and terminates communication sessions between two applications. It manages the dialogue, handling connection checkpoints and recovery if a session is interrupted.</li><li><strong>Layer 6: Presentation Layer: </strong>Acts as the data translator. It formats, encrypts, and compresses data so the Application layer can accept it. When your browser performs a TLS handshake to secure an HTTPS connection, or when data is serialized into JSON, it happens here.</li><li><strong>Layer 7: Application Layer:</strong> The layer closest to the end user. It provides network services directly to software applications using protocols like HTTP, DNS, and FTP. <strong>Layer 7 load balancers</strong> and API gateways operate here, making intelligent routing decisions based on the actual content of the request, such as HTTP headers, cookies, or specific URL paths.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BlIhaqVSxJh7DOyngrtwpw.png" /></figure><p>What happens when you type “google.com” on your search engine?</p><ol><li>Your browser looks up the domain (e.g., “google.com”) in the Domain Name System (DNS) to translate it into a numeric IP address, much like a phonebook.</li><li>Your machine establishes a reliable connection with the server using a quick 3-step greeting <strong>TCP handshake</strong> (SYN, SYN-ACK, ACK), followed by a TLS handshake to encrypt and secure the channel.</li></ol><p><strong>3. </strong>Once connected securely, your browser sends a formal request asking the server for the webpage. (<strong>HTTP GET request)</strong></p><p>4. The server receives the request, routes it through load balancers to the right backend systems, and fetches the necessary data.</p><p>5. The server sends the requested webpage (HTML, images, etc.) back to your browser to be rendered on your screen. (<strong>HTTP Response)</strong></p><p>6. After the data is fully transferred, the client and server cleanly close the connection using a 4-step “goodbye” process. This is called TCP Teardown.</p><p>Let’s shift gears to the network protocols that actually matter for system designers and developers..specifically those at the Network, Transport, and Application layers. ;)</p><h4><strong>Network Layer: IP (Internet Protocol)</strong></h4><p>Operating at Layer 3, IP is the internet’s postal service. When you send an espresso recipe over the web, the data is chopped into “packets.” IP slaps a shipping label on each one with a Source and Destination IP. It doesn’t care what’s inside the package or if it arrives in perfect order .. it just handles the addressing and routing so the network knows exactly where it’s going.</p><h4><strong>Transport Layer: TCP vs. UDP</strong></h4><p>This is Layer 4, which is the tier where your standard Layer 4 load balancers operate to route incoming traffic based strictly on IP and port numbers.</p><ul><li><strong>TCP (Transmission Control Protocol):</strong> The reliable workhorse. It requires a <strong>connection handshake, guarantees delivery, and ensures packets arrive in perfect order</strong>. It will actively request retransmission for lost packets, but this strict verification makes it slightly slower due to the overhead.</li><li><strong>UDP (User Datagram Protocol):</strong> The fast, connectionless alternative. <strong>There is no handshake, no delivery guarantee, and no strict ordering</strong>. If a packet drops, UDP just keeps moving. T<strong>his minimal overhead means incredibly low latency, making it the industry standard for live video streaming, multiplayer gaming, and lightning-fast DNS lookups where speed outweighs perfect accuracy</strong>.</li></ul><p><strong>Fun Fact:</strong> While native mobile and desktop apps can open raw UDP connections for custom, high-speed tasks (like multiplayer gaming), web browsers don’t give developers direct access to raw UDP sockets for security reasons.</p><h3>Application Layer Protocols</h3><p>Now, let’s shift gears to the Application Layer (Layer 7). This is the layer closest to the end user and where your software actually lives.</p><p><strong>HTTP/HTTPS (Hypertext Transfer Protocol)</strong></p><p>This is the foundational request-response protocol for data communication on the World Wide Web. It dictates exactly how messages are formatted and transmitted, moving data from Point A (the client) to Point B (the server).</p><p>How does it work? It uses standard methods:</p><ul><li><strong>GET:</strong> Request data from the server.</li><li><strong>POST:</strong> Send new data to the server.</li><li><strong>PUT:</strong> Update existing data on the server.</li><li><strong>PATCH:</strong> Partially update data.</li><li><strong>DELETE:</strong> Remove data from the server.</li></ul><p>It also communicates success or failure using standard status codes (like 200 OK, 404 Not Found, 500 Server Error, 401 Unauthorized, 403 Forbidden, 429 Too Many Requests, and 502 Bad Gateway). Every request includes <strong>Headers</strong> (metadata about the payload) and a <strong>Body</strong> (the actual content). HTTPS is simply the secure version, ensuring all requests and responses are encrypted in transit.</p><p>Crucially, HTTP/HTTPS is just a delivery vehicle. It simply delivers the package; it doesn’t care what the package contains or if the request makes logical sense to the receiving application.</p><p><strong>HTTP vs. API: </strong>A common point of confusion is the difference between an API and HTTP. Think of a restaurant: an API is the <strong>menu</strong>. It defines the rules of engagement..exactly what dishes you can order and what ingredients you can expect. HTTP is the <strong>waiter</strong>. It is the delivery vehicle that physically takes your order to the kitchen and carries your food back to the table. In system design, the API sets the endpoints and rules, while HTTP handles the actual transit.</p><p><strong>HTTP vs. TCP: </strong>Are these competing technologies? No. The fundamental difference is that they operate at different layers of the network architecture. HTTP (Layer 7) actually <em>relies</em> on TCP (Layer 4) to function securely and reliably.</p><h3>API Paradigms: How Services Talk</h3><p>When building APIs for communication between services, you generally choose between three main paradigms:</p><p><strong>1. REST (Representational State Transfer): </strong>The most popular, simple, and flexible way to create APIs. It is a stateless architecture built heavily around standard HTTP methods, mapping them directly to CRUD operations (Create, Read, Update, Delete). The server typically returns responses in JSON, XML, or HTML.</p><ul><li><strong>When to use:</strong> It is the default choice for public-facing external APIs because it is incredibly easy to understand and universally supported.</li></ul><p><strong>2. GraphQL: </strong>A query language designed for highly flexible data fetching. Also stateless, GraphQL allows the client to request <em>exactly</em> the data they need in a single request—preventing &quot;over-fetching&quot; (downloading huge payloads) or &quot;under-fetching&quot; (having to make multiple requests).</p><ul><li><strong>When to use:</strong> Use it when UI flexibility and rapid front-end iteration are top priorities.</li><li><strong>The Catch:</strong> It introduces significant backend complexity and makes standard HTTP-level caching very difficult. When in doubt, default to REST for simplicity.</li></ul><p><strong>3. gRPC: </strong>A high-performance, stateless Remote Procedure Call (RPC) framework built by Google on HTTP/2 and Protocol Buffers. It offers significantly smaller payloads and much faster CPU parsing than JSON.</p><ul><li><strong>When to use:</strong> It is the gold standard for internal, service-to-service communication in a microservices architecture. Use it when throughput is critical, latencies are network-bound, or when passing massive amounts of internal data.</li><li><strong>When NOT to use:</strong> Do not use gRPC for public-facing external APIs, as browser support is notoriously poor.</li></ul><p><strong>Rule of Thumb:</strong> Use REST for external clients, route them through an API Gateway, and use gRPC for internal microservices behind the scenes.</p><h4>Stateful &amp; Real-Time Protocols</h4><p>What happens when you need real-time data instead of waiting for a client to request it?</p><p><strong>SSE (Server-Sent Events): </strong>A native HTTP standard that allows a server to push a continuous stream of messages to a client over a single, long-lived connection. It is stateful and strictly <strong>uni-directional</strong> (server to client).</p><ul><li><strong>When to use:</strong> Perfect for real-time updates where the user only needs to receive data, like news feeds, stock tickers, sports scores, or system progress bars.</li><li><strong>Reality Check:</strong> Load balancers will inevitably drop long-lived SSE connections. You must design your server to track message IDs so reconnecting clients can seamlessly resume without dropping data.</li></ul><p><strong>WebSockets: </strong>A persistent, stateful TCP connection initiated via an &quot;HTTP upgrade&quot; that allows for <strong>bi-directional</strong>, real-time communication with extremely low latency.</p><ul><li><strong>When to use:</strong> Only when you need high-frequency, two-way communication. Examples include live chat applications (like WhatsApp), multiplayer gaming, or collaborative editing tools (like Google Docs).</li><li><strong>Reality Check:</strong> WebSockets require stateful infrastructure. This makes load balancing significantly harder, requiring sticky sessions or Pub/Sub backplanes like Redis.</li></ul><blockquote><strong><em>Fun Fact: How do you scale WebSockets to millions of users?</em></strong></blockquote><blockquote><em>Scaling standard HTTP is easy: Load balancers just distribute stateless traffic evenly. Because WebSockets glue a user to a specific server, scaling requires a completely different blueprint:</em></blockquote><ul><li><strong>Layer 4 Load Balancers:</strong> Drop down to a Layer 4 (Network) load balancer (like AWS NLB). It operates at the TCP level, using far less CPU and memory to hold millions of idle connections open.</li><li><strong>Server Tuning (The C10M Problem):</strong> Holding millions of connections requires massive RAM and tuning Linux OS limits (like fs.file-max) so the server doesn&#39;t crash from &quot;too many open files.&quot;</li><li><strong>The Pub/Sub Backplane:</strong> If User A on Server 1 messages User B on Server 2, you need a message broker (Redis Pub/Sub or Kafka) behind the servers to broadcast messages between isolated nodes.</li><li><strong>In-Memory Registry:</strong> Use a fast datastore (Redis) to track exactly which server node every online user is connected to.</li><li><strong>Client Resilience:</strong> Implement &quot;heartbeats&quot; (ping/pong frames) to detect dead connections, and &quot;exponential backoff&quot; so disconnected clients don&#39;t instantly retry and DDoS your load balancer.</li></ul><p><strong>WebRTC</strong></p><p>A complex set of stateful protocols (using UDP) enabling direct <strong>peer-to-peer</strong> media and data streaming, bypassing centralized application servers entirely.</p><ul><li><strong>When to use:</strong> Keep this strictly in the box marked &quot;Video and Audio Conferencing&quot; (e.g., Zoom, Google Meet, Discord Voice).</li><li><strong>When NOT to use:</strong> WebRTC is notoriously brittle. It requires STUN servers (to bypass firewalls) and TURN servers (as fallback relays). Do not use WebRTC to build generic peer-to-peer data architectures; stick to using it solely for media streaming.</li></ul><p>Now, let’s talk about Load Balancing. :)</p><h4><strong>Load Balancing</strong></h4><p>Load balancing is the art of distributing incoming requests across multiple servers so no single machine becomes a bottleneck. There are two primary ways to do this: Client-Side and Server-Side.</p><p><strong>1. Client-Side Load Balancing</strong></p><p>In this model, the client independently decides which backend server to contact by querying a service registry.</p><p><em>Wait, don’t get confused!</em> In system design, the “client” here usually isn’t a web browser. Browsers almost always rely on server-side load balancing (with one exception: DNS, where the DNS server rotates a list of IPs and your browser just picks the first one).</p><p>Instead, client-side load balancing is heavily used <em>internally</em> behind the scenes.</p><ul><li><strong>How it works:</strong> Imagine a shipping app. The Checkout service needs to talk to the Inventory service. Because both are inside your company’s internal network, the Checkout service acts as the “client.” It checks a secure internal registry to see all available Inventory servers and routes the request directly to one itself. The client periodically syncs its list of available servers, bypassing the need for a middleman on every request.</li><li><strong>Pros &amp; Cons:</strong> It is highly efficient and fast because there are zero extra network hops. However, it requires the client to handle the routing logic.</li><li><strong>Examples:</strong> Redis clusters (where nodes use a gossip protocol and the client routes directly to the correct shard) and DNS.</li><li><strong>When to use:</strong> Server-to-server traffic between internal microservices, or for massive client bases where slow updates are tolerable (like DNS).</li></ul><p><strong>2. Server-Side Load Balancing (Dedicated Load Balancers)</strong></p><p>This is what most people picture: a dedicated hardware device or server sitting between the client and the backend infrastructure. It adds one network hop but completely abstracts the backend complexity away from the client.</p><p>These are typically split into two categories:</p><p><strong>Layer 4 (L4) Load Balancers:</strong></p><ul><li>Operating at the Transport Layer (TCP/UDP), L4 load balancers route traffic based purely on network info (IPs and ports). Because they don’t inspect the packet contents, they act as an incredibly fast, direct pipe.</li><li><strong>Key Characteristics:</strong> Fast and efficient (minimal overhead), maintains persistent TCP connections, and routes strictly at the network level. (Example: AWS Network Load Balancer).</li><li><strong>When to Use:</strong> The gold standard for high-performance systems and persistent connections like WebSockets.</li></ul><p><strong>Layer 7 (L7) Load Balancers:</strong></p><ul><li>Operating at the Application Layer, L7 load balancers actually terminate the incoming connection, inspect the data, and open a brand new connection to the backend server.</li><li><strong>Key Characteristics:</strong> Capable of content-based routing (looking at URLs, headers, cookies), highly flexible (routes API traffic differently than web traffic), but more CPU-intensive.</li><li><strong>When to Use:</strong> The go-to choice for standard HTTP-based traffic (REST, GraphQL). <em>Not</em> ideal for persistent WebSockets.</li></ul><p><strong>Routing Algorithms: How do they choose a server?</strong></p><p>Once a load balancer intercepts a request, how does it pick a destination? It uses one of these common algorithms:</p><ul><li><strong>Round Robin:</strong> Requests are distributed sequentially in a loop.</li><li><strong>Random:</strong> Requests are distributed entirely at random.</li><li><strong>Least Connections:</strong> Sends the request to the server with the fewest currently active connections.</li><li><strong>Least Response Time:</strong> Sends the request to the server responding the fastest.</li><li><strong>IP Hash:</strong> Uses the client’s IP address to determine the server (great for session persistence).</li></ul><p><em>Pro Tip:</em> Round Robin and Random are usually perfect for stateless applications. But if you have persistent connections (like WebSockets or SSE), use Least Connections so one single server doesn’t accidentally accumulate all the long-lived traffic!</p><blockquote><strong>Fun Fact:</strong> The public internet is literally not configured to route traffic to private IP addresses! Think of Private IPs as hotel room numbers (like “Room 101”). Millions of networks use the exact same private IPs, so the internet wouldn’t know which one you mean. Public IPs, on the other hand, are the globally unique street address of the hotel. To bridge this gap, you use a NAT or a public-facing Load Balancer as your “front desk receptionist.” This device sits at the edge of your network with a public street address, accepts incoming outside traffic, and securely routes it to the hidden servers (the room numbers) safely tucked inside your internal network.</blockquote><p><strong>Wrapping Up Part 1</strong></p><p>That covers the network essentials! We still have plenty of core concepts to tackle (like data modeling, caching, and sharding), which I will dive into in the next article.</p><p>Stay tuned! :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b835727f413d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[System Design Series: What is Distributed System Design and why should I care about it?]]></title>
            <link>https://medium.com/@shruti9520/what-is-distributed-system-design-and-why-should-i-care-about-it-05b28a515834?source=rss-bf78be10b7a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/05b28a515834</guid>
            <dc:creator><![CDATA[Shruti Singh]]></dc:creator>
            <pubDate>Mon, 06 Jul 2026 22:04:07 GMT</pubDate>
            <atom:updated>2026-07-06T22:05:08.296Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi there,</p><p>It’s been a while since I last wrote a blog post on Medium. Lately, I’ve been thinking about sharing some of the things I’ve learned over the past five years. I used to be a very enthusiastic writer during my college days, especially when I was interning with Mozilla through the Outreachy program. A lot has changed since then: I moved countries, grew into leadership roles, and now work on delivering programs with significant impact.</p><p>One thing I’ve noticed in the technology field is that many people truly learn <strong>system design</strong> only after they start working in the industry. The concept is often taught in college, but we rarely get real exposure to it until we begin building and scaling real systems.</p><p>This blog post is for an absolute beginner.. someone who feels intimidated by the term <em>“distributed system design”</em>, whether in interviews or in a work environment. Don’t worry! I was exactly like you when I started my career.</p><p>So let’s start from the basics and understand what system design really means and how it impacts the world around us.</p><p>When I say the word <strong>system</strong>, what comes to your mind?</p><p>A computer?</p><p>That’s not wrong.</p><p>Let’s imagine I start a business — say, an online coffee delivery service. On the first day, I only have a few customers browsing the website and placing orders. At this stage, I could technically run the entire website from my personal computer. I could build the website, connect it to a database for storing orders and customer information, host it locally, and make it accessible online.</p><p>So far, so good.</p><p>But now imagine it’s time for me to sleep. If I turn my computer off, the website goes down and customers can no longer place orders.</p><p>Someone might say, “No problem, I’ll just keep the computer running all the time.”</p><p>Fair enough.</p><p>But what happens if there is a power outage? Or if the computer crashes? Suddenly, the entire business is unavailable.</p><p>And that’s a big problem.</p><p>This is exactly where <strong>distributed system design</strong> comes into the picture. You’d like your website to be running all the time. Instead of relying on one single machine that needs constant electricity and a perfect internet connection, distributed system design suggests a different approach: let’s use a team of computers. Imagine spreading your online coffee shop across several servers located in different places. If one server goes down because of a localized power outage, another one instantly picks up the slack. Your customers still get to order their lattes, and you get to sleep soundly. To the person browsing your website, it looks and feels like one seamless application, but behind the scenes, it’s a coordinated network of machines working together.</p><p>But keeping the lights on is only half the battle; the other half is handling growth. What if your coffee business goes viral and suddenly a thousand people want to place an order at the exact same minute? A single computer would quickly get overwhelmed, leaving your customers staring at a frozen loading screen. Distributed systems allow you to scale horizontally -meaning you can just add more machines to the team to share the sudden heavy lifting. From my experience managing and delivering large-scale technical programs, I can tell you that anticipating these risks and designing for resilience is exactly what separates a fun weekend project from a robust, global product.</p><p>In my next blog post, we are going to take these concepts out of the coffee shop and apply them to a real-world scenario. I’ll be walking you through basic system design concepts, key technologies and a real-time system design question..the exact kind you might see in a technical interview or a whiteboard planning session and we will design the solution together, step by step.</p><p>Stay tuned! :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=05b28a515834" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS — Basic concepts]]></title>
            <link>https://medium.com/@shruti9520/aws-basic-concepts-682f9623f9f8?source=rss-bf78be10b7a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/682f9623f9f8</guid>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Shruti Singh]]></dc:creator>
            <pubDate>Tue, 14 Jul 2020 18:35:32 GMT</pubDate>
            <atom:updated>2020-07-15T07:22:11.829Z</atom:updated>
            <content:encoded><![CDATA[<h3>AWS — Basic concepts</h3><p>Hi there!</p><p>Welcome. :)</p><p>This blog post is for an absolute beginner. If you want to get a sense of what AWS is or what cloud is , then this is a right place to start with.</p><h4><strong>What is Cloud?</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1HgIf9tfC3n7Ts2UAr0rxw.png" /><figcaption>hola! :) I am Cloud!</figcaption></figure><p>Cloud is a place where you store your data and access it whenever you want via Internet. In simple terms, It’s just a computer/server/data center somewhere else. You’re utilizing that computer for storage, processing etc.</p><h4><strong>Common cloud terminologies</strong></h4><ol><li><strong>High availability</strong>- If you put a file on cloud, you can access it from any type of device as long as you’ve Internet connection. That makes it highly available. High availability keeps your business running without downtime.</li><li><strong>Fault tolerance</strong>- If you’ve file only in your home computer and your computer’s hard drive fails, then it’s gone. But if the file is in the cloud and it is backed up in multiple services, then there’s always a copy of file that you can access. So, even if there’s a fault in the system, you always have the ability to retrieve your data.</li><li><strong>Scalability-</strong> Let’s take an example to get a clear understanding of this terminology. Let’s say you manage an enterprise that use On-premise services. That means company has their own server computers to manage their data ,code etc. Your company is going good and you’re expecting more users as the time passes. So, you bought additional set of servers in your data center to handle the load of additional users. But things didn’t go as expected, and the number of users decreased. So, now entire segment of servers that you bought is in waste and it’s a tremendous waste of money and time.<br> But when you use cloud service provider services, you only pay for what you use. As user base grows, you can add more servers and as the user base shrinks you can drop them. You can scale up whenever you want and also you pay as per your demand. Isn’t it great?</li><li><strong>Elasticity</strong>- The ability to quickly grow and shrink based on demand is called elasticity.</li></ol><p>Now, we have clear understanding of what cloud is and what are basic cloud terminologies. Let’s move ahead and discuss about AWS (Amazon Web Services). :)</p><h4><strong>What is AWS?</strong></h4><p>AWS is a Cloud service provider. Common cloud services include storage, computing power, databases, analytics, security, monitoring, developer tools, networking etc.</p><h4><strong>Introduction to Core AWS Services</strong></h4><p>Let’s take a look at a very basic AWS architectural block diagram.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*wA053-e6s38QaBg_S-gbLg.png" /></figure><p>Please note that there’s a lot more when you get into technical details of this block diagram. But for now, we will only discuss some core AWS services- VPC, EC2, RDS and S3. Introduction of these core services are good enough to start with. We will gradually move into technical details in other blog posts.</p><p><strong>Virtual Private Cloud</strong> is your private section of AWS where you can place AWS resources and allow/restrict access to them. Yes, as simple as that! :)</p><p><strong>EC2</strong> (Elastic Cloud compute)- EC2 is good for any type of “processing” activity. It could be a web hosting, any kind of encoding, mathematical equation solving etc. Think of EC2 as a virtual computer that you can use for whatever you like.</p><p><strong>RDS</strong> is a provisioned database service of Amazon. Commonly used for things like storing customer account information, payment info etc.</p><p><strong>S3</strong>- Amazon S3 is a massive storage bucket. Amazon S3 uses the same scalable storage infrastructure that Amazon.com uses to run its global e-commerce network. :D</p><p>Now, let’s take an example to summarize all the things we learned today.</p><p>Let’s suppose I own a company where my business is to stream movies online and I am using AWS to run my business. Basically, I am using RDS to store my user’s details and subscription information and S3 to store movie videos. EC2 instances are responsible for web hosting of my website, to process information to and fro RDS, to encode video content from S3 to my website in order to enable live streaming etc. There are more than 50k users of my website between 8pm to 12 am time. But less than 5k users throughout the day. To manage user load, I’ve multiple EC2 instances because if everyone use one instance, it will crash. So, that’s why we have multiple instances to divide the load (Load balancing). AWS is managing load balancing for me. Due to this cloud service provider, I am able to scale up and down as per my needs. Also, I am only paying as per the use. So that means, I pay more when 50k users are active and pay less when 5k users are active. Yay! I am making good money. :P Haha!</p><p>In my next blog post, I will talk more about AWS services and we will have an in depth knowledge sharing session. Stay tuned!</p><p>Thanks for reading. :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AJ4u7rdIhtRRxQHQ1vh0Uw.png" /><figcaption>Thanks for understanding me. Blushy cloud. :P</figcaption></figure><p>Bye!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=682f9623f9f8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[FOSSASIA’19- Amazing moment of Outreachy journey!]]></title>
            <link>https://medium.com/@shruti9520/fossasia19-amazing-moment-of-outreachy-journey-563e930d6979?source=rss-bf78be10b7a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/563e930d6979</guid>
            <category><![CDATA[fossasia]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[outreachy]]></category>
            <category><![CDATA[mozilla]]></category>
            <dc:creator><![CDATA[Shruti Singh]]></dc:creator>
            <pubDate>Thu, 21 Mar 2019 19:44:08 GMT</pubDate>
            <atom:updated>2019-03-21T19:44:08.928Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi there!</p><p>Outreachy is a life changing experience for me. It helped me to grow technically as well as personally. I did my Outreachy internship with Mozilla and my mentor was <a href="https://medium.com/@lmorchard">Les Orchard</a>. I would like to thank my mentor again because he helped me gaining confidence in myself and I consider him an integral part for securing a full time job at INTEL. For those who are reading my blog for the first time and haven’t heard about this program, let me start with “What is Outreachy”? :-)</p><p><strong>Outreachy</strong> provides three-month internships for people from groups traditionally underrepresented in tech. Interns are paid a stipend of <strong>$5,500</strong> and have a <strong>$500 travel stipend</strong> available to them. Interns work remotely with mentors from <strong>Free and Open Source Software (FOSS)</strong> communities on projects ranging from programming, user experience, documentation, illustration and graphical design, to data science. You can get more information about this program <a href="https://www.outreachy.org/">here</a>.</p><p>So, making use of the travel stipend, I attended <strong>FOSSASIA 2019 </strong>summit. FOSSASIA is said to be ASIA’s biggest opensource conference and it attracted many great speakers from across the globe. I flew all the way to the beautiful city <em>Singapore to attend FOSSASIA. </em>It was my first international flight and I was little worried but I was lucky enough to find a companion- Kanika Saini ( another Outreachy intern from Mozilla). :-)</p><p>I attended full conference (14th March — 17th March) and had a great experience while listening various tech talks and meeting new people. I got to witness amazing people like <strong>Mitch Altman</strong> (CEO open Hardware Creator), <strong>Hong Phuc</strong>( Founder FOSSASIA), <strong>Bunnie Huang</strong> ( CTO Chibitronics) etc. The best part of this conference, apart from the talks, was to have a one to one discussions with speakers. They are the most talented as well as humble people I’ve ever met. Mr Altman gave an out standing talk and he talked about his journey from being bullied kid to a successful person. I am really impressed by his talk.</p><p>Another thing that left me awestruck was the speech of <strong>Dr Williams </strong>(<strong> </strong>Director of Data science Microsoft). He talked about how much he support open source and I was really impressed listening to his thoughts about the opportunities that FOSS bring to society. This is something that I wasn’t expecting from a person working in Microsoft and this changed my thought process completely. :-) <br>I attended various talks — Open Tech Hardware, Security, Microsoft commitment to Openness and Collaboration, Open AI , Open Source Quantum computing, Machine learning etc. I get to learn so many things from each of them. One thing that interests me a lot is Embedded Programming using MicroPython and CircuitPython. The speaker of this talk explained and demonstrated embedded programming. I would really like to learn in depth about this. :)</p><p>Apart from attending the talks, I also got chance to meet awesome personalities like <strong>Hong Phuc </strong>and<strong> Mitch Altman </strong>in person. I was spellbound by their humbleness. Meeting and talking to these great people motivated me a lot. Here is the picture of us with Hong Phuc-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FMZLJJ8IQNvjatSSwBe-7A.jpeg" /></figure><p>FOSSASIA’19 was a wonderful experience for me. Everything was perfect- talks, one to one meeting, discussions, food etc. I would like to thank <strong>Outreachy </strong>for<strong> </strong>supporting me financially to attend this amazing event.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4pZq63q63sgplIYAbeFskQ.jpeg" /></figure><p>This is me posing in front of the FOSSASIA banner. :-P</p><p>Outreachy is the best opportunity a girl can grab. As they say- “<strong><em>A journey of thousand miles begins with a single step</em></strong>”. <em>Outreachy is that single step for me</em>. :)</p><p>Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=563e930d6979" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Outreachy internship with Mozilla: A journey worth taking]]></title>
            <link>https://medium.com/@shruti9520/outreachy-internship-with-mozilla-a-journey-worth-taking-880758790db9?source=rss-bf78be10b7a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/880758790db9</guid>
            <category><![CDATA[outreachy]]></category>
            <category><![CDATA[mozilla]]></category>
            <dc:creator><![CDATA[Shruti Singh]]></dc:creator>
            <pubDate>Fri, 17 Aug 2018 18:22:16 GMT</pubDate>
            <atom:updated>2018-08-17T18:34:49.199Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi there!</p><p>It’s hard to believe, but today is the last day of officially holding Mozilla’s LDAP credentials. :(</p><p>Yes, my awesome three months Outreachy internship program is ending. Time flies so fast! I still remember the day when I was sitting on my couch and was going through the projects listed in this round. Oh, I will surely gonna miss this.</p><p>In this blog post, I will be talking about my journey. :)</p><p>The internship was officially started on 14th May 2018, but my bonding with community and my mentor was started in the month of march. I still remember, I thought 100 times before commenting on the first bug of Firefox color. But a little courage at that time (that too at 3 a.m.) changed my life completely. Before, I used to be a less confident girl. But now after three months, I am more confident and full of positive vibes. This internship helps me to build my technical as well as behavioural skills. My mentor ( <a href="https://medium.com/@lmorchard">Les Orchard</a>) is an awesome person. He helped me to built my technical skills. He encouraged me to learn new things. He gave me courage to do experiments. Thank you, Les. For me, Outreachy is directly proportional to you! :)</p><p><em>Outreachy === Mentor :)</em></p><p>If I talk in technical terms, I’ve learnt about so many things- React, Dynamic themes, building dynamic themes from scratch, Unit testing, Node scripting, AWS etc. Apart from these, I have learnt to ask questions and to believe in myself.</p><p>Additionally, I’ve learned to be independent. I remember how hard I tried to get my visa on time. I went to unknown city for my visa thing. I tried my best but I missed the chance to visit San Francisco for All-hands event and most importantly to meet other Mozillians ( specially my mentor). But, atleast I saw all the videos and read all the links. :D</p><p>I still remember, how happy I was when I got my first Macbook pro from Mozilla. :)</p><p>I would also like to thank my Fmentor (<a href="https://medium.com/@jbalaco_112012">Jennifer Balaco</a>). Thank you, Jennifer for supporting me. I really appreciate this kind gesture of yours. :)</p><p><a href="https://medium.com/@lmorchard">Les</a>, I want to share some of the things that I have noticed about you in last three- four months. Dear readers, my mentor watches netflix and has a cute cat and rabbits as pets ( I got to know this through twitter :P). He didn’t scold me even once in last three months. He supported me each and every time. He is awesome in technical stuffs (afterall he is a Mozillian) and is the best mentor ever. Thank you again, Les. :)</p><p>Outreachy is the best opportunity a girl can grab. As they say- “<strong><em>A journey of thousand miles begins with a single step</em></strong>”. <em>Outreachy is that single step for me</em>. :)</p><p>Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=880758790db9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Outreachy internship with Mozilla: AWS Lambda with Serverless]]></title>
            <link>https://medium.com/@shruti9520/outreachy-internship-with-mozilla-aws-lambda-with-serverless-ee96d49c82d4?source=rss-bf78be10b7a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/ee96d49c82d4</guid>
            <category><![CDATA[mozilla]]></category>
            <category><![CDATA[outreachy]]></category>
            <dc:creator><![CDATA[Shruti Singh]]></dc:creator>
            <pubDate>Thu, 16 Aug 2018 20:25:54 GMT</pubDate>
            <atom:updated>2018-08-16T20:31:35.563Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi there!</p><p>In this blog post, we will see how AWS lambda works with Serverless framework.</p><p>In my previous blog posts, I’ve talked about what is AWS, how to create your first Lambda function, what is AWS API gateway etc. So, you have already seen that there are several ways to set up an API gateway and Lambda functions. One can do it all with the AWS web interface or with command line commands. But, the Serverless framework makes it a way more easy. Now, let’s see what is Serverless framework and how it makes our task easy. :)</p><p>Serverless Framework is a kind of toolkit that is used to deploy serverless architectures to any provider. My mentor (<a href="https://medium.com/@lmorchard"> Les Orchard</a>) gave an interesting definition while explaining this to me-</p><p>“Serverless framework sets up an API gateway and Lambda functions automatically from a recipe.” :D</p><p>Isn’t is cool? Hehe.</p><h4>Getting Started with Serverless</h4><ol><li>First of all, you need to install serverless framework in your machine.</li></ol><p>npm install -g serverless</p><p>2. Next, you need to set up your AWS provider credentials. For this, you should know your API Key &amp; Secret key. If you don’t have any, you should search for Identity &amp; Access Management (IAM) after signing in to your AWS account and should create an IAM user with admin access. This enables you to see your API and Secret key. Next, you can export your API and Secret key as environment variables so they would be accessible to Serverless and the AWS SDK in your shell as shown below:</p><p>export AWS_ACCESS_KEY_ID=&lt;your-key-here&gt;</p><p>export AWS_SECRET_ACCESS_KEY=&lt;your-secret-key-here&gt;</p><p>3. Now, you can create a new service using any language (Node.js, python, java etc) template by specifying a unique name and an optional path for your service. You can also go to that particular directory first and then use serverless create command without mentioning the path.</p><p>serverless create — template aws-nodejs--path my-service</p><p>Now, we created a handler.js and serverless.yml file as templates. You can modify those files according to your application’s requirements.</p><p>4. Finally, you can deploy your service using-</p><p>serverless deploy</p><p>Tada. Your application starts running. :)</p><p>This thing is difficult to understand. I’ve asked so many questions to my mentor and he answered all of them with atmost patience. :)</p><p>So, the idea is to use this information and implement it for one of the preset theme of Firefox color with POST request. I’ve already written a script that takes all the preset themes and produce a directory that contains add-on files for each of the themes. But now, AWS lambda came into picture and the major idea is to write lambda function with API gateway that accepts theme JSON via POST and send the formatted data in a response (in zipped folder). I tried that with serverless framework. My mentor also taught me an awesome thing called Cloudwatch. :)</p><p>Cloudwatch is useful to check each and every step of your requests (GET/POST) and you can see how data is being passed. So, I checked my code on Cloudwatch (with lot of console statements :P ). I checked for each preset theme using curl. As of now, data is passed correctly and add-on is created perfectly. Only there’s a little difficulty in passing data as zipped folder in the response. I know this could be solved as we take deeper dive in the project. :)</p><p>At the end, I would like to thank my mentor (<a href="https://medium.com/@lmorchard">Les Orchard</a>). I can’t believe that Outreachy is ending. :( In my next blog post, I will write about my whole journey. I am so grateful to my mentor and Outreachy organizers for giving me this opportunity.</p><p><a href="https://medium.com/@lmorchard">Les</a>, I know I can’t ping you over mozilla slack channel and mozilla email from tomorrow onwards :( , but I will keep asking my stupid questions over emails or IRC. Hehe. :P</p><p>All my dear readers, I will keep updating and writing my blogs ( not as an Outreachy intern anymore but as a happy mozilla contributor). :D</p><p>Stay tuned! :)</p><p>Thanks for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ee96d49c82d4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Outreachy internship with Mozilla: API Gateway]]></title>
            <link>https://medium.com/@shruti9520/outreachy-internship-with-mozilla-api-gateway-621d943b1e99?source=rss-bf78be10b7a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/621d943b1e99</guid>
            <category><![CDATA[aws-lambda]]></category>
            <dc:creator><![CDATA[Shruti Singh]]></dc:creator>
            <pubDate>Fri, 27 Jul 2018 22:11:55 GMT</pubDate>
            <atom:updated>2018-07-27T22:21:07.412Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi there!</p><p>In this blog post, I will be talking about connecting your lambda function to API gateway. Let’s start with a formal definition of API Gateway.</p><p>API Gateway is an AWS service that enables developers to create, publish, maintain, monitor, and secure APIs at any scale. In other terms, API Gateway lets you create, configure, and host a Restful API to enable applications to access the AWS Cloud. As you can see in the image below, Amazon API Gateway connects AWS container to User’s HTTP requests.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*qinh1bf504BbRmEailuX_w.png" /></figure><h4>How to connect API Gateway to Lambda functions?</h4><p>First login to your AWS account. Then search for “API gateway” from your console. Once you click on API Gateway, you will get to see something like this-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OfEo00-JODCvHkUon6sMqA.png" /></figure><p>In order to create new API, select “New API” and then fill the API name. Now, click on “Create API” and you will see this-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7hiEUz93sWgsXQ9leAIHFA.png" /></figure><p>Here we can configure Resources, stages, models etc. Now, I am gonna create new resource (by clicking on Actions button) and after creating a new resource, I will create a method. Methods can be DELETE, GET, POST, PUT, HEAD etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qr0Fddh7yoU1zOM9FWb5sA.png" /><figcaption>Creating a new resource</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/985/1*2GhOp8iHwP6a0_FdvzDkAw.png" /><figcaption>Choosing method</figcaption></figure><p>In this blog post, I am taking an example of GET method. Now, we can choose the integration type.There are a lot of integration type in the image below. So, we can either proxy this request to different web servers OR we can mock this integration OR we can use Lambda function etc. I am choosing Lambda function here because this blog post is about integrating API Gateway to Lambda functions. So, after choosing integration type as Lambda Function, one can specify the Lambda function’s name. In my previous blog post, I made a Lambda function to calculate the volume of cone. I will be using that Lambda function here i.e “volume-of-cone”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*OIvnHWMslRuipRR7_be6gA.png" /></figure><p>Once you are done with integration type, click on save button and you will get something like this-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6BTlQPO5qbPZJDZ8SrJ3UQ.png" /></figure><p>Tada! :D</p><p>The request is being created and you can see the overview of the request in the above image. The client makes a method request and then you can integrate the request ( i.e you can transform the input data of your request [ we will see this later in this blog]) and then it hits our Lambda function which in turn returns a request.</p><p>We can now go to the Actions button and click on “Deploy API”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S0gnogT8Ksni0uJTlM0GtQ.png" /></figure><p>After deploying API, you can actually see the whole URL of your API as follows-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3Kb4Q1e-VVs0MZwY6mCtxQ.png" /></figure><p>After clicking on the URL , you will get this-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*hgfxPm9Bruw2AZSmO6zwsQ.png" /></figure><p>Yay! I can see the result of my Volume Lambda function. :)</p><p>Now, let’s see how integration request works. You will get to know about the functionality of event parameter too. :)</p><p>Earlier we were taking a fixed value of height and radius in our Lambda function. Now, I want the user to give that values. To do this let’s go to our API gateway and let’s open our API gateway. That looks like this-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6BTlQPO5qbPZJDZ8SrJ3UQ.png" /></figure><p>Now, click on Integration Request to edit it’s integration request. By default API Gateway strips all the inputs that user give to API. So, you have to explicitly write the inputs you want ( You can see this in the last image of this blog). You have to specifically define the input variables that you want. When you click on Integration Request, you will get something like this-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OU6Ps451n0Q839Mmp_5dSw.png" /></figure><p>Now, click on Mapping Templates in order to define your input variables. In this section, you can “add” mapping templates. So, click on add mapping templates and specify the name of the JSON you want. It will look like this-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8OTDqJKNiExQewPDuQwUbQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N9oRHuSp_ZHbf7qlJZpFOA.png" /></figure><p>Now, generate a template. Mine looks like this-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*ApTWxV2jgMcXsqZYMD5FgQ.png" /></figure><p>Save this and again deploy your API Gateway. That’s it for the API Gateway. The next thing we have to do is to change our old Lambda Function so that it can take input from users. My new Lambda function looks like this-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p02utfCxVxq0CWJcjX9kQg.png" /></figure><p>Here, you can see how event parameter is being used. Now, let’s refresh our GET request API and provide height and radius at the end of the URL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/843/1*maV9f4pyMvsb7G0u7iqJsQ.png" /></figure><p>I can see the volume with height=5 and radius=3 ( See the URL above). Now, lets’s change the height to 6 and radius to 4. You will get this-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/877/1*lE8wHAF8DuF6f7_Bou1FwA.png" /></figure><p>Yay. :) <br>It is working fine. So, this is all about integrating API Gateway to Lambda functions.</p><p>Thanks for reading!</p><p><strong><em>Cheers!</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=621d943b1e99" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Outreachy internship with Mozilla: First lambda function]]></title>
            <link>https://medium.com/@shruti9520/outreachy-internship-with-mozilla-first-lambda-function-5fe17995367c?source=rss-bf78be10b7a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/5fe17995367c</guid>
            <category><![CDATA[mozilla]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[outreachy]]></category>
            <dc:creator><![CDATA[Shruti Singh]]></dc:creator>
            <pubDate>Thu, 26 Jul 2018 22:20:51 GMT</pubDate>
            <atom:updated>2018-07-26T22:20:51.998Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi there!</p><p>In this blog post, I will be talking about generating AWS lambda functions. Let’s go ahead. :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tFl-8wQUENETYLjX5mYWuA.png" /></figure><p>First things first- You should have an Amazon Web Services account. I got mine through Mozilla dev account. Awesome! :D</p><p>So, here I am logged into my AWS console. It looks like this-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*02lPjIPH9nTs3Bty4PcQhQ.png" /></figure><p>As we have already seen in my last blog post that AWS Lamda is a part of compute domain. You can certainly see “Lambda” under “Compute” heading in the above image. Now, click on “Lambda” to create a new lambda function. As an example, I will be writing a function to calculate volume of cone in NodeJs.</p><p>Now you can create a function code all by yourself or you can use some of the blueprints that amazon gives you. In the image below, you will see a number of blue prints ( some basic codes that amazon gives you).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U44Mt6Bow79Y79-JBzo0-Q.png" /></figure><p>In order to create a new lambda function, you should provide a name, choose a role ( if you don’t have any previous created role then create a new role and provide a role name to it), runtime etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WN0MgV_z-yH5K_S2dceR1A.png" /></figure><p>Now, let’s talk about how a basic AWS lambda function looks like. AWS Lambda invokes your Lambda function via a handler object. A handler represents the name of your Lambda function. For example-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q6HjUgnP3vCBETnUwltZfg.png" /></figure><p>Here, in order to invoke our function, we should write the name of the file along with the name of the function in Handler section ( as you can see in above image i.e index.handler). Now, let’s take a look on parameters of the function. Here you can see three parameters- event, context and callback. Callback is something that is used when you want to return something back to the user. The general syntax is- Callback(error, success). Here success can be a string message or the object you want to return. I will talk about event and context in my next blog(API Gateway).</p><p>In AWS, each lambda function is executed in a container and you can explicitly specify the memory, time etc settings of each container as shown below-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oPCbQwLYieyLHtQ7jfK9SQ.png" /></figure><p>Once you are done with writing function, you can create a lambda function by clicking on “create button”. After that you can see a success message on your console- “Congratulations! your lambda function ‘xyz’ has been created successfully”. After that you can test your code and the test results would be somelike like this-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QDq9tVVuuJOTAhbIkbVUqw.png" /></figure><p>Here you can see the response object, response ID, execution time, memory size etc. Well, this is the basic example of generating lambda functions. A lot more things like including triggers etc will be discussed in my next blog ( API gateway). So, stay tuned. :)</p><p>Thanks for reading!</p><p><strong><em>Cheers!</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5fe17995367c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Outreachy internship with Mozilla: AWS Lambda]]></title>
            <link>https://medium.com/@shruti9520/outreachy-internship-with-mozilla-aws-lambda-651eb2ac6e81?source=rss-bf78be10b7a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/651eb2ac6e81</guid>
            <category><![CDATA[outreachy]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[mozilla]]></category>
            <dc:creator><![CDATA[Shruti Singh]]></dc:creator>
            <pubDate>Fri, 20 Jul 2018 13:49:12 GMT</pubDate>
            <atom:updated>2018-07-21T07:45:15.107Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi there!</p><p>In this blog post, I will be talking about AWS Lamda. Let’s start with a little introduction.</p><p>AWS ( Amazon Web Services ) is a cloud services platform that offers services like database storage, content delivery, compute power/domain etc. AWS Lamda is a part of compute domain. Basically, there are three main services in compute domain-</p><ol><li>EC2 — It is like a raw server. We can also say that it is like a personal computer that we are working on remotely. It can install any kind of operating system which is supported by AWS infrastructure and then you can use it in any manner i.e one can configure it to become a server etc.</li><li>Elastic Beanstalk- This is an automated version of EC2. Here, you don’t get the access to the operating system but you still have control over the configuration. Here, you can directly upload the code and then application is deployed on AWS infrastructure.</li><li>AWS Lambda- This is also an automated version of EC2. But here, you neither have access to the operating system nor you have any control over the configuration. All you do is to upload your code and it executes.</li></ol><p>AWS Lambda is not used to deploy applications. It is used to execute background tasks. So, we can say that- “AWS lambda is a serverless compute service ( i.e you are not choosing the kind of configuation you want). The developers don’t have to worry about which AWS resource to launch or how to manage them. <strong>Just put the code on Lambda and it runs</strong>”.</p><p>Once you upload the code, your code will be executed on your behalf using Amazon’s infrastructure. Each piece of your code is called a function on Lambda platform. All of the functions that you upload has to be stateless. Now, the question is- How to trigger a Lambda function? Lambda funnctions can be triggered by events ( events from AWS services i.e S3 is also allowed), https calls etc.</p><p>In order to use AWS Services, you have to set up an AWS account. I got mine through mozilla. Next is to learn and implement some practical examples. I will write my experience with AWS lambda along with examples in my next blog.</p><p>Thanks for reading!</p><p><strong><em>Cheers!</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=651eb2ac6e81" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>