Great point, Chinedu. I am saving the new random string in the DB table alongside the long URL. If the next request generates the same short string and finds it in the DB when querying it, it will create a new one before returning it to the client. Thoughts?
Cool, I think that makes sense. You'd probably index the random string column to enhance the performance because for every new record, you'd search for a duplicate random string.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Great point, Chinedu. I am saving the new random string in the DB table alongside the long URL. If the next request generates the same short string and finds it in the DB when querying it, it will create a new one before returning it to the client. Thoughts?
Cool, I think that makes sense. You'd probably index the random string column to enhance the performance because for every new record, you'd search for a duplicate random string.