this is a short lived app with no db and only keeping Mapping of original->shorten in memory. If I have following scala method which gets called everytime, to generate a value (which is then used as a shorten URL) and then kept in a Map(originalUrl->shortenUrl. choosing from 4.2 billion(Integer.MAX_VALUE) possibles with redix 36. Any downside of the approach for generating unique shorten URL values if called in a multi-threaded environment?
def randomUrl: String = {
Integer.toString(new Random().nextInt(Integer.MAX_VALUE), 36)
}