I am practicing designing an eCommerce application and I realized that if I want to display a particular product I have to do so using a unique identifier such as the product id.
I noticed a drawback. If a user bookmarks that product with the URL of lets say
example.com/product/<productId> or adds it to the cart and somewhere down the line that product is deleted from the database, the users bookmark will be useless because that
productId no longer exists and if that item was previously in the cart that will also be useless.
Can someone please suggest a way to solve this problem? Thanks.