
Learn how Redisai speeds Django apps with real-time features. Explore fundamentals of keys, strings, hashes, lists, and sets, and build real-world projects using Docker, Rest Framework, and Django Ninja.
Kick off module two by laying the practical foundation for working with readings, introducing Redis, and using Docker to set up and manage a Reddit container.
Learn how Redis, an in-memory, high-performance key-value store, uses simple structures like strings, lists, and sets for ultra-fast data access, with optional persistence for durability.
Establish a clean, reproducible development environment with Docker, install Docker Desktop, and learn Docker images, containers, and volumes to run a Redis container from Docker Hub with persistent data.
Create and run a redisai container with docker compose, exposing port 6379, using an alpine-based image, and manage it in detached mode for easy development environments.
Set up a redesigned site container with Docker and connect it to a running Redisai server to manage and inspect Redisai data using Redisai Insight.
Explore the fundamentals of Redis strings, including setting values with set, understanding keys and naming patterns, and managing expiration with expire and TTL, then practice append, length, and counters.
Learn to store string values in Redis with the set command and variants, including NX and XX, and apply TTL with EX or PX for time-bound keys.
Design clear Redis keys with meaningful names, colon separators, and prefixes to prevent data collisions in a single global namespace and enable patterns and scan for efficient lookups.
Learn how to manage key lifetimes in Redis by using expire, TTL, and persist, with practical examples of setting, checking, updating, and removing expirations.
Learn how to retrieve strings from Redis using get and mget, handle missing keys with nil, and check existence with exists, building a practical foundation for real-time data access.
Learn how to manipulate Redis strings with append and measure length using STRLEN, initialize or extend values, and understand byte-based length and non-existent key handling.
Learn to use Redis strings as simple counters with incr and decr to track page views and other real-time metrics, including atomic operations, type checks, exists, and Lua scripts.
Explore Redis hash structures to store multiple field value pairs under a key, enabling object-like data, and learn creating, reading, updating, and deleting hashes with key naming and expiry times.
Learn to store multiple related values under a single key with Redis hashes, grouping fields and values like user details. Retrieve or update specific fields without affecting others, ensuring efficiency.
Learn to create and manage redis hashes with hset, storing related fields under a single key like user 1002, where name, email, and age are stored as strings.
Read data from a Redis hash with hget, hmget, and hgetall; exists, hexists, and hlen verify keys, fields, and counts; nil or null signals missing data.
Update and overwrite existing hash fields with hset, replacing values silently without prompts. Add new fields as needed and verify updates with get all to ensure accuracy.
Delete specific fields with hdel and remove entire hashes with del in Redis, preserving data while auto-deleting empty hashes and guarding against typos.
Adopt consistent, human-readable hash key naming with metadata and key-level expiry in Redis to improve traceability, performance, and memory management for sessions, caches, and user activity.
Master Redis hash operations with safe, efficient patterns, explore pipelines for batching commands, and use transactions for atomic hash updates, choosing the right approach for your real-time projects.
Use Redis pipelines to batch commands, especially when updating many hash fields, to reduce network round trips and lower latency, while preserving command order.
Learn how Redis transactions use multi and exec to group commands, execute in order, prevent interference, and discard to cancel, contrasting with pipelining for speed.
Build a session-based cart system with redis, using django and python to create endpoints, serializers, and views for real-time cart operations via restful api patterns.
Spin up a clean Django environment with Docker and PostgreSQL, seed basic models, expose the first API with Django Rest Framework, and verify with swagger as groundwork for Redisai.
Containerize PostgreSQL in an isolated docker service, configure username, password, and inventory database, and map port 5432. Build and run with docker compose up -d using the alpine image.
Learn to containerize a Django app with Docker by building a Python Alpine-based image, installing dependencies from requirements.txt, and wiring Django to Redis and PostgreSQL via Docker Compose.
Initialize a Django project inside a dockerized environment, connect it to Postgres, and set up an app with a local bind mount for seamless development.
Define django models for products and category tables, including a self-referential category field, __str__ method, and product foreign key, plus a decimal price field with 10 digits and 2 decimals.
Automate seeding a Postgres database for a Django project by initializing containers with an init script and csv fixtures, using fake migrations and Docker Compose for a ready-to-run setup.
Create your first api endpoint with drf by building a product list view and serializer, exposing it via urls to return json for the client.
Learn to test Django Rest Framework APIs with swagger UI using DRF spectacular, configure the OpenAPI schema, and interact with Redis-enabled endpoints through the interactive docs.
Integrate Redis into the Django project to manage a session-based shopping cart using an in-memory store, storing items, updating quantities, and applying promo codes across the cart lifecycle.
Recap how to initialize the project from source and run docker compose to start Redis, Postgres, and Django containers, then build a Redis-enabled shopping cart.
Map each client request to a Redis cart using django sessions, storing the session id in a cookie and forming cart keys like 'cart context:<session_id>'.
Add items to the cart using a Django DRF API backed by Redis hashes, associating cart data with session IDs to support anonymous and logged-in users.
Implement a get cart endpoint to retrieve a user's shopping cart from Redis using a session ID, serialize items with DRF, and return JSON via a Django API.
Implement remove from cart via a POST endpoint, validate a remove-from-cart serializer with product id, identify the cart by session id, and delete the product field from the Redis hash.
Implement a clear cart feature by deleting the cart Redis hash with the session ID, via a new delete method on the cart view, returning a 204 or 200 response.
Increment and decrement product quantities in the shopping cart using an api endpoint, with front end input or quantity buttons, updating a Redis hash cart via json data.
Set a specific quantity for a product in the cart by posting product id and quantity, using the set quantity serializer and a dedicated API view.
Learn how to implement a cart promo code feature with redis strings, a promo serializer, and endpoints to set and get the promo code tied to the session cart.
Validate each cart item against the latest data stored in Postgres to ensure Redis-backed cart reflects accurate names and prices before checkout.
Learn to auto expire inactive carts with Redis TTL by setting 30 minutes for cart and promo keys and refreshing TTL on each interaction.
Refine Redis data handling by structuring cart data into dedicated hashes, optimize commands with pipelines, and ensure atomic operations while preparing for asynchronous readings in Django.
Refactor the Redis cart to use separate quantity and details hashes, enabling atomic quantity updates with hash increment, and merge data from both hashes for cart retrieval.
Learn how Redisai pipelines batch cart operations to reduce network round trips and speed up updates, while understanding when to use pipelines versus atomic updates and avoiding race conditions.
Learn to enforce cart consistency with atomic Redis updates by using watch, multi, and exec, implementing a five-attempt retry to safely handle concurrent updates.
Build on strings and hashes from the first project by mastering lists and sets in Redis. Learn persistent patterns and prepare for the next project.
Explore how redis lists store strings in insertion order and support left or right pushes. Create, view, and update lists with push and lrange, noting zero-based indexing and duplicates.
Learn how LPUSH and RPUSH insert elements at the left or right of a Redis list, alter order, verify with LRANGE, and create the list if it doesn't exist.
Learn to read and remove items from Redis lists with lrange, lpop, and rpop. See how leftmost and rightmost items are popped, and that empty lists disappear.
Learn how blocking list operations in Redis wait for data, using BLPOP or BRPOP to pause until a value arrives, enabling efficient multi-list queues and timeouts.
Learn to trim Redis lists in place with LTRIM by keeping only a specified start to stop range, including negative indices, to control memory and handle edge cases.
Explore Redis sets and learn how to add, remove, and check values. Understand handling multiple sets, with simple comparisons and combinations, for clear, practical use of sets.
Explore Redis sets as a fast, unique collection of strings that ignores duplicates and lacks order, contrasting them with lists and highlighting quick membership checks, aided by hash-table style performance.
Master membership checks in Redis sets with SISMEMBER, returning 1 if a value exists and 0 otherwise, noting non-existent sets are treated as empty.
learn how to count set members in redis with scard, returning the set size or zero for missing keys, and handling type errors when used on non-set keys.
Learn to combine, intersect, and differ sets with s union, s inter, and s diff, yielding unique elements and overlaps for real-time analytics and tagging.
Build a high performance polling system with Django, Ninja, and Redis, backed by Postgres; implement vote tracking, rate limiting, and real-time metrics, with async APIs and a live-updating front-end view.
Set up a clean Django project and Django Ninja foundation, define poll models, and build a fast API to manage polls before adding real-time features and redisai integration.
Set up a Postgres database inside a docker container with docker compose, move credentials to an env file, and start and inspect the poll database using docker compose up.
Containerize a Django app with Docker and docker-compose, create the project in the container, configure env vars via an env file, and run with uvicorn, linking Postgres and Redisai.
Design and migrate a Django poll model with a json field in Postgres, register it in the admin, automate migrations and admin setup in Docker, and collect static files.
Learn to build a real-time API endpoint with Django Ninja that reads poll data from the database, returns JSON, and tests it via Swagger UI, using async-aware patterns.
Phase 2 builds a polling system with core Django and Django Ninja setup, creating polls and votes endpoints, while using RedisAI to track counts, prevent duplicates, and enforce interaction rules.
Create a Django Ninja api endpoint to submit polls via post, validating with create poll schema, saving asynchronously, and returning poll out schema (id, question, text) with 201/400.
Design and implement a vote API endpoint with a path parameter poll id that uses Redis to increment counts in real time, with poll and option validation and error handling.
Learn how to prevent authenticated users from voting more than once per poll by tracking their unique IDs in Redis using a voted users set and atomic checks.
Explore IP and cookie based vote limiting in Redis-backed real-time polls, using lightweight rate limiting to prevent anonymous duplicates without requiring user accounts.
Track a poll's recent votes by storing a rolling history in a Redis list, capturing user id, IP, and option, trimmed to the latest 100 entries for easy analysis.
learn to implement ip-based rate limiting for poll submissions with Redis by setting a five-second expiry key using set with nx, and checking is_rate_limited to block rapid repeats.
Add is_active and expires_at fields to polls in Django, enforce availability in voting endpoints, and manage poll lifecycles with manual or automated expiry.
Phase three refines how we use readings to support advanced behaviors in the poll system, optimizing reads with atomic pipelines and caching, and boosting a live admin view.
Learn how to optimize Redis interactions with pipelines and atomic transactions to update vote counts, log activity, and trim history in one efficient, error-free operation.
Build a basic poll results endpoint that reads vote counts from redis and returns poll data from the database. Expose totals and options for real-time reporting.
Learn to implement on-demand caching for poll results with Redis, cache results for one hour, and invalidate the cache on new votes to balance speed and accuracy.
Create a lightweight live poll view inside the Django admin using a custom change form and JavaScript polling that auto-refreshes every few seconds from a results API.
Redis is one of the most powerful tools in modern web development — known for blazing-fast performance, real-time capabilities, and a simple yet flexible data model. Whether you're building e-commerce carts, analytics dashboards, or scalable backend systems, Redis can dramatically improve your app’s responsiveness and architecture.
Who This Course Is For:
Python or Django developers looking to add Redis to their tech stack for performance and scalability
Backend engineers who want hands-on experience with Redis in real-world projects
Web developers aiming to build fast, real-time features like session carts, live analytics, or rate-limited APIs
Students or bootcamp grads who want practical Redis experience to stand out in job applications
DevOps or full-stack developers interested in Docker-based workflows and caching strategies
Anyone curious about Redis who wants to go beyond tutorials and apply it in full-stack Django apps
In this hands-on course, you’ll go beyond theory to build full-stack projects that integrate Redis with Python and Django. You’ll start with the fundamentals — keys, strings, hashes, lists, sets, pipelines, and transactions — all with practical coding exercises. From there, you’ll dive into real-world applications:
Project 1: A session-based shopping cart using Django and Redis for fast session management, cart persistence, quantity tracking, and TTL-based auto-expiry.
Project 2: A real-time analytics voting app built with Django Ninja, using Redis for vote counting, rate limiting, and live results in the Django Admin.
* More projects will be added in the future.
The course uses Docker to ensure smooth local development and RedisInsight for better data visualization.
Whether you’re a backend developer, Python enthusiast, or Django pro, this course gives you the Redis foundation and confidence to build high-performance, scalable applications — fast.