<?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 Eli Mutchnik on Medium]]></title>
        <description><![CDATA[Stories by Eli Mutchnik on Medium]]></description>
        <link>https://medium.com/@eli.mutchnik?source=rss-2eb060445af2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*jmlx368YPAjtwpg6.jpg</url>
            <title>Stories by Eli Mutchnik on Medium</title>
            <link>https://medium.com/@eli.mutchnik?source=rss-2eb060445af2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 06:21:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@eli.mutchnik/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[From Minutes to Seconds: Achieving “Live Reload” for AWS ECS]]></title>
            <link>https://medium.com/sola-security/from-minutes-to-seconds-live-reload-aws-ecs-961a4c3bb875?source=rss-2eb060445af2------2</link>
            <guid isPermaLink="false">https://medium.com/p/961a4c3bb875</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[devex]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[fargate]]></category>
            <dc:creator><![CDATA[Eli Mutchnik]]></dc:creator>
            <pubDate>Sat, 17 Jan 2026 23:24:45 GMT</pubDate>
            <atom:updated>2026-02-05T13:35:57.210Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rf9BCqnLEbQxnZXJQ_VcVw.png" /></figure><p>There is a specific kind of pain known only to developers working with containerized microservices.</p><p>We loved our architecture: Docker images running on ECS Fargate at a remote environment orchestrated by Terraform, cleanly separated services, and reproducible infrastructure. But we hated the <strong>waiting game</strong>.</p><p>Every time we changed a line of code, the tax was paid in minutes per service which sums to tens of minutes overall.</p><p><strong>For each service the deploy process was:</strong></p><p><strong>[Build]</strong> the new Docker image → [<strong>Push]</strong> to registry → [<strong>Deploy]</strong> new ECS task definition with the new image → [<strong>Wait]</strong> for the ECS task to provision → [<strong>Test]</strong> and make additional code changes.</p><p>It felt like a massive waste of developer’s time. We realized that if we wanted to keep our velocity, <strong>we had to hack that loop</strong>. We needed to go from minutes of deployment time to <strong>seconds of live updates.</strong></p><p>Here is how we did it.</p><h3>The Vision: Frontend-Style Live Reloading for ECS Fargate Containers</h3><p>If you have ever done frontend development, you know the joy of Hot Module Replacement (HMR). You save a file, and the browser updates instantly.</p><p>Our goal was to bring that same “Live Reload” experience to our heavy, containerized Python and Node.js backend services running on AWS ECS Fargate. We wanted to update the code inside the running container <strong>without</strong> triggering a new deployment and <strong>without</strong> replacing the ECS task.</p><h3>The Challenge: Getting code into a running container</h3><p>We needed a pipeline that looked like this:</p><ol><li><strong>Local Watcher:</strong> Detects file changes on the developer’s machine.</li><li><strong>Transport:</strong> Ship the code to the cloud instantly.</li><li><strong>Reflector:</strong> The container detects the change and restarts the server process.</li></ol><h3>Initial attempt: The Naive EFS Mount (And why it failed)</h3><p>Our first thought was simple: Let’s just use AWS EFS.</p><p>We tried mounting an EFS volume directly to the developer’s local machine and, simultaneously, to the ECS task. In theory, I save a file locally, and it appears in the cloud.</p><p><strong>The reality:</strong> It was painfully slow and unstable. Network latency made working on the mounted drive feel sluggish, and file locks became a nightmare. We realized that mounting cloud storage locally was a dead end.</p><h3>The Solution: The “Broker” Pattern</h3><p>We didn’t need a two-way sync. We needed a lightning-fast, one-way injection of code.</p><p>We architected a solution using an <strong>EC2 “Broker” instance</strong>. Here is the flow:</p><ol><li><strong>The Developer</strong> works on their local machine.</li><li><strong>The Local Watcher </strong>uses<strong> rsync </strong>and pushes <em>only the file deltas</em> to an EC2 broker instance.</li><li><strong>The EC2 Instance</strong> has the EFS drive mounted to it.</li><li><strong>The ECS Task</strong> has that <em>same</em> EFS drive access point mounted as a volume.</li></ol><p>By using rsync, we aren’t transferring the whole repo — just the bytes that changed. The EC2 acts as a high-speed bridge, writing directly to the EFS mount that the container is reading from. So eventually, after the developer hits save in its IDE, the changes appear <strong>in seconds</strong> in the target container.</p><h3>The Implementation Stack</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wqo91Tp9jJ3CuUAHRfdQUw.png" /></figure><p>To make this seamless for our developers, we glued it together with a few key tools:</p><h4>1. The Local Watcher</h4><p>Since we work in a monorepo managed by <a href="https://nx.dev/"><strong>nx</strong></a>, we utilized the <a href="https://nx.dev/docs/reference/nx-commands#nx-watch"><strong><em>nx watch</em></strong></a> command. It listens for file changes in specific projects and triggers our sync script.</p><p>To keep this tidy, we wrapped the watch command in <a href="https://pm2.keymetrics.io/"><strong>pm2</strong></a>. This gives developers a nice monitoring experience to see which services are currently “syncing” and provides logs if a sync fails.</p><h4>2. The Sync</h4><p>When <em>nx watch</em> fires, it executes a script that will calculate what exactly needs to be synced and does it via <a href="https://linux.die.net/man/1/rsync"><strong>rsync</strong></a> command. It pushes the files to a dedicated path on the EC2 broker that corresponds to the specific service and developer environment (e.g., /efs/user-dev/service-a).</p><h4>3. The Container Restart</h4><p>Once the file lands in the ECS container (via the EFS mount), the application needs to notice the change and restart.</p><p><strong>For Python:</strong> This was easy. We leveraged <a href="https://uvicorn.dev/"><strong>uvicorn</strong></a> which already supports live reloading. We simply updated our entry point:</p><pre>uvicorn main:app --reload --reload-dir /app/code</pre><p><strong>For Node.js (TypeScript):</strong> This was harder. The standard node <em>watch</em> flag relies on <em>inotify</em> events (signals sent by the OS when a file changes). However, because the file change was happening on the EFS mount (technically outside the container’s OS), <em>inotify</em> events often didn’t trigger reliably.</p><p>We solved this with <a href="https://github.com/watchexec/watchexec"><strong>watchexec</strong></a>. It is a fantastic, cross-platform tool that polls for file changes and handles the restart robustly, even across network mounts.</p><pre>watchexec --poll 1000 --debounce 1000 --restart --watch /app/code/index.js \ <br>-- node /app/code/index.js</pre><h3>The Result</h3><p>We provided via an internal CLI the ability to watch and sync every task in every service and the difference was night and day.</p><ul><li><strong>Before:</strong> Change code → Wait <strong>5 minutes</strong> for Terraform → Test.</li><li><strong>After:</strong> Change code → Wait <strong>5 seconds</strong> for rsync + Restart → Test.</li></ul><p>We didn’t just save time; we saved our focus. By removing the friction of deployment, we returned to the “flow state” that makes development enjoyable.</p><p>If you found yourself nodding along to the pain I described at the start, you might be wondering if building this architecture is worth the engineering effort.</p><p>I challenge you to perform a quick calculation right now. Run these numbers for your organization:</p><blockquote><strong><em>{</em></strong>Number of Developers<strong><em>}</em> <em>X</em> <em>{avg</em></strong> Changes Per Day<strong><em>}</em> <em>X</em> <em>{</em></strong>Build and Deploy Time<strong><em>}</em> = <em>The amount of time you are about to save.</em></strong></blockquote><p>The result isn’t just “saved minutes.” It is the amount of time your team currently spends staring at progress bars instead of building features. It is the cost of context switching and lost momentum. We realized we couldn’t afford <strong><em>not</em></strong> to fix it. If your number looks anything like ours did, <strong>neither can you</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=961a4c3bb875" width="1" height="1" alt=""><hr><p><a href="https://medium.com/sola-security/from-minutes-to-seconds-live-reload-aws-ecs-961a4c3bb875">From Minutes to Seconds: Achieving “Live Reload” for AWS ECS</a> was originally published in <a href="https://medium.com/sola-security">Sola Security</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>