<?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: SYED SUHAIL</title>
    <description>The latest articles on DEV Community by SYED SUHAIL (@syed_suhail).</description>
    <link>https://dev.to/syed_suhail</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%2F3006814%2Fea1c73e0-594f-477b-9fdf-b6e4fa86b5d3.png</url>
      <title>DEV Community: SYED SUHAIL</title>
      <link>https://dev.to/syed_suhail</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/syed_suhail"/>
    <language>en</language>
    <item>
      <title>Your Sortable IDs Might Not Sort</title>
      <dc:creator>SYED SUHAIL</dc:creator>
      <pubDate>Sat, 15 Aug 2026 20:15:56 +0000</pubDate>
      <link>https://dev.to/syed_suhail/your-sortable-ids-might-not-sort-3i3f</link>
      <guid>https://dev.to/syed_suhail/your-sortable-ids-might-not-sort-3i3f</guid>
      <description>&lt;p&gt;Here's a bug you can check for in about ten seconds.&lt;/p&gt;

&lt;p&gt;If you generate time-sortable IDs in base62, find the alphabet string your library uses. If it looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;your IDs don't sort chronologically. Not "sometimes." Ever, across a character-class boundary.&lt;/p&gt;

&lt;p&gt;The reason is that lexicographic string comparison uses &lt;strong&gt;code points&lt;/strong&gt;, and in ASCII the digits (48–57) come &lt;em&gt;before&lt;/em&gt; uppercase (65–90), which comes before lowercase (97–122). An alphabet ordered &lt;code&gt;a…zA…Z0…9&lt;/code&gt; maps the digit &lt;code&gt;0&lt;/code&gt; — the &lt;em&gt;smallest&lt;/em&gt; value in your encoding — to the &lt;em&gt;largest&lt;/em&gt; code point. So an earlier timestamp can sort after a later one, silently, with nothing thrown and no test failing unless someone happened to write one that straddles the boundary.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ascending&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;common&lt;/span&gt;     &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;isSortSafe&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;[...&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;every&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;c&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nx"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;charCodeAt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;charCodeAt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

&lt;span class="nf"&gt;isSortSafe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ascending&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// true&lt;/span&gt;
&lt;span class="nf"&gt;isSortSafe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;common&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;    &lt;span class="c1"&gt;// false  ← lexicographic order ≠ encoded order&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I found this while building a small ID library, and it turned out to be the most interesting thing I learned — because it's an invariant that every sortable-ID scheme depends on and almost nobody states out loud.&lt;/p&gt;

&lt;p&gt;This post is about that invariant and two other design decisions that surprised me, plus an honest account of where the established options beat the thing I built — including one place where my own library still gets this wrong.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the big specs never hit this
&lt;/h2&gt;

&lt;p&gt;ULID and TypeID both encode in &lt;strong&gt;Crockford's Base32&lt;/strong&gt; — &lt;code&gt;0123456789ABCDEFGHJKMNPQRSTVWXYZ&lt;/code&gt; (or lowercased). That alphabet is already in ascending code-point order, so the invariant holds for free and the specs never have to mention it.&lt;/p&gt;

&lt;p&gt;Which is fine until you want base62 for density. Base62 has no canonical ordering. Every implementation picks one, and the intuitive pick — "letters then digits," or "lowercase, uppercase, digits" — is exactly wrong. The invariant is real, load-bearing, and undocumented.&lt;/p&gt;

&lt;p&gt;So the first design decision: &lt;strong&gt;assert it at construction time.&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;alphabet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;alphabet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;charCodeAt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="nx"&gt;alphabet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;charCodeAt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;RangeError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;a sortable `alphabet` must have characters in strictly ascending &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
      &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;code-point order (no duplicates), otherwise a lexicographic sort &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
      &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;would not match chronological order.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
    &lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Nine lines, thrown once at setup rather than discovered a year later when someone notices the feed is subtly out of order. Failing loudly at configuration time beats being wrong quietly at runtime — which is the whole theme of this post.&lt;/p&gt;

&lt;h2&gt;
  
  
  Monotonicity is about clocks, not milliseconds
&lt;/h2&gt;

&lt;p&gt;Every sortable-ID library advertises "monotonic." I assumed that meant "handles two IDs generated in the same millisecond." That's the easy half.&lt;/p&gt;

&lt;p&gt;The hard half is the system clock going &lt;strong&gt;backwards&lt;/strong&gt; — NTP correction, VM migration, a leap-second smear, a laptop waking up. When that happens, a naive time-prefixed ID scheme emits an ID that sorts &lt;em&gt;before&lt;/em&gt; one you already issued, and if you're using those IDs as pagination cursors or database keys, you now have rows that are invisible to a "newer than X" query.&lt;/p&gt;

&lt;p&gt;Here's what the ULID spec says about clock regression: nothing. The word "clock" appears &lt;strong&gt;zero times&lt;/strong&gt; in it. Every implementation invents its own behaviour, and they differ.&lt;/p&gt;

&lt;p&gt;ULID also mandates increment-by-1 for its monotonic mode, which makes the next ID trivially predictable from the current one — something RFC 9562 (the UUIDv7 spec) explicitly warns against.&lt;/p&gt;

&lt;p&gt;So the second decision: treat clock regression as a first-class case with the same code path as the same-millisecond case.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;monotonic&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;time&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="nx"&gt;lastTime&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;   &lt;span class="c1"&gt;// note: &amp;lt;=, not ===&lt;/span&gt;
  &lt;span class="nx"&gt;time&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;lastTime&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;                     &lt;span class="c1"&gt;// pin to the last time we issued&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;next&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;incrementIndices&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;lastRandom&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;radix&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;lastRandom&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;                 &lt;span class="c1"&gt;// bump the random tail&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;time&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;lastTime&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;               &lt;span class="c1"&gt;// tail exhausted: borrow a millisecond&lt;/span&gt;
    &lt;span class="nx"&gt;lastRandom&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;randomIndices&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;radix&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;randomSize&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nx"&gt;lastTime&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;time&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three behaviours fall out of that:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Same millisecond&lt;/strong&gt; → increment the random tail (the ULID approach).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tail exhausted&lt;/strong&gt; → borrow a millisecond from the future rather than throwing. With a 16-character base62 tail that's ~95 bits of headroom, so this is theoretical, but "theoretical" is where outages live.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Clock steps backwards&lt;/strong&gt; → pin to the last issued time and keep incrementing. IDs stay strictly increasing regardless of what the clock does.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now the costs, because there are three and they all matter.&lt;/p&gt;

&lt;p&gt;The state is &lt;strong&gt;per generator instance&lt;/strong&gt; — closure state inside one &lt;code&gt;createSortableId()&lt;/code&gt;. Not per-process: two instances in the same process are already unordered relative to each other, and across workers or machines there's no ordering at all. Nothing without coordination can fix that, and any library claiming otherwise is claiming something it can't deliver.&lt;/p&gt;

&lt;p&gt;The second cost is subtler, and I didn't appreciate it until I went back over the code for this post. &lt;strong&gt;Preserving order under a backwards clock means sacrificing the timestamp.&lt;/strong&gt; When time is pinned to &lt;code&gt;lastTime&lt;/code&gt;, every subsequent ID reports that stale reading — with no cap and no warning. Simulate a three-year NTP step backwards and the IDs stay perfectly ordered while &lt;code&gt;getTimestamp()&lt;/code&gt; reports a time three years in the future, indefinitely. Counter exhaustion has the mirror problem: &lt;code&gt;time = lastTime + 1&lt;/code&gt; fabricates a millisecond that never happened.&lt;/p&gt;

&lt;p&gt;So &lt;code&gt;sortableId&lt;/code&gt; gives you a &lt;strong&gt;sort key that happens to be readable as a time&lt;/strong&gt;, not a timestamp you should trust for anything. If you need to know when a row was created, store a &lt;code&gt;created_at&lt;/code&gt; column. ULID's reference implementation behaves the same way under regression, so this is a shared property of the design rather than something I invented — but "everyone does it" isn't documentation, and it should be written down.&lt;/p&gt;

&lt;p&gt;I also made the clock injectable (&lt;code&gt;now: () =&amp;gt; number&lt;/code&gt;), because a time-dependent function you can't control in a test is a time-dependent function you can't test.&lt;/p&gt;

&lt;h2&gt;
  
  
  The prefix should be a type, not a convention
&lt;/h2&gt;

&lt;p&gt;The prefixed-ID pattern is Stripe's: &lt;code&gt;cus_MJA953cFzEuO1z&lt;/code&gt;, &lt;code&gt;pi_3LKQhv…&lt;/code&gt;. The stated reasons are readable logs and polymorphic lookup — you can tell what an ID &lt;em&gt;is&lt;/em&gt; without a schema.&lt;/p&gt;

&lt;p&gt;The obvious next step in TypeScript is making the compiler enforce it. There are two ways, and the difference matters.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Branded types.&lt;/strong&gt; TypeID's TypeScript implementation uses:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;TypeId&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;T&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;__type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;T&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's a plain property name, not a &lt;code&gt;unique symbol&lt;/code&gt;. Two consequences I verified rather than assumed: it's forgeable with a single &lt;code&gt;as&lt;/code&gt; cast, and the brand doesn't survive string operations — call &lt;code&gt;.toUpperCase()&lt;/code&gt; and you get a plain &lt;code&gt;string&lt;/code&gt; back.&lt;/p&gt;

&lt;p&gt;The sharper issue is that the compile-time and runtime prefix checks aren't linked. This type-checks cleanly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;fromString&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;user&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;post_01h5fskfsk4fpeqwnsyz5hj55t&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;// ✅ returns TypeId&amp;lt;'user'&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You asked for a user ID, you handed it a post ID, and the compiler agreed with you.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Template literal types.&lt;/strong&gt; The alternative is to describe the string as what it actually is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nf"&gt;id&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;user&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="c1"&gt;// type: `user_${string}`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No brand, no fiction — a structural type the compiler can verify. It composes with narrowing (&lt;code&gt;startsWith("user_")&lt;/code&gt; works the way you'd hope), it survives being passed through generic code that expects &lt;code&gt;string&lt;/code&gt;, and there's nothing to forge because there's no claim beyond the shape.&lt;/p&gt;

&lt;p&gt;It isn't free either, and one of the costs is a wart in my own API. A template literal type degrades to &lt;code&gt;string&lt;/code&gt; under arbitrary string manipulation, and it can only express "this has the right prefix shape," never "this is a valid ID." That would be fine if the runtime side picked up the slack. It doesn't:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;isId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;user_!!!! spaces&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;user&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;// → true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;isId&lt;/code&gt; is a &lt;code&gt;startsWith&lt;/code&gt; check and nothing more, and the Zod companion inherits the same predicate — so &lt;code&gt;zId("user").safeParse("user_@@@!")&lt;/code&gt; succeeds. If you reach for it as an input validator at a trust boundary, you have a hole. The name promises more than the function delivers, which is my fault and is being fixed; the type is honest, the runtime guard isn't yet.&lt;/p&gt;

&lt;p&gt;The related sharp edge: there's no version or variant marker in the format, so &lt;code&gt;getTimestamp()&lt;/code&gt; will cheerfully decode the first nine characters of a &lt;em&gt;non&lt;/em&gt;-sortable &lt;code&gt;id()&lt;/code&gt; and hand you a plausible date. Measured across 20,000 random IDs, about 64% produce an in-range &lt;code&gt;Date&lt;/code&gt;. A reader function that can't tell it's been handed the wrong kind of input is a reader function that lies.&lt;/p&gt;

&lt;h2&gt;
  
  
  The honest comparison
&lt;/h2&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%2Fr53fnovx2qqo94cn0sqs.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%2Fr53fnovx2qqo94cn0sqs.png" alt=" " width="800" height="452"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;prefID's 142.9 bits versus nanoid's 126 is a length choice, not a cleverness win — 24 characters instead of 21, both using a CSPRNG. And nanoid is smaller: 516 bytes gzipped for its whole entry against prefID's 992 bytes for &lt;code&gt;id&lt;/code&gt; alone, 2,315 for the full surface. "✓ ms" means k-sortable to millisecond granularity; within a millisecond, ordering across processes is not guaranteed for any of them. One implementation detail worth naming: the random body uses masked rejection sampling rather than &lt;code&gt;% radix&lt;/code&gt;, so custom alphabets stay unbiased — the twenty-line version most people write is subtly skewed.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;One more thing the figure doesn't capture: nanoid's default alphabet includes &lt;code&gt;_&lt;/code&gt; and &lt;code&gt;-&lt;/code&gt;, which is quietly hostile to the prefixed-ID pattern, because &lt;code&gt;id.split("_")[0]&lt;/code&gt; isn't reliable when the random body can contain underscores.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where my own library still has this bug
&lt;/h2&gt;

&lt;p&gt;I opened this post with an invariant: a sortable alphabet must be in ascending code-point order. My library asserts it at construction time. Which felt airtight right up until I asked the obvious follow-up question — &lt;em&gt;ascending according to whom?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;JavaScript's default string comparison uses code points. Your database's does not.&lt;/p&gt;

&lt;p&gt;MySQL's default collation (&lt;code&gt;utf8mb4_0900_ai_ci&lt;/code&gt;) and Postgres under an ICU or &lt;code&gt;en_US.UTF-8&lt;/code&gt; locale both order letters case-insensitively: &lt;code&gt;a &amp;lt; A &amp;lt; b &amp;lt; B&lt;/code&gt;. Under that comparator, mixed-case base62 stops being sortable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;earlier&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;evt_00000000Z&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;// encoded rank 35&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;later&lt;/span&gt;   &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;evt_00000000a&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;// encoded rank 36 — one millisecond later&lt;/span&gt;

&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;later&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;earlier&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;sort&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;                           &lt;span class="c1"&gt;// ['…Z', '…a']  ✅ code points: correct&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Intl&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Collator&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;en-US&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;earlier&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;later&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;sort&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;compare&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;  &lt;span class="c1"&gt;// ['…a', '…Z']  ❌ inverted&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;ORDER BY id&lt;/code&gt; in your application returns one order. &lt;code&gt;ORDER BY id&lt;/code&gt; in your database returns another. Same bug as the opening of this post, one layer down — and I shipped it as the default.&lt;/p&gt;

&lt;p&gt;Two fixes, neither of which I get to feel clever about: use the exported Crockford base32 alphabet, which is single-case and therefore collation-proof, or force a binary collation on the column (&lt;code&gt;utf8mb4_bin&lt;/code&gt;, or &lt;code&gt;COLLATE "C"&lt;/code&gt; in Postgres). Making the single-case alphabet the default for sortable IDs is the right long-term answer.&lt;/p&gt;

&lt;p&gt;The generalisable lesson is the one I'd keep even if you never touch any of this: &lt;strong&gt;"sortable" is not a property of an ID format.&lt;/strong&gt; It's a relationship between an encoding and a specific comparator. I verified my encoding against JavaScript's comparator, declared victory, and shipped a default that violates the invariant under the comparator that actually runs in production — the database's. Every layer that sorts your IDs gets a vote, and they don't all agree.&lt;/p&gt;

&lt;h2&gt;
  
  
  When you should not use the thing I built
&lt;/h2&gt;

&lt;p&gt;This is the part I'd want to read first, so:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use TypeID if you need cross-language IDs.&lt;/strong&gt; TypeID has a written specification, conformance fixtures, and implementations across roughly two dozen languages. prefID is TypeScript/JavaScript only. If a Go service and a Python job both mint IDs, a shared spec is worth more than any ergonomic detail in this post.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use TypeID or UUIDv7 if you want native UUID storage.&lt;/strong&gt; This is the big one. A TypeID's suffix &lt;em&gt;is&lt;/em&gt; a UUIDv7, so you can store the 128 bits in a Postgres &lt;code&gt;uuid&lt;/code&gt; column — 16 bytes, native indexing — and keep the prefix in your application layer. prefID's base62 string is a string; you store it as &lt;code&gt;text&lt;/code&gt;/&lt;code&gt;varchar&lt;/code&gt;. On a large table with several secondary indexes that difference is real, because InnoDB copies the primary key into every secondary index.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use UUIDv7 if you need a standard.&lt;/strong&gt; It's a Standards Track RFC with named authors, normative language and test vectors. Auditors, other teams and future maintainers all know what it is. "A library I found on npm" is a harder sell.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use nanoid if you just need a random string.&lt;/strong&gt; It's smaller, extremely well-tested, and if you don't need prefixes or sortability, everything in this post is overhead.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use cuid2 if unguessability is your priority.&lt;/strong&gt; It's deliberately not sortable, precisely because a timestamp in an ID leaks information.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Don't use a sortable ID as a bearer secret.&lt;/strong&gt; Not an invite link, a share URL, a password-reset token, or an unsubscribe link. In monotonic mode the same-millisecond siblings are the current ID with its last character incremented, so one leaked sample enumerates a burst. RFC 9562 names this pattern as a hazard. Use a pure random token.&lt;/p&gt;

&lt;h2&gt;
  
  
  The strongest objection comes from Stripe
&lt;/h2&gt;

&lt;p&gt;If prefixed IDs are Stripe's idea, it's worth reading what Stripe actually tells API consumers. Their upgrades documentation lists, under &lt;strong&gt;backward-compatible changes&lt;/strong&gt; — things they may do without warning:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Changing the length of object IDs, and adding or removing fixed prefixes.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Stripe invented the pattern and explicitly tells you &lt;strong&gt;not to depend on the prefix&lt;/strong&gt;. They lengthened their IDs in production in 2013 and tell integrators to handle IDs up to 255 characters.&lt;/p&gt;

&lt;p&gt;The resolution, I think, is that these are two different situations. Stripe is talking about &lt;em&gt;consuming someone else's IDs across an API boundary you don't control&lt;/em&gt; — there, parsing the prefix is coupling to an implementation detail, and they're right. Inside a system where you mint the IDs, the prefix is your own schema, and encoding it in the type system makes it checkable rather than decorative.&lt;/p&gt;

&lt;p&gt;Two more objections worth conceding rather than deflecting:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A prefix doesn't make an ID unguessable.&lt;/strong&gt; All the unguessability lives in the random suffix. A typed ID with weak entropy is a weak ID with better logging.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prefixes don't fix authorization.&lt;/strong&gt; IDOR is unaffected by ID format. An unguessable, beautifully typed ID in front of a missing access check is still a missing access check.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd take away even if you never use any of this
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;If your encoding has an ordering requirement, assert it at construction.&lt;/strong&gt; Most sortable-ID bugs aren't in the sorting; they're in an alphabet that quietly doesn't satisfy the invariant the sort assumes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;"Sortable" is a relationship, not a property.&lt;/strong&gt; Check your encoding against &lt;em&gt;every&lt;/em&gt; comparator that will touch it — your language's, your database's collation, your search index's. They disagree more often than you'd think.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;"Monotonic" is a claim about clocks.&lt;/strong&gt; Ask what a scheme does when time moves backwards, and what that costs. If its spec doesn't say, its implementations disagree.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A type that can't be verified is documentation with extra steps.&lt;/strong&gt; If your brand can be forged with &lt;code&gt;as&lt;/code&gt;, it's a naming convention wearing a type's clothes — and if your runtime guard is a &lt;code&gt;startsWith&lt;/code&gt;, so is that.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cross-language reach beats local ergonomics&lt;/strong&gt; more often than library authors like to admit — mine included.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The library is &lt;a href="https://github.com/suhailopensource/prefID" rel="noopener noreferrer"&gt;prefID&lt;/a&gt; (MIT, zero dependencies) if these specific tradeoffs are the ones you want. The &lt;code&gt;isId&lt;/code&gt; weakness and the collation default above are tracked in the issue backlog rather than quietly known. If they aren't your tradeoffs, TypeID and UUIDv7 are genuinely good — and this post will have done its job if you go and check your alphabet ordering, and then your database collation, either way.&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>database</category>
    </item>
    <item>
      <title>Understanding Storage Types in AWS: A Deep Dive into EBS and Beyond</title>
      <dc:creator>SYED SUHAIL</dc:creator>
      <pubDate>Wed, 11 Jun 2025 09:21:49 +0000</pubDate>
      <link>https://dev.to/syed_suhail/understanding-storage-types-in-aws-a-deep-dive-into-ebs-and-beyond-55b2</link>
      <guid>https://dev.to/syed_suhail/understanding-storage-types-in-aws-a-deep-dive-into-ebs-and-beyond-55b2</guid>
      <description>&lt;p&gt;When designing cloud-based applications, storage plays a crucial role in ensuring data persistence, availability, and performance. AWS (Amazon Web Services) offers a wide range of storage solutions tailored to different data types, workloads, and durability needs. In this blog post, we’ll explore the various storage types available in AWS, with a special focus on Elastic Block Store (EBS) — a core component for EC2-backed storage.&lt;br&gt;
Storage Types&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Block Storage Elastic Block Storage (EBS) Volumes: Provides persistent block storage volumes that can be attached to EC2 instances. Allows you to create, attach, and detach volumes to EC2 instances as needed. Supports different volume types optimized for various workloads, including General Purpose SSD (gp2/gp3), Provisioned IOPS SSD (io1/io2), and Throughput Optimized HDD (st1). &lt;br&gt;
Instance Storage: Directly attached storage to EC2 instances. Provides high I/O performance but is non-persistent. Data stored in instance storage is lost if the instance is stopped or terminated. Typically available in fixed sizes and types and limited to specific instance types.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;File Storage AWS Elastic File System (EFS): Fully managed file storage service that supports NFSv4 protocol. Offers scalable and highly available file storage for Linux-based workloads, allowing multiple EC2 instances to access the same file system concurrently.&lt;br&gt;
AWS FSx: Provides fully managed file systems optimized for Windows-based workloads, including Windows File Server and Lustre.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Object Storage Amazon Simple Storage Service (S3): Object storage service designed to store and retrieve any amount of data from anywhere on the web. Ideal for storing unstructured data, such as images, videos, documents, and backups. Offers high durability, availability, and scalability at a low cost. &lt;br&gt;
Amazon Glacier: Low-cost storage service designed for long-term data archiving and backup. Offers multiple retrieval options with varying latency, allowing you to optimize costs based on your access requirements.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;4.Advantages and Use Cases of EBS Volumes Permanent Storage: EBS volumes provide persistence, ensuring that data remains intact even if the associated EC2 instance is stopped or terminated. Flexible Volume Types: Choose from a variety of EBS volume types optimized for different performance and cost requirements, ranging from high-performance SSDs to cost-effective HDDs.&lt;br&gt;
Scalability and Attachment Flexibility: Easily scale EBS volumes up to 16TB in size and attach/detach them to different EC2 instances as needed. Practical Implementation and Best Practices Volume Provisioning and Mounting: Provision EBS volumes and mount them to EC2 instances using standard Linux commands like lsblk, fdisk, mkfs, and mount. Update the /etc/fstab file to automatically mount EBS volumes at boot time. &lt;/p&gt;

&lt;p&gt;Performance Optimization: Utilize different EBS volume types based on your application's performance requirements, ensuring optimal I/O performance and cost-effectiveness. By understanding the various storage options available in AWS, including EBS volumes, you can architect scalable and reliable storage solutions tailored to your specific workload requirements and budget constraints.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>EC2 ELASTIC IP</title>
      <dc:creator>SYED SUHAIL</dc:creator>
      <pubDate>Fri, 25 Apr 2025 12:55:41 +0000</pubDate>
      <link>https://dev.to/syed_suhail/ec2-elastic-ip-4363</link>
      <guid>https://dev.to/syed_suhail/ec2-elastic-ip-4363</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;EC2 Elastic IP&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;In the world of the internet, every device (like your computer or a server) needs a unique address to communicate with other devices. This address is called an IP (Internet Protocol) address. Think of it as a phone number for computers.&lt;/p&gt;

&lt;p&gt;Now, in cloud computing, when you create a virtual server (like on Amazon Web Services), it also gets an IP address. However, this IP address might change if you stop and restart your server. Here's where Elastic IP addresses come into play.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Elastic IP Address in AWS:&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;An Elastic IP address in AWS is a unique, static IP address designed for dynamic cloud computing. When you launch a virtual server (an EC2 instance) on AWS, it's given an IP address. However, this IP address can change if you stop and start your instance. Elastic IPs are a way to overcome this limitation.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Use in Real Life (Specific to AWS):&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Hosting a Website: If you host a website on an EC2 instance, using an Elastic IP ensures your website has a consistent address. Even if you replace the instance, your users won't notice any change in the website's location.&lt;/li&gt;
&lt;li&gt;Running Applications: For applications that require a fixed IP address (for security reasons or integration purposes), Elastic IPs provide a stable solution. You can move the IP if you upgrade or replace your servers.&lt;/li&gt;
&lt;li&gt;Failover and Redundancy: Elastic IPs are crucial for setting up failover mechanisms. If your main server fails, you can quickly redirect the Elastic IP to a backup server, ensuring continuous service availability.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Allocate Ip Address&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;To allocate an Elastic IP address from Amazon's pool of public IPv4 addresses or from a custom IP address pool, follow these steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open the Amazon EC2 console at &lt;a href="https://console.aws.amazon.com/ec2/" rel="noopener noreferrer"&gt;https://console.aws.amazon.com/ec2/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;In the navigation pane, choose Network &amp;amp; Security, Elastic IPs.&lt;/li&gt;
&lt;li&gt;Choose Allocate Elastic IP address.&lt;/li&gt;
&lt;li&gt;Choose the type of address pool: Amazon's pool of IPv4 addresses, Public IPv4 address that you bring to your AWS account, or Customer owned pool of IPv4 addresses.&lt;/li&gt;
&lt;li&gt;(Optional) Choose a network border group for the Elastic IP address.&lt;/li&gt;
&lt;li&gt;Choose Allocate.&lt;/li&gt;
&lt;li&gt;Associate Elastic IP address to An EC2 Instance&lt;/li&gt;
&lt;li&gt;Open the Amazon EC2 console at &lt;a href="https://console.aws.amazon.com/ec2" rel="noopener noreferrer"&gt;https://console.aws.amazon.com/ec2&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;In the navigation pane, choose Elastic IPs.&lt;/li&gt;
&lt;li&gt;Select the Elastic IP address to associate and choose Actions, Associate Elastic IP address.&lt;/li&gt;
&lt;li&gt;For Resource type, choose Instance.&lt;/li&gt;
&lt;li&gt;For Instance, choose the instance with which to associate the Elastic IP address. You can also enter text to search for a specific instance.&lt;/li&gt;
&lt;li&gt;(Optional) For Private IP address, specify a private IP address with which to associate the Elastic IP address.&lt;/li&gt;
&lt;li&gt;Choose Associate.&lt;/li&gt;
&lt;li&gt;You can disassociate an Elastic IP address from an instance or network interface at any time. After you disassociate the Elastic IP address, you can reassociate it with another resource.&lt;/li&gt;
&lt;li&gt;You can disassociate an Elastic IP address using one of the following methods.&lt;/li&gt;
&lt;li&gt;Open the Amazon EC2 console at &lt;a href="https://console.aws.amazon.com/ec2/" rel="noopener noreferrer"&gt;https://console.aws.amazon.com/ec2/&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;In the navigation pane, choose Elastic IPs.&lt;/li&gt;
&lt;li&gt;Select the Elastic IP address to disassociate, choose Actions, Disassociate Elastic IP address.&lt;/li&gt;
&lt;li&gt;Choose Disassociate.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Release an Elastic IP address&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;If you no longer need an Elastic IP address, we recommend that you release it using one of the following methods. The address to release must not be currently associated with an AWS resource, such as an EC2 instance, NAT gateway, or Network Load Balancer.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open the Amazon EC2 console at &lt;a href="https://console.aws.amazon.com/ec2/" rel="noopener noreferrer"&gt;https://console.aws.amazon.com/ec2/&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;In the navigation pane, choose Elastic IPs.&lt;/li&gt;
&lt;li&gt;Select the Elastic IP address to release and choose Actions, Release Elastic IP addresses.&lt;/li&gt;
&lt;li&gt;Choose Release.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
      <category>web</category>
      <category>ec2</category>
      <category>programming</category>
    </item>
    <item>
      <title>Transit Gateway Configuration Guide</title>
      <dc:creator>SYED SUHAIL</dc:creator>
      <pubDate>Thu, 17 Apr 2025 15:17:27 +0000</pubDate>
      <link>https://dev.to/syed_suhail/transit-gateway-configuration-guide-4k43</link>
      <guid>https://dev.to/syed_suhail/transit-gateway-configuration-guide-4k43</guid>
      <description>&lt;p&gt;&lt;strong&gt;What is a Transit Gateway?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A Transit Gateway is a network transit hub that enables you to connect multiple VPCs, VPNs, and on-premises networks to streamline network connectivity and management within your AWS infrastructure.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How does a Transit Gateway Work?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Transit Gateways act as a central hub for routing traffic between connected networks. They simplify network architecture by providing a single point of entry and exit for traffic, reducing the need for complex VPC peering configurations.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Setting Up a Transit Gateway&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;To set up a Transit Gateway:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Navigate to the Transit Gateway Console: Access the AWS Management Console and navigate to the Transit Gateway service.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a Transit Gateway: Click on "Create Transit Gateway" and provide details such as name, description, and Amazon side ASN (Autonomous System Number).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Add Attachments: Attach VPCs, VPN connections, and Direct Connect gateways to the Transit Gateway to establish connectivity. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Configure Route Tables: Define route tables to specify how traffic should be routed between attached networks.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Propagation of Routes: Propagate routes from attached VPCs or VPN connections to ensure proper routing of traffic.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Associate Subnets: Associate subnets from attached VPCs with the Transit Gateway to enable communication between resources.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Testing and Validation: Test connectivity between resources in different networks to ensure proper routing through the Transit Gateway.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Benefits of Using a Transit Gateway&lt;/strong&gt;
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Simplified Network Architecture: Transit Gateways simplify network connectivity by providing a centralized hub for routing traffic.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Scalability: They support the connection of thousands of VPCs and on-premises networks, allowing for scalable network expansion.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Cost-Effective: Transit Gateways eliminate the need for multiple VPN connections and complex VPC peering arrangements, reducing operational costs.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Considerations&lt;/strong&gt;
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Data Transfer Costs: Data transfer costs may apply for traffic traversing the Transit Gateway between regions or across AWS services.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;High Availability: Deploy Transit Gateways across multiple Availability Zones for high availability and fault tolerance.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;By leveraging Transit Gateways, you can establish a scalable and efficient network architecture in AWS, facilitating seamless communication between VPCs, VPNs, and on-premises networks.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Happy networking with Transit Gateways!&lt;/p&gt;

</description>
      <category>cloudcomputing</category>
      <category>aws</category>
      <category>webdev</category>
      <category>cloudpractitioner</category>
    </item>
    <item>
      <title>EC2 Elastic IP</title>
      <dc:creator>SYED SUHAIL</dc:creator>
      <pubDate>Fri, 04 Apr 2025 14:04:12 +0000</pubDate>
      <link>https://dev.to/syed_suhail/ec2-elastic-ip-3ccb</link>
      <guid>https://dev.to/syed_suhail/ec2-elastic-ip-3ccb</guid>
      <description>&lt;p&gt;In the world of the internet, every device (like your computer or a server) needs a unique address to communicate with other devices. This address is called an IP (Internet Protocol) address. Think of it as a phone number for computers.&lt;/p&gt;

&lt;p&gt;Now, in cloud computing, when you create a virtual server (like on Amazon Web Services), it also gets an IP address. However, this IP address might change if you stop and restart your server. Here's where Elastic IP addresses come into play.&lt;/p&gt;

&lt;h2&gt;
  
  
  Elastic IP Address in AWS:
&lt;/h2&gt;

&lt;p&gt;An Elastic IP address in AWS is a unique, static IP address designed for dynamic cloud computing. When you launch a virtual server (an EC2 instance) on AWS, it's given an IP address. However, this IP address can change if you stop and start your instance. Elastic IPs are a way to overcome this limitation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use in Real Life (Specific to AWS):
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Hosting a Website: If you host a website on an EC2 instance, using an Elastic IP ensures your website has a consistent address. Even if you replace the instance, your users won't notice any change in the website's location.&lt;/li&gt;
&lt;li&gt;Running Applications: For applications that require a fixed IP address (for security reasons or integration purposes), Elastic IPs provide a stable solution. You can move the IP if you upgrade or replace your servers.&lt;/li&gt;
&lt;li&gt;Failover and Redundancy: Elastic IPs are crucial for setting up failover mechanisms. If your main server fails, you can quickly redirect the Elastic IP to a backup server, ensuring continuous service availability.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Allocate Ip Address
&lt;/h2&gt;

&lt;p&gt;To allocate an Elastic IP address from Amazon's pool of public IPv4 addresses or from a custom IP address pool, follow these steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open the Amazon EC2 console at &lt;a href="https://console.aws.amazon.com/ec2/" rel="noopener noreferrer"&gt;https://console.aws.amazon.com/ec2/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;In the navigation pane, choose Network &amp;amp; Security, Elastic IPs.&lt;/li&gt;
&lt;li&gt;Choose Allocate Elastic IP address.&lt;/li&gt;
&lt;li&gt;Choose the type of address pool: Amazon's pool of IPv4 addresses, Public IPv4 address that you bring to your AWS account, or Customer owned pool of IPv4 addresses.&lt;/li&gt;
&lt;li&gt;(Optional) Choose a network border group for the Elastic IP address.&lt;/li&gt;
&lt;li&gt;Choose Allocate.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Associate Elastic IP address to An EC2 Instance
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Open the Amazon EC2 console at &lt;a href="https://console.aws.amazon.com/ec2" rel="noopener noreferrer"&gt;https://console.aws.amazon.com/ec2&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;In the navigation pane, choose Elastic IPs.&lt;/li&gt;
&lt;li&gt;Select the Elastic IP address to associate and choose Actions, Associate Elastic IP address.&lt;/li&gt;
&lt;li&gt;For Resource type, choose Instance.&lt;/li&gt;
&lt;li&gt;For Instance, choose the instance with which to associate the Elastic IP address. You can also enter text to search for a specific instance.&lt;/li&gt;
&lt;li&gt;(Optional) For Private IP address, specify a private IP address with which to associate the Elastic IP address.&lt;/li&gt;
&lt;li&gt;Choose Associate.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can disassociate an Elastic IP address from an instance or network interface at any time. After you disassociate the Elastic IP address, you can reassociate it with another resource.&lt;/p&gt;

&lt;p&gt;You can disassociate an Elastic IP address using one of the following methods.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open the Amazon EC2 console at &lt;a href="https://console.aws.amazon.com/ec2/" rel="noopener noreferrer"&gt;https://console.aws.amazon.com/ec2/&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;In the navigation pane, choose Elastic IPs.&lt;/li&gt;
&lt;li&gt;Select the Elastic IP address to disassociate, choose Actions, Disassociate Elastic IP address.&lt;/li&gt;
&lt;li&gt;Choose Disassociate.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Release an Elastic IP address
&lt;/h2&gt;

&lt;p&gt;If you no longer need an Elastic IP address, we recommend that you release it using one of the following methods. The address to release must not be currently associated with an AWS resource, such as an EC2 instance, NAT gateway, or Network Load Balancer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Open the Amazon EC2 console at &lt;a href="https://console.aws.amazon.com/ec2/" rel="noopener noreferrer"&gt;https://console.aws.amazon.com/ec2/&lt;/a&gt;.
&lt;/h2&gt;

&lt;p&gt;In the navigation pane, choose Elastic IPs.&lt;br&gt;
Select the Elastic IP address to release and choose Actions, Release Elastic IP addresses.&lt;br&gt;
Choose Release.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Understanding AWS and How It Works</title>
      <dc:creator>SYED SUHAIL</dc:creator>
      <pubDate>Wed, 02 Apr 2025 09:38:08 +0000</pubDate>
      <link>https://dev.to/syed_suhail/understanding-aws-and-how-it-works-12ek</link>
      <guid>https://dev.to/syed_suhail/understanding-aws-and-how-it-works-12ek</guid>
      <description>&lt;h2&gt;
  
  
  What is AWS?
&lt;/h2&gt;

&lt;p&gt;AWS is a collection of cloud computing services provided by Amazon. It includes services related to computing power, storage, databases, networking, security, and more. AWS offers a pay-as-you-go model, allowing businesses to optimize costs while maintaining flexibility.&lt;/p&gt;

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

&lt;p&gt;AWS operates through a global network of data centers, categorized into different regions and availability zones. Users can select the region closest to their users for lower latency and better performance. The key services AWS provides include:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Compute Services&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Amazon EC2 (Elastic Compute Cloud): Provides scalable virtual servers in the cloud.&lt;/li&gt;
&lt;li&gt;AWS Lambda: A serverless computing service that runs code in response to events.&lt;/li&gt;
&lt;li&gt;Amazon Elastic Beanstalk: A platform for deploying and managing applications.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Storage Services&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Amazon S3 (Simple Storage Service): A highly scalable object storage service.&lt;/li&gt;
&lt;li&gt;Amazon EBS (Elastic Block Store): Persistent storage for EC2 instances.&lt;/li&gt;
&lt;li&gt;Amazon Glacier: Low-cost archival storage for long-term data retention.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Database Services&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Amazon RDS (Relational Database Service): Managed databases like MySQL, PostgreSQL, and SQL Server.&lt;/li&gt;
&lt;li&gt;Amazon DynamoDB: A fully managed NoSQL database for key-value storage.&lt;/li&gt;
&lt;li&gt;Amazon Redshift: A data warehouse solution for analytics.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Networking and Security&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Amazon VPC (Virtual Private Cloud): Isolates AWS resources within a private network.&lt;/li&gt;
&lt;li&gt;AWS IAM (Identity and Access Management): Controls permissions and access.&lt;/li&gt;
&lt;li&gt;AWS CloudFront: A global content delivery network (CDN) for caching data.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;DevOps and Monitoring&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AWS CloudFormation: Automates infrastructure deployment.&lt;/li&gt;
&lt;li&gt;AWS CloudWatch: Monitors AWS resources and applications.&lt;/li&gt;
&lt;li&gt;AWS CodePipeline: Automates the software release process.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Benefits of AWS
&lt;/h2&gt;

&lt;p&gt;Scalability: Scale applications automatically based on demand.&lt;/p&gt;

&lt;p&gt;Cost Efficiency: Pay only for what you use, reducing upfront investments.&lt;/p&gt;

&lt;p&gt;Security: AWS follows industry-leading security standards.&lt;/p&gt;

&lt;p&gt;Global Reach: AWS has data centers in multiple locations worldwide.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Started with AWS
&lt;/h2&gt;

&lt;p&gt;If you're new to AWS, you can start with the AWS Free Tier, which provides limited access to various AWS services for free for 12 months. AWS also offers extensive documentation, training programs, and certification paths for developers and businesses.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;AWS is a powerful cloud platform that provides everything you need to build and manage applications at scale. Whether you’re a beginner or an experienced developer, AWS offers a flexible and cost-effective solution for all your cloud computing needs.&lt;/p&gt;

&lt;p&gt;Do you use AWS for your projects? Share your experiences in the comments below!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>aws</category>
    </item>
  </channel>
</rss>
