Skip to content

Latest commit

 

History

History
81 lines (70 loc) · 1.35 KB

README.md

File metadata and controls

81 lines (70 loc) · 1.35 KB

TinyUrl with Redis

This project is aimed to practice CRUD operations using Redis. It involves setting up and interacting with a TinyURL service, where Redis serves as the backend for storing these links.

Setup Instructions

Build and run Docker containers

sudo docker compose build
sudo docker compose up -d

Access Redis inside the Docker

sudo docker exec -it tinyurl-redis sh

Start the Redis CLI

redis-cli

Basic Redis commands

Check connection

ping

Key-value Operations

  • check if a key exists:
    EXISTS key
  • set a key-value:
    SET key value
  • get value by key:
    GET key
  • delete key:
    DEL key
  • show all keys:
    KEYS *
  • set Expiry:
    EXPIRE key seconds
  • check time-to-live:
    TTL key

Hash Operations

  • set a field in a hash:
    HSET key field value
  • get a field value from a hash:
    HGET key field
  • retrieve all fields and values from hash:
    HGETALL key

Flush All Data

  • clear everything:
    FLUSHALL

Additional resource (Russian)