Need advice about which tool to choose?Ask the StackShare community!
Cassandra vs Riak: What are the differences?
- Data Model: Cassandra uses a wide-column store data model, while Riak follows the key-value store data model. This means that Cassandra organizes data into columns within rows, similar to a table, while Riak stores data as key-value pairs without a fixed schema.
- Consistency Model: Cassandra employs eventual consistency by default, allowing data to be inconsistent for a period and then reconciled. In contrast, Riak offers tunable consistency, allowing users to choose between strong consistency or eventual consistency based on their requirements.
- Partitioning: Cassandra uses consistent hashing for partitioning data across multiple nodes but relies on a coordinator node to handle requests. Riak, on the other hand, uses a decentralized partitioning strategy where each node is responsible for a subset of the keyspace, enabling high availability and scalability without a single point of failure.
- Concurrency Control: Cassandra uses the Last-Write-Wins (LWW) conflict resolution strategy, where the most recent write takes precedence in case of conflicts. Riak, however, uses vector clocks to track causal relationships between updates, allowing for more sophisticated conflict resolution and the ability to handle divergent replicas.
- Secondary Indexes: Cassandra supports secondary indexes that enable querying on non-primary key fields, but they come with performance trade-offs. Riak, on the other hand, offers search capabilities through full-text search integration with tools like Riak Search or external indexing solutions.
- Deployment Flexibility: Cassandra is designed for horizontal scalability and is typically deployed in clusters spanning multiple data centers for high availability and fault tolerance. Riak, while also scalable, is often chosen for its deployment simplicity, flexibility, and ease of use in premises with less complex setup requirements.
In Summary, Cassandra and Riak differ in their data models, consistency models, partitioning strategies, concurrency control mechanisms, support for secondary indexes, and deployment flexibility.
Developing a solution that collects Telemetry Data from different devices, nearly 1000 devices minimum and maximum 12000. Each device is sending 2 packets in 1 second. This is time-series data, and this data definition and different reports are saved on PostgreSQL. Like Building information, maintenance records, etc. I want to know about the best solution. This data is required for Math and ML to run different algorithms. Also, data is raw without definitions and information stored in PostgreSQL. Initially, I went with TimescaleDB due to PostgreSQL support, but to increase in sites, I started facing many issues with timescale DB in terms of flexibility of storing data.
My major requirement is also the replication of the database for reporting and different purposes. You may also suggest other options other than Druid and Cassandra. But an open source solution is appreciated.
Hi Umair, Did you try MongoDB. We are using MongoDB on a production environment and collecting data from devices like your scenario. We have a MongoDB cluster with three replicas. Data from devices are being written to the master node and real-time dashboard UI is using the secondary nodes for read operations. With this setup write operations are not affected by read operations too.
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.
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
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.
i love syclla for pet projects however it's license which is based on server model is an issue. thus i recommend cassandra
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.
Fauna is a serverless database where you store data as JSON. Also, you have build in a HTTP GraphQL interface with a full authentication & authorization layer. That means you can skip your Backend and call it directly from the Frontend. With the power, that you can write data transformation function within Fauna with her own language called FQL, we're getting a blazing fast application.
Also, Fauna takes care about scaling and backups (All data are sharded on three different locations on the globe). That means we can fully focus on writing business logic and don't have to worry anymore about infrastructure.
Pros of Cassandra
- Distributed119
- High performance98
- High availability81
- Easy scalability74
- Replication53
- Reliable26
- Multi datacenter deployments26
- Schema optional10
- OLTP9
- Open source8
- Workload separation (via MDC)2
- Fast1
Pros of Riak
- High Performance14
- High Availability11
- Easy Scalability9
- Flexible5
- Strong Consistency1
- Eventual Consistency1
- Distributed1
- Multi datacenter deployments1
- Reliable1
Sign up to add or upvote prosMake informed product decisions
Cons of Cassandra
- Reliability of replication3
- Size1
- Updates1