In our web application, we have the requirement to log users' activities. The user's information can be extracted from jwt token. And due to privacy reasons, the user's employee id or email are not allowed to be used as identifiers in the log.
One of the options I am thinking about is to create a user table in the persistent layer, and store the uuid identifiers there. But due to some reasons, I don't want to go down this route because the process is very complicated.
Another option I have is to encrypt the user's email and use the hex ciphertext as the identifier. That way I don't need to keep the user -> identifier mapping in the persistent layer.
What do you guys think?