<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Aadarsh Singh</title>
    <description>The latest articles on DEV Community by Aadarsh Singh (@onlyaadarsh).</description>
    <link>https://dev.to/onlyaadarsh</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1163385%2F96d3bd10-7001-491b-934e-39b046edd66b.jpeg</url>
      <title>DEV Community: Aadarsh Singh</title>
      <link>https://dev.to/onlyaadarsh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/onlyaadarsh"/>
    <language>en</language>
    <item>
      <title>Introducing TheCoder: A Coding Practice Platform with an In-Browser Compiler</title>
      <dc:creator>Aadarsh Singh</dc:creator>
      <pubDate>Mon, 02 Nov 2026 10:43:41 +0000</pubDate>
      <link>https://dev.to/onlyaadarsh/introducing-thecoder-a-coding-practice-platform-with-an-in-browser-compiler-52hm</link>
      <guid>https://dev.to/onlyaadarsh/introducing-thecoder-a-coding-practice-platform-with-an-in-browser-compiler-52hm</guid>
      <description>&lt;p&gt;Learning programming is easy to start, but becoming a good programmer requires consistent practice.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgf2r80ap2q6b1tp9itj2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgf2r80ap2q6b1tp9itj2.png" alt="coding platform" width="800" height="386"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can watch hundreds of tutorials, read documentation, and learn different programming languages. But eventually, you need to open an editor, write code, solve problems, make mistakes, debug errors, and improve your problem-solving skills.&lt;/p&gt;

&lt;p&gt;That's exactly the experience I want to make easier with TheCoder.&lt;/p&gt;

&lt;p&gt;I'm excited to introduce the improved version of TheCoder, a coding platform designed to bring coding practice, problem-solving, and an online compiler together in one place.&lt;/p&gt;

&lt;p&gt;Let's explore what it offers!&lt;/p&gt;

&lt;h2&gt;
  
  
  💡 What is TheCoder?
&lt;/h2&gt;

&lt;p&gt;TheCoder is a coding practice platform built for developers, students, and programming enthusiasts who want to improve their coding skills through hands-on experience.&lt;/p&gt;

&lt;p&gt;Explore &lt;a href="https://code.thecoder.in" rel="noopener noreferrer"&gt;TheCoder Code – Free Online Code Compiler with Practice Problems&lt;/a&gt; and start practicing today.&lt;/p&gt;

&lt;p&gt;The platform focuses on three important things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Practice: Work on curated coding problems and improve your problem-solving abilities.&lt;/li&gt;
&lt;li&gt;Execute: Write and run code directly in your browser without setting up a local development environment.&lt;/li&gt;
&lt;li&gt;Prepare: Follow structured interview tracks to improve your programming and technical interview preparation.
The idea is simple: spend less time setting up your coding environment and more time actually coding.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  ⚡ 1. An Online Compiler with Multiple Language Support
&lt;/h3&gt;

&lt;p&gt;One of the major improvements I've recently introduced is the online compiler.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://code.thecoder.in/compiler" rel="noopener noreferrer"&gt;You can write and execute code using our Code Compiler&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Setting up a development environment can sometimes become a distraction, especially when you're learning a new programming language or simply want to test a small piece of code.&lt;/p&gt;

&lt;p&gt;With TheCoder, you can launch a dedicated coding environment directly from your browser.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Language&lt;/th&gt;
&lt;th&gt;Runtime / Version&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Python&lt;/td&gt;
&lt;td&gt;Python 3.14&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;JavaScript&lt;/td&gt;
&lt;td&gt;Node.js 24&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C++&lt;/td&gt;
&lt;td&gt;GCC 13 (C++20)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Java&lt;/td&gt;
&lt;td&gt;OpenJDK 21&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C#&lt;/td&gt;
&lt;td&gt;.NET 8.0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SQL&lt;/td&gt;
&lt;td&gt;SQLite 3&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Whether you're experimenting with Python, testing a JavaScript function, compiling a C++ program, or executing SQL queries, you can do it directly in your browser.&lt;/p&gt;

&lt;p&gt;No local compiler installation is required to get started.&lt;/p&gt;

&lt;h3&gt;
  
  
  🛠️ 2. Dedicated Coding Environments
&lt;/h3&gt;

&lt;p&gt;Instead of providing just a basic code execution box, TheCoder offers dedicated environments for different programming languages.&lt;/p&gt;

&lt;p&gt;Some of the compiler capabilities include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Language-specific coding environments.&lt;/li&gt;
&lt;li&gt;Instant code execution.&lt;/li&gt;
&lt;li&gt;Custom standard input (stdin) support.&lt;/li&gt;
&lt;li&gt;Isolated sandbox execution.&lt;/li&gt;
&lt;li&gt;A streamlined coding interface.
The goal is to provide a convenient environment where developers can experiment with code and test different approaches.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🧩 3. Curated Coding Problems
&lt;/h3&gt;

&lt;p&gt;Learning programming concepts is important, but applying those concepts to real problems is where the actual learning happens.&lt;/p&gt;

&lt;p&gt;TheCoder also provides a dedicated Problems section where developers can practice coding problems.&lt;/p&gt;

&lt;p&gt;Solving problems regularly helps develop several important skills:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Logical thinking.&lt;/li&gt;
&lt;li&gt;Algorithmic problem-solving.&lt;/li&gt;
&lt;li&gt;Understanding data structures.&lt;/li&gt;
&lt;li&gt;Writing optimized solutions.&lt;/li&gt;
&lt;li&gt;Debugging and handling edge cases.
Whether you're a beginner trying to understand programming fundamentals or an intermediate developer preparing for technical interviews, consistent problem-solving can make a significant difference.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🎯 4. Structured Interview Preparation
&lt;/h3&gt;

&lt;p&gt;Preparing for coding interviews can sometimes feel overwhelming.&lt;/p&gt;

&lt;p&gt;There are thousands of coding problems available online, but randomly solving problems doesn't always lead to structured learning.&lt;/p&gt;

&lt;p&gt;That's why TheCoder focuses on structured interview tracks alongside its coding practice experience.&lt;/p&gt;

&lt;p&gt;The objective is to help developers approach interview preparation with more direction rather than simply solving random questions.&lt;/p&gt;

&lt;h2&gt;
  
  
  👨‍💻 Who Should Use TheCoder?
&lt;/h2&gt;

&lt;p&gt;I want TheCoder to be useful for developers at different stages of their programming journey.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Beginners&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you're just starting with programming, you can experiment with code directly in your browser without worrying about compiler installation and environment configuration.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Intermediate Developers&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you already understand programming fundamentals, you can use the platform to practice problems, experiment with different approaches, and strengthen your problem-solving skills.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Competitive Programming Enthusiasts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can use the coding environment to test implementations and work on improving your problem-solving approach.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Students Preparing for Interviews&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Structured interview preparation and coding practice can help you build consistency and become more comfortable with technical problem-solving.&lt;/p&gt;

&lt;h2&gt;
  
  
  🚀 Why Am I Building Another Coding Platform?
&lt;/h2&gt;

&lt;p&gt;Let's be honest: there are already several excellent coding platforms available.&lt;/p&gt;

&lt;p&gt;So why build another one?&lt;/p&gt;

&lt;p&gt;Because I believe there is still room to build better learning experiences for developers.&lt;/p&gt;

&lt;p&gt;My goal isn't simply to create another online compiler or coding problem website.&lt;/p&gt;

&lt;p&gt;I want to bring together the essential tools developers need when learning and practicing programming.&lt;/p&gt;

&lt;p&gt;A place where you can:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open a coding environment.&lt;/li&gt;
&lt;li&gt;Experiment with different programming languages.&lt;/li&gt;
&lt;li&gt;Practice coding problems.&lt;/li&gt;
&lt;li&gt;Improve your problem-solving skills.&lt;/li&gt;
&lt;li&gt;Prepare for technical interviews.
All without constantly switching between different tools.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;TheCoder is an evolving project, and I'm continuously working on improving its capabilities and user experience.&lt;/p&gt;

&lt;h2&gt;
  
  
  🔮 What's Next?
&lt;/h2&gt;

&lt;p&gt;This is just one step in the journey.&lt;/p&gt;

&lt;p&gt;I have several ideas for making TheCoder a more comprehensive coding practice environment.&lt;/p&gt;

&lt;p&gt;My long-term vision is to make it a useful destination for developers who want to learn by doing rather than just consuming tutorials.&lt;/p&gt;

&lt;p&gt;There is still a lot to build, improve, and experiment with.&lt;/p&gt;

&lt;p&gt;And I would love to hear what features the developer community would find useful.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://code.thecoder.in/problems" rel="noopener noreferrer"&gt;improve your problem-solving skills with Practice Problems&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  🤝 Give TheCoder a Try!
&lt;/h3&gt;

&lt;p&gt;If you're learning programming, practicing data structures and algorithms, preparing for coding interviews, or simply looking for an online compiler, give TheCoder a try.&lt;/p&gt;

&lt;p&gt;🌐&lt;a href="https://code.thecoder.in" rel="noopener noreferrer"&gt;Coding &amp;amp; Online Compiler&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;≥ Compilers&lt;/p&gt;

&lt;p&gt;&lt;a href="https://code.thecoder.in/compiler/python" rel="noopener noreferrer"&gt;online compiler Python&lt;/a&gt;&lt;br&gt;
&lt;a href="https://code.thecoder.in/compiler/javascript" rel="noopener noreferrer"&gt;online compiler Javascript&lt;/a&gt;&lt;br&gt;
&lt;a href="https://code.thecoder.in/compiler/cpp" rel="noopener noreferrer"&gt;online compiler cpp&lt;/a&gt;&lt;br&gt;
&lt;a href="https://code.thecoder.in/compiler/cshrp" rel="noopener noreferrer"&gt;online compiler cshrp&lt;/a&gt;&lt;br&gt;
&lt;a href="https://code.thecoder.in/compiler/java" rel="noopener noreferrer"&gt;online compiler java&lt;/a&gt;&lt;br&gt;
&lt;a href="https://code.thecoder.in/compiler/sql" rel="noopener noreferrer"&gt;online compiler SQL&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'd genuinely appreciate your feedback.&lt;/p&gt;

&lt;p&gt;If you find a bug, have a feature suggestion, or think something could be improved, feel free to share your thoughts in the comments.&lt;/p&gt;

&lt;p&gt;I'm building this with the developer community in mind, and your feedback can help shape what comes next.&lt;/p&gt;

&lt;p&gt;Happy Coding! 💚&lt;/p&gt;

</description>
      <category>programming</category>
      <category>webdev</category>
      <category>competativeprogramming</category>
      <category>coding</category>
    </item>
    <item>
      <title>Architecting for Zero: Building an Event-Driven, Scale-to-Zero AI Platform</title>
      <dc:creator>Aadarsh Singh</dc:creator>
      <pubDate>Sun, 27 Sep 2026 13:03:15 +0000</pubDate>
      <link>https://dev.to/onlyaadarsh/architecting-for-zero-building-an-event-driven-scale-to-zero-ai-platform-4b93</link>
      <guid>https://dev.to/onlyaadarsh/architecting-for-zero-building-an-event-driven-scale-to-zero-ai-platform-4b93</guid>
      <description>&lt;p&gt;Most modern AI applications follow an intuitive, straightforward pattern: the browser sends an HTTP POST, the API server invokes an LLM SDK, waits 15 seconds while streaming chunks back over the wire, and saves the result to a database.&lt;/p&gt;

&lt;p&gt;It works smoothly in development. But in production, this simple synchronous pattern quickly reveals its cracks:&lt;/p&gt;

&lt;p&gt;Vercel / Edge function timeouts abruptly cut off long-running multi-step agent graphs.&lt;br&gt;
Traffic spikes lock server threads, ballooning costs and stalling web traffic.&lt;br&gt;
Idle compute burns cash: keeping GPU-ready or high-memory container clusters running 24/7 when traffic fluctuates to zero overnight bleeds resources.&lt;br&gt;
Dropped client connections kill execution: if a user on mobile loses cell signal mid-generation, the entire inference is lost, wasting tokens and compute.&lt;br&gt;
When architecting Rewire—an AI platform orchestrating safety-critical cognitive reframing, Neo4j GraphRAG, and longitudinal mental health tracking—we set a clear architectural constraint:&lt;/p&gt;

&lt;p&gt;True Zero-Scale Economics: Baseline idle cost must be near $0/month, yet the system must instantly burst to handle concurrent multi-stage AI graphs without dropping tokens, exhausting database connections, or timing out web requests.&lt;/p&gt;

&lt;p&gt;Here is the high-level system architecture, the mechanics of our scale-to-zero pipeline, and the real-world pitfalls you encounter when taking this approach.&lt;/p&gt;

&lt;p&gt;The High-Level Topology&lt;br&gt;
Rewire is built as a decoupled monorepo (powered by Turborepo and pnpm). Instead of coupling user-facing authentication and rendering with heavy agentic inference, the architecture is split cleanly across an asynchronous message boundary:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                      ┌──────────────────────────────┐
                      │    User Browser / Client     │
                      └──────────────┬───────────────┘
                                     │ HTTP / SSE
                                     ▼
                      ┌──────────────────────────────┐
                      │  Next.js 16 BFF (apps/web)   │
                      │  Auth, tRPC, UI &amp;amp; SSE Stream │
                      └──────┬────────────────▲──────┘
         1. Enqueue Job      │                │ 4. Read Stream Events
         (Sub-100ms response)│                │    (XREAD with recovery)
                             ▼                │
                      ┌──────────────┐ ┌──────┴──────────────┐
                      │   AWS SQS    │ │    Redis Streams     │
                      │  (Job Queue) │ │   (ai:run:{runId})   │
                      └──────┬───────┘ └──────▲──────────────┘
         2. SQS Trigger      │                │ 3. Publish Tokens
            Event            ▼                │    &amp;amp; Deltas
                      ┌───────────────────────┴──────┐
                      │ NestJS AI Worker (apps/api)  │
                      │  AWS Lambda (Scale-to-Zero)  │
                      │  LangGraph + Neo4j GraphRAG  │
                      └──────────────┬───────────────┘
                                     │
                                     ▼
                      ┌──────────────────────────────┐
                      │ PostgreSQL (Prisma ORM)      │
                      │ Single Source of Truth       │
                      └──────────────────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The system operates across three autonomous tiers:&lt;/p&gt;

&lt;p&gt;The Edge &amp;amp; BFF Tier (apps/web): Built with Next.js 16 (App Router), React 19, and Better Auth. It handles authentication, renders UI components, and serves as an ultra-fast gateway.&lt;br&gt;
The Elastic Queue &amp;amp; Stream Buffer: AWS SQS decouples ingestion from execution. Redis Streams (ai:run:{runId}) serves as an ephemeral, replayable token buffer.&lt;br&gt;
The AI Worker Tier (apps/api): A modular NestJS 11 application compiled into an AWS Lambda function triggered exclusively by SQS events. It drives LangGraph cognitive state machines, verifies clinical safety gates, and retrieves therapeutic context from Neo4j GraphRAG.&lt;br&gt;
Anatomy of an Asynchronous Interaction&lt;br&gt;
What does a message cycle look like when client requests never wait for an LLM?&lt;/p&gt;

&lt;p&gt;sequenceDiagram&lt;br&gt;
    autonumber&lt;br&gt;
    actor User as User Browser&lt;br&gt;
    participant Web as Next.js BFF (Vercel Serverless)&lt;br&gt;
    participant DB as PostgreSQL (Prisma)&lt;br&gt;
    participant SQS as AWS SQS&lt;br&gt;
    participant Worker as NestJS Worker (AWS Lambda)&lt;br&gt;
    participant Redis as Redis Streams&lt;br&gt;
    participant LLM as LLM Provider / Neo4j&lt;br&gt;
    User-&amp;gt;&amp;gt;Web: Send Prompt ("I'm feeling overwhelmed...")&lt;br&gt;
    Web-&amp;gt;&amp;gt;DB: 1. Persist User Message &amp;amp; AiRun(status: "queued")&lt;br&gt;
    Web-&amp;gt;&amp;gt;SQS: 2. Enqueue Lean Payload { runId, conversationId, userId }&lt;br&gt;
    Web--&amp;gt;&amp;gt;User: 3. Return { runId } immediately (&amp;lt; 100ms)&lt;br&gt;
    par Ephemeral Streaming&lt;br&gt;
        User-&amp;gt;&amp;gt;Web: GET /api/ai/runs/:runId/stream (SSE)&lt;br&gt;
        Web-&amp;gt;&amp;gt;Redis: XREAD from ai:run:{runId}&lt;br&gt;
    and Serverless Worker Execution&lt;br&gt;
        SQS-&amp;gt;&amp;gt;Worker: Trigger Lambda Event&lt;br&gt;
        Worker-&amp;gt;&amp;gt;DB: Update AiRun -&amp;gt; "running"&lt;br&gt;
        Worker-&amp;gt;&amp;gt;Redis: XADD run.started&lt;br&gt;
        Worker-&amp;gt;&amp;gt;Worker: Run LangGraph: Load Context -&amp;gt; Safety Triage -&amp;gt; Neo4j GraphRAG&lt;br&gt;
        loop Token Generation&lt;br&gt;
            LLM--&amp;gt;&amp;gt;Worker: Stream Token Chunk&lt;br&gt;
            Worker-&amp;gt;&amp;gt;Redis: XADD message.delta&lt;br&gt;
            Redis--&amp;gt;&amp;gt;Web: Event Delivered&lt;br&gt;
            Web--&amp;gt;&amp;gt;User: SSE Chunk Rendered in UI&lt;br&gt;
        end&lt;br&gt;
        Worker-&amp;gt;&amp;gt;DB: Commit Final Message &amp;amp; Mark AiRun "completed"&lt;br&gt;
        Worker-&amp;gt;&amp;gt;Redis: XADD run.completed&lt;br&gt;
        Web--&amp;gt;&amp;gt;User: Close SSE Connection&lt;br&gt;
    end&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The Sub-100ms Handshake
When the user submits a prompt, the Next.js API route does not invoke LangGraph or call an AI model.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Instead, it validates the request using a shared Zod schema from packages/validation, writes the message and an AiRun record (flagged as queued) to PostgreSQL, and pushes an ultra-lean pointer payload to AWS SQS:&lt;/p&gt;

&lt;p&gt;{  "runId": "run_cuid123",  "conversationId": "conv_cuid456",  "messageId": "msg_cuid789",  "userId": "usr_cuid000"}&lt;br&gt;
The web server responds to the browser with { runId } in under 100ms. No gateway timeouts, no thread exhaustion, no risk of a 30-second multi-step graph stalling the front door.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Event-Driven Wake-Up
AWS SQS triggers the NestJS worker deployed on AWS Lambda. If there is zero traffic, zero Lambda instances are running.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;When a job arrives, Lambda spins up, pulls authoritative context from PostgreSQL, and hands the state over to a deterministic LangGraph state machine:&lt;/p&gt;

&lt;p&gt;[START] &lt;br&gt;
   │&lt;br&gt;
   ▼&lt;br&gt;
[Load Context] ──► [Safety Triage] ──┬──► (Acute Risk) ──► [Crisis Helpline Flow] ──┐&lt;br&gt;
                                     │                                              │&lt;br&gt;
                                     └──► (Safe) ──► [Neo4j GraphRAG]               │&lt;br&gt;
                                                           │                        │&lt;br&gt;
                                                           ▼                        │&lt;br&gt;
                                                    [LLM Generation]                │&lt;br&gt;
                                                           │                        │&lt;br&gt;
                                                           ▼                        ▼&lt;br&gt;
                                                 [Response Verification] ◄──────────┘&lt;br&gt;
                                                           │&lt;br&gt;
                                                           ▼&lt;br&gt;
                                                    [Persist &amp;amp; END]&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Decoupled Streaming via Redis Streams
How does a serverless Lambda stream real-time text back to a browser without opening a direct WebSocket connection?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;As tokens arrive from the LLM, the Lambda worker pushes structured events (message.delta) into a dedicated Redis Stream: ai:run:{runId}.&lt;/p&gt;

&lt;p&gt;Meanwhile, the client connects to an SSE endpoint (/api/ai/runs/:runId/stream) served by Next.js. The SSE route reads from Redis Streams using XREAD and pipes events down to the client.&lt;/p&gt;

&lt;p&gt;Why Redis Streams Instead of Pub/Sub or WebSockets?&lt;br&gt;
Replayability &amp;amp; Resilient Reconnection: Redis Pub/Sub is fire-and-forget. If a user walks into an elevator and drops connection for 3 seconds, all missed tokens vanish. With Redis Streams, events are logged. When the client reconnects, it passes its Last-Event-ID, and the SSE handler resumes streaming exactly where it left off.&lt;br&gt;
Serverless Compatibility: Maintaining persistent, bidirectional WebSockets on serverless runtimes requires specialized gateway infrastructure (e.g., AWS API Gateway WebSockets). Redis Streams + SSE works over standard HTTP/2.&lt;br&gt;
Ephemeral Footprint: Each run’s stream has a short Time-to-Live (TTL). Once the run completes, the stream expires, keeping memory usage minimal.&lt;br&gt;
Why Scale-to-Zero?&lt;br&gt;
True Cost Elasticity: A startup or side project with sporadic traffic shouldn’t pay $150–$300/month for dedicated ECS/EKS clusters or container instances just to wait for user prompts. In this setup, idle compute cost is practically $0.&lt;br&gt;
Infinite Headroom for Spikes: If 500 users submit prompts simultaneously, SQS buffers the traffic cleanly. AWS Lambda scales out concurrently to process the jobs without bringing down the web tier.&lt;br&gt;
Protection Against Provider Outages: If an upstream LLM provider rate-limits or throttles requests, SQS handles exponential backoffs and dead-letter queueing (DLQ) without crashing the user’s browser session.&lt;br&gt;
Architectural Pitfalls &amp;amp; Trade-Offs&lt;br&gt;
While the zero-scale paradigm is cost-effective and resilient, it introduces non-trivial engineering trade-offs that every architect must evaluate.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The “Double Cold Start” Problem
When both your web tier (Next.js on Vercel) and your AI worker (NestJS on Lambda) scale to zero, an idle system encounters compounding cold starts:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Next.js Serverless Function: ~300ms–800ms&lt;br&gt;
SQS Delivery Latency: ~50ms–200ms&lt;br&gt;
NestJS AWS Lambda Boot: 1,200ms–2,500ms (loading TypeScript metadata, Prisma engine, LangChain modules)&lt;br&gt;
While the user receives an immediate UI response acknowledging their message, their Time-to-First-Token (TTFT) after an idle period can reach 3–4 seconds.&lt;/p&gt;

&lt;p&gt;Mitigation: Optimize the Lambda bundle using esbuild/tree-shaking, minimize global module imports in NestJS, and use Lambda SnapStart or lightweight container provisioning if sub-second first-token response is mandatory.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Database Connection Flooding
Serverless workers scale horizontally with zero shared memory. When 100 SQS messages arrive at once:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;100 Lambda containers spin up in parallel.&lt;br&gt;
Each container attempts to open a connection pool via Prisma to PostgreSQL.&lt;br&gt;
PostgreSQL default max connection limit (e.g., 100–200 connections) is instantly saturated, causing Connection pool timeout errors.&lt;br&gt;
Mitigation: You cannot connect directly to vanilla Postgres from serverless workers at scale. You must place a connection pooler like AWS RDS Proxy, PgBouncer, or use serverless-native drivers (Prisma Accelerate / Neon Serverless Driver) to multiplex connections.&lt;/p&gt;

&lt;p&gt;Because i use the manage postgres database instance so there are no need to required PgBouncer on the top, pooler is associated to the layer of the database so our lambda can reuse the connection not make or create a new connection on each invocation.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The Cost Inversion Point
Scale-to-zero is unbeatable at low to moderate traffic:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Monthly Active Workflows    Dedicated Server (Fargate / EKS)    Scale-to-Zero (Lambda + SQS + Redis)&lt;br&gt;
Low (0 – 10,000 runs) ~$80 – $200 / mo  ~$0 – $5 / mo&lt;br&gt;
Medium (100,000 runs)   ~$150 – $250 / mo ~$20 – $40 / mo&lt;br&gt;
Extreme Scale (10M+ runs)   ~$400 – $800 / mo ~$1,200 – $2,500+ / mo&lt;br&gt;
At millions of continuous requests per day, pay-per-invocation Lambda compute, SQS API calls, and Redis read/write operations surpass the predictable monthly cost of a well-tuned auto-scaling container cluster.&lt;/p&gt;

&lt;p&gt;The Verdict: When Should You Build This?&lt;br&gt;
The Decoupled Zero-Scale Architecture is the ideal blueprint if:&lt;/p&gt;

&lt;p&gt;✅ Your AI workloads involve multi-step reasoning, tool calls, or RAG that can exceed standard HTTP request timeouts.&lt;br&gt;
✅ Your application experiences variable or unpredictable traffic patterns, making dedicated 24/7 server clusters financially wasteful.&lt;br&gt;
✅ Resilience is paramount: client disconnections, mobile signal drops, or provider rate limits must never corrupt state or lose generated content.&lt;/p&gt;

&lt;p&gt;By strictly separating your fast web gateway from your heavy agent execution, and bridging them with a durable queue and an ephemeral stream, you get the best of both worlds: a lightning-fast user experience with zero idle infrastructure overhead.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://heyrewire.com" rel="noopener noreferrer"&gt;Visit HeyRewire platform&lt;/a&gt; &lt;/p&gt;

</description>
      <category>ai</category>
      <category>architecture</category>
      <category>cloud</category>
      <category>serverless</category>
    </item>
    <item>
      <title>Fluent UI 9 TextArea input field with useForm hook wher error happen it's loose my focus</title>
      <dc:creator>Aadarsh Singh</dc:creator>
      <pubDate>Sun, 17 Sep 2023 13:37:22 +0000</pubDate>
      <link>https://dev.to/onlyaadarsh/fluent-ui-9-textarea-input-field-with-useform-hook-wher-error-happen-its-loose-my-focus-2652</link>
      <guid>https://dev.to/onlyaadarsh/fluent-ui-9-textarea-input-field-with-useform-hook-wher-error-happen-its-loose-my-focus-2652</guid>
      <description>&lt;div class="ltag__stackexchange--container"&gt;
  &lt;div class="ltag__stackexchange--title-container"&gt;
    
      &lt;div class="ltag__stackexchange--title"&gt;
        &lt;div class="ltag__stackexchange--header"&gt;
          &lt;img src="https://assets.dev.to/assets/stackoverflow-logo-b42691ae545e4810b105ee957979a853a696085e67e43ee14c5699cf3e890fb4.svg" alt=""&gt;
          &lt;a href="https://stackoverflow.com/questions/77117993/fluent-ui-9-textarea-input-field-with-useform-hook-wher-error-happen-its-loose" rel="noopener noreferrer"&gt;
            Fluent UI 9 TextArea input field with useForm hook wher error happen it's loose my focus
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="ltag__stackexchange--post-metadata"&gt;
          &lt;span&gt;Sep 16 '23&lt;/span&gt;
            &lt;span&gt;Comments: 1&lt;/span&gt;
            &lt;span&gt;Answers: 0&lt;/span&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;a class="ltag__stackexchange--score-container" href="https://stackoverflow.com/questions/77117993/fluent-ui-9-textarea-input-field-with-useform-hook-wher-error-happen-its-loose" rel="noopener noreferrer"&gt;
        &lt;img src="https://assets.dev.to/assets/stackexchange-arrow-up-eff2e2849e67d156181d258e38802c0b57fa011f74164a7f97675ca3b6ab756b.svg" alt=""&gt;
        &lt;div class="ltag__stackexchange--score-number"&gt;
          1
        &lt;/div&gt;
        &lt;img src="https://assets.dev.to/assets/stackexchange-arrow-down-4349fac0dd932d284fab7e4dd9846f19a3710558efde0d2dfd05897f3eeb9aba.svg" alt=""&gt;
      &lt;/a&gt;
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--body"&gt;
    
&lt;p&gt;I loose the focus when error happen the in textArea Component, and when i menualy all the foucs using ref.focus method it's ignore the previous type value and it's my new charector start in 0th position,&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
import * as React from "react"
import {
  makeStyles,
  shorthands,
  useId,
  Input,
  Label,
  Field,&lt;/code&gt;&lt;/pre&gt;…
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--btn--container"&gt;
    &lt;a href="https://stackoverflow.com/questions/77117993/fluent-ui-9-textarea-input-field-with-useform-hook-wher-error-happen-its-loose" class="ltag__stackexchange--btn" rel="noopener noreferrer"&gt;Open Full Question&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;


</description>
    </item>
  </channel>
</rss>
