Skip to content

Redis Cache Management is a powerful and efficient caching solution designed to optimize data retrieval and application performance by leveraging the Redis in-memory data structure store. This component provides a streamlined approach to managing cached data, reducing latency, and minimizing load on backend databases or services.

Notifications You must be signed in to change notification settings

vedantwork/Redis-Cache-Management

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

7 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

REDIS CACHE MANAGEMENT

Optimized caching solution for Django applications using Redis

๐Ÿ“— Table of Contents

  • ๐Ÿ“– About the Project
  • ๐Ÿ‘€ Overview
  • ๐Ÿ›  Built With
    • ๐Ÿ”ฅ Tech Stack
  • ๐Ÿ”‘ Key Features
  • ๐Ÿ’ป Getting Started
    • ๐Ÿ“œ Prerequisites
    • โš™๏ธ Setup
    • โ–ถ๏ธ Run Application
    • ๐Ÿ•น๏ธ Usage
  • ๐Ÿ‘ฅ Author

๐Ÿ“– About the Project

Redis Cache Management is a backend microservice integrated into a Django application, designed to optimize data retrieval and application performance by leveraging Redis as an in-memory data store. This service streamlines cache management, reduces latency, and minimizes load on backend databases.

๐Ÿ‘€ Overview

  • The service provides methods to store (setredisdata), retrieve (getredisdata), and delete (deleteredisdata) cached data in Redis.
  • It handles caching efficiently, storing responses for up to 45 days to reduce the need for repeated data fetching from the backend.

๐Ÿ›  Built With

  • Python
  • Django
  • Redis
  • JSON

๐Ÿ”ฅ Tech Stack

  • Django
  • Redis

๐Ÿ”‘ Key Features

  • Efficient Caching: Caches data for up to 45 days to reduce backend load.
  • Data Retrieval: Retrieves data from the cache, minimizing response time.
  • Cache Management: Provides methods to set, get, and delete cache entries.

๐Ÿ’ป Getting Started

๐Ÿ“œ Prerequisites

To use this service, you will need:

  • Python 3.x
  • Django
  • Redis server installed
  • Required Python libraries: django-redis, json.

โš™๏ธ Setup

  1. Clone the repository:

    git clone https://github.com/your-repo/redis-cache-management.git
  2. Navigate to the project directory:

    cd redis-cache-management
  3. Install the required dependencies:

    pip install -r requirements.txt
  4. Configure Redis in Django:

    In your Django project's settings.py, add the following configuration:

    CACHES = {
        "default": {
            "BACKEND": "django_redis.cache.RedisCache",
            "LOCATION": "redis://127.0.0.1:6379/1",
            "OPTIONS": {
                "CLIENT_CLASS": "django_redis.client.DefaultClient",
            }
        }
    }
  5. Start the Redis server:

    sudo service redis-server start

โ–ถ๏ธ Run Application

  1. Run the Django development server:
    python manage.py runserver

๐Ÿ•น๏ธ Usage

  1. Set Data: Use the setredisdata method to store data in Redis.
  2. Get Data: Use the getredisdata method to retrieve cached data.
  3. Delete Data: Use the deleteredisdata method to delete cache entries as needed.

Example Usage:

To set data in the cache, you can send a POST request to the setredisdata endpoint with the following payload:

{
    "key": "unique_key",
    "value": {
        "data": "your_data"
    }
}

About

Redis Cache Management is a powerful and efficient caching solution designed to optimize data retrieval and application performance by leveraging the Redis in-memory data structure store. This component provides a streamlined approach to managing cached data, reducing latency, and minimizing load on backend databases or services.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages