A better example would be an object Userthat needs to be saved. I have the following candidates for assigning a unique identifier to a user:
- Assign keys provided by the back-end (NDB, MySQL, etc.).
- Manual work with a unique identifier using some service (for example, a system clock).
- Properties such as emailId.
Taking a simple example of a detailed view, we often have a detailed view of a user of the type some/path/users/{user_id}, if we store emailId as a unique identifier, then there is a chance that the user will one day be able to change his email identifier and it will break.
Which approach is better for identifying the same object?
source
share