flâneur — a map of the web's best reading

Using Snowflakes for database IDs | Matteo Contrini

matteosonoio.it · 1,534 words · saved by 1 readers

A practical example of using Snowflake for database keys without a centralized service, with .NET and Entity Framework Core.

Table of Contents Snowflakes in .NET Generating a unique instance ID Value generators vs manual generation When designing a database, the most common choice for primary keys and IDs has historically been auto-incrementing numeric values . There are several reasons why you may want to avoid that strategy: for example, avoiding leaking records count information (and the rate of new records) when IDs are exposed in URLs, avoiding the penalty of locks for generating the next number, or supporting distributed systems scenarios. Alternative solutions involve masquerading IDs (e.g. with Sqids ), usin

Explore this link on the map →

related reading