[SD-945] Generating unique_id and unique_name

Refactored the code with the help of @petrjasek. Now, using Redis to generate `unique_id`.