<?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: Girish bari</title>
    <description>The latest articles on DEV Community by Girish bari (@gigbee).</description>
    <link>https://dev.to/gigbee</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%2F4083493%2F488276dc-7e6e-4e22-b17b-ba485a309772.png</url>
      <title>DEV Community: Girish bari</title>
      <link>https://dev.to/gigbee</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gigbee"/>
    <language>en</language>
    <item>
      <title>When DSA Solved Our AWS Scaling Problem</title>
      <dc:creator>Girish bari</dc:creator>
      <pubDate>Tue, 18 Aug 2026 15:33:26 +0000</pubDate>
      <link>https://dev.to/gigbee/when-dsa-solved-our-aws-scaling-problem-213n</link>
      <guid>https://dev.to/gigbee/when-dsa-solved-our-aws-scaling-problem-213n</guid>
      <description>&lt;h2&gt;
  
  
  When DSA Solved Our AWS Scaling Problem
&lt;/h2&gt;

&lt;p&gt;In the age of AI, it feels like DSA is slowly disappearing from day-to-day development.&lt;/p&gt;

&lt;p&gt;You can ask an AI to generate a queue, configure an AWS service, or write a retry mechanism in seconds.&lt;/p&gt;

&lt;p&gt;But there is one thing AI cannot remove from engineering:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Constraints.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;And when constraints appear, DSA suddenly becomes relevant again.&lt;/p&gt;

&lt;p&gt;At our startup, we often solve problems in a scalable way. But scalability doesn't always mean adding another AWS service. Sometimes, the solution is simply &lt;strong&gt;using the existing components differently&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;You usually don't recognize a DSA concept in a real-world system until someone asks:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"Why are we doing it this way?"&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That question led us to a surprisingly simple solution to an AWS scheduling problem.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem: We Were Running Out of Schedules
&lt;/h2&gt;

&lt;p&gt;Imagine we have a large number of jobs.&lt;/p&gt;

&lt;p&gt;Each job can fail and needs to be retried on subsequent days:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Parent Job
   │
   ├── Retry 1 → +1 day
   ├── Retry 2 → +2 days
   └── Retry 3 → +3 days
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Initially, this seems straightforward.&lt;/p&gt;

&lt;p&gt;We can simply create an EventBridge schedule for every retry.&lt;/p&gt;

&lt;p&gt;But then scale enters the picture.&lt;/p&gt;

&lt;p&gt;We encountered a situation where, for every &lt;strong&gt;6,000 jobs&lt;/strong&gt;, we needed to create &lt;strong&gt;3 separate EventBridge schedules&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That means:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;6,000 jobs
   ×
3 retry schedules
   =
18,000 schedules
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now imagine increasing the workload.&lt;/p&gt;

&lt;p&gt;What happens if we have &lt;strong&gt;10,000 jobs&lt;/strong&gt;?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;10,000 jobs
    ×
3 retries
    =
30,000 schedules
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And what if this keeps growing?&lt;/p&gt;

&lt;p&gt;We eventually run into EventBridge scheduling limits.&lt;/p&gt;

&lt;p&gt;The obvious solution might be:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Let's add another AWS component."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;But our senior asked a different question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"Can we solve this using a sliding window?"&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That was the interesting part.&lt;/p&gt;




&lt;h2&gt;
  
  
  First, What Is a Sliding Window?
&lt;/h2&gt;

&lt;p&gt;A sliding window is a technique where we don't process the entire dataset at once.&lt;/p&gt;

&lt;p&gt;Instead, we maintain a smaller &lt;strong&gt;active window&lt;/strong&gt; and continuously move it forward.&lt;/p&gt;

&lt;p&gt;For example, imagine these jobs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Day 1   Day 2   Day 3   Day 4   Day 5   Day 6   Day 7
 ├───────┼───────┼───────┼───────┼───────┼───────┼───────┤
         [──────────── Window ────────────]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As time moves forward:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Before:

Day 1   Day 2   Day 3   Day 4   Day 5   Day 6   Day 7
         [──────── Window ────────]


After:

Day 1   Day 2   Day 3   Day 4   Day 5   Day 6   Day 7
                 [──────── Window ────────]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The important idea is:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;We don't need to keep scheduling everything forever.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We only care about jobs relevant to the current time window.&lt;/p&gt;

&lt;p&gt;That observation changes how we think about the EventBridge problem.&lt;/p&gt;




&lt;h2&gt;
  
  
  What If We Don't Schedule Every Retry?
&lt;/h2&gt;

&lt;p&gt;This was the key idea.&lt;/p&gt;

&lt;p&gt;Instead of asking:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"When should this retry happen?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;and creating an EventBridge schedule for that future date...&lt;/p&gt;

&lt;p&gt;we ask:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"Which retries are supposed to happen today?"&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That small change removes the need to schedule every future retry individually.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Original Approach
&lt;/h2&gt;

&lt;p&gt;Let's say today is &lt;strong&gt;August 18&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;A parent job runs today.&lt;/p&gt;

&lt;p&gt;Its retries are:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;August 18
   │
   ├── Retry 1 → August 19
   ├── Retry 2 → August 20
   └── Retry 3 → August 21
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The traditional approach is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;              EventBridge
                  │
       ┌──────────┼──────────┐
       ▼          ▼          ▼
    Aug 19     Aug 20     Aug 21
    Retry 1    Retry 2    Retry 3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For every parent job, we create future schedules.&lt;/p&gt;

&lt;p&gt;This is where the number of schedules grows rapidly.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Sliding Window Approach
&lt;/h2&gt;

&lt;p&gt;Now let's change the perspective.&lt;/p&gt;

&lt;p&gt;Instead of scheduling:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Retry 1 → tomorrow
Retry 2 → day after tomorrow
Retry 3 → three days later
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;we maintain a &lt;strong&gt;daily execution window&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Every day, we ask:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"Which existing parent jobs have a retry due today?"&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Then we execute those retries.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                    TODAY
                      │
                      ▼
             ┌─────────────────┐
             │   Sliding       │
             │    Window       │
             └────────┬────────┘
                      │
        ┌─────────────┼─────────────┐
        ▼             ▼             ▼
     Retry 1       Retry 2       Retry 3
      due today     due today     due today
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;EventBridge no longer needs to know about every individual retry.&lt;/p&gt;

&lt;p&gt;It only needs to trigger the &lt;strong&gt;parent job&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  But What About Jobs From Previous Days?
&lt;/h2&gt;

&lt;p&gt;This is where the idea becomes interesting.&lt;/p&gt;

&lt;p&gt;Suppose a parent job ran &lt;strong&gt;3 days ago&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Let's say:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Parent Job
August 15
   │
   ├── Retry 1 → August 16
   ├── Retry 2 → August 17
   └── Retry 3 → August 18
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Today is August 18.&lt;/p&gt;

&lt;p&gt;The third retry is due &lt;strong&gt;today&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Under the traditional approach, we would have created a schedule on August 15 for the retry that should execute on August 18.&lt;/p&gt;

&lt;p&gt;But we don't need to do that anymore.&lt;/p&gt;

&lt;p&gt;Instead, today's sliding window discovers it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;August 15        August 16        August 17        August 18
Parent Job       Retry 1          Retry 2          Retry 3
    │                │                │                │
    └────────────────┴────────────────┴────────────────┘
                                                     ▲
                                                     │
                                                   TODAY
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The system simply asks:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"What retries are due on August 18?"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And finds:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Parent Job: August 15
Retry:      3
Due:        August 18
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then it executes it.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Trick
&lt;/h2&gt;

&lt;p&gt;This is the entire trick:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Don't schedule the future retries.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Instead Conceptually:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                 ┌─────────────────────┐
                 │   Daily Trigger     │
                 └──────────┬──────────┘
                            │
                            ▼
                 ┌─────────────────────┐
                 │  Current Time      │
                 │     Window         │
                 └──────────┬──────────┘
                            │
                            ▼
              ┌──────────────────────────┐
              │ Find retries due today   │
              └────────────┬─────────────┘
                           │
                 ┌─────────┴─────────┐
                 ▼                   ▼
            Retry due             Not due
                 │                   │
                 ▼                   ▼
              Execute              Ignore

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Why This Scales Better
&lt;/h2&gt;

&lt;p&gt;The important difference is &lt;strong&gt;what we are scheduling&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Number of schedules grows&lt;br&gt;
with the number of jobs&lt;/p&gt;

&lt;p&gt;Now the number of EventBridge schedules is no longer directly proportional to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Number of Jobs × Number of Retries
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Instead, EventBridge becomes the mechanism that wakes up the &lt;strong&gt;scheduler/processor&lt;/strong&gt;, while the application determines which work actually needs to happen.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Bigger Lesson
&lt;/h2&gt;

&lt;p&gt;The interesting part of this problem wasn't really EventBridge.&lt;/p&gt;

&lt;p&gt;It was recognizing that we were using EventBridge to solve a problem that didn't necessarily belong there.&lt;/p&gt;

&lt;p&gt;We initially thought:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"We need to schedule millions of future events."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The better question was:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"Do we actually need to schedule millions of future events?"&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And the answer was no.&lt;/p&gt;

&lt;p&gt;We only needed to know:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"What needs to happen today?"&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That is where a simple DSA concept like &lt;strong&gt;sliding window&lt;/strong&gt; becomes a practical system-design technique.&lt;/p&gt;




&lt;h2&gt;
  
  
  DSA Is Not Dead
&lt;/h2&gt;

&lt;p&gt;This is why I don't think DSA is disappearing from software engineering.&lt;br&gt;
Sometimes the answer is a sophisticated distributed system.&lt;/p&gt;

&lt;p&gt;And sometimes...&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;it's a sliding window.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The important skill isn't memorizing DSA patterns.&lt;/p&gt;

</description>
      <category>dsa</category>
      <category>development</category>
      <category>webdev</category>
      <category>career</category>
    </item>
  </channel>
</rss>
