This question already has an answer here:
I'm building an app with a Client table that lists clients and it's PK by an auto-incrementing ID field.
I need an immutable unique identifier for each client that will be used in business logic. For example client will upload a single file to an AWS S3 bucket, I want to use this ID as part of the file naming convention.
I'm hesitant about using the surrogate key as that field because I feel it would be coupling my business logic to my model layer.
The alternative would be adding a separate ID field, that's not used for foreign key relations and only used in business logic, but then I'd have to generate that myself everytime a new client is created.
Is the alternative worth doing in the long run, or am I overthinking it?