loading...

Discussion on: Build Url Shortener API In Django - Redis

Collapse
aligoren profile image
Ali GOREN

Thanks. It looks very good <3. For improvement;

You can find count for all possibilities to hash length. Because you can check it like that;

if n_possible_count == redis_n_count:
    n_possible_count += 1

So you avoid duplicates. Of course, you should check the hash either exists in the database or not.

Collapse
magesh236 profile image
Mageshwaran Author

Sure, we can use incremental value. Instead of checking the hash is already exists.
This will improve the performance.