(just started coding a year ago and am still in awe of how cool people on StackOverflow are :))
Anyhow, on my previous job we used custom UUID's for userId's in the backend instead of the automatically generated mongo Object ID's.
Back then I though it had to do with possible security issues when exposing these via URL routes. Yet I can't really figure out how that is any less secure then exposing the custom ID's. Hackers can assume my db?
Could anyone shed some light on best practices in this regard?
Thanks!
ObjectIds are not in any way less secure than, say, UUID.
They do carry a timestamp part, so if you expose the object id, clients can know the time of generation of this id. But: