3 ms·
You would run into this problem even if you aren't using the database number as your primary key. We don't want to force the user to generate the incident handl
by advisedwang 5y ago
You would run into this problem even if you aren't using the database number as your primary key. We don't want to force the user to generate the incident handle (slowing down incident creation) so a sequence of number is useful.
Generating the sequence in application logic can make it challenging to guarantee we don't duplicate numbers if two requests come in at once (you don't want locks/global synchronous state in the application if you can avoid it), so having the database generate them is a good fit.