0% found this document useful (0 votes)
44 views

CockroachLabs CockroachDB Vs MongoDB

CockroachLabs CockroachDB vs MongoDB

Uploaded by

Phan Long
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views

CockroachLabs CockroachDB Vs MongoDB

CockroachLabs CockroachDB vs MongoDB

Uploaded by

Phan Long
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

CockroachDB vs MongoDB

At Cockroach Labs, we are solely focused on the delivery of a feature-rich distributed SQL database. We know that consumers have
a choice, which is why we monitor what our peers are building and delivering to ensure we achieve this goal.

This is a summary of some of the key points of concern for CockroachDB relative to MongoDB. We try our hardest to be fair and
complete in our analysis, but also understand we are not experts in the competing solution. Please take this comparison as a guide
for you to consider our database against others and not as the ultimate truth.

MongoDB is one of the most popular MongoDB CockroachDB


NoSQL databases available and is
used by thousands to deliver data to Document Model: JSON, Relational Model and
Database type and SQL coverage
partial SQL coverage JSON, native SQL
Compliance with standard SQL
apps and services. It is a highly through connectors language
available distributed database that is
great for workloads where you have a Data integrity Optional schema Enforces referential
The ability to ensure data is correct across validation lacks integrity and
known set of access patterns, relationships and for data types referential integrity strict data types
non-critical transactions, and a fairly
static data model. While often used in Database Schema Change Agile with Online, orchestrated
place of a relational database, it is Modify database schema across all tables limited schema schema changes

quite different and you should always


seek to choose the right database for Database Horizontal Scale Node based, Node based,
Increase storage and transactional capacity automated for both automated for both
your workload. by adding more instances/nodes reads and writes reads and writes

Availability Raft protocol ensures Raft protocol ensures


Ability to ensure access to the database, availability during availability during
//Consistent Transactions even when there are major challenges node failure node failure

The document model of MongoDB can handle


simple transactions, but is unable to guarantee Failover With Atlas, Up-replicates data if
consistency and may result in data issues, such Provide access to backup data upon failure failed nodes restart nodes do not restart
as dirty or phantom reads.

Consistent transactions
Potential Data Issues (default) Serializable, guaranteed
not guaranteed
//Data Integrity Possible data issues at default isolation level consistent transactions
by default

With MongoDB, you get schema validation, but


the database does not enforce referential Transaction performance Sub-optimal for Optimized for
Speed of queries for complex transactions transactional workloads transactional workloads
integrity or strict data typing. This allows for
agility, but leaves you open to data integrity
issues. Further, setting these constraints you to Cost-Based Optimization Basic heuristics based Complex, multi-faceted
code them into your application logic. Optimize query execution based on analytics on index caching optimizer uses stats

//Aggregate Views Multi-region writes Not by default, but Native, all nodes can
Ability to execute writes across tables and possible with complex, accept reads and writes
MongoDB is great when you know what you multiple regions careful setup even across regions
want to access from it. However, if you are
looking to pull aggregate views or large Tie data to a node to Tie data to a node to
collections and merge data with it, you may not Data Geo-partitioning
optimize performance or optimize performance or
have the tooling in the database and will have to Tie data to an instance/node to comply with
comply with data comply with data
regulations or optimize access latency
complete these tasks in your application code. regulations regulations

Developer tools Closed system with


Rich ecosystem of
Ecosystem of tooling to help developers and limited tooling, mostly
//Business Workloads Postgres developer tools
admins administer and maintain the database created by vendor

MongoDB is good for workloads that have a


set way of accessing data and for data Simple hierarchical data Optimized for
Ideal workloads models, access forward relationship based,
models that rarely change and aren’t too
Typical workloads that will suit the database with minimal simple and complex
complex. Its limitations around transactions
transactions (if any) transactional workloads
also limit its ability to handle critical system of
record workloads.

Copyright 2022 Cockroach Labs, Inc. All rights reserved. September 2022 | cockroachlabs.com

You might also like