Need advice about which tool to choose?Ask the StackShare community!

Cassandra

3.6K
3.5K
+ 1
507
Redis

59.4K
45.6K
+ 1
3.9K
Add tool

Cassandra vs Redis: What are the differences?

Introduction

Cassandra and Redis are both popular NoSQL databases known for their high performance and scalability. However, they have distinct differences in terms of data model, data persistence, data types, use cases, and data consistency.

  1. Data Model: Cassandra is a wide-column store database that uses a tabular format with rows and columns to store data. It supports flexible schema design and is suitable for handling large amounts of structured and unstructured data. In contrast, Redis is a key-value store database that uses a simple key-value data model, which is optimized for quick access and data retrieval based on the key.

  2. Data Persistence: Cassandra provides durable storage by persisting data on disk, allowing for high availability and fault tolerance. It also offers tunable consistency levels for reads and writes. On the other hand, Redis primarily stores data in memory for faster access, making it highly scalable and suitable for use cases that require low-latency data access. However, Redis also supports persistence to disk for data durability.

  3. Data Types: Cassandra supports a wide range of data types, including primitive types (e.g., integers, boolean), collections (e.g., lists, sets, maps), and user-defined types. This flexibility facilitates complex data modeling and query operations. In contrast, Redis has a limited set of data types, including strings, lists, sets, sorted sets, and hashes. While the simplicity of these types allows for efficient storage and retrieval, it may require additional application logic for handling complex data structures.

  4. Use Cases: Due to its scalability, fault-tolerance, and support for large data sets, Cassandra is well-suited for use cases that involve storing and processing massive amounts of data, such as big data analytics, content management systems, and time-series data. On the other hand, Redis is commonly used for caching, real-time analytics, pub/sub (publish/subscribe) messaging, and session management, where low-latency data access is crucial.

  5. Data Consistency: Cassandra uses a tunable consistency model that provides eventual consistency by default, allowing for high availability and fault tolerance. It supports configurable consistency levels for both read and write operations. Redis, on the other hand, emphasizes data consistency and provides strong consistency guarantees in a single-node configuration. However, in a distributed setup, Redis also offers eventual consistency like Cassandra.

  6. Scalability: Cassandra is designed for linear scalability, allowing it to handle large workloads by distributing data across multiple nodes. It employs a distributed architecture with built-in mechanisms for automatic data partitioning and replication. Redis, while also capable of horizontal scaling through clustering, is primarily optimized for vertical scaling on a single server by utilizing high-speed RAM and multi-core processors.

In summary, Cassandra excels in handling massive amounts of structured and unstructured data, providing high availability and fault tolerance, while Redis specializes in fast data access and low-latency use cases such as caching and real-time analytics. Both databases offer different trade-offs in terms of data model, persistence, data types, use cases, data consistency, and scalability.

Advice on Cassandra and Redis
Vinay Mehta
Needs advice
on
CassandraCassandra
and
ScyllaDBScyllaDB

The problem I have is - we need to process & change(update/insert) 55M Data every 2 min and this updated data to be available for Rest API for Filtering / Selection. Response time for Rest API should be less than 1 sec.

The most important factors for me are processing and storing time of 2 min. There need to be 2 views of Data One is for Selection & 2. Changed data.

See more
Replies (4)
Recommends
on
ScyllaDBScyllaDB

Scylla can handle 1M/s events with a simple data model quite easily. The api to query is CQL, we have REST api but that's for control/monitoring

See more
Alex Peake
Recommends
on
CassandraCassandra

Cassandra is quite capable of the task, in a highly available way, given appropriate scaling of the system. Remember that updates are only inserts, and that efficient retrieval is only by key (which can be a complex key). Talking of keys, make sure that the keys are well distributed.

See more
Pankaj Soni
Chief Technical Officer at Software Joint · | 2 upvotes · 161K views
Recommends
on
CassandraCassandra

i love syclla for pet projects however it's license which is based on server model is an issue. thus i recommend cassandra

See more
Recommends
on
ScyllaDBScyllaDB

By 55M do you mean 55 million entity changes per 2 minutes? It is relatively high, means almost 460k per second. If I had to choose between Scylla or Cassandra, I would opt for Scylla as it is promising better performance for simple operations. However, maybe it would be worth to consider yet another alternative technology. Take into consideration required consistency, reliability and high availability and you may realize that there are more suitable once. Rest API should not be the main driver, because you can always develop the API yourself, if not supported by given technology.

See more
Manage your open source components, licenses, and vulnerabilities
Learn More
Pros of Cassandra
Pros of Redis
  • 119
    Distributed
  • 98
    High performance
  • 81
    High availability
  • 74
    Easy scalability
  • 53
    Replication
  • 26
    Reliable
  • 26
    Multi datacenter deployments
  • 10
    Schema optional
  • 9
    OLTP
  • 8
    Open source
  • 2
    Workload separation (via MDC)
  • 1
    Fast
  • 886
    Performance
  • 542
    Super fast
  • 513
    Ease of use
  • 444
    In-memory cache
  • 324
    Advanced key-value cache
  • 194
    Open source
  • 182
    Easy to deploy
  • 164
    Stable
  • 155
    Free
  • 121
    Fast
  • 42
    High-Performance
  • 40
    High Availability
  • 35
    Data Structures
  • 32
    Very Scalable
  • 24
    Replication
  • 22
    Great community
  • 22
    Pub/Sub
  • 19
    "NoSQL" key-value data store
  • 16
    Hashes
  • 13
    Sets
  • 11
    Sorted Sets
  • 10
    NoSQL
  • 10
    Lists
  • 9
    Async replication
  • 9
    BSD licensed
  • 8
    Bitmaps
  • 8
    Integrates super easy with Sidekiq for Rails background
  • 7
    Keys with a limited time-to-live
  • 7
    Open Source
  • 6
    Lua scripting
  • 6
    Strings
  • 5
    Awesomeness for Free
  • 5
    Hyperloglogs
  • 4
    Transactions
  • 4
    Outstanding performance
  • 4
    Runs server side LUA
  • 4
    LRU eviction of keys
  • 4
    Feature Rich
  • 4
    Written in ANSI C
  • 4
    Networked
  • 3
    Data structure server
  • 3
    Performance & ease of use
  • 2
    Dont save data if no subscribers are found
  • 2
    Automatic failover
  • 2
    Easy to use
  • 2
    Temporarily kept on disk
  • 2
    Scalable
  • 2
    Existing Laravel Integration
  • 2
    Channels concept
  • 2
    Object [key/value] size each 500 MB
  • 2
    Simple

Sign up to add or upvote prosMake informed product decisions

Cons of Cassandra
Cons of Redis
  • 3
    Reliability of replication
  • 1
    Size
  • 1
    Updates
  • 15
    Cannot query objects directly
  • 3
    No secondary indexes for non-numeric data types
  • 1
    No WAL

Sign up to add or upvote consMake informed product decisions