Pros and cons of Database identity
Nice to work with in URLs
Limiting, as they require a trip to the database, which precludes some patterns
Can be tricky to return IDs when inserting in some cases (EF Core etc solves this)
Can cause contention in high throughput scenarios. May make scaling out impossible
In an earlier column,
I suggested that one way to speed up your application was to reduce the
trips you make to your database, specifically by avoiding calling a
stored procedure multiple times. To enable that, I showed how to pass a
stored procedure multiple parameter values in a single call and then,
inside the stored procedure, load the parameters into a table where they
could be integrated with other SQL statements.