在本文中,我们将讨论 MongoDB 和 Cassandra 之间的异同。
1. MongoDB :
MongoDB 是一个跨平台的面向文档的数据库程序。它是一个开源文档数据库,以键值对的形式存储数据。
支持的语言: C++、Go、JavaScript、 Python。
2.卡桑德拉:
Cassandra 是一个免费、开源、分布式、广泛的列存储、NoSQL 数据库管理系统。用于处理大量数据。
支持的语言: Java
相似之处:
- MongoDB 和 Cassandra 使用 TCP/IP 协议通过网络传输/接收数据。
- 锁在两者中都可用。
- 两者都将支持 Linux OS、Mac – OS 和 Windows
- 两者都将数据存储在光盘中。
- MongoDB 和 Cassandra 是开源的(免费提供给所有人)
- 两者都是可扩展的
MongoDB 和 Cassandra 的区别:
Cassandra |
MongoDB |
Cassandra was developed by Apache Software foundation. | MongoDB was developed by MongoDB Inc. |
Cassandra can be written only in Java language. | MongoDB is written in C++, Go, JavaScript, Python languages. |
It will provide Local Transactions. | It will not provide Local Transactions. |
Triggers are available. | Triggers are not available. |
Data is replicated by using Multi-Master for Replication Factor. | Data is replicated by using Master-Slave for Replication Factor. |
Cassandra will not support Secondary Indexes. | MongoDB Supports Secondary Indexes. |
It is linearly scalable. | It is not linearly scalable. |
It stores large dataset. | It can’t store large datasets. |
Node failure may occur in Cassandra. | Node failure never occurs in Cassandra. |
Cassandra gives better throughput than MongoDB. | Less throughput than Cassandra. |
Cassandra support JSON data format. | MongoDB supports both JSON and BSON data formats. |
Data protection is upto 80%. | Data protection is upto 70%. |