<?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: Sreekar Reddy</title>
    <description>The latest articles on DEV Community by Sreekar Reddy (@esreekarreddy).</description>
    <link>https://dev.to/esreekarreddy</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%2F3678910%2Fd7c2554f-5af3-4a55-ae45-d8f7b63e44f0.jpg</url>
      <title>DEV Community: Sreekar Reddy</title>
      <link>https://dev.to/esreekarreddy</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/esreekarreddy"/>
    <language>en</language>
    <item>
      <title>🧶 Dependency Hell Explained Like You're 5</title>
      <dc:creator>Sreekar Reddy</dc:creator>
      <pubDate>Thu, 03 Sep 2026 23:52:03 +0000</pubDate>
      <link>https://dev.to/esreekarreddy/dependency-hell-explained-like-youre-5-2kc0</link>
      <guid>https://dev.to/esreekarreddy/dependency-hell-explained-like-youre-5-2kc0</guid>
      <description>&lt;p&gt;&lt;em&gt;When your packages disagree about versions&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Day 155 of 155&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://sreekarreddy.com/learn/eli5/dependency-hell" rel="noopener noreferrer"&gt;Full deep-dive with code examples&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The Recipe Chain Analogy
&lt;/h2&gt;

&lt;p&gt;You install one package. It quietly brings its own shopping list, and every item on that list brings another.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;you            -&amp;gt; chart-library ^2.0.0
you            -&amp;gt; form-library  ^3.0.0
chart-library  -&amp;gt; color-utils   ^1.0.0
form-library   -&amp;gt; color-utils   ^2.0.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two of your packages want &lt;code&gt;color-utils&lt;/code&gt;. They disagree about which one.&lt;/p&gt;

&lt;p&gt;That is dependency hell.&lt;/p&gt;




&lt;h2&gt;
  
  
  Direct vs Transitive
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Direct:&lt;/strong&gt; what you typed into &lt;code&gt;package.json&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Transitive:&lt;/strong&gt; what your dependencies dragged in behind them&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A short direct list usually expands into a much bigger installed tree.&lt;/p&gt;

&lt;p&gt;A few dozen direct packages routinely resolve into many hundreds of entries in the lockfile.&lt;/p&gt;

&lt;p&gt;Most of the code you ship was chosen by somebody else.&lt;/p&gt;




&lt;h2&gt;
  
  
  Ranges Are a Promise
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;^1.4.0&lt;/code&gt; means "any 1.x from 1.4.0 upward". You are trusting each maintainer to judge correctly what counts as a breaking change.&lt;/p&gt;

&lt;p&gt;Usually that works.&lt;/p&gt;

&lt;p&gt;Sometimes a small release changes a default, and an install that resolves fresh today picks up a version that breaks you with nothing changed on your side.&lt;/p&gt;

&lt;p&gt;A committed lockfile is exactly what stops that.&lt;/p&gt;




&lt;h2&gt;
  
  
  Lockfiles Freeze One Answer
&lt;/h2&gt;

&lt;p&gt;A range describes a set of acceptable versions. A lockfile records which one you actually got, for every package in the tree.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt;   &lt;span class="c"&gt;# reconciles package.json with the lockfile&lt;/span&gt;
npm ci        &lt;span class="c"&gt;# installs exactly what the lockfile says&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Continuous integration should install with &lt;code&gt;npm ci&lt;/code&gt;, so every build starts from the tree the lockfile describes.&lt;/p&gt;




&lt;h2&gt;
  
  
  In One Sentence
&lt;/h2&gt;

&lt;p&gt;Dependency hell is what happens when packages you did not pick disagree about versions of packages you have not heard of.&lt;/p&gt;




&lt;p&gt;🔗 &lt;strong&gt;Enjoying these? Follow for daily ELI5 explanations!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Making complex tech concepts simple, one day at a time.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>eli5</category>
      <category>devops</category>
      <category>codequality</category>
      <category>programming</category>
    </item>
    <item>
      <title>♻️ Build Caching Explained Like You're 5</title>
      <dc:creator>Sreekar Reddy</dc:creator>
      <pubDate>Wed, 02 Sep 2026 23:54:09 +0000</pubDate>
      <link>https://dev.to/esreekarreddy/build-caching-explained-like-youre-5-2pe</link>
      <guid>https://dev.to/esreekarreddy/build-caching-explained-like-youre-5-2pe</guid>
      <description>&lt;p&gt;&lt;em&gt;Skip the work you already did&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Day 154 of 155&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://sreekarreddy.com/learn/eli5/build-caching" rel="noopener noreferrer"&gt;Full deep-dive with code examples&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The Freezer Batch Analogy
&lt;/h2&gt;

&lt;p&gt;You cook the same stock every Sunday. It takes hours.&lt;/p&gt;

&lt;p&gt;So you freeze a batch and write the recipe on the label: ingredients, quantities, cooking time.&lt;/p&gt;

&lt;p&gt;Next Sunday, check the label:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Label matches tonight's recipe → reheat it 🎉&lt;/li&gt;
&lt;li&gt;Recipe changed → cook fresh, freeze it under a new label&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The label is the &lt;strong&gt;cache key&lt;/strong&gt;. The frozen batch is the cached output.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Builds Are Slow Without It
&lt;/h2&gt;

&lt;p&gt;A fresh CI runner starts with an empty disk:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;checkout → quick
install  → download every dependency again
build    → recompile every file again
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your dependencies did not change since yesterday. Most of your source files did not either.&lt;/p&gt;

&lt;p&gt;The runner has no memory, so it repeats all of it 😫&lt;/p&gt;




&lt;h2&gt;
  
  
  The Cache Key
&lt;/h2&gt;

&lt;p&gt;Hash the inputs, then look up the result.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;key = hash(lockfile + toolchain version + OS + flags)

hit  → restore the output, skip the step
miss → do the work, save it under the new key
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The rule: the key should cover every input that can change the output.&lt;/p&gt;




&lt;h2&gt;
  
  
  A Real Workflow
&lt;/h2&gt;

&lt;p&gt;A typical Node CI workflow sets up every job the same way:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/setup-node@v7&lt;/span&gt;
  &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;node-version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;22'&lt;/span&gt;
    &lt;span class="na"&gt;cache&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;npm'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That restores npm's download cache, keyed on a hash of &lt;code&gt;package-lock.json&lt;/code&gt;. The job still runs &lt;code&gt;npm ci&lt;/code&gt;, but packages come off local disk instead of the network.&lt;/p&gt;

&lt;p&gt;Change the lockfile and the key changes, so the next run installs fresh.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Catch
&lt;/h2&gt;

&lt;p&gt;A key that leaves out a real input hands you a stale result that looks correct. A slow pipeline is annoying; a wrong one costs you an afternoon.&lt;/p&gt;




&lt;h2&gt;
  
  
  In One Sentence
&lt;/h2&gt;

&lt;p&gt;Build caching hashes the inputs of a step so a later run with matching inputs restores the stored output instead of redoing the work.&lt;/p&gt;




&lt;p&gt;🔗 &lt;strong&gt;Enjoying these? Follow for daily ELI5 explanations!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Making complex tech concepts simple, one day at a time.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>eli5</category>
      <category>devops</category>
      <category>performance</category>
      <category>programming</category>
    </item>
    <item>
      <title>🧵 Thread Safety Explained Like You're 5</title>
      <dc:creator>Sreekar Reddy</dc:creator>
      <pubDate>Tue, 01 Sep 2026 23:51:26 +0000</pubDate>
      <link>https://dev.to/esreekarreddy/thread-safety-explained-like-youre-5-2mgi</link>
      <guid>https://dev.to/esreekarreddy/thread-safety-explained-like-youre-5-2mgi</guid>
      <description>&lt;p&gt;&lt;em&gt;Code that survives being run at once&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Day 153 of 155&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://sreekarreddy.com/learn/eli5/thread-safety" rel="noopener noreferrer"&gt;Full deep-dive with code examples&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The Shared Whiteboard Analogy
&lt;/h2&gt;

&lt;p&gt;Two people keep a tally on one whiteboard. Each does three things: read the number, add one, write it back.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Alice reads 5
Bob   reads 5      &amp;lt;- Alice has not written yet
Alice writes 6
Bob   writes 6     &amp;lt;- the tally should say 7
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;An increment vanished. Nobody was careless. The steps just interleaved.&lt;/p&gt;




&lt;h2&gt;
  
  
  One Line, Three Steps
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;counter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;counter&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One move? No, three: read &lt;code&gt;counter&lt;/code&gt;, add 1, write it back.&lt;/p&gt;

&lt;p&gt;A thread can be paused between any two, and that gap is where a &lt;strong&gt;race condition&lt;/strong&gt; lives.&lt;/p&gt;

&lt;p&gt;Here it costs you an increment, which is why this shape is called a lost update.&lt;/p&gt;

&lt;p&gt;Races need two ingredients at once: state that is &lt;strong&gt;shared&lt;/strong&gt; (several threads reach it) and &lt;strong&gt;mutable&lt;/strong&gt; (someone writes it).&lt;/p&gt;

&lt;p&gt;Remove either and the race usually goes away.&lt;/p&gt;




&lt;h2&gt;
  
  
  Ways Out, Cheapest First
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Approach&lt;/th&gt;
&lt;th&gt;Idea&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Immutability&lt;/td&gt;
&lt;td&gt;Produce new values, don't mutate&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Confinement&lt;/td&gt;
&lt;td&gt;Give each thread its own copy&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Atomics&lt;/td&gt;
&lt;td&gt;Read-modify-write in one go&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Locks&lt;/td&gt;
&lt;td&gt;Admit one thread at a time&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A lock marks a &lt;strong&gt;critical section&lt;/strong&gt;: the stretch where the invariant is temporarily false and nobody else should look.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;lock&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;counter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;counter&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  A Lock Is Not a Proof
&lt;/h2&gt;

&lt;p&gt;The lock has to cover the whole invariant, not each line.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;lock&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;missing&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;cache&lt;/span&gt;   &lt;span class="c1"&gt;# check
&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;missing&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;build&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;           &lt;span class="c1"&gt;# expensive, so keep it out of the lock
&lt;/span&gt;    &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;lock&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;cache&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt;       &lt;span class="c1"&gt;# act
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every touch of &lt;code&gt;cache&lt;/code&gt; is locked, and the bug survives: two threads can both see &lt;code&gt;missing&lt;/code&gt; and both build.&lt;/p&gt;

&lt;p&gt;A decision made under one lock is stale the moment that lock is released.&lt;/p&gt;




&lt;h2&gt;
  
  
  In One Sentence
&lt;/h2&gt;

&lt;p&gt;Thread-safe code keeps its invariants true no matter how the scheduler interleaves the threads running it.&lt;/p&gt;




&lt;p&gt;🔗 &lt;strong&gt;Enjoying these? Follow for daily ELI5 explanations!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Making complex tech concepts simple, one day at a time.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>eli5</category>
      <category>programming</category>
      <category>concurrency</category>
    </item>
    <item>
      <title>🗝️ Distributed Locks Explained Like You're 5</title>
      <dc:creator>Sreekar Reddy</dc:creator>
      <pubDate>Tue, 01 Sep 2026 01:02:25 +0000</pubDate>
      <link>https://dev.to/esreekarreddy/distributed-locks-explained-like-youre-5-1a7b</link>
      <guid>https://dev.to/esreekarreddy/distributed-locks-explained-like-youre-5-1a7b</guid>
      <description>&lt;p&gt;&lt;em&gt;One worker at a time across many machines&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Day 152 of 155&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://sreekarreddy.com/learn/eli5/distributed-locks" rel="noopener noreferrer"&gt;Full deep-dive with code examples&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The Coffee Shop Key
&lt;/h2&gt;

&lt;p&gt;One restroom, one key, tied to a wooden spoon so nobody pockets it. Whoever holds the spoon has the room; everyone else waits.&lt;/p&gt;

&lt;p&gt;Now the awkward part: someone walks out still holding it, and the restroom stays shut all afternoon.&lt;/p&gt;

&lt;p&gt;Distributed locks solve that with an expiry date.&lt;/p&gt;




&lt;h2&gt;
  
  
  Three Copies, One Job
&lt;/h2&gt;

&lt;p&gt;Your nightly billing job runs on three instances for availability. At midnight all three wake up and start billing the same customers.&lt;/p&gt;

&lt;p&gt;A language-level mutex will not help. Each process has its own memory. The lock has to live somewhere all three can see.&lt;/p&gt;




&lt;h2&gt;
  
  
  Taking the Key
&lt;/h2&gt;

&lt;p&gt;One atomic operation that checks and claims together:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SET lock:billing worker-7 NX PX 45000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;NX&lt;/code&gt; means "only if the key is absent" - the race is settled in one step.&lt;/li&gt;
&lt;li&gt;The value &lt;code&gt;worker-7&lt;/code&gt; is your &lt;strong&gt;owner identity&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;PX&lt;/code&gt; sets a &lt;strong&gt;lease&lt;/strong&gt;, so a crashed holder does not block the job forever.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Release by comparing first, usually in a small Lua script so check and delete are one operation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;redis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;call&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"GET"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;KEYS&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;ARGV&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;redis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;call&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"DEL"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;KEYS&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A plain &lt;code&gt;DEL&lt;/code&gt; would wipe out someone else's lock once your lease had expired.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Honest Limit
&lt;/h2&gt;

&lt;p&gt;Your process can freeze - garbage collection, a network hiccup - after the lease expires and before your write lands.&lt;/p&gt;

&lt;p&gt;The lock service took no part in that pause, so it cannot rescue you.&lt;/p&gt;

&lt;p&gt;That is why careful systems add a &lt;strong&gt;fencing token&lt;/strong&gt;: a number that increases on each acquisition, checked by the storage layer so a late writer is turned away.&lt;/p&gt;

&lt;p&gt;Idempotence is a separate defence, not a stronger one. It stops a &lt;em&gt;repeated&lt;/em&gt; operation from doing damage.&lt;/p&gt;

&lt;p&gt;It does nothing about a &lt;em&gt;stale&lt;/em&gt; one: if your delayed write sets &lt;code&gt;qty = 6&lt;/code&gt; while newer work already set &lt;code&gt;qty = 4&lt;/code&gt;, replaying it safely still leaves the row wrong.&lt;/p&gt;




&lt;h2&gt;
  
  
  In One Sentence
&lt;/h2&gt;

&lt;p&gt;A distributed lock is a shared, expiring claim that lets one worker act at a time, and it is only as safe as the resource behind it.&lt;/p&gt;




&lt;p&gt;🔗 &lt;strong&gt;Enjoying these? Follow for daily ELI5 explanations!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Making complex tech concepts simple, one day at a time.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>eli5</category>
      <category>architecture</category>
      <category>concurrency</category>
      <category>distributed</category>
    </item>
    <item>
      <title>🔒 Pessimistic Locking Explained Like You're 5</title>
      <dc:creator>Sreekar Reddy</dc:creator>
      <pubDate>Mon, 31 Aug 2026 00:15:26 +0000</pubDate>
      <link>https://dev.to/esreekarreddy/pessimistic-locking-explained-like-youre-5-5eag</link>
      <guid>https://dev.to/esreekarreddy/pessimistic-locking-explained-like-youre-5-5eag</guid>
      <description>&lt;p&gt;&lt;em&gt;Lock the row before you touch it&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Day 151 of 155&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://sreekarreddy.com/learn/eli5/pessimistic-locking" rel="noopener noreferrer"&gt;Full deep-dive with code examples&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The Fitting Room Analogy
&lt;/h2&gt;

&lt;p&gt;A shop has one fitting room.&lt;/p&gt;

&lt;p&gt;You take the garment in and the attendant hangs the "occupied" sign, so the next customer waits at the door rather than walking in on you.&lt;/p&gt;

&lt;p&gt;Nobody has to sort out an awkward collision afterwards, because the collision was ruled out up front.&lt;/p&gt;

&lt;p&gt;The cost is the queue: while you are deciding, everyone else stands still.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;That is pessimistic locking.&lt;/strong&gt; You claim the row before you touch it, and you pay for that certainty in waiting.&lt;/p&gt;




&lt;h2&gt;
  
  
  Lock At Read Time, Not Write Time
&lt;/h2&gt;

&lt;p&gt;Two transactions want the same row. Two ways to keep them honest:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Optimistic:&lt;/strong&gt; let both read, then catch the clash when the second writes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pessimistic:&lt;/strong&gt; lock the row as you read it, so the second reader waits.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It assumes a collision is likely, so it prevents the fight instead of refereeing it afterwards.&lt;/p&gt;




&lt;h2&gt;
  
  
  SELECT ... FOR UPDATE
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;BEGIN&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;stock&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;products&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;42&lt;/span&gt;
&lt;span class="k"&gt;FOR&lt;/span&gt; &lt;span class="k"&gt;UPDATE&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;          &lt;span class="c1"&gt;-- row locked from here&lt;/span&gt;

&lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;products&lt;/span&gt; &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;stock&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;stock&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;42&lt;/span&gt; &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;stock&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;-- guard, or you sell stock you do not have&lt;/span&gt;

&lt;span class="k"&gt;COMMIT&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;              &lt;span class="c1"&gt;-- lock released&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At the common read-committed level, another transaction running that same query blocks until the &lt;code&gt;COMMIT&lt;/code&gt;, then reads the decremented stock rather than the stale value.&lt;/p&gt;

&lt;p&gt;The lock lives and dies with the transaction: commit or roll back, and it is gone.&lt;/p&gt;




&lt;h2&gt;
  
  
  What It Costs You
&lt;/h2&gt;

&lt;p&gt;Waiting. And deadlocks: A holds row 1 and wants row 2 while B holds row 2 and wants row 1.&lt;/p&gt;

&lt;p&gt;Databases usually detect that and abort one, so your code retries.&lt;/p&gt;

&lt;p&gt;Keep them short. A lock held while a user decides, or while a slow API answers, turns that row into a queue for everybody.&lt;/p&gt;




&lt;h2&gt;
  
  
  In One Sentence
&lt;/h2&gt;

&lt;p&gt;Pessimistic locking takes a lock on the row as you read it, so other transactions wait their turn instead of racing you to the write.&lt;/p&gt;




&lt;p&gt;🔗 &lt;strong&gt;Enjoying these? Follow for daily ELI5 explanations!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Making complex tech concepts simple, one day at a time.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>eli5</category>
      <category>database</category>
      <category>concurrency</category>
      <category>programming</category>
    </item>
    <item>
      <title>🤞 Optimistic Locking Explained Like You're 5</title>
      <dc:creator>Sreekar Reddy</dc:creator>
      <pubDate>Sat, 29 Aug 2026 23:56:13 +0000</pubDate>
      <link>https://dev.to/esreekarreddy/optimistic-locking-explained-like-youre-5-a3d</link>
      <guid>https://dev.to/esreekarreddy/optimistic-locking-explained-like-youre-5-a3d</guid>
      <description>&lt;p&gt;&lt;em&gt;Assume no conflict, check before saving&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Day 150 of 155&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://sreekarreddy.com/learn/eli5/optimistic-locking" rel="noopener noreferrer"&gt;Full deep-dive with code examples&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Two Waiters, One Ticket
&lt;/h2&gt;

&lt;p&gt;Two waiters grab the same order ticket off the rail.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Waiter A writes "no onions"&lt;/li&gt;
&lt;li&gt;Waiter B writes "extra cheese"&lt;/li&gt;
&lt;li&gt;Waiter B pins his copy back last&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Waiter A's note is gone, and nobody noticed 😱&lt;/p&gt;

&lt;p&gt;That is the &lt;strong&gt;lost update&lt;/strong&gt; problem.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Same Thing in a Database
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Alice reads row 42: note="", version=7
Bob   reads row 42: note="", version=7

Alice saves note="no onions"    -&amp;gt; row says "no onions"
Bob   saves note="extra cheese" -&amp;gt; row says "extra cheese"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Alice's edit vanished. The database did nothing wrong: it applied both writes in arrival order.&lt;/p&gt;




&lt;h2&gt;
  
  
  Attach a Version Marker
&lt;/h2&gt;

&lt;p&gt;Optimistic locking assumes collisions are rare, so it locks nothing up front and checks at save time instead.&lt;/p&gt;

&lt;p&gt;Keep a &lt;code&gt;version&lt;/code&gt; column on the row, and send back the version you read:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt;
&lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;note&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'extra cheese'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;version&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;version&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;42&lt;/span&gt; &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="k"&gt;version&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If Alice saved first, the row is on version 8, the &lt;code&gt;WHERE&lt;/code&gt; matches nothing, and &lt;strong&gt;zero rows are affected&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That zero tells Bob he lost the race.&lt;/p&gt;

&lt;p&gt;On stricter isolation levels some engines raise a serialization error instead, so production code handles both.&lt;/p&gt;

&lt;p&gt;The check and the write are one statement, so nothing can slip in between them.&lt;/p&gt;




&lt;h2&gt;
  
  
  What You Do On Conflict
&lt;/h2&gt;

&lt;p&gt;Zero rows is information, not a crash. Pick a response:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Retry:&lt;/strong&gt; refetch, reapply your change, save again&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Merge:&lt;/strong&gt; combine edits that touch different fields&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ask:&lt;/strong&gt; tell the user "this record changed while you were editing"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Web APIs use the same trick with the HTTP &lt;code&gt;ETag&lt;/code&gt; and &lt;code&gt;If-Match&lt;/code&gt; headers.&lt;/p&gt;




&lt;h2&gt;
  
  
  In One Sentence
&lt;/h2&gt;

&lt;p&gt;Optimistic locking lets everyone edit freely, then rejects any save whose version marker no longer matches the row.&lt;/p&gt;




&lt;p&gt;🔗 &lt;strong&gt;Enjoying these? Follow for daily ELI5 explanations!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Making complex tech concepts simple, one day at a time.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>eli5</category>
      <category>database</category>
      <category>concurrency</category>
      <category>programming</category>
    </item>
    <item>
      <title>🔒 SSL/TLS Explained Like You're 5</title>
      <dc:creator>Sreekar Reddy</dc:creator>
      <pubDate>Sat, 23 May 2026 22:55:02 +0000</pubDate>
      <link>https://dev.to/esreekarreddy/ssltls-explained-like-youre-5-5ghe</link>
      <guid>https://dev.to/esreekarreddy/ssltls-explained-like-youre-5-5ghe</guid>
      <description>&lt;p&gt;&lt;em&gt;Encrypting data between you and websites&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Day 149 of 149&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://sreekarreddy.com/learn/eli5/ssl-tls" rel="noopener noreferrer"&gt;Full deep-dive with code examples&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The Sealed Envelope Analogy
&lt;/h2&gt;

&lt;p&gt;Sending a postcard:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Everyone can read it (mail carriers, neighbors)&lt;/li&gt;
&lt;li&gt;No privacy!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sending a sealed, locked box:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Only the recipient has the key&lt;/li&gt;
&lt;li&gt;Contents are private&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;SSL/TLS is the sealed box for your internet data!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It encrypts the data sent over the connection between your browser (client) and a website (server), protecting it while it travels across the network.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why It Matters
&lt;/h2&gt;

&lt;p&gt;Without SSL/TLS:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Passwords can be sent in plain text&lt;/li&gt;
&lt;li&gt;Credit card numbers can be exposed&lt;/li&gt;
&lt;li&gt;Someone who can observe the network may be able to read or change what you send&lt;/li&gt;
&lt;li&gt;On public WiFi, attackers can potentially intercept traffic&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With SSL/TLS:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data sent over the connection is encrypted (and integrity-protected)&lt;/li&gt;
&lt;li&gt;It helps prevent eavesdropping and tampering while data is in transit&lt;/li&gt;
&lt;li&gt;Reduces risk on public WiFi (but it doesn’t stop a compromised device or server)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  How You Know It's Working
&lt;/h2&gt;

&lt;p&gt;Look for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;https://&lt;/strong&gt; (not http://)&lt;/li&gt;
&lt;li&gt;Your browser indicating an encrypted connection&lt;/li&gt;
&lt;li&gt;Certificate details in the site info/security UI&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Note: a lock icon means the connection is encrypted and the certificate checks out — it doesn’t automatically mean the site itself is trustworthy.&lt;/p&gt;




&lt;h2&gt;
  
  
  How It Works (Simplified)
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Handshake:&lt;/strong&gt; Browser and server agree on encryption method&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Certificates:&lt;/strong&gt; Server proves its identity&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Key exchange:&lt;/strong&gt; They create a shared secret key&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Encrypted connection:&lt;/strong&gt; All data encrypted with that key&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Think of it like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Meeting someone, showing ID, agreeing on a secret code, then speaking in code!&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  SSL vs TLS
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;SSL:&lt;/strong&gt; Old protocol family (legacy; SSL 2.0/3.0 are no longer recommended)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TLS:&lt;/strong&gt; Modern protocol family (what we actually use today)&lt;/li&gt;
&lt;li&gt;People still say "SSL" but mean TLS&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;TLS 1.3 is the newest widely deployed version, and TLS 1.2 is still commonly used.&lt;/p&gt;




&lt;h2&gt;
  
  
  In One Sentence
&lt;/h2&gt;

&lt;p&gt;SSL/TLS encrypts data between your browser and websites, turning readable information into scrambled text that only you and the website can understand.&lt;/p&gt;




&lt;p&gt;🔗 &lt;strong&gt;Enjoying these? Follow for daily ELI5 explanations!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Making complex tech concepts simple, one day at a time.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>eli5</category>
      <category>security</category>
      <category>encryption</category>
      <category>programming</category>
    </item>
    <item>
      <title>⚡ Redis Explained Like You're 5</title>
      <dc:creator>Sreekar Reddy</dc:creator>
      <pubDate>Fri, 22 May 2026 23:01:49 +0000</pubDate>
      <link>https://dev.to/esreekarreddy/redis-explained-like-youre-5-4dgb</link>
      <guid>https://dev.to/esreekarreddy/redis-explained-like-youre-5-4dgb</guid>
      <description>&lt;p&gt;&lt;em&gt;Super fast in-memory data store&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Day 148 of 149&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://sreekarreddy.com/learn/eli5/redis" rel="noopener noreferrer"&gt;Full deep-dive with code examples&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The Sticky Note Analogy
&lt;/h2&gt;

&lt;p&gt;Your desk has a drawer full of files (database) and sticky notes on your monitor (Redis):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Drawer:&lt;/strong&gt; Organized, permanent, but slow to find things&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sticky notes:&lt;/strong&gt; Right in front of you, instant access!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Redis is like sticky notes for your applications!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Super fast because data lives in memory, not on disk.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Redis Is Fast
&lt;/h2&gt;

&lt;p&gt;Traditional databases:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Store data on disk (SSD/HDD)&lt;/li&gt;
&lt;li&gt;Disk access is slow (milliseconds)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Redis:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Stores data in RAM (memory)&lt;/li&gt;
&lt;li&gt;RAM access is fast (microseconds)&lt;/li&gt;
&lt;li&gt;100x faster than disk!&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  What Redis Stores
&lt;/h2&gt;

&lt;p&gt;Not just simple values:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Strings:&lt;/strong&gt; Simple key-value pairs&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lists:&lt;/strong&gt; Ordered collections&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sets:&lt;/strong&gt; Unique items&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hashes:&lt;/strong&gt; Objects with multiple fields&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sorted sets:&lt;/strong&gt; Ranked data (leaderboards!)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Common Uses
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Caching:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Store frequently accessed data&lt;/li&gt;
&lt;li&gt;Avoid hitting slow database&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Sessions:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;User login sessions&lt;/li&gt;
&lt;li&gt;Shopping carts&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Real-time features:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Chat messages&lt;/li&gt;
&lt;li&gt;Live notifications&lt;/li&gt;
&lt;li&gt;Leaderboards&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Rate limiting:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Track request counts&lt;/li&gt;
&lt;li&gt;Block abusive users&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  The Trade-Off
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Fast:&lt;/strong&gt; In-memory is blazingly fast&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Volatile:&lt;/strong&gt; RAM can lose data on restart (though Redis can persist)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Limited size:&lt;/strong&gt; RAM is more expensive than disk&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  In One Sentence
&lt;/h2&gt;

&lt;p&gt;Redis is a super-fast in-memory data store used for caching, sessions, and real-time features where speed matters most.&lt;/p&gt;




&lt;p&gt;🔗 &lt;strong&gt;Enjoying these? Follow for daily ELI5 explanations!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Making complex tech concepts simple, one day at a time.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>eli5</category>
      <category>database</category>
      <category>caching</category>
      <category>programming</category>
    </item>
    <item>
      <title>🚦 Rate Limiting Explained Like You're 5</title>
      <dc:creator>Sreekar Reddy</dc:creator>
      <pubDate>Thu, 21 May 2026 23:04:31 +0000</pubDate>
      <link>https://dev.to/esreekarreddy/rate-limiting-explained-like-youre-5-loe</link>
      <guid>https://dev.to/esreekarreddy/rate-limiting-explained-like-youre-5-loe</guid>
      <description>&lt;p&gt;&lt;em&gt;Controlling how fast requests can be made&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Day 147 of 149&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://sreekarreddy.com/learn/eli5/rate-limiting" rel="noopener noreferrer"&gt;Full deep-dive with code examples&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The Highway On-Ramp Analogy
&lt;/h2&gt;

&lt;p&gt;Highway on-ramps have traffic lights:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Let one car through every few seconds&lt;/li&gt;
&lt;li&gt;Prevents too many cars entering at once&lt;/li&gt;
&lt;li&gt;Keeps highway traffic flowing smoothly&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Rate Limiting is the traffic light for your API!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It controls how many requests can be made in a time period.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Rate Limit?
&lt;/h2&gt;

&lt;p&gt;Without limits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One user can make 1,000,000 requests/second&lt;/li&gt;
&lt;li&gt;Server gets overwhelmed&lt;/li&gt;
&lt;li&gt;Everyone suffers (slow or no service)&lt;/li&gt;
&lt;li&gt;Attackers can crash your system&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With limits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Each user gets 100 requests/minute&lt;/li&gt;
&lt;li&gt;Server stays healthy&lt;/li&gt;
&lt;li&gt;Fair access for everyone&lt;/li&gt;
&lt;li&gt;Protection from attacks&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  How It Works
&lt;/h2&gt;

&lt;p&gt;Track requests per user/IP:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User Alice:
- Made 95 requests this minute
- Limit: 100/minute
- 5 remaining ✓

User Bob (attacker):
- Made 100 requests this minute
- Limit: 100/minute
- BLOCKED until next minute ✗
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Common Strategies
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Fixed window:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reset counter every minute&lt;/li&gt;
&lt;li&gt;Simple but can have edge-case bursts&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Sliding window:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Rolling time window&lt;/li&gt;
&lt;li&gt;Smoother limiting&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Token bucket:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tokens refill over time&lt;/li&gt;
&lt;li&gt;Spend tokens to make requests&lt;/li&gt;
&lt;li&gt;Allows short bursts&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  What Happens When Limited
&lt;/h2&gt;

&lt;p&gt;Server returns HTTP &lt;strong&gt;429 Too Many Requests&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"Slow down!"&lt;/li&gt;
&lt;li&gt;Often includes "Retry-After" header&lt;/li&gt;
&lt;li&gt;Tells you when to try again&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  In One Sentence
&lt;/h2&gt;

&lt;p&gt;Rate Limiting controls how many requests users can make in a time period, protecting servers from overload and ensuring fair access for everyone.&lt;/p&gt;




&lt;p&gt;🔗 &lt;strong&gt;Enjoying these? Follow for daily ELI5 explanations!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Making complex tech concepts simple, one day at a time.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>eli5</category>
      <category>architecture</category>
      <category>security</category>
      <category>programming</category>
    </item>
    <item>
      <title>🤑 Greedy Algorithms Explained Like You're 5</title>
      <dc:creator>Sreekar Reddy</dc:creator>
      <pubDate>Wed, 20 May 2026 23:15:25 +0000</pubDate>
      <link>https://dev.to/esreekarreddy/greedy-algorithms-explained-like-youre-5-4i5l</link>
      <guid>https://dev.to/esreekarreddy/greedy-algorithms-explained-like-youre-5-4i5l</guid>
      <description>&lt;p&gt;&lt;em&gt;Always pick the best option right now&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Day 146 of 149&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://sreekarreddy.com/learn/eli5/greedy" rel="noopener noreferrer"&gt;Full deep-dive with code examples&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The Coin Change Analogy
&lt;/h2&gt;

&lt;p&gt;You owe someone $0.63 and want to use the fewest coins:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Greedy approach:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;With common US coins (25¢, 10¢, 5¢, 1¢): 25¢ → 25¢ → 10¢ → 1¢ → 1¢ → 1¢ = 6 coins&lt;/li&gt;
&lt;li&gt;Pick the largest coin that fits, then repeat&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;That's greedy!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;At each step, pick what looks best RIGHT NOW without thinking ahead.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem It Solves
&lt;/h2&gt;

&lt;p&gt;Optimization problems have many choices:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"What's the shortest route?"&lt;/li&gt;
&lt;li&gt;"How to fit most items in a bag?"&lt;/li&gt;
&lt;li&gt;"Minimum number of steps?"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Checking all combinations can be too slow. Greedy gives a fast answer by repeatedly picking a locally optimal choice.&lt;/p&gt;




&lt;h2&gt;
  
  
  How It Works
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Make a choice&lt;/strong&gt; → Pick the best available option&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reduce the problem&lt;/strong&gt; → New smaller problem remains&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Repeat&lt;/strong&gt; → Until problem is solved&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;No looking back, no reconsidering. Just greedy choices.&lt;/p&gt;




&lt;h2&gt;
  
  
  When Greedy Works
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Classic cases where greedy is optimal (with proof):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Coin change (for some coin systems, like common US coins)&lt;/li&gt;
&lt;li&gt;Activity scheduling (most non-overlapping events)&lt;/li&gt;
&lt;li&gt;Huffman coding (compression)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Doesn't work for every problem:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Some problems need to look ahead&lt;/li&gt;
&lt;li&gt;Greedy might miss the globally optimal solution&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Greedy vs Dynamic Programming
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Greedy&lt;/th&gt;
&lt;th&gt;Dynamic Programming&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Fast, simple&lt;/td&gt;
&lt;td&gt;Slower, more complex&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Local choices&lt;/td&gt;
&lt;td&gt;Considers all options&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;May not be optimal&lt;/td&gt;
&lt;td&gt;Can be optimal&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Use when it provably works&lt;/td&gt;
&lt;td&gt;Use when greedy fails&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Note: Dynamic programming can produce an optimal answer when the problem has the right structure (like optimal substructure) and you model it correctly.&lt;/p&gt;




&lt;h2&gt;
  
  
  In One Sentence
&lt;/h2&gt;

&lt;p&gt;Greedy Algorithms solve problems by picking the best available option at each step, which is fast but only works when local choices lead to a global solution.&lt;/p&gt;




&lt;p&gt;🔗 &lt;strong&gt;Enjoying these? Follow for daily ELI5 explanations!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Making complex tech concepts simple, one day at a time.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>eli5</category>
      <category>algorithms</category>
      <category>optimization</category>
      <category>programming</category>
    </item>
    <item>
      <title>📇 Database Indexing Explained Like You're 5</title>
      <dc:creator>Sreekar Reddy</dc:creator>
      <pubDate>Tue, 19 May 2026 23:03:40 +0000</pubDate>
      <link>https://dev.to/esreekarreddy/database-indexing-explained-like-youre-5-3i30</link>
      <guid>https://dev.to/esreekarreddy/database-indexing-explained-like-youre-5-3i30</guid>
      <description>&lt;p&gt;&lt;em&gt;Speed up queries with organized data pointers&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Day 145 of 149&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://sreekarreddy.com/learn/eli5/database-indexing" rel="noopener noreferrer"&gt;Full deep-dive with code examples&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The Library Card Catalog Analogy
&lt;/h2&gt;

&lt;p&gt;Imagine finding a book in a library with no organization:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Walk through every aisle&lt;/li&gt;
&lt;li&gt;Check every shelf&lt;/li&gt;
&lt;li&gt;Look at every book until you find it&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now imagine the card catalog:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Look up the book by title or author&lt;/li&gt;
&lt;li&gt;Get the exact shelf location&lt;/li&gt;
&lt;li&gt;Go directly there!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Database indexing is like the library card catalog!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It creates a shortcut to find your data without scanning everything.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem It Solves
&lt;/h2&gt;

&lt;p&gt;Without indexing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Database scans every row to find matches&lt;/li&gt;
&lt;li&gt;1 million rows = 1 million checks&lt;/li&gt;
&lt;li&gt;Slow queries that get slower as data grows&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With indexing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Database looks up the index first&lt;/li&gt;
&lt;li&gt;Knows exactly where the data is&lt;/li&gt;
&lt;li&gt;Fast queries even with millions of rows&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  How It Works
&lt;/h2&gt;

&lt;p&gt;An index is a sorted structure pointing to data:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Index (sorted by name):          Actual Table:
Alice → Row 47        ──────→    Row 47: Alice, 30, Sydney
Bob → Row 12          ──────→    Row 12: Bob, 25, Melbourne
Carol → Row 89        ──────→    Row 89: Carol, 35, Perth
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finding "Carol"? Index points straight to row 89!&lt;/p&gt;




&lt;h2&gt;
  
  
  When To Use Indexes
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Add indexes when:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Columns are used in WHERE clauses&lt;/li&gt;
&lt;li&gt;Columns are used for sorting (ORDER BY)&lt;/li&gt;
&lt;li&gt;Columns are used for joining tables&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Don't over-index:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Indexes slow down writes (inserts, updates)&lt;/li&gt;
&lt;li&gt;Each index takes storage space&lt;/li&gt;
&lt;li&gt;Too many indexes = diminishing returns&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  In One Sentence
&lt;/h2&gt;

&lt;p&gt;Database Indexing creates organized shortcuts to your data, turning slow full-table scans into fast direct lookups.&lt;/p&gt;




&lt;p&gt;🔗 &lt;strong&gt;Enjoying these? Follow for daily ELI5 explanations!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Making complex tech concepts simple, one day at a time.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>eli5</category>
      <category>database</category>
      <category>performance</category>
      <category>programming</category>
    </item>
    <item>
      <title>📱 Two-Factor Authentication Explained Like You're 5</title>
      <dc:creator>Sreekar Reddy</dc:creator>
      <pubDate>Mon, 18 May 2026 23:04:35 +0000</pubDate>
      <link>https://dev.to/esreekarreddy/two-factor-authentication-explained-like-youre-5-4l27</link>
      <guid>https://dev.to/esreekarreddy/two-factor-authentication-explained-like-youre-5-4l27</guid>
      <description>&lt;p&gt;&lt;em&gt;Password plus your phone&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Day 144 of 149&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://sreekarreddy.com/learn/eli5/two-factor-auth" rel="noopener noreferrer"&gt;Full deep-dive with code examples&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The Bank Vault Analogy
&lt;/h2&gt;

&lt;p&gt;To access a bank vault, you need:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;A key&lt;/strong&gt; (something you have)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A PIN code&lt;/strong&gt; (something you know)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Having just one isn't enough. Someone who steals your key can't get in without the PIN.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Two-Factor Authentication (2FA) works the same way!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You need two different types of proof to log in.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Passwords Aren't Enough
&lt;/h2&gt;

&lt;p&gt;Passwords can be:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Stolen&lt;/strong&gt; → Attackers may get them from data breaches&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Guessed&lt;/strong&gt; → People use weak passwords&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Phished&lt;/strong&gt; → Fake websites trick you&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With only a password, if someone gets it, they can often log in as you.&lt;/p&gt;




&lt;h2&gt;
  
  
  How 2FA Helps
&lt;/h2&gt;

&lt;p&gt;Even if someone has your password, they still need the second factor:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Types of second factors:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Something you have:&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Your phone (SMS code, authenticator app)&lt;/li&gt;
&lt;li&gt;A security key (like YubiKey)&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Something you are:&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Fingerprint&lt;/li&gt;
&lt;li&gt;Face recognition&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Some systems also use extra signals (like location or device) to reduce risk, but the classic factor categories are: know / have / are.&lt;/p&gt;




&lt;h2&gt;
  
  
  How It Works
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Enter username and password (first factor)&lt;/li&gt;
&lt;li&gt;System asks for second factor&lt;/li&gt;
&lt;li&gt;You provide a code from your phone or scan fingerprint&lt;/li&gt;
&lt;li&gt;Both verified? You're in!
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Password ✓ (something you know)
+
Phone code ✓ (something you have)
=
Access granted!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Why It's Important
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Attacker gets your password → They may still be blocked&lt;/li&gt;
&lt;li&gt;You lose your phone → They still need your password&lt;/li&gt;
&lt;li&gt;Harder for attackers to have BOTH factors&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Note: some 2FA methods (like SMS or one-time codes) can still be phished in real time. Phishing-resistant options include hardware security keys and passkeys (WebAuthn).&lt;/p&gt;




&lt;h2&gt;
  
  
  In One Sentence
&lt;/h2&gt;

&lt;p&gt;Two-Factor Authentication requires two different types of proof to verify your identity, making accounts harder to compromise than password-only login.&lt;/p&gt;




&lt;p&gt;🔗 &lt;strong&gt;Enjoying these? Follow for daily ELI5 explanations!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Making complex tech concepts simple, one day at a time.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>eli5</category>
      <category>security</category>
      <category>auth</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
