Skip to main content

Introducing Redis

Welcome to the course! In this lesson, you'll get an overview of Redis, understand its core motivations, and set up your environment so you're ready for hands-on learning.

info

Whether you're new to databases or just new to Redis, this lesson will ensure you start with a solid foundation.


A Brief History of Redis

Redis was created in 2009 by Salvatore Sanfilippo (also known as antirez) to address the performance limitations of traditional databases when dealing with real-time web applications. Originally designed to support a startup project that needed fast log aggregation and real-time analytics, Redis quickly evolved into a full-featured data store.

Since then, it has become one of the most widely used NoSQL solutions in the world and is maintained by a vibrant open-source community, with commercial support available via Redis Inc.


What is Redis?

Redis (REmote DIctionary Server) is a blazing-fast, open-source, in-memory data store that can be used as a:

  • Database
  • Cache
  • Message broker

It supports key-value pairs and a wide range of data structures like:

  • Strings
  • Hashes
  • Lists
  • Sets
  • Sorted Sets (ZSets)
  • Bitmaps and more...

Why Redis Was Needed

Before Redis, most applications relied heavily on relational databases like MySQL or PostgreSQL for everything—including storing session data, caching, pub/sub systems, and real-time analytics. However, these databases were not designed for ultra-fast operations or high-throughput tasks.

Redis was introduced to solve this problem by:

  • Providing in-memory data access for faster performance
  • Supporting non-relational data structures natively
  • Offering simple and efficient commands for developers
  • Reducing the complexity of building fast, real-time applications

Redis filled the gap between high-latency relational databases and the need for instant access to structured or semi-structured data.


Key Features of Redis

  1. In-memory Storage: Redis keeps all data in memory for blazing-fast access and sub-millisecond latency. Can read/write upto 100K transactions per second.

  2. Versatile Data Structures: Redis supports multiple types of data—like strings, lists, sets, and hashes—giving you flexibility that traditional key-value stores lack.

  3. Persistence Options: Use RDB snapshots or Append Only File (AOF) logging to persist data to disk.

  4. Replication and Clustering: Redis supports replication (master-replica) and clustering for high availability and horizontal scaling.

  5. Lightweight and Fast: Redis is written in C Language and is extremely lightweight and fast—ideal for low-latency apps.


Why Use Redis? Real-World Use Cases

Here are some battle-tested use cases from companies like Twitter, GitHub, and Stack Overflow:

  • Caching: Reduce backend load and accelerate responses by caching frequently accessed data.
  • Session Store: Manage user session data in scalable web apps.
  • Leaderboards: Real-time scoring with sorted sets (e.g., gaming platforms).
  • Pub/Sub Systems: Build real-time notification or chat systems.
  • Task Queues: Simple producer-consumer queues without external tooling.
tip

Want to see it in action? Try using redis-cli to SET and GET keys after installing Redis.