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

Redis

58.4K
45K
+ 1
3.9K
RocksDB

136
290
+ 1
11
Add tool

Redis vs RocksDB: What are the differences?

Redis is an in-memory data structure store known for its speed and versatility, while RocksDB is an embedded key-value store optimized for fast storage on flash devices. Let's explore the key differences between them.

  1. Data Storage and Durability: Redis is primarily an in-memory data store, where data is stored in RAM for fast access. It supports optional persistence through snapshots or logs, but the primary focus is on fast in-memory operations. On the other hand, RocksDB is an on-disk data store, where data is stored in persistent storage. It offers durability guarantees by writing data to disk and ensures data integrity even in the face of system failures.

  2. Data Access Patterns: Redis is optimized for high-throughput, low-latency operations by keeping the entire working dataset in RAM. It provides a wide range of data structures and supports operations like string manipulation, list manipulation, and pub/sub messaging. RocksDB, on the other hand, is suitable for applications that require large-scale data persistence. It is designed to handle high write throughput and supports random reads and writes efficiently.

  3. Scalability: Redis is primarily a single-node database, but it provides replication and clustering mechanisms to achieve high availability and scale. With Redis, you can replicate data across multiple nodes and use Redis Cluster for horizontal scaling. RocksDB, on the other hand, is a library that can be used as part of a distributed database system, such as Apache HBase or Apache Cassandra, to improve their performance and durability.

  4. Data Size Limitation: Redis is limited by the amount of RAM available in a single node. If the dataset exceeds the available RAM, it will start swapping to disk, which can significantly impact performance. In contrast, RocksDB does not have a strict limitation on the dataset size since it can store data on disk. However, the performance of random reads and writes may degrade if the dataset size exceeds the available RAM for caching frequently accessed data.

  5. Consistency Guarantees: Redis provides eventual consistency, which means that after a write operation, the updates may take some time to propagate to all replicas in a replication setup. RocksDB offers strict consistency guarantees by ensuring that the data written to disk is immediately durable and consistent across all replicas.

In summary, Redis is optimized for fast in-memory operations and real-time data access, while RocksDB is designed for high-throughput data persistence and on-disk storage. Redis is suitable for applications with smaller datasets and low-latency requirements, whereas RocksDB is more suitable for applications that require scalable data storage with durability guarantees.

Get Advice from developers at your company using StackShare Enterprise. Sign up for StackShare Enterprise.
Learn More
Pros of Redis
Pros of RocksDB
  • 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
  • 5
    Very fast
  • 3
    Made by Facebook
  • 2
    Consistent performance
  • 1
    Ability to add logic to the database layer where needed

Sign up to add or upvote prosMake informed product decisions

Cons of Redis
Cons of RocksDB
  • 15
    Cannot query objects directly
  • 3
    No secondary indexes for non-numeric data types
  • 1
    No WAL
    Be the first to leave a con

    Sign up to add or upvote consMake informed product decisions

    - No public GitHub repository available -

    What is Redis?

    Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache, and message broker. Redis provides data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, geospatial indexes, and streams.

    What is RocksDB?

    RocksDB is an embeddable persistent key-value store for fast storage. RocksDB can also be the foundation for a client-server database but our current focus is on embedded workloads. RocksDB builds on LevelDB to be scalable to run on servers with many CPU cores, to efficiently use fast storage, to support IO-bound, in-memory and write-once workloads, and to be flexible to allow for innovation.

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

    Jobs that mention Redis and RocksDB as a desired skillset
    LaunchDarkly
    Oakland, California, United States
    What companies use Redis?
    What companies use RocksDB?
    See which teams inside your own company are using Redis or RocksDB.
    Sign up for StackShare EnterpriseLearn More

    Sign up to get full access to all the companiesMake informed product decisions

    What tools integrate with Redis?
    What tools integrate with RocksDB?

    Sign up to get full access to all the tool integrationsMake informed product decisions

    Blog Posts

    Jan 26 2022 at 4:34AM

    Pinterest

    Amazon EC2RocksDBOpenTSDB+3
    3
    729
    Nov 20 2019 at 3:38AM

    OneSignal

    PostgreSQLRedisRuby+8
    9
    4656
    Jun 6 2019 at 5:11PM

    AppSignal

    RedisRubyKafka+9
    15
    1651
    What are some alternatives to Redis and RocksDB?
    Memcached
    Memcached is an in-memory key-value store for small chunks of arbitrary data (strings, objects) from results of database calls, API calls, or page rendering.
    MongoDB
    MongoDB stores data in JSON-like documents that can vary in structure, offering a dynamic, flexible schema. MongoDB was also designed for high availability and scalability, with built-in replication and auto-sharding.
    RabbitMQ
    RabbitMQ gives your applications a common platform to send and receive messages, and your messages a safe place to live until received.
    Hazelcast
    With its various distributed data structures, distributed caching capabilities, elastic nature, memcache support, integration with Spring and Hibernate and more importantly with so many happy users, Hazelcast is feature-rich, enterprise-ready and developer-friendly in-memory data grid solution.
    Cassandra
    Partitioning means that Cassandra can distribute your data across multiple machines in an application-transparent matter. Cassandra will automatically repartition as machines are added and removed from the cluster. Row store means that like relational databases, Cassandra organizes data by rows and columns. The Cassandra Query Language (CQL) is a close relative of SQL.
    See all alternatives