DiceDB
DiceDB is an open-source, reactive in-memory database optimized for modern hardware, outperforming Redis in throughput and latency, and encouraging community contributions under the BSD 3-Clause License.
Read original articleDiceDB is an open-source, fast, reactive, in-memory database designed for modern hardware. It features query subscriptions that allow it to push result sets to users instead of requiring them to poll for changes. This design enhances performance, achieving higher throughput and lower median latencies, making it suitable for contemporary workloads. Performance benchmarks on a Hetzner CCX23 machine with 4 vCPUs and 16GB RAM show that DiceDB outperforms Redis in several metrics, including throughput (15,655 ops/sec compared to Redis's 12,267 ops/sec) and latency for GET and SET operations. DiceDB's GET and SET p50 latencies are 0.227 ms and 0.230 ms, respectively, while Redis's are 0.270 ms and 0.272 ms. The database is fully optimized to utilize the underlying hardware effectively, ensuring better performance. DiceDB is licensed under the BSD 3-Clause License, encouraging community contributions to enhance its capabilities. The project aims to provide a user-friendly experience for developers looking to implement a reactive database solution.
- DiceDB is an open-source, reactive in-memory database optimized for modern hardware.
- It features query subscriptions, allowing real-time updates without polling.
- Performance benchmarks show DiceDB outperforms Redis in throughput and latency.
- The database is designed for high throughput and efficient hardware utilization.
- Community contributions are encouraged under the BSD 3-Clause License.
Related
The Ultimate Database Platform
AverageDB, a database platform for developers, raised $50 million in funding. It offers speed, efficiency, serverless architecture, real-time data access, and customizable pricing. The platform prioritizes data privacy and caters to diverse user needs.
Why is single threaded Redis so fast
Redis is a high-performance, in-memory key-value database that achieves around 100,000 queries per second, utilizing a single-threaded architecture, efficient data structures, and non-blocking I/O for optimal performance.
The Fastest Redis Ever
Redis 8.0-M02 introduces performance enhancements, reducing latency for key commands, adding scaling features, and supporting high-performance vector searches. It is available for download as Docker images.
Use Cases for ChDB, a Powerful In-Memory OLAP SQL Engine
chDB is an in-memory OLAP SQL engine that outperforms DuckDB, designed for lightweight analytics, enabling local data pipelines and serverless SQL analytics, with potential future enhancements for real-time processing.
Databases in 2024: A Year in Review
In 2024, Redis Ltd. and Elastic N.V. changed their licensing models amid competition, while Databricks and Snowflake intensified rivalry, focusing on ecosystem integration. DuckDB gained popularity for analytics.
One example among many:
https://github.com/DiceDB/dice/blob/0e241a9ca253f17b4d364cdf... defines func ExpandID, which reads from cycleMap without locking the package-global mutex; and func NextID, which writes to cycleMap under a lock of the package-global mutex. So writes are synchronized, but only between each other, and not with reads, so concurrent calls to ExpandID and NextID would race.
This is all fine as a hobby project or whatever, but very far from any kind of production-capable system.
I could be wrong but the primary in-memory storage appears to be a standard Go map with locking. Is this a temporary choice for iterative development, and is there a longer-term plan to adopt a more optimized or custom data structure ?
I find the DiceDB's reactivity mechanism very intriguing, particularly the "re-execution" of the entire watch command (i.e re-running GET.WATCH mykey on key modification), it's an intriguing design choice.
From what I understand is the Eval func executes client side commands this seem to be laying foundation for more complex watch command that can be evaluated before sending notifications to clients.
But I have the following question.
What is the primary motivation behind re-executing the entire command, as opposed to simply notifying clients of a key change (as in Redis Pub/Sub or streams)? Is the intent to simplify client-side logic by handling complex key dependencies on the server?
Given that re-execution seems computationally expensive, especially with multiple watchers or more complex (hypothetical) watch commands, how are potential performance bottlenecks addressed?
How does this "re-execution" approach compare in terms of scalability and consistency to more established methods like server-side logic (e.g., Lua scripts in Redis) or change data capture (CDC) ?
Are there plans to support more complex watch commands beyond GET.WATCH (e.g. JSON.GET.WATCH), and how would re-execution scale in those cases?
I'm curious about the trade-offs considered in choosing this design and how it aligns with the project's overall goals. Any insights into these design decisions would help me understand its use-cases.
Thanks
Reactive looks promising, doesn't look much useful in realworld for a cache. For example, a client subscribes for something and the machines goes down, what happens to reactivity?
| Metric | DiceDB | Redis |
| -------------------- | -------- | -------- |
| Throughput (ops/sec) | 15655 | 12267 |
| GET p50 (ms) | 0.227327 | 0.270335 |
| GET p90 (ms) | 0.337919 | 0.329727 |
| SET p50 (ms) | 0.230399 | 0.272383 |
| SET p90 (ms) | 0.339967 | 0.331775 |
UPD Nevermind, I didn't have my eyes open. Sorry for the confusion.Something I still fail to understand is where you can actually spend 20ms while answering a GET request in a RAM keyvalue storage (unless you implement it in Java).
I never gained much experience with existing opensource implementations, but when I was building proprietary solutions at my previous workplace, the in-memory response time was measured in tens-hundreds of microseconds. The lower bound of latency is mostly defined by syscalls so using io_uring should in theory result in even better timings, even though I never got to try it in production.
If you read from nvme AND also do the erasure-recovery across 6 nodes (lrc-12-2-2) then yes, you got into tens of milliseconds. But seeing these numbers for a single node RAM DB just doesn't make sense and I'm surprised everyone treats them as normal.
Does anyone has experience with low-latency high-throughput opensource keyvalue storages? Any specific implementation to recommend?
Is there a plan to commercialise this product? (Offer commercial support, features, etc.) I could not find anything obvious from the home page.
Would be great to disclose details of this one. I'm interested in using what DiceDB achieves higher throughput.
FYI this is a misspelling of "higher"
Anyway to persist data in case of reboots?
That's the only thing missing here.
Is Go the only SDK ?
It’s written in Go.
These are the real numbers - https://dzone.com/articles/performance-and-scalability-analy...
Does not match with your benchmarks.
Related
The Ultimate Database Platform
AverageDB, a database platform for developers, raised $50 million in funding. It offers speed, efficiency, serverless architecture, real-time data access, and customizable pricing. The platform prioritizes data privacy and caters to diverse user needs.
Why is single threaded Redis so fast
Redis is a high-performance, in-memory key-value database that achieves around 100,000 queries per second, utilizing a single-threaded architecture, efficient data structures, and non-blocking I/O for optimal performance.
The Fastest Redis Ever
Redis 8.0-M02 introduces performance enhancements, reducing latency for key commands, adding scaling features, and supporting high-performance vector searches. It is available for download as Docker images.
Use Cases for ChDB, a Powerful In-Memory OLAP SQL Engine
chDB is an in-memory OLAP SQL engine that outperforms DuckDB, designed for lightweight analytics, enabling local data pipelines and serverless SQL analytics, with potential future enhancements for real-time processing.
Databases in 2024: A Year in Review
In 2024, Redis Ltd. and Elastic N.V. changed their licensing models amid competition, while Databricks and Snowflake intensified rivalry, focusing on ecosystem integration. DuckDB gained popularity for analytics.