Comments on: Working With Guid in C# https://code-maze.com/csharp-guid-class/ Learn. Code. Succeed. Wed, 08 Nov 2023 14:15:42 +0000 hourly 1 https://wordpress.org/?v=6.7.5 By: Neal W. https://code-maze.com/csharp-guid-class/#comment-8482 Mon, 19 Jun 2023 12:59:52 +0000 https://code-maze.com/?p=91660#comment-8482 While GUIDs are good for distributed systems, GUIDs generated by .NET are not. The GUIDs generated by .NET uses UUID v4 and is completely random. As a result, two workers within the same distributed system that are solely using Guid.NewGuid() could generate the same GUID and cause a collision. Even if you could guarantee collisions wouldn’t happen, random GUIDs present other issues, such as fragmentation when used as keys. You would either need to introduce a dedicated mechanism into your system that all system differ to for GUID generation or use another type altogether, like FlakeId, that still allows ID generation to be local, but guarantees uniqueness.

]]>