<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="312088" data-post-id="312088">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="champeric" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/champeric/120/28339_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  champeric
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>For all people worrying about the size of a UUID when sent as a string in a game, why would this ever be a problem? If size of updates was really a problem, you would be using some sort of binary format and not sending strings, no?</p>
<p>Anyway, what I did in a project in the past when sending UUID ids in JSON was to base64 encode them so a UUID like <code>179cb862-a623-11e8-9eae-ef59cb81df07</code> would be sent as <code>F5y4YqYjEeieru9Zy4HfBw</code>. So 22 bytes instead of 32-36 if sent directly as a string</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="312088" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/identifying-users-content-by-64-bit-int-like-twitter-vs-128-bit-uuid-string-vs-64-bit-random-string-isnt-64-bit-int-or-random-string-far-more-efficient/60505/22">Post #21</a>
	                </div>
	            </div>
              <div id="likers-container-312088" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="312088"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #21"></div>
  </section>
</div>
    <div class="postbit" id="312089" data-post-id="312089">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="adw632" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  adw632
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="sbuttgereit" data-post="17" data-topic="60505">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sbuttgereit/48/30162_2.png" class="avatar"> sbuttgereit:</div>
<blockquote>
<p>I think UUIDv7 is being worked on to land in PostgreSQL 17 (I could be very wrong about that) and I’m looking forward to it.</p>
</blockquote>
</aside>
<p>There is at least one UUID7 Postgres <a href="https://github.com/fboulnois/pg_uuidv7" rel="noopener nofollow ugc">extension</a> available already which can be used today. No need to wait for official supoort.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="312089" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/identifying-users-content-by-64-bit-int-like-twitter-vs-128-bit-uuid-string-vs-64-bit-random-string-isnt-64-bit-int-or-random-string-far-more-efficient/60505/23">Post #22</a>
	                </div>
	            </div>
              <div id="likers-container-312089" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="312089"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #22"></div>
  </section>
</div>
    <div class="postbit" id="312090" data-post-id="312090">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="adw632" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  adw632
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="derek-zhou" data-post="16" data-topic="60505">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/derek-zhou/48/19943_2.png" class="avatar"> derek-zhou:</div>
<blockquote>
<p>UUID has the same problem, by the way.</p>
</blockquote>
</aside>
<p>Well no, not all UUIDs are the same, UUID7 does offer locality of reference.</p>
<p>It’s pretty simple, use automatically incrementing database sequences unless you have to use client/distributed generation of identifiers (e.g. creating records when disconnected). For the UUID use case, UUID7 is a good choice.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="312090" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/identifying-users-content-by-64-bit-int-like-twitter-vs-128-bit-uuid-string-vs-64-bit-random-string-isnt-64-bit-int-or-random-string-far-more-efficient/60505/24">Post #23</a>
	                </div>
	            </div>
              <div id="likers-container-312090" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="312090"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #23"></div>
  </section>
</div>
    <div class="postbit" id="312623" data-post-id="312623">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="bjunc" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/bjunc/120/16781_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  bjunc
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>FWIW, I use PUID, prefixed with a 36 base timestamp (<code>Integer.to_string(36)</code>). Optionally, you can further prefix with a type abbreviation (a la Stripe). To keep the timestamp short, I use the amount of seconds since a given epoch (eg, the date the company was created). You can then “decode” a given ID, and you’ll get an approximation on when the record was created (not all IDs end up in a DB). This can be used as a cheap validation step since the date must be after the epoch.</p>
<p>So something like: <code>usr_wqa9v9WWcZidGFW</code></p>
<p>As you know, you can tweak the entropy settings when using PUID. Since the ID above is prefixed with a “seconds since epoch”, we essentially end up with a scenario where if we generate 10k IDs in one second, we have a 1-in-1 billion chance of collision – which has typically been good enough for me (but you could always increase it).</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="312623" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/identifying-users-content-by-64-bit-int-like-twitter-vs-128-bit-uuid-string-vs-64-bit-random-string-isnt-64-bit-int-or-random-string-far-more-efficient/60505/25">Post #24</a>
	                </div>
	            </div>
              <div id="likers-container-312623" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="312623"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>