jhtodd / sequentialguid Goto Github PK
View Code? Open in Web Editor NEWThis is an example project to demonstrate the creation of sequential GUID values for use as primary keys in database tables under various database types.
This is an example project to demonstrate the creation of sequential GUID values for use as primary keys in database tables under various database types.
Hi,
First i have to thank you about the great tutorial and Example, I like them too much..
I have a problem not in your coding but i need your expert answer / idea
I have an application sql server 2014 Database on remote server and i have multiple clients works with LocalDB mdf and i'm searching for the best solution to implement Microsoft Sync Framework between the clients and the server with avoiding Duplicate and similar issues.
I intend to use your way to generate a GUIDs cause i found it genius but my main problem is in PK and FK relationships.
As an example from old database
1- Table Customers have
[id] which is PK and identity
2- Table Orders
[id] which PK and identity
[customerID] FK to table Customers
How can i solve this issue and Re-Design tables to allow sync and not lose the benefits of using PK and FK in searching, indexing etc...
I really appreciate any help here
When I generate several Guids, with SequentialAsString type, in a 'for' loop
for (int i = 0; i < 20; i++)
System.Console.WriteLine(SeqGuid.NewGuid(SequentialGuidType.SequentialAsString));
it gives the following guids:
39c27317-3f03-3ed1-2a27-d0e4b21bc541
39c27317-3f04-c80a-a605-59a55e951bfa
39c27317-3f04-b3dd-8464-7d229af028bc
39c27317-3f04-8fe5-fe83-dbcfe4067dc1
39c27317-3f04-6f10-84dd-75d5d0e89aa7
As you can see third and fourth Guid does not look sequential ?
I am using this for PostgreSql.
Now from what I understand first 2 block shold be sequential but here they are the same.
Obviously generator is using some time value and this is created in milliseconds that it gives the same result.
So is this a valid SeqGuid, if not can it be fixed ?
One way I could fix it is using some sleep method in loop, what do you think?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.