Guids as primary keys #795
symbiogenesis
started this conversation in
Ideas
Replies: 1 comment 2 replies
-
Wow. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
So I was using Guids as primary keys via EF 3.1 backed by Azure SQL Server and SQLite in a Xamarin.Forms app that was deployed on UWP, iOS, and Android.
This was causing some unique constraint collisions when doing syncing with DMS
I was able to solve this by ripping out all of the Guid primary and foreign keys, and switching them to ULIDs and storing them as byte arrays via a ValueConverter. There are at least 3 implementations of ULID for .NET. I haven't seen any problems since.
I am forced to use .NET Standard 2.0 because that is all that UWP supports.
I don't know if more recent .NET versions handle Guids better, and of course Mono is involved on the mobile platforms.
But it might be worth cautioning against Guids as primary keys.
Beta Was this translation helpful? Give feedback.
All reactions