<?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: Louis Franck M</title>
    <description>The latest articles on DEV Community by Louis Franck M (@louis_franckm_2c5016864a).</description>
    <link>https://dev.to/louis_franckm_2c5016864a</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3816310%2F63881f18-a3bc-4511-aaee-e948cc53bdac.png</url>
      <title>DEV Community: Louis Franck M</title>
      <link>https://dev.to/louis_franckm_2c5016864a</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/louis_franckm_2c5016864a"/>
    <language>en</language>
    <item>
      <title>Designing a Structured UUID v8 Generator for Distributed Systems (EUID)</title>
      <dc:creator>Louis Franck M</dc:creator>
      <pubDate>Tue, 10 Mar 2026 08:24:49 +0000</pubDate>
      <link>https://dev.to/louis_franckm_2c5016864a/designing-a-structured-uuid-v8-generator-for-distributed-systems-euid-2ena</link>
      <guid>https://dev.to/louis_franckm_2c5016864a/designing-a-structured-uuid-v8-generator-for-distributed-systems-euid-2ena</guid>
      <description>&lt;p&gt;Unique identifiers are fundamental to modern software systems.&lt;br&gt;
Databases, APIs, microservices, and event-driven architectures all rely on them.&lt;/p&gt;

&lt;p&gt;Most developers simply use random UUIDs. But at scale, randomness can introduce limitations.&lt;/p&gt;

&lt;p&gt;This article introduces &lt;strong&gt;EUID (Evolutionary Unique Identifier)&lt;/strong&gt; — a structured UUID v8 generator designed for distributed systems and database-friendly indexing.&lt;/p&gt;


&lt;h1&gt;
  
  
  The Problem With Traditional UUIDs
&lt;/h1&gt;
&lt;h2&gt;
  
  
  UUID v4
&lt;/h2&gt;

&lt;p&gt;The most commonly used UUID is &lt;strong&gt;version 4&lt;/strong&gt;, which is completely random.&lt;/p&gt;

&lt;p&gt;While this guarantees uniqueness, it has several drawbacks in large systems:&lt;/p&gt;

&lt;p&gt;• no time ordering&lt;br&gt;
• poor database index locality&lt;br&gt;
• opaque identifiers&lt;br&gt;
• no infrastructure awareness&lt;/p&gt;

&lt;p&gt;When UUID v4 values are used as database primary keys, inserts become effectively random, which can fragment indexes and reduce performance.&lt;/p&gt;


&lt;h2&gt;
  
  
  UUID v7
&lt;/h2&gt;

&lt;p&gt;The newer &lt;strong&gt;UUID v7&lt;/strong&gt; specification introduces &lt;strong&gt;time ordering&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It includes:&lt;/p&gt;

&lt;p&gt;• a 48-bit timestamp&lt;br&gt;
• random entropy bits&lt;/p&gt;

&lt;p&gt;This greatly improves database performance because records are inserted in roughly chronological order.&lt;/p&gt;

&lt;p&gt;However, UUID v7 remains intentionally random beyond the timestamp.&lt;/p&gt;

&lt;p&gt;In some distributed systems, it can be useful for identifiers to contain &lt;strong&gt;information about the infrastructure that generated them&lt;/strong&gt;.&lt;/p&gt;


&lt;h1&gt;
  
  
  A Different Approach: Structured Identifiers
&lt;/h1&gt;

&lt;p&gt;Instead of relying on randomness, some distributed systems prefer &lt;strong&gt;structured identifiers&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Examples include:&lt;/p&gt;

&lt;p&gt;• snowflake-style identifiers&lt;br&gt;
• sharded database IDs&lt;br&gt;
• topology-aware identifiers&lt;/p&gt;

&lt;p&gt;The core idea is simple:&lt;/p&gt;

&lt;p&gt;An identifier can encode &lt;strong&gt;where it was generated&lt;/strong&gt;, not just &lt;strong&gt;when&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This can help with:&lt;/p&gt;

&lt;p&gt;• debugging distributed systems&lt;br&gt;
• tracing requests&lt;br&gt;
• understanding data origin&lt;br&gt;
• operational observability&lt;/p&gt;

&lt;p&gt;This philosophy inspired the design of &lt;strong&gt;EUID&lt;/strong&gt;.&lt;/p&gt;


&lt;h1&gt;
  
  
  Introducing EUID
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;EUID (Evolutionary Unique Identifier)&lt;/strong&gt; is a &lt;strong&gt;UUID v8-compatible identifier&lt;/strong&gt; that combines:&lt;/p&gt;

&lt;p&gt;• time ordering&lt;br&gt;
• topology encoding&lt;br&gt;
• deterministic generation&lt;/p&gt;

&lt;p&gt;Unlike random UUIDs, EUID identifiers are &lt;strong&gt;fully decodable&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;From a single identifier you can determine:&lt;/p&gt;

&lt;p&gt;• when it was generated&lt;br&gt;
• which region generated it&lt;br&gt;
• which shard handled it&lt;br&gt;
• which node created it&lt;br&gt;
• the sequence number&lt;/p&gt;


&lt;h1&gt;
  
  
  EUID Bit Layout
&lt;/h1&gt;

&lt;p&gt;EUID uses the 128-bit UUID structure with the following layout:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Bits&lt;/th&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;48&lt;/td&gt;
&lt;td&gt;Timestamp (milliseconds)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;Version (UUID v8)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;Region&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;Shard&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;Variant&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;14&lt;/td&gt;
&lt;td&gt;Node&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;48&lt;/td&gt;
&lt;td&gt;Sequence&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;h3&gt;
  
  
  Timestamp
&lt;/h3&gt;

&lt;p&gt;A 48-bit millisecond timestamp ensures &lt;strong&gt;time ordering&lt;/strong&gt; and database-friendly indexing.&lt;/p&gt;
&lt;h3&gt;
  
  
  Region / Shard / Node
&lt;/h3&gt;

&lt;p&gt;These fields encode &lt;strong&gt;distributed topology&lt;/strong&gt;, allowing identifiers to carry infrastructure metadata.&lt;/p&gt;
&lt;h3&gt;
  
  
  Sequence
&lt;/h3&gt;

&lt;p&gt;Each node maintains a &lt;strong&gt;monotonic sequence counter&lt;/strong&gt; to generate multiple identifiers within the same millisecond.&lt;/p&gt;


&lt;h1&gt;
  
  
  Operational Observability Through Identifiers
&lt;/h1&gt;

&lt;p&gt;One interesting side effect of structured identifiers is &lt;strong&gt;operational observability&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In many systems, identifiers are opaque.&lt;br&gt;
When something fails in production, engineers often need to query logs or databases just to determine &lt;strong&gt;where an identifier originated&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Because EUID embeds topology information directly in the identifier, operational metadata can be extracted immediately.&lt;/p&gt;

&lt;p&gt;From a single identifier you can determine:&lt;/p&gt;

&lt;p&gt;• when it was generated&lt;br&gt;
• which region produced it&lt;br&gt;
• which shard handled the request&lt;br&gt;
• which node created the identifier&lt;/p&gt;

&lt;p&gt;Instead of being black boxes, identifiers become &lt;strong&gt;structured infrastructure signals&lt;/strong&gt;.&lt;/p&gt;


&lt;h1&gt;
  
  
  Example Usage
&lt;/h1&gt;

&lt;p&gt;Generating an identifier in Java:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;EuidGenerator&lt;/span&gt; &lt;span class="n"&gt;generator&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;EuidGenerator&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

&lt;span class="no"&gt;UUID&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;generator&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;generate&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"EUID: "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;019caad2-a445-8083-8005-000000000011
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The identifier can then be decoded:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;DecodedEuid&lt;/span&gt; &lt;span class="n"&gt;decoded&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;EuidDecoder&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;decode&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;decoded&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getInstant&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;decoded&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getRegion&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;decoded&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getShard&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;decoded&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getNode&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;decoded&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getSequence&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Base58 Encoding
&lt;/h1&gt;

&lt;p&gt;EUID also supports &lt;strong&gt;Base58 encoding&lt;/strong&gt;, which produces shorter and more human-friendly identifiers.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1CYctoRWaz5VGXwscmiovG
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Base58 avoids visually confusing characters such as:&lt;/p&gt;

&lt;p&gt;• 0 and O&lt;br&gt;
• l and I&lt;/p&gt;

&lt;p&gt;This makes identifiers easier to use in URLs, logs, and APIs.&lt;/p&gt;




&lt;h1&gt;
  
  
  When Should You Use EUID?
&lt;/h1&gt;

&lt;p&gt;EUID can be useful when you need:&lt;/p&gt;

&lt;p&gt;• time-ordered identifiers&lt;br&gt;
• database-friendly indexing&lt;br&gt;
• infrastructure-aware IDs&lt;br&gt;
• deterministic identifier structure&lt;/p&gt;

&lt;p&gt;If you only need a random identifier, &lt;strong&gt;UUID v4 or UUID v7 may already be sufficient&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;EUID is designed for systems where &lt;strong&gt;traceability and infrastructure awareness are important&lt;/strong&gt;.&lt;/p&gt;




&lt;h1&gt;
  
  
  Open Source Project
&lt;/h1&gt;

&lt;p&gt;The EUID library is open source and available on Maven Central.&lt;/p&gt;

&lt;p&gt;GitHub repository:&lt;/p&gt;

&lt;p&gt;[&lt;a href="https://github.com/louis-franck-moussima/euid-java" rel="noopener noreferrer"&gt;https://github.com/louis-franck-moussima/euid-java&lt;/a&gt;]&lt;/p&gt;

&lt;p&gt;The project includes:&lt;/p&gt;

&lt;p&gt;• a high-performance generator&lt;br&gt;
• Base58 encoding support&lt;br&gt;
• full decode capability&lt;br&gt;
• unit tests and stress tests&lt;/p&gt;




&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;Identifiers are often treated as opaque random values.&lt;/p&gt;

&lt;p&gt;But in distributed systems, identifiers can carry &lt;strong&gt;valuable structural information&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;EUID explores an alternative approach using &lt;strong&gt;UUID v8 with deterministic topology encoding&lt;/strong&gt;, producing identifiers that are:&lt;/p&gt;

&lt;p&gt;• time ordered&lt;br&gt;
• infrastructure aware&lt;br&gt;
• database friendly&lt;br&gt;
• fully decodable&lt;/p&gt;

&lt;p&gt;If you are interested in the project, feel free to explore the repository or try the library in your own systems.&lt;br&gt;
Feedback and discussion are always welcome you can leave questions in comments.&lt;/p&gt;

</description>
      <category>java</category>
      <category>distributedsystems</category>
      <category>opensource</category>
      <category>backend</category>
    </item>
  </channel>
</rss>
