Need advice about which tool to choose?Ask the StackShare community!
Azure Cosmos DB vs Cassandra: What are the differences?
Azure Cosmos DB and Apache Cassandra are both popular NoSQL databases that are widely used for building scalable and highly available applications. Let's explore the key differences between them.
Consistency models: Azure Cosmos DB provides five well-defined consistency models, including strong, bounded staleness, session, consistent prefix, and eventual consistency. In contrast, Cassandra offers tunable consistency, where users can customize the level of consistency for each read and write operation.
Data distribution: Azure Cosmos DB uses a partitioning scheme called "container" to distribute data across multiple physical partitions automatically. This enables automatic load balancing and horizontal scalability. On the other hand, Cassandra has a decentralized architecture where data is partitioned and distributed across multiple nodes using a consistent hashing algorithm.
Multi-model capabilities: Azure Cosmos DB is a multi-model database that supports document, key-value, graph, and columnar data models, allowing developers to choose the best model for their application needs. Cassandra, on the other hand, primarily supports the columnar model, although some support for other models can be achieved through customizations and extensions.
Scalability and performance: Azure Cosmos DB offers elastic scalability with automatic partitioning and load balancing, enabling applications to scale seamlessly as the workload grows. It is also designed to deliver low-latency performance even at global scale. Cassandra provides linear scalability by adding more nodes to the cluster. However, scaling Cassandra requires manual configuration and management.
Global distribution: Azure Cosmos DB provides built-in support for global distribution, allowing data to be stored and accessed from multiple regions around the world with low latency. Cassandra, on the other hand, requires manual configuration and replication to achieve global distribution, making it more complex and time-consuming.
Backup and recovery: Azure Cosmos DB offers built-in backup and restore capabilities, allowing users to easily recover their data in case of a disaster or accidental data loss. Cassandra requires users to set up their own backup and recovery mechanisms, which can be more complex and time-consuming.
In summary, Azure Cosmos DB, a fully managed cloud-native database service, provides global distribution, multi-model support, and comprehensive SLAs, making it suitable for building globally distributed applications with low-latency access. Cassandra, an open-source distributed database, offers high availability, fault tolerance, and tunable consistency levels, providing flexibility in deployment and customization options for large-scale distributed systems.
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.
Pros of Azure Cosmos DB
- Best-of-breed NoSQL features28
- High scalability22
- Globally distributed15
- Automatic indexing over flexible json data model14
- Tunable consistency10
- Always on with 99.99% availability sla10
- Javascript language integrated transactions and queries7
- Predictable performance6
- High performance5
- Analytics Store5
- Rapid Development2
- No Sql2
- Auto Indexing2
- Ease of use2
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
Sign up to add or upvote prosMake informed product decisions
Cons of Azure Cosmos DB
- Pricing18
- Poor No SQL query support4
Cons of Cassandra
- Reliability of replication3
- Size1
- Updates1