<?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 Pratham Sharma on Medium]]></title>
        <description><![CDATA[Stories by Pratham Sharma on Medium]]></description>
        <link>https://medium.com/@igreaper?source=rss-993e261b22dc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*n2TZ5dkfQaOj3F8IBKLzlA.jpeg</url>
            <title>Stories by Pratham Sharma on Medium</title>
            <link>https://medium.com/@igreaper?source=rss-993e261b22dc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 01:06:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@igreaper/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[Your Growth Is Defined by Your Circle. Choose Wisely.]]></title>
            <link>https://igreaper.medium.com/your-growth-is-defined-by-your-circle-choose-wisely-4de8ea282cfd?source=rss-993e261b22dc------2</link>
            <guid isPermaLink="false">https://medium.com/p/4de8ea282cfd</guid>
            <category><![CDATA[mindset]]></category>
            <category><![CDATA[growth]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[growth-mindset]]></category>
            <dc:creator><![CDATA[Pratham Sharma]]></dc:creator>
            <pubDate>Mon, 09 Nov 2026 14:14:07 GMT</pubDate>
            <atom:updated>2026-11-09T14:14:07.181Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Keep ambitious people around you. Their normal standards will force you to raise yours.</em></p><p>I’ve had the opportunity to build friendships and connections with people working at some incredible companies — Rubrik, Google, NVIDIA, Amazon, Zomato, Razorpay, LangChain, CodeRabbit, OpenAI, Anthropic, several YC-backed startups, and other big tech companies.</p><p>At this point, name almost any good tech company, and there’s a 90% chance I’ll know someone working there.</p><p>And that’s something I’ve consciously learned along the way:</p><p><strong>Along with technical knowledge, invest in building your connections.</strong></p><p>But let me share something personal.</p><h3>I wasn’t always this person.</h3><p>People who know me personally, especially those who knew me during college, know that until my second or third year, I didn’t know a lot of things.</p><p>I was still figuring things out, exploring opportunities, understanding the industry, and discovering what I was capable of.</p><p>Then the pressure hit.</p><p>The competition, failures, rejections, ambitious people around me, and the realization that there was so much more to achieve — everything started pushing me forward.</p><p>One mindset stayed constant:</p><p><strong>Never give up. Figure it out. Keep moving.</strong></p><p>Slowly, things started coming together.</p><h3>1. Your circle defines your standards.</h3><p>When you surround yourself with people who are constantly learning, building products, solving difficult problems, joining great companies, or building startups, something changes.</p><p>Their achievements stop looking impossible. Their discipline becomes normal. Their ambitions start influencing yours.</p><p>You naturally start thinking bigger.</p><p>Not because you’re competing with them, but because you’re constantly exposed to what’s possible.</p><p><strong>Your circle doesn’t just influence what you do. It influences what you believe you can do.</strong></p><h3>2. Build your network alongside your technical skills.</h3><p>Technical knowledge alone isn’t enough.</p><p>Talk to people. Share what you’re building. Ask questions. Participate in discussions. Build genuine relationships.</p><p>Don’t approach networking thinking about what you can get from someone.</p><p>The right connections expose you to opportunities, perspectives, experiences, and ideas you might never discover on your own.</p><p>Sometimes, one conversation can change the way you look at your career.</p><h3>3. Find a good mentor.</h3><p>Especially during your early career, find someone humble enough to entertain your questions and patient enough to guide you.</p><p>You won’t know everything. You’ll ask basic questions, make mistakes, and sometimes need someone to explain the same thing twice.</p><p>A good mentor understands that.</p><p>And remember, someday you’ll be in that position. Someone junior will approach you with the same questions you once had.</p><p>Be patient with them. Share your experiences. Help them grow.</p><p><strong>Become the mentor you once needed.</strong></p><h3>4. Don’t limit your circle by age or designation.</h3><p>Don’t restrict your network to SDE 1s, SDE 2s, or people with the same years of experience.</p><p>Be equally comfortable approaching a CEO, VP, Engineering Manager, Technical Architect, Staff Engineer, or someone just starting their career.</p><p>Don’t let someone’s designation or experience intimidate you.</p><p>Approach them with confidence, curiosity, and respect.</p><p>You don’t need to prove yourself in every conversation. Sometimes, listening and asking the right questions is enough.</p><p><strong>Never let your designation decide whom you’re comfortable learning from.</strong></p><h3>5. It’s not luck. It’s everything that happened before the outcome.</h3><p>People often tell me, “You’re lucky!” or ask, “How did you crack Robinhood, Google, Amazon, Zomato, Razorpay, Intuit, Salesforce, YC Backed Startups etc.”</p><p>Some people look at the final outcome — a high-paying offer, getting featured in Times Square, or being recognised in LinkedIn News — and assume that’s the difficult part.</p><p>Nooooo, bro. That’s not the difficult part.</p><p>What you don’t see is everything that happened before those moments.</p><p>The countless hours of learning, failures, rejections, missed opportunities, uncomfortable phases, people who guided you, and the discipline to keep showing up.</p><p>Of course, luck and timing matter. But you also need to put yourself in a position to make the most of those opportunities.</p><p><strong>People see the achievement. They don’t see the journey behind it.</strong></p><p>The offer is an outcome. The real work happens much earlier.</p><h3>6. Pressure is a privilege.</h3><p>I genuinely believe this.</p><p>Pressure forces you to discover capabilities you didn’t know you had. It challenges your limits, exposes your weaknesses, and pushes you out of your comfort zone.</p><p>Some of the biggest improvements in my life came during uncomfortable phases.</p><p>Don’t run away from every challenge. Learn to grow through them.</p><p><strong>Pressure is a privilege when you use it to become better.</strong></p><h3>A few things to remember.</h3><ul><li>Choose your circle wisely.</li><li>Build your network alongside your technical skills.</li><li>Find mentors who are humble and patient.</li><li>Never let age or designation intimidate you.</li><li>Learn from failures instead of making excuses.</li><li>Stay consistent, even when progress feels invisible.</li><li>When you grow, help someone else grow, too.</li></ul><p>I wasn’t someone who had everything figured out during my early college years. I had a lot to learn, and I still do.</p><p>But having the right mindset, surrounding myself with ambitious people, learning from failures, and consistently pushing myself made a huge difference.</p><p>You don’t need to be the smartest person in the room.</p><p>Sometimes, the best thing you can do for your growth is to enter a room where everyone knows something you don’t.</p><p>Listen. Learn. Observe. Execute.</p><p>And eventually, become that person for someone else.</p><p><strong>Pressure is a privilege. Your circle is a choice. Your growth is your responsibility.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4de8ea282cfd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Guardrails for Text-to-SQL: How to Let an LLM Query Your Data Without Letting It Go Wrong]]></title>
            <link>https://igreaper.medium.com/guardrails-for-text-to-sql-how-to-let-an-llm-query-your-data-without-letting-it-go-wrong-ad909ba2363e?source=rss-993e261b22dc------2</link>
            <guid isPermaLink="false">https://medium.com/p/ad909ba2363e</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[llm-guardrails]]></category>
            <category><![CDATA[llm-hallucinations]]></category>
            <category><![CDATA[text-to-sql]]></category>
            <dc:creator><![CDATA[Pratham Sharma]]></dc:creator>
            <pubDate>Sat, 24 Oct 2026 10:03:47 GMT</pubDate>
            <atom:updated>2026-10-24T10:03:47.144Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Natural language to SQL is one of the most useful things you can build with an LLM. It’s also one of the easiest to get wrong. Here’s how to add the guardrails that make it safe enough for production.</em></p><p>Demos of text-to-SQL look magical. Someone types a question in plain English, and a correct query appears. Production is different. A wrong query can return the wrong numbers with complete confidence, expose data to people who shouldn’t see it, or, in a badly built system, run a write against a live database.</p><p>This article walks through the layers of a text-to-SQL system that a security or compliance team could reasonably approve. The example throughout is a question a SOC analyst might ask:</p><blockquote><em>“Tell me the last time this user logged in, and what activities they did, like stopped processes or executed actions.”</em></blockquote><p>The model can write the SQL. The system’s job is to decide whether that SQL is allowed to run, whether it’s correct, and whether the answer can be trusted.</p><h3>Start with authorization, not SQL</h3><p>The first mistake many teams make is assuming that the hard part is writing the query. The first thing to check is who is asking, and whether they’re allowed to see what they’re asking about.</p><p>In the example, “this user” is a <em>target</em>, not the requester. The analyst may be allowed to query some tables, but that doesn’t mean they may see another person’s login history. So the server does three things before any AI runs:</p><ol><li>Verifies the token and derives the requester’s identity and role from it. The request body is never trusted for this.</li><li>Determines which tables and views that role may read.</li><li>Checks whether this requester may view the target user’s activity.</li></ol><p>If the third check fails, the system stops. No keywords are extracted, and no query is built.</p><p>The rule is simple: <strong>authorization decides what the model is allowed to see, and the model never decides it.</strong></p><h3>The catalog: what the database knows, and what it doesn’t</h3><p>Before the model can write useful SQL, it needs to know what exists. That knowledge comes from two sources.</p><p>The first is the database’s own structure, read from information_schema. It gives table names, column names, types, and keys. It contains no rows.</p><p>The second is a YAML file written by the data team, stored in the code repository:</p><p>yaml</p><pre>tables:<br>  login_events_v:<br>    description: &quot;Authentication events. One row per login or logout.&quot;<br>    synonyms: [logins, sign-ins, access log]<br>    columns:<br>      username:    {type: text, description: &quot;Account name of the user&quot;}<br>      event_type:  {type: text, allowed_values: [login, logout, failed_login]}<br>      occurred_at: {type: timestamptz, description: &quot;Event time, UTC&quot;}</pre><pre>  process_events_v:<br>    description: &quot;Processes started or stopped on monitored endpoints.&quot;<br>    synonyms: [executions, processes, actions, activity]<br>    columns:<br>      username:    {type: text}<br>      action:      {type: text, allowed_values: [started, stopped, executed]}<br>      occurred_at: {type: timestamptz}</pre><p>The database can’t say that “sign-ins” means login_events_v, that UTC matters for “last 24 hours,” or that stopped is a valid action value. The YAML holds that meaning. It’s reviewed in pull requests like any other code, so a change to what a term means leaves a history.</p><p>The app merges the two sources into one catalog object at build time, versions it, and loads it at startup. Every audit record can then say which catalog produced an answer.</p><h3>Matching keywords in three layers</h3><p>The model extracts keywords from the question: <em>last, login, activities, stopped, executed, user</em>. Your code then matches them against the catalog in three passes, from cheapest to most expensive.</p><p><strong>Direct match</strong> compares keywords with table names, column names, and synonyms, exactly. “Logins” matches login_events_v. “Actions” matches process_events_v.</p><p><strong>Fuzzy match</strong> handles typos and small variations using string similarity. “Stoped” matches “stopped.”</p><p><strong>Semantic match</strong> handles words that mean the same thing without sharing letters. Embeddings of the keyword are compared with precomputed embeddings of table and column descriptions. This is the least predictable layer, so its matches should carry lower confidence and be shown to the user when they drive the query.</p><p>Each keyword produces candidate tables. The union, filtered by the role, becomes the schema slice sent to the model. If a keyword matches nothing, the system doesn’t guess. It says which term it couldn’t map and offers the closest catalog terms.</p><h3>Building the query without putting values in the SQL text</h3><p>The model writes SQL using only the matched tables. The prompt includes their exact column names, types, and allowed values, so the model copies real names instead of recalling them.</p><p>The important design decision is what the model does not write. The target username and the time window come from your code, not from the model’s text. The query uses placeholders:</p><p>sql</p><pre>SELECT l.occurred_at, l.event_type<br>FROM analytics.login_events_v AS l<br>WHERE l.username = %(target_user)s<br>  AND l.event_type = &#39;login&#39;<br>ORDER BY l.occurred_at DESC<br>LIMIT 1;</pre><p>The application binds the values when executing:</p><p>python</p><pre>cursor.execute(sql, {&quot;target_user&quot;: validated_username})</pre><p>This matters for two reasons. The user-supplied name never gets concatenated into SQL text, which closes off injection through that value. And the model doesn’t have to be trusted to quote it correctly.</p><p>Literal fixed values, such as &#39;login&#39; in the query above, still come from the model, so they need checking.</p><h3>Validating literals against the catalog</h3><p>A literal is a fixed value in the query. For a column with a fixed set of valid values, the literal must be in that set.</p><p>Consider a model that writes event_type = &#39;logon&#39;. The database will happily run it and return zero rows. The user sees “no logins found” and believes it. This kind of silent failure is one of the most common in text-to-SQL.</p><p>The check is simple:</p><p>python:</p><pre>def check_literal(allowed: list[str], value: str) -&gt; dict | None:<br>    if value in allowed:<br>        return None<br>    close = difflib.get_close_matches(value, allowed, n=1, cutoff=0.6)<br>    return {&quot;value&quot;: value, &quot;suggestion&quot;: close[0] if close else None}</pre><pre>check_literal([&quot;login&quot;, &quot;logout&quot;, &quot;failed_login&quot;], &quot;logon&quot;)<br># {&quot;value&quot;: &quot;logon&quot;, &quot;suggestion&quot;: &quot;login&quot;}</pre><p>When a typo has a close match, the system asks rather than silently correcting: “Did you mean <em>login</em>?” A silent correction can change the meaning of the question, and that’s worse than a clarifying question.</p><p>Usernames are different. There are too many to list in a catalog, so they aren’t checked against allowed_values. Instead, the system confirms the user exists and that the requester may access them, then binds the name as a parameter.</p><h3>Asking a specific question when the request is unclear</h3><p>When matching fails, a generic “please rephrase” wastes the user’s time. The system should say exactly what it didn’t understand and offer concrete options.</p><p>For the example, “stopped” and “executed some actions” may not map to a single recorded event. A useful response would be:</p><blockquote><em>I can find the last login for this user, but “stopped” and “executed some actions” don’t map to one recorded event type. Did you mean process events (started, stopped, executed), or only login and logout events?</em></blockquote><p>Concrete options get the user to a good question in one reply. Designing these messages is part of the guardrail, because it’s the step where users either succeed or give up.</p><h3>Checking the query structure with sqlglot</h3><p>The model returns SQL as text. sqlglot parses it into a tree, which lets the system check the query’s structure rather than searching the string with regular expressions.</p><p>The policy checks are:</p><ul><li>Exactly one statement, and it’s a SELECT.</li><li>Every table is on the requester’s allowed list.</li><li>Every join has a join condition, which blocks accidental cartesian products.</li><li>A LIMIT is present, and added if missing.</li></ul><p>A simplified version:</p><p>python:</p><pre>def check_policy(sql: str, allowed_tables: set[str], max_rows: int = 500) -&gt; tuple[str | None, list[str]]:<br>    errors = []<br>    statements = sqlglot.parse(sql, read=&quot;postgres&quot;)<br>    if len(statements) != 1:<br>        return None, [&quot;exactly one statement is allowed&quot;]</pre><pre>    tree = statements[0]<br>    if not isinstance(tree, exp.Select):<br>        errors.append(&quot;only SELECT queries are allowed&quot;)</pre><pre>    for table in tree.find_all(exp.Table):<br>        if table.name not in allowed_tables:<br>            errors.append(f&quot;table not allowed: {table.name}&quot;)</pre><pre>    for join in tree.find_all(exp.Join):<br>        if join.args.get(&quot;on&quot;) is None and join.args.get(&quot;using&quot;) is None:<br>            errors.append(&quot;join without a condition&quot;)</pre><pre>    if errors:<br>        return None, errors<br>    return tree.limit(max_rows).sql(dialect=&quot;postgres&quot;), []</pre><p>sqlglot doesn’t know whether a join is the <em>right</em> join. A join can have a valid condition and still connect the wrong tables. That’s a question of meaning, and it’s covered by the result checks and the optional output validation below.</p><h3>Running the query under a restricted role</h3><p>Even a validated query runs under a restricted database role, not an admin account. The role can read approved views only, and the transaction is read-only with a statement timeout.</p><p>sql:</p><pre>CREATE ROLE nl2sql_reader NOLOGIN;<br>GRANT USAGE ON SCHEMA analytics TO nl2sql_reader;<br>GRANT SELECT ON analytics.login_events_v, analytics.process_events_v TO nl2sql_reader;<br>ALTER ROLE nl2sql_reader SET default_transaction_read_only = on;<br>ALTER ROLE nl2sql_reader SET statement_timeout = &#39;5s&#39;;</pre><p>This is defense in depth. If a bug in the parser lets a bad query through, the database still refuses it. The app’s checks are the first wall, and the database permissions are the last one.</p><h3>Checking the result</h3><p>After execution, the system inspects the rows with plain logic:</p><ul><li><strong>Zero rows</strong> may be a correct “none” or a wrong filter. Say so: “No login events found for this user in the selected range. Check the username or time range.”</li><li><strong>More rows than expected</strong> for a “last” question suggests a bad join. Warn, or rerun.</li><li><strong>Truncation at the row cap</strong> means the answer may be incomplete. Say so.</li></ul><p>These checks catch a large share of wrong answers, and they cost nothing.</p><h3>Optional output validation, done properly</h3><p>A tempting design is to have a second model build a query from the same question and compare answers. This is weaker than it looks. If the same model made a mistake when writing the first query, it will often make the same mistake again, so the two results agree and the check proves little.</p><p>A better design uses an independent path:</p><ul><li><strong>A semantic check</strong> asks a separate model call whether the SQL matches the question, and returns a structured verdict with a reason. This tests the query’s meaning against the question, not the answer’s wording.</li><li><strong>A fixed template</strong> for common questions. “Last login for user X” can be a hand-written query that doesn’t involve the model at all. Comparing the model’s result with the template’s result is a real cross-check.</li><li><strong>Result-set comparison</strong> instead of comparing answer sentences. Normalize rows by sorting them and rounding floats, then compare.</li></ul><p>This check costs a second query and a second model call, so run it selectively, such as when the result is unusual or the question is high-stakes. Be honest about the cost in your design.</p><h3>What this doesn’t guarantee</h3><p>No layer makes the system correct. The deterministic checks catch invented tables, bad literals, unsafe statements, and missing limits. The independent checks catch many wrong interpretations. Each one reduces risk and none removes it. A query can pass every check and still answer a slightly different question.</p><p>That’s why the system shows its work. The answer comes with the SQL in a “How was this computed?” section, the tables used, and any warnings. A user who can see the query can catch what the system missed, and an audit record can show later what happened.</p><h3>The principle</h3><p>The model proposes. The system verifies. The database enforces.</p><p>A text-to-SQL system that a compliance team will approve isn’t one where the model never makes mistakes. It’s one where the model’s mistakes are limited in what they can touch, caught before they reach the user when possible, and visible when they aren’t.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r0mXSc01YLcT2rQV8PXmJw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ad909ba2363e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why I Built a Semantic Caching Layer for LLM Applications (And How It Works)]]></title>
            <link>https://igreaper.medium.com/why-i-built-a-semantic-caching-layer-for-llm-applications-and-how-it-works-b34131a478a5?source=rss-993e261b22dc------2</link>
            <guid isPermaLink="false">https://medium.com/p/b34131a478a5</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[large-language-models]]></category>
            <category><![CDATA[vector-database]]></category>
            <category><![CDATA[ai-engineering]]></category>
            <dc:creator><![CDATA[Pratham Sharma]]></dc:creator>
            <pubDate>Sun, 04 Oct 2026 17:35:52 GMT</pubDate>
            <atom:updated>2026-10-04T17:35:52.724Z</atom:updated>
            <content:encoded><![CDATA[<p><em>How I used embeddings, local AI models, FastAPI, and Qdrant to solve a common inefficiency in LLM applications.</em></p><h3>1. The problem I wanted to solve</h3><p>Every time an application sends a prompt to an LLM provider, it potentially pays for another inference request.</p><p>Now imagine a customer support chatbot receiving the following questions:</p><ul><li>“What’s your refund policy?”</li><li>“How do I get a refund?”</li><li>“Can I return my order and get my money back?”</li></ul><p>From a user’s perspective, these questions have nearly identical intent. But from a traditional caching system’s perspective, they are three different strings.</p><p>Without a way to recognize semantic similarity, an application may repeatedly call an LLM provider to generate answers it has effectively generated before.</p><p>This creates three problems:</p><ul><li><strong>Cost:</strong> Repeated requests consume tokens and increase API expenses.</li><li><strong>Latency:</strong> Every request waits for another model response, even when a suitable answer may already exist.</li><li><strong>Scalability:</strong> Unnecessary requests consume API quotas and contribute to rate-limit pressure.</li></ul><p>I initially considered traditional caching. However, exact-match caching only works when the incoming request matches an existing cache key.</p><p>Real users rarely phrase questions identically.</p><p>That led me to a different question:</p><p><strong>What if I could cache the meaning of a prompt instead of caching only the prompt itself?</strong></p><p>That was the idea behind LLM Cache Gateway.</p><p><strong>My Own solution workflow :</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XAGQGVVSl7_Aa0OHTDG8mw.png" /></figure><p><strong>Github Repo Link : </strong><a href="https://github.com/TRSxReaperOG/llm-cache-gateway"><strong>https://github.com/TRSxReaperOG/llm-cache-gateway</strong></a></p><h3>2. Exploring the solution: From exact matching to semantic caching</h3><p>My first design goal was simple: intercept incoming LLM requests and determine whether a sufficiently similar request had already been processed.</p><p>Instead of comparing strings directly, I wanted to compare their semantic representations.</p><p>This is where embeddings came in.</p><p>Embeddings convert text into numerical vectors that represent semantic information. Queries with similar meanings can have vectors that are close to each other in a vector space.</p><p>For example:</p><p>&quot;How can I reset my password?&quot;</p><p>and</p><p>&quot;I forgot my password. How do I change it?&quot;</p><p>An embedding model can represent these queries in a way that allows a similarity search to recognize their relationship.</p><p>This approach seemed promising, but it introduced a few engineering challenges:</p><ul><li>Which embedding model should I use?</li><li>Should I use a hosted API or run a model locally?</li><li>Where should I store and search the generated vectors?</li><li>How similar should two queries be before reusing a cached response?</li><li>How do I prevent an incorrect cache hit?</li></ul><p>I decided to investigate each of these separately.</p><h3>3. Choosing an embedding model: Hosted APIs vs. local models</h3><p>The first major decision was choosing the model responsible for generating embeddings.</p><p>A hosted embedding API offers convenience, managed infrastructure and potentially strong embedding quality. However, it introduces recurring costs, external dependencies and additional network latency.</p><p>Since the purpose of this project was to reduce unnecessary LLM expenses, I also wanted to evaluate whether a local embedding model could achieve comparable results.</p><p>I experimented with a local model using Sentence Transformers and compared its performance with a paid embedding API.</p><p>My evaluation focused on:</p><ul><li>Semantic matching quality.</li><li>Embedding generation latency.</li><li>Resource requirements.</li><li>Operational complexity.</li><li>Cost per embedding.</li></ul><p>Running the model locally gave me greater control over the embedding pipeline and reduced embedding costs by approximately 90% in my comparison.</p><p>There was a trade-off, though. Local inference moves the burden to your own infrastructure. You need to consider model loading, CPU or GPU resources, concurrency and memory usage.</p><p>The lesson was that the best embedding model is not necessarily the one with the highest benchmark score. It is the one that provides an appropriate balance of quality, cost and latency for your workload.</p><h3>4. Why I chose Qdrant as my vector database</h3><p>Once I could generate embeddings, I needed a way to store them and efficiently search for similar prompts.</p><p>One option was to store vectors directly in a regular database and calculate similarities manually. That might work for a small experiment, but it becomes increasingly expensive as the number of cached prompts grows.</p><p>I chose Qdrant as the vector database for this project.</p><p>Qdrant allows me to store prompt embeddings along with associated metadata and perform vector similarity searches to find potentially reusable responses.</p><p>The basic flow is:</p><ol><li>Generate an embedding for the incoming prompt.</li><li>Search Qdrant for similar stored vectors.</li><li>Retrieve the closest candidate and its similarity score.</li><li>Compare the score against a configured threshold.</li><li>Return the stored response when the match qualifies.</li><li>Otherwise, forward the request to the LLM provider and cache the result.</li></ol><p>This separates the responsibilities cleanly:</p><ul><li>The embedding model represents the meaning of the prompt.</li><li>Qdrant finds semantically similar cached entries.</li><li>The gateway decides whether a result is safe to reuse.</li><li>The LLM provider generates a fresh response when no suitable match exists.</li></ul><p>One important distinction: Qdrant does not understand whether two answers are factually interchangeable. It retrieves similar vectors. The application still needs to make the final caching decision.</p><h3>5. Building the gateway with FastAPI</h3><p>I didn’t want to build a cache that required every application to change its entire LLM integration.</p><p>Instead, I designed LLM Cache Gateway as a proxy that sits between the application and the LLM provider.</p><p>FastAPI handles incoming requests, while provider adapters manage the upstream communication.</p><p>The request lifecycle looks like this:</p><p><strong>Incoming request → Request parsing → Embedding generation → Qdrant search → Similarity evaluation → Cache hit or upstream LLM call</strong></p><p>On a cache hit, the gateway returns the stored response without making another upstream model call.</p><p>On a cache miss, it forwards the request to the provider, processes the response and stores the relevant information for future requests.</p><p>I also wanted to support more than a single provider, so I used a provider abstraction to keep the gateway’s request-handling logic separate from provider-specific behavior.</p><p>This makes it easier to extend the system without coupling semantic caching to a particular LLM vendor.</p><h3>6. The hardest part: Finding the right similarity threshold</h3><p>At this point, the basic architecture was working. However, I encountered a more important problem.</p><p>A high cache hit rate doesn’t necessarily mean a good cache.</p><p>Consider these questions:</p><ul><li>“How do I delete my account?”</li><li>“How do I deactivate my account temporarily?”</li></ul><p>They are related, but the answers may be significantly different.</p><p>If the similarity threshold is too low, the cache might return a response that doesn’t actually answer the incoming question.</p><p>If the threshold is too high, many useful semantic matches may be missed.</p><p>I needed a way to evaluate the trade-off rather than choosing a threshold based on intuition.</p><p>I created a labeled dataset containing 30 query pairs and tested similarity thresholds against their expected matching behavior.</p><p>The goal was to maximize useful matches without introducing incorrect cache hits.</p><p>On my labeled evaluation set, I achieved 1.0 precision after tuning the threshold.</p><p>That means every predicted match in that dataset was correct. It does not guarantee perfect matching across unseen production traffic, but it gave me a useful starting point.</p><p>This experiment reinforced an important principle:</p><p><strong>For semantic caching, a missed cache hit is usually an opportunity to save money, while a false-positive cache hit can be a correctness issue.</strong></p><h3>7. Benchmarking the system</h3><p>Once the main components were integrated, I wanted to understand the actual impact.</p><p>I benchmarked the gateway to compare the latency of a fresh upstream request against a request served from the cache.</p><p>My reported results:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*tyjjN8SYIPGLkMBI0lY2CA.png" /></figure><p>The most noticeable improvement was response latency. A cached response could be returned in milliseconds instead of waiting for another model inference.</p><p>At a 75% cache hit rate, a significant portion of the tested requests could avoid a fresh upstream model call.</p><p>This also means fewer redundant inference requests and lower token consumption, assuming the cached responses are valid and the workload is representative.</p><p>However, these numbers need context. The latency improvement depends on the model, network conditions, cache state and benchmark setup. Similarly, the cost reduction depends on the embedding API pricing and local infrastructure costs used for comparison.</p><p>The numbers demonstrate what I achieved in my evaluation, not a universal performance guarantee.</p><h3>8. What I learned while building it</h3><p>Building this project taught me that adding a vector database and an embedding model is the relatively straightforward part.</p><p>The real challenge is deciding when it is safe to reuse a response.</p><p>Semantic similarity alone cannot guarantee answer correctness. Some queries depend on changing information, user-specific context, timestamps or generation parameters.</p><p>A production implementation needs to consider:</p><ul><li>Cache invalidation and expiration.</li><li>User and tenant isolation.</li><li>Context-aware matching.</li><li>Model and generation parameter compatibility.</li><li>Handling dynamic or time-sensitive information.</li><li>Concurrency and failure behavior.</li><li>Evaluation against realistic traffic.</li></ul><p>I also learned that optimizing a system requires balancing multiple metrics. Maximizing cache hits is not useful if it comes at the expense of correctness.</p><p>If I were taking this project further, I would expand the evaluation dataset, test with larger and more diverse workloads, improve cache safety checks and measure performance under concurrent traffic.</p><h3>9. Final thoughts</h3><p>LLM applications are becoming increasingly common, but repeated inference is an inefficiency worth addressing.</p><p>With LLM Cache Gateway, I explored how semantic embeddings and vector search can help applications reuse responses for semantically similar queries rather than relying entirely on exact string matching.</p><p>The project gave me hands-on experience with embedding models, local inference, vector databases, API proxy design, evaluation and performance optimization.</p><p>More importantly, it helped me understand that building a useful AI infrastructure component involves much more than integrating an AI model. It requires making thoughtful decisions about cost, latency, correctness and reliability.</p><p><strong>Explore the project:</strong> <a href="https://github.com/TRSxReaperOG/llm-cache-gateway">LLM Cache Gateway on GitHub</a></p><p>I’d be interested to hear how others approach semantic caching and what safeguards they would introduce before deploying a similar system in production.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5pxdhBrhiRbCP1ktfAuZPA.avif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b34131a478a5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Offer That Will Always Mean the Most]]></title>
            <link>https://igreaper.medium.com/the-offer-that-will-always-mean-the-most-1b889771b345?source=rss-993e261b22dc------2</link>
            <guid isPermaLink="false">https://medium.com/p/1b889771b345</guid>
            <dc:creator><![CDATA[Pratham Sharma]]></dc:creator>
            <pubDate>Thu, 27 Aug 2026 13:07:20 GMT</pubDate>
            <atom:updated>2026-08-27T13:08:00.735Z</atom:updated>
            <content:encoded><![CDATA[<p>It’s been a year since I started my journey as a Software Engineer.</p><p>Along the way, I’ve been fortunate to receive international opportunities and offers from companies such as Cyble, Amazon, Robinhood, Oracle, Google, and more across product-based companies, Big Tech, Big 4, and YC-backed startups.</p><p>I’ve received multiple offers across packages of ₹30 LPA, ₹42 LPA, ₹56 LPA, and ₹78 LPA, etc.</p><p>I was featured in Times Square, New York.<br>I was featured in a LinkedIn newsletter.</p><p>These milestones are special, and I’m deeply grateful for every one of them.</p><p>But there is one moment that will always remain above everything else: cracking my first offer.</p><p>Not because of the package.<br>Not because of the company.<br>Not because of the title.</p><p>It was because of that one word from my parents: <strong>“Shabash.”</strong></p><p>The happiness in their eyes. The pride in their smiles. The feeling that all those late nights, self-doubt, rejections, and hard work had finally meant something.</p><p>No achievement will ever replace that moment for me.</p><p>Trust me, <strong>mehnat karne se sach mein ho jata hai.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1b889771b345" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[No More Hard Stops: Cursor-Based Pagination for Data That Never Stops Growing]]></title>
            <link>https://igreaper.medium.com/no-more-hard-stops-cursor-based-pagination-for-data-that-never-stops-growing-15137a8104dd?source=rss-993e261b22dc------2</link>
            <guid isPermaLink="false">https://medium.com/p/15137a8104dd</guid>
            <category><![CDATA[backend-engineering]]></category>
            <category><![CDATA[design-thinking]]></category>
            <category><![CDATA[system-design-interview]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-architecture]]></category>
            <dc:creator><![CDATA[Pratham Sharma]]></dc:creator>
            <pubDate>Thu, 06 Aug 2026 15:11:25 GMT</pubDate>
            <atom:updated>2026-08-06T15:11:25.495Z</atom:updated>
            <content:encoded><![CDATA[<h3>What problem I will discuss here?</h3><p>Almost every product eventually builds a screen that lists live, continuously growing data an activity feed, a notifications inbox, an order history, a monitoring dashboard, a log viewer. Early on, “just fetch the latest N and show them” works fine. Then the dataset grows, and that same screen quietly stops scaling: a hidden cap creeps in, refreshing gets expensive, and deep pages get slow. This is a general pagination design problem, and it’s worth understanding independent of what the “items” actually are.</p><h3>The problem we had, and why it was a problem</h3><p>The list endpoint didn’t really paginate it sliced. It always fetched the newest N items (say, 500), sorted by recency, and returned exactly that. There was no real “page 2”: once you had the top 500, anything older simply didn’t exist as far as the UI was concerned.</p><pre>GET /items?limit=500<br>ORDER BY recency_timestamp DESC<br>LIMIT 500</pre><p>Why this breaks, in general terms:</p><ul><li><strong>It silently breaks correctness, not just completeness.</strong> Any feature that deep-links into “the list, filtered by X” (a dashboard counter, a saved search, a “jump to unresolved items” link) assumes it’s searching the <em>whole</em> dataset. It’s actually only searching the top 500. An older matching item never surfaces no error, nothing that looks wrong on screen, just quietly missing.</li><li><strong>There’s no ceiling to grow into.</strong> This isn’t a small page size someone forgot to raise it’s a structural wall. As the dataset grows (which is usually a sign the product is working), more and more of it becomes permanently unreachable through the UI.</li><li><strong>Refresh cost scales with write volume, not with viewers.</strong> If every new item triggers a refetch of the capped list, a burst of new data becomes a burst of expensive queries exactly when the system is under the most load, which is the worst time for cost to spike.</li><li><strong>The index doesn’t match the query.</strong> It’s common to have an index built for one sort order (say, insertion time, because some background job needs it) while the UI actually sorts by a different field (say, “last updated”). Without an index on the field you actually sort by, the query degrades into scanning and sorting everything in memory as the table grows the opposite of what an index is supposed to buy you.</li></ul><h3>Why the database layer needed special attention here</h3><p>Before the pagination logic, I treated this as a cost problem: total DB load on this page roughly follows (cost per query) × (how often it fires) × (how many people have it open). As the main page of the product, the last term is large and constant so any inefficiency in the other two gets multiplied all day, across every user. The fix had to attack all three:</p><ul><li><strong>Index to match the query, not just any index.</strong> A composite index only serves patterns using its leading columns in order (leftmost-prefix). Filtering by account and sorting by recency needs an (account, recency) index specifically anything else falls back to an in-memory sort that gets slower as the table grows.</li><li><strong>Drop indexes that don’t earn their keep.</strong> Every index costs write overhead and storage, forever. Once (account, recency) existed, a lone account index was redundant dropped it. A saving that never shows up in read latency, only in write cost.</li><li><strong>Skip </strong><strong>COUNT(*) entirely.</strong> Fetch one extra row past the page size instead if it comes back, there&#39;s more. Same answer, no extra scan.</li><li><strong>Bound every query’s cost, independent of depth.</strong> A large OFFSET or unindexed sort gets slower simply because the product is succeeding and data is growing. Every query needs a fixed worst case, regardless of table size.</li><li><strong>Cut query frequency, not just query cost the biggest lever.</strong> Not every view needs to poll continuously. Splitting “must always be fresh” from “just being read through” means polling load depends on concurrent live viewers, not on total data or how deep someone has paged.</li></ul><p>Together the right index, no redundant ones, no count queries, bounded cost per query, and fewer things polling in the first place — this turned “cost grows with our success” into “cost stays flat,” no matter how much data or how many pages exist.</p><h3>How I designed and implemented it, and why</h3><p><strong>1. Cursor (keyset) pagination instead of OFFSET.</strong> The naive fix LIMIT 100 OFFSET 5000doesn&#39;t actually solve anything. The database still has to walk and discard 5,000 rows to hand you the next 100, so cost keeps climbing the deeper you page. Worse, on a live table, rows shift while you&#39;re browsing: new items land, older ones move position, and a user paging forward can see the same item twice or skip one entirely.</p><p>The fix is to anchor every “next page” request on the last item the client actually has, instead of a numeric offset from the start:</p><pre>GET /items?after_timestamp=T&amp;after_id=I&amp;limit=100<br>WHERE (recency_timestamp, id) &lt; (T, I)<br>ORDER BY recency_timestamp DESC, id DESC<br>LIMIT 100</pre><p>Cost is now flat no matter how deep you page you’re always asking “give me the next 100 after this exact point,” never “skip everything before this point.”</p><p><strong>2. Tie-break on a unique id, not just the timestamp.</strong> Two items can share the same timestamp, so timestamp alone isn’t a safe cursor you’d risk skipping or duplicating rows at the boundary. Pairing the timestamp with a unique, strictly ordered id ((timestamp, id)) gives a gapless, unambiguous ordering to walk forward or backward on.</p><p><strong>3. A small, bounded offset only for direct page jumps.</strong> Pure cursor pagination can’t jump straight to “page 40” it can only walk there one page at a time. But clicking a page number is a real, common interaction. So I allowed a bounded offset (capped low, say ≤ 5,000 rows), applied <em>relative to a cursor the client already holds</em>, never relative to row zero. That gives random-access page jumps up to a reasonable depth, with a fixed worst-case cost, while anything deeper falls back to sequential paging instead of an open-ended scan.</p><p><strong>4. “Has more” without a second count query.</strong> Instead of running a separate COUNT(*) to know whether a &quot;Next&quot; button should be enabled (which re-scans the same data you just paged through), fetch one extra row past the page size:</p><pre>fetch limit + 1 rows<br>has_more = (rows returned &gt; limit)<br>return rows[:limit], has_more</pre><p>One query, no extra scan.</p><p><strong>5. Decouple “live” from “paged” the part that actually kills the cost problem.</strong> Even with cheap pagination, if every page kept auto-refreshing on every new item, you’ve just moved the original problem now N pages refetch instead of one capped list. The fix: only the first/”live” view auto-refreshes. Every other page is fetched once, when the user navigates to it, and stays frozen until they leave and come back. Someone reviewing page 12 is looking at a fixed slice of history, not watching for new arrivals freezing it is more correct, not a compromise, and it means refresh cost scales with how many people are on the live view, never with how many pages exist or how much data has accumulated.</p><p><strong>6. Index the field the query actually sorts by.</strong> If the read path sorts by field B but the only index is on field A, add the index that matches field B. It sounds obvious, but it’s the step that’s easy to skip when an index already “exists” on the table the existing one just isn’t the one this query needs.</p><p><strong>7. Add the new path alongside the old one, don’t rewrite it in place.</strong> If other parts of the system already depend on the old, simple “give me the list” call and its exact response shape, introduce the new paginated version as a separate endpoint/function rather than changing the original underneath them. Smaller blast radius, and nothing else has to be retested.</p><p><strong>The general pattern, stripped down:</strong> replace “skip N, take M” with “give me the next M after this specific point I already have,” break ties with a unique id, allow a small bounded jump for random access, infer “more data exists” from an extra fetched row instead of a count, and make sure only the view that’s genuinely live pays the cost of staying live. That combination is what lets a list scale from “the newest few hundred” to effectively endless, without the cost of browsing it growing with the size of the dataset.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=15137a8104dd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Self-Healing Auto-Refresh Framework: RBAC, Kill Switches, Monitoring & Real-Time Control…]]></title>
            <link>https://igreaper.medium.com/building-a-self-healing-auto-refresh-framework-rbac-kill-switches-monitoring-real-time-control-87d6faccbfd3?source=rss-993e261b22dc------2</link>
            <guid isPermaLink="false">https://medium.com/p/87d6faccbfd3</guid>
            <category><![CDATA[scaling]]></category>
            <category><![CDATA[rbac-access-control]]></category>
            <category><![CDATA[grafana]]></category>
            <category><![CDATA[system-design-concepts]]></category>
            <category><![CDATA[mqtt]]></category>
            <dc:creator><![CDATA[Pratham Sharma]]></dc:creator>
            <pubDate>Sun, 21 Jun 2026 06:40:06 GMT</pubDate>
            <atom:updated>2026-06-21T06:40:06.436Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Building a Self-Healing Auto-Refresh Framework: RBAC, Kill Switches, Monitoring &amp; Real-Time Control at Scale</strong></h3><p>Most engineers have implemented auto-refresh at some point.</p><p>Set a timer on the frontend, call an API every few seconds, update the UI, and ship it.</p><p>Simple.</p><p>Until the application starts serving multiple tenants, multiple businesses, thousands of users, and several real-time dashboards.</p><p>Then the real questions begin:</p><ul><li>How do we control refresh intervals without redeployments?</li><li>How do we disable refresh instantly if database load spikes?</li><li>How do we roll out changes tenant by tenant?</li><li>How do we ensure only authorized users can modify configurations?</li><li>What happens when the engineer monitoring production doesn’t have access to the business admin portal?</li></ul><p>This article covers how I designed and implemented a generic auto-refresh framework that evolved into a complete feature management and operational control system.</p><p>The solution combined:</p><ul><li>Dynamic configuration management</li><li>Role-Based Access Control (RBAC)</li><li>Tenant and business-level targeting</li><li>Kill switches</li><li>MQTT-based real-time updates</li><li>Automated protection based on infrastructure metrics</li><li>Grafana observability</li></ul><p>All without requiring deployments.</p><h3>The Problem</h3><p>Our platform contained multiple real-time dashboards.</p><p>Examples:</p><ul><li>Live Users</li><li>Active Sessions</li><li>Security Events</li><li>Threat Monitoring</li><li>Analytics Dashboards</li></ul><p>Each dashboard needed fresh data.</p><p>The traditional solution looked like this:</p><p>Client → API → Database</p><p>Every few seconds or minutes, the frontend would call the backend and fetch new data.</p><p>Initially this works well.</p><p>However, several problems quickly emerge.</p><h3>Problem 1: Configuration Changes</h3><p>Different businesses wanted different refresh intervals.</p><p>Some wanted updates every minute.</p><p>Others preferred every five minutes.</p><p>Changing this through code was inefficient.</p><h3>Problem 2: Feature Rollout</h3><p>Not every business should receive every feature immediately.</p><p>A new dashboard refresh strategy might be enabled only for specific businesses.</p><h3>Problem 3: Operational Risk</h3><p>Imagine a refresh-heavy dashboard suddenly starts causing excessive database load.</p><p>Disabling it should take seconds, not a deployment cycle.</p><h3>Problem 4: Access Management</h3><p>The person monitoring Grafana alerts may not have credentials to access the business administration portal.</p><p>How can they disable a problematic feature during an incident?</p><h3>Existing Approach</h3><p>Most dashboards were implementing refresh independently.</p><p>Each team solved the same problem repeatedly.</p><p>┌─────────────┐<br>│ Live Users │<br>└──────┬──────┘<br>│<br>Custom Logic</p><p>┌─────────────┐<br>│ Threat Feed │<br>└──────┬──────┘<br>│<br>Custom Logic</p><p>┌─────────────┐<br>│ Analytics │<br>└──────┬──────┘<br>│<br>Custom Logic</p><p>This leads to duplicated code, inconsistent behavior, and difficult maintenance.</p><p>I wanted a generic solution.</p><h3>Designing a Generic Framework</h3><p>Instead of treating Auto Refresh as a feature, I treated it as infrastructure.</p><p>The dashboard became the feature.</p><p>For example:</p><p>{<br>“featureName”: “LIVE_USERS”,<br>“tenant”: “META”,<br>“business”: “INSTAGRAM”,<br>“enabled”: true,<br>“refreshInterval”: 60<br>}</p><p>Tomorrow another dashboard can onboard simply by creating a new configuration:</p><p>{<br>“featureName”: “THREAT_EVENTS”,<br>“tenant”: “META”,<br>“business”: “INSTAGRAM”,<br>“enabled”: true,<br>“refreshInterval”: 120<br>}</p><p>No new APIs.</p><p>No new tables.</p><p>No duplicated refresh logic.</p><p>Just configuration.</p><h3>Architecture</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/492/1*T1z-UOlwG7uy5UxrjOdB1A.png" /></figure><p>Title:<br>Generic Auto Refresh Framework Architecture</p><p>Diagram:</p><pre>                Frontend<br>                    │<br>                    ▼           <br>            Configuration API<br>                    │<br>                    ▼              <br>             MongoDB Config<br>                    ▼<br>             MQTT Pub/Sub<br>      ┌───────────────────────────┐<br>      ▼                           ▼<br>    LIVE_USERS             ANALYTICS_THREATS<br></pre><h3>Generic Configuration API</h3><p>One of the design goals was avoiding feature-specific APIs.</p><p>I didn’t want:</p><p>/live-users/config</p><p>/analytics/config</p><p>/threats/config</p><p>Instead, I built generic APIs.</p><p>Example:</p><p>POST /feature-config</p><p>The feature name became part of the request.</p><p>This allowed future features to use the same infrastructure.</p><h3>Role-Based Access Control</h3><p>Configuration management is powerful.</p><p>Which means it’s also dangerous.</p><p>If everyone can change production settings, incidents become inevitable.</p><p>RBAC was integrated directly into the framework.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/836/1*nrE0d5xk0eht8XHwfVGE9A.png" /></figure><p>Example:</p><p>Super Admin</p><ul><li>Read</li><li>Create</li><li>Update</li><li>Delete</li></ul><p>Admin</p><ul><li>Read</li><li>Create</li></ul><p>Viewer</p><ul><li>Read</li></ul><p>Only authorized users could modify feature configurations.</p><p>This ensured governance while maintaining flexibility.</p><h3>Real-Time Updates with MQTT</h3><p>Updating configuration in the database wasn’t enough.</p><p>What happens when thousands of users are already connected?</p><p>Waiting for a page refresh wasn’t acceptable.</p><p>To solve this, I integrated MQTT.</p><p>Flow:</p><p>Configuration Updated<br>↓<br>MQTT Event Published<br>↓<br>Connected Clients Receive Event<br>↓<br>UI Updates Instantly</p><p>This allowed feature changes to propagate in real time.</p><h3>Building a Production Kill Switch</h3><p>One of the most important requirements was operational safety.</p><p>Imagine a dashboard generating unexpected load.</p><p>The traditional response is:</p><p>Detect Issue<br>↓<br>Find Admin<br>↓<br>Login<br>↓<br>Disable Feature</p><p>This process is slow.</p><p>Instead, I built a dedicated Kill Switch API.</p><p>The engineer monitoring production can immediately disable the feature.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/428/1*T6a8BpMOcaSS_Tln1jTX1w.png" /></figure><p>Title:<br>Kill Switch Flow</p><p>Grafana Alert<br>↓<br>Operator<br>↓<br>Kill API<br>↓<br>Config Updated<br>↓<br>MQTT Event<br>↓<br>Feature Disabled</p><h3>Solving the Access Problem</h3><p>A challenge emerged.</p><p>The engineer monitoring metrics often did not possess credentials for a specific business.</p><p>Giving everyone administrative access was not an option.</p><p>The solution was a middleware-protected operational API.</p><p>The API accepted a short-lived operational token.</p><p>Properties:</p><ul><li>Separate from business credentials</li><li>Intended only for incident response</li><li>Rotated every hour</li><li>Accessible only to a limited group</li></ul><p>This created a secure operational control layer.</p><p>In effect, platform engineers could manage incidents without requiring access to every business account.</p><h3>Automatic Protection</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/465/1*dcpg784RGdicuf6uQ6mcqg.png" /></figure><p>Then I asked an important question.</p><p>What if nobody is watching?</p><p>What if a production issue happens at 3 AM?</p><p>A manual kill switch is useful.</p><p>An automatic kill switch is even better.</p><p>I introduced infrastructure-based protection.</p><p>The system continuously monitored database utilization.</p><p>If utilization crossed a threshold:</p><p>Database Usage &gt; 30%<br>↓<br>Auto Refresh Disabled<br>↓<br>MQTT Event Published<br>↓<br>UI Updated</p><p>Users would see a message:</p><p>“Auto refresh has been temporarily disabled due to system load. Please use manual refresh for the time being.”</p><p>When utilization returned to normal:</p><p>Database Usage Normal<br>↓<br>Feature Re-enabled<br>↓<br>MQTT Event Published<br>↓<br>UI Restored</p><p>The system effectively became self-healing.</p><h3>Automatic Recovery Architecture</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/407/1*e-rZNxnj8haxrLKQrIlyNg.png" /></figure><p>Title:<br>Automatic Infrastructure Protection</p><pre>Database Metrics<br>│<br>▼<br>Threshold Monitor<br>│<br>    ├─────────────► Disable Refresh<br>│<br>▼<br>MQTT Broadcast<br>▼<br>All Connected Users</pre><h3>Observability</h3><p>Any production feature is incomplete without monitoring.</p><p>Every refresh request emitted metrics to Grafana.</p><p>We tracked:</p><ul><li>Success rate</li><li>Failure rate</li><li>Refresh volume</li><li>Tenant usage</li><li>Feature adoption</li></ul><p>This provided confidence during rollout and helped identify issues early.</p><h3>Results</h3><p>The final framework delivered:</p><p>✅ Generic onboarding for future dashboards</p><p>✅ Tenant-level targeting</p><p>✅ Business-level targeting</p><p>✅ RBAC integration</p><p>✅ Real-time configuration updates</p><p>✅ MQTT-powered propagation</p><p>✅ Operational kill switches</p><p>✅ Rotating authorization tokens</p><p>✅ Automated protection based on infrastructure health</p><p>✅ Automatic recovery</p><p>✅ No deployments required for configuration changes</p><h3>Lessons Learned</h3><p>The most valuable lesson from this feature was that the real challenge wasn’t implementing auto refresh.</p><p>The challenge was building a system that could safely operate at scale.</p><p>A seemingly simple feature evolved into:</p><ul><li>Configuration management</li><li>Access control</li><li>Operational tooling</li><li>Observability</li><li>Reliability engineering</li><li>Incident response</li></ul><p>The best engineering solutions often start as a feature request and end up becoming platform capabilities.</p><p>And that’s exactly what happened here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FtM7su9LqGAw-gUqz4hjnQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=87d6faccbfd3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Import Cycles in Go]]></title>
            <link>https://igreaper.medium.com/understanding-import-cycles-in-go-a33c14fda95f?source=rss-993e261b22dc------2</link>
            <guid isPermaLink="false">https://medium.com/p/a33c14fda95f</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[design-systems]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[compilers]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Pratham Sharma]]></dc:creator>
            <pubDate>Thu, 11 Jun 2026 19:01:39 GMT</pubDate>
            <atom:updated>2026-06-11T19:01:39.234Z</atom:updated>
            <content:encoded><![CDATA[<p>One of the design decisions in Go is that package dependencies must form a directed acyclic graph (DAG). In simple terms, packages cannot depend on each other in a circular way.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*ja4ZLfGc5XR5lry1hXhipw.png" /></figure><h3>What is an Import Cycle?</h3><p>Consider two packages:</p><h3>Package A</h3><pre>package a</pre><pre>import &quot;project/b&quot;</pre><h3>Package B</h3><pre>package b</pre><pre>import &quot;project/a&quot;</pre><p>Here:</p><ul><li>Package A imports Package B.</li><li>Package B imports Package A.</li></ul><p>This creates a cycle:</p><pre>A → B<br>↑   ↓<br>└───┘</pre><p>When the Go compiler tries to build the project, it runs into a problem.</p><p>To compile Package A, it first needs Package B.</p><p>But to compile Package B, it first needs Package A.</p><p>Now the compiler is stuck because neither package can be compiled independently.</p><p>As a result, Go reports an error similar to:</p><pre>import cycle not allowed</pre><h3>Why Does Go Disallow Import Cycles?</h3><p>Import cycles make dependency graphs harder to understand and maintain. They can also slow down compilation and create tightly coupled code.</p><p>By preventing cycles, Go encourages a cleaner architecture where dependencies flow in a single direction.</p><h3>How to Solve Import Cycles</h3><h3>1. Extract an Interface</h3><p>A common solution is to move the dependency behind an interface.</p><p>Instead of Package A depending on the concrete implementation in Package B (and vice versa), one package defines an interface and the other package implements it.</p><p>This removes the direct circular dependency while preserving the behavior.</p><h3>2. Introduce a Third Package</h3><p>Another approach is to move shared code into a separate package.</p><p>Instead of:</p><pre>A → B<br>B → A</pre><p>Create a third package:</p><pre>A → C<br>B → C</pre><p>Where:</p><ul><li>Package A depends on Package C.</li><li>Package B depends on Package C.</li><li>Package C does not depend on either A or B.</li></ul><p>This breaks the cycle and creates a cleaner dependency structure.</p><p>Be careful: if Package C imports either A or B, the cycle can reappear.</p><h3>Final Thoughts</h3><p>Whenever you see an import cycle in Go, it’s often a sign that package responsibilities are not clearly separated.</p><p>The two most common fixes are:</p><ol><li>Introduce interfaces to invert dependencies.</li><li>Extract shared functionality into a third package.</li></ol><p>Both approaches help create a cleaner and more maintainable codebase.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a33c14fda95f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MongoDB Basics for Beginners]]></title>
            <link>https://igreaper.medium.com/mongodb-basics-for-beginners-10963ccddf72?source=rss-993e261b22dc------2</link>
            <guid isPermaLink="false">https://medium.com/p/10963ccddf72</guid>
            <category><![CDATA[sde-interview]]></category>
            <category><![CDATA[mongodb]]></category>
            <category><![CDATA[database-design]]></category>
            <category><![CDATA[system-design-concepts]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Pratham Sharma]]></dc:creator>
            <pubDate>Mon, 08 Jun 2026 19:03:45 GMT</pubDate>
            <atom:updated>2026-06-08T19:03:45.759Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is MongoDB?</h3><p>MongoDB is a <strong>NoSQL database</strong> that stores data in a flexible, JSON-like format called <strong>documents</strong>.</p><p>Unlike traditional SQL databases, MongoDB does not require a fixed schema. This means documents within the same collection can have different fields, making it highly flexible for modern applications.</p><h3>Example Document</h3><pre>{<br>  &quot;name&quot;: &quot;John&quot;,<br>  &quot;age&quot;: 25,<br>  &quot;city&quot;: &quot;Delhi&quot;<br>}</pre><h3>How Data is Stored in MongoDB</h3><p>MongoDB organizes data in the following hierarchy:</p><pre>Database<br> └── Collection<br>      └── Document</pre><h3>Understanding the Structure</h3><ul><li><strong>Database</strong> → Contains multiple collections.</li><li><strong>Collection</strong> → Similar to a table in SQL.</li><li><strong>Document</strong> → Similar to a row in SQL and stores data in JSON-like format.</li></ul><p>Example:</p><pre>CompanyDB<br> └── Employees<br>      ├── { &quot;name&quot;: &quot;John&quot;, &quot;role&quot;: &quot;Developer&quot; }<br>      └── { &quot;name&quot;: &quot;Sarah&quot;, &quot;role&quot;: &quot;Designer&quot; }</pre><h3>Important MongoDB Components</h3><h3>1. mongod</h3><p>mongod is the main MongoDB server process.</p><p>Responsibilities:</p><ul><li>Stores database data.</li><li>Handles read and write operations.</li><li>Processes queries.</li><li>Manages indexes and data storage.</li></ul><p>Think of it as the engine that powers MongoDB.</p><h3>2. mongosh</h3><p>mongosh (MongoDB Shell) is a developer-friendly command-line interface.</p><p>Using mongosh, you can:</p><ul><li>Create databases and collections.</li><li>Insert documents.</li><li>Update documents.</li><li>Delete documents.</li><li>Run queries directly from the terminal.</li></ul><p>Example:</p><pre>db.users.find()</pre><h3>3. MongoDB Compass</h3><p>MongoDB Compass is MongoDB’s graphical user interface (GUI).</p><p>It provides:</p><ul><li>Visual data exploration.</li><li>Query execution.</li><li>Aggregation pipeline builder.</li><li>Index management.</li></ul><p>It performs the same database operations as mongosh but through a user-friendly interface.</p><h3>CRUD Operations</h3><p>CRUD stands for:</p><ul><li><strong>Create</strong> → Insert data</li><li><strong>Read</strong> → Fetch data</li><li><strong>Update</strong> → Modify data</li><li><strong>Delete</strong> → Remove data</li></ul><h3>Create</h3><p>Insert one document:</p><pre>db.users.insertOne({<br>  name: &quot;John&quot;,<br>  age: 25<br>})</pre><p>Insert multiple documents:</p><pre>db.users.insertMany([<br>  { name: &quot;John&quot; },<br>  { name: &quot;Sarah&quot; }<br>])</pre><h3>Read</h3><p>Find all documents:</p><pre>db.users.find()</pre><p>Find one document:</p><pre>db.users.findOne({<br>  name: &quot;John&quot;<br>})</pre><h3>Update</h3><p>Update a single document:</p><pre>db.users.updateOne(<br>  { name: &quot;John&quot; },<br>  { $set: { age: 26 } }<br>)</pre><p>Use updateOne() when only one record needs modification.</p><p>Update multiple documents:</p><pre>db.users.updateMany(<br>  { city: &quot;Delhi&quot; },<br>  { $set: { country: &quot;India&quot; } }<br>)</pre><p>Use updateMany() when multiple records match the condition.</p><h3>Delete</h3><p>Delete one document:</p><pre>db.users.deleteOne({<br>  name: &quot;John&quot;<br>})</pre><p>Delete multiple documents:</p><pre>db.users.deleteMany({<br>  city: &quot;Delhi&quot;<br>})</pre><h3>Aggregation Pipeline</h3><p>Aggregation Pipeline is one of MongoDB’s most powerful features.</p><p>Instead of writing one large and complex query, MongoDB allows data to flow through multiple stages.</p><p>Each stage performs a specific operation, and the output of one stage becomes the input of the next stage.</p><p>Think of it like an assembly line:</p><pre>Stage 1 → Stage 2 → Stage 3 → Final Result</pre><h3>Example</h3><pre>db.orders.aggregate([<br>  { $match: { status: &quot;completed&quot; } },<br>  { $group: { _id: &quot;$customerId&quot;, total: { $sum: &quot;$amount&quot; } } },<br>  { $sort: { total: -1 } }<br>])</pre><p>Here:</p><ol><li>Filter completed orders.</li><li>Group orders by customer.</li><li>Calculate total spending.</li><li>Sort customers by spending.</li></ol><h3>Why Use Aggregation?</h3><ul><li>Handles complex data processing efficiently.</li><li>Reduces application-side processing.</li><li>Optimized to run inside MongoDB.</li><li>Makes data analysis easier and faster.</li></ul><h3>Indexing</h3><p>Indexes help MongoDB find data quickly without scanning every document in a collection.</p><p>Without an index:</p><pre>MongoDB checks every document.</pre><p>With an index:</p><pre>MongoDB directly jumps to the matching data.</pre><h3>Benefits</h3><ul><li>Faster search operations.</li><li>Improved query performance.</li><li>Better sorting performance.</li></ul><h3>Important Trade-off</h3><p>Indexes are not always free.</p><p><strong>More indexes = Faster Reads</strong></p><p>But: <strong>More indexes = Slower Writes</strong></p><p>Why? Whenever data is inserted, updated, or deleted, MongoDB must also update all related indexes.</p><h3>Best Practice</h3><p>Do not create indexes blindly.</p><p>Choose indexes based on:</p><ul><li>Frequently searched fields.</li><li>Common filtering conditions.</li><li>Sorting requirements.</li><li>Real application usage patterns.</li></ul><p>The right indexing strategy depends on your use case.</p><h3>Final Thoughts</h3><p>MongoDB is a flexible and beginner-friendly NoSQL database that stores data as documents.</p><p>To become comfortable with MongoDB, focus on:</p><ol><li>Understanding databases, collections, and documents.</li><li>Practicing CRUD operations.</li><li>Learning aggregation pipelines.</li><li>Understanding how indexing improves performance.</li></ol><p>Mastering these fundamentals will help you build a strong foundation before moving to advanced MongoDB concepts such as replication, sharding, transactions, and performance optimization.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kjGlwLyGHWmGTLWHgXOJvg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=10963ccddf72" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Work at a startup at least once in your life.]]></title>
            <link>https://igreaper.medium.com/work-at-a-startup-at-least-once-in-your-life-968cde3e5881?source=rss-993e261b22dc------2</link>
            <guid isPermaLink="false">https://medium.com/p/968cde3e5881</guid>
            <dc:creator><![CDATA[Pratham Sharma]]></dc:creator>
            <pubDate>Mon, 25 May 2026 23:19:59 GMT</pubDate>
            <atom:updated>2026-05-25T23:19:59.846Z</atom:updated>
            <content:encoded><![CDATA[<p>I genuinely mean this.</p><p>The chaos, speed, ownership, and pressure to figure things out change you.</p><p>In a strong product startup, you don’t just write code.</p><p>You learn how systems behave in production.<br> You learn how products are built and shipped.<br> You learn to debug uncertainty, not just bugs.<br> You learn to think in trade-offs, move through ambiguity, and take ownership beyond your role.</p><p>And somewhere in that process, your mindset changes.</p><p>The hunger becomes different.<br>The execution becomes sharper.<br>You stop waiting for perfect requirements and start figuring things out.</p><p>My personal take?</p><p>For ownership, execution speed, and practical system thinking</p><p><strong>Strong product startup experience &gt;&gt;&gt; FAANG / MAANG / MNC comfort zones.</strong></p><p>Not because one is universally better than the other.</p><p>They simply build different muscles.</p><p>FAANG and large companies teach scale, process, and operating mature systems.</p><p>Startups teach you how to build when nothing is mature yet.</p><p>If you want compressed growth, end-to-end thinking, and real ownership — work at a startup at least once.</p><p>It leaves a different mark on you as an engineer.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=968cde3e5881" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding EDR, From the Lens of a Backend Engineer]]></title>
            <link>https://igreaper.medium.com/understanding-edr-from-the-lens-of-a-backend-engineer-9081fa2d26f7?source=rss-993e261b22dc------2</link>
            <guid isPermaLink="false">https://medium.com/p/9081fa2d26f7</guid>
            <category><![CDATA[backend-engineering]]></category>
            <category><![CDATA[product-development]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[endpoint-security]]></category>
            <dc:creator><![CDATA[Pratham Sharma]]></dc:creator>
            <pubDate>Thu, 05 Mar 2026 20:40:21 GMT</pubDate>
            <atom:updated>2026-03-05T20:40:21.642Z</atom:updated>
            <content:encoded><![CDATA[<p>While working on <strong>Endpoint Detection &amp; Response (EDR)</strong> systems at a Y Combinator backed security company, I got to see how modern endpoint security actually works under the hood.</p><p>Most people have heard of <strong>antivirus</strong>, but EDR is a completely different approach to endpoint protection.</p><p>Before going deeper into architecture, let’s start with <strong>why EDR was built in the first place.</strong></p><h3>Why Traditional Antivirus Was Not Enough</h3><p>Earlier, most systems relied on <strong>antivirus software</strong>.</p><p>Antivirus tools mainly work using <strong>signature-based detection</strong>.</p><p>This means they maintain a <strong>database of known malicious signatures</strong> (hashes, patterns, known malware samples). Whenever a file is scanned, the antivirus checks whether it matches something in that database.</p><p>If it matches → malware detected.</p><p>But this approach has a major limitation.</p><p>Imagine you are an attacker.</p><p>You can simply create <strong>new malware that is not present in the antivirus database</strong>. Since the signature is unknown, the antivirus will not detect it.</p><p>This is where the <strong>entire security model started to break.</strong></p><p>Attackers became faster at creating new variants than antivirus databases could update.</p><p>So the industry needed a <strong>behavior-based detection system</strong> rather than just a <strong>signature-based system</strong>.</p><p>And that’s where <strong>EDR was introduced.</strong></p><h3>What is EDR (Endpoint Detection &amp; Response)?</h3><p><strong>Endpoint Detection &amp; Response (EDR)</strong> is a security system that continuously <strong>monitors endpoint behavior</strong> and analyzes activities to determine whether something malicious is happening.</p><p>Instead of only checking files against a database, EDR focuses on <strong>intent and behavior.</strong></p><p>It observes <strong>what processes are doing</strong>, <strong>how they interact with the system</strong>, and <strong>what sequence of actions is happening.</strong></p><p>If something suspicious occurs, it can:</p><ul><li>Raise alerts</li><li>Investigate the activity</li><li>Take automated actions to contain the threat</li></ul><h3>What is an Endpoint?</h3><p>An <strong>endpoint</strong> simply refers to a device connected to the network.</p><p>Examples include:</p><ul><li>Laptops</li><li>Desktop computers</li><li>Servers</li><li>Virtual machines</li></ul><p>These endpoints are usually the <strong>first entry point for attackers</strong>, which is why monitoring them becomes critical.</p><h3>Important Terminologies in EDR</h3><p>Before diving deeper, let’s understand some common terms.</p><h3>Endpoint</h3><p>The device being monitored (laptop, PC, server, etc).</p><h3>Events</h3><p>Every action happening on the endpoint generates an <strong>event</strong>.</p><p>Examples:</p><ul><li>Opening a folder</li><li>Running a process</li><li>Executing a PowerShell script</li><li>Creating or deleting files</li><li>Network connections</li><li>Registry modifications</li></ul><p>All these activities are recorded as <strong>events</strong>.</p><p>EDR systems collect <strong>millions of such events</strong> from endpoints.</p><h3>Incident</h3><p>When suspicious or malicious activity is detected from a set of events, an <strong>alert</strong> is generated.</p><p>This alert is referred to as an <strong>incident</strong>.</p><p>Security teams investigate incidents to determine whether an attack is actually happening.</p><h3>Remediation</h3><p>Once an incident is detected, the system can take <strong>remediation actions</strong>.</p><p>These actions help <strong>contain or eliminate the threat.</strong></p><p>Common remediation operations include:</p><ul><li>Killing malicious processes</li><li>Quarantining files</li><li>Isolating the endpoint from the network</li><li>Blocking execution of a file</li><li>Rolling back malicious changes</li></ul><p>These actions can be triggered <strong>manually by analysts</strong> or <strong>automatically by the system</strong>.</p><h3>Sandbox Integration</h3><p>Sometimes it’s not clear whether a file is malicious.</p><p>In such cases, the file can be sent to a <strong>sandbox environment</strong>.</p><p>A sandbox runs the file in a <strong>controlled virtual environment</strong> and observes its behavior.</p><p>The system then generates a <strong>detailed analysis report</strong>, including:</p><ul><li>Network calls</li><li>File system modifications</li><li>Process spawning</li><li>Suspicious behaviors</li></ul><p>This helps determine <strong>how harmful the file actually is.</strong></p><h3>Core Components of an EDR System</h3><p>From a high-level architecture perspective, an EDR system typically consists of <strong>three main components.</strong></p><h3>1. Endpoint Agent (Kernel + System Level Monitoring)</h3><p>The <strong>agent</strong> runs on the endpoint machine.</p><p>It is responsible for:</p><ul><li>Monitoring system activity</li><li>Capturing events</li><li>Enforcing remediation actions</li></ul><p>Many agents interact with <strong>kernel-level components</strong> to observe deep system behavior like:</p><ul><li>Process execution</li><li>File system changes</li><li>Registry activity</li><li>Network calls</li></ul><p>These events are then <strong>streamed to the backend infrastructure</strong> for analysis.</p><h3>2. Backend Infrastructure</h3><p>This is where most <strong>backend engineering effort goes.</strong></p><p>The backend is responsible for:</p><ul><li>Receiving high-volume event streams from endpoints</li><li>Processing and storing these events</li><li>Running detection rules</li><li>Generating alerts</li><li>Sending remediation commands back to agents</li></ul><p>Typical backend challenges include:</p><ul><li><strong>High throughput ingestion</strong></li><li><strong>Low latency detection</strong></li><li><strong>Massive event storage</strong></li><li><strong>Rule execution engines</strong></li><li><strong>Distributed processing pipelines</strong></li></ul><p>Backend systems often use technologies like:</p><ul><li>Streaming systems (Kafka)</li><li>Distributed storage</li><li>Event processing pipelines</li><li>Detection rule engines</li></ul><h3>3. User Interface (Security Dashboard)</h3><p>The UI is used by <strong>security analysts</strong> to monitor and investigate threats.</p><p>Through the UI they can:</p><ul><li>View alerts and incidents</li><li>Investigate event timelines</li><li>Analyze process trees</li><li>Trigger remediation actions</li><li>Manage endpoints</li></ul><p>Essentially, it acts as the <strong>control center</strong> for the entire EDR platform.</p><h3>How a Backend Engineer Sees an EDR System</h3><p>From a <strong>backend engineer’s perspective</strong>, working on an EDR platform usually involves building systems that can handle:</p><h3>Massive Event Ingestion</h3><p>Endpoints continuously send telemetry data. The backend must ingest and process <strong>huge volumes of events reliably.</strong></p><h3>Detection Pipelines</h3><p>Running detection logic on incoming events to identify suspicious patterns.</p><h3>Incident Generation</h3><p>Correlating multiple events together to generate meaningful security incidents.</p><h3>Command &amp; Control</h3><p>Sending remediation commands from backend to agents.</p><h3>Event Storage and Search</h3><p>Security analysts often need to <strong>query historical endpoint activity</strong>, which requires efficient indexing and search systems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*duimZXICm_d64BtUxdvxrg.png" /></figure><h3>Final Thoughts</h3><p>EDR represents a shift from <strong>signature-based security</strong> to <strong>behavior-based detection</strong>.</p><p>Instead of only asking:</p><blockquote><em>“Is this file known malware?”</em></blockquote><p>EDR asks a more powerful question:</p><blockquote><em>“Is this system behavior suspicious?”</em></blockquote><blockquote>This shift allows security systems to detect <strong>previously unseen attacks</strong>, making endpoint protection significantly more effective.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9081fa2d26f7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>