-
Notifications
You must be signed in to change notification settings - Fork 18
SequentialGuid
sdrapkin edited this page Mar 26, 2017
·
10 revisions
SequentialGuid.CreateSequentialGuid() located in TinyORM.Helpers creates a System.Guid that is greater than any GUID previously generated by this function on a current WindowsOS since that WindowsOS was started. After restarting WindowsOS, the GUIDs can start again from a lower range, but they will still be globally unique.
TinyORM's sequential .NET GUIDs have the following advantages over other COMBined GUID approaches:
- As effective as TSQL-based
NEWSEQUENTIALIDin avoiding GUID-based index fragmentation and page cache pressure. - Extremely fast.
CreateSequentialGuid()runtime cost is similar to callingGuid.NewGuid()twice. - Provides 64 bits of cryptographically-strong entropy/randomness.
- Google required 2+ years and 2^63 computations to find a SHA1 collision.
- Captures creation DateTime with ~7min accuracy.
- Creation DateTime can be extracted with
SequentialGuid.ExtractDateTimeUtc(guid).
- Creation DateTime can be extracted with
- Works perfectly across multiple Threads, AppDomains, and Processes.
- No synchronization costs are incurred, since all synchronization happens at the WindowsOS level.
Copyright (c) 2016-2022 Stan Drapkin