CST363: Learning Journal Week 7

Prompt for this week's journal entry.

Compare MongoDB with MySQL. 

What are some similarities? 

What are some differences? 

When would you choose one over the other? 

Similarities:

Data Storage: Both MongoDB and MySQL store data persistently on disk.

Indexes: Both databases support indexes for improving query performance.

Data Manipulation: Both provide capabilities for inserting, updating, deleting, and querying data.

Differences:

Data Model: MongoDB is a NoSQL database, while MySQL is a relational database. MongoDB stores data in flexible, schema-less documents (JSON-like format), while MySQL stores data in structured tables with predefined schemas.

Query Language: MongoDB uses a query language similar to JavaScript called the MongoDB Query Language (MQL), while MySQL uses SQL (Structured Query Language).

Schema: MongoDB is schema-less, allowing for dynamic and flexible schemas, while MySQL requires a predefined schema for each table.

Scaling: MongoDB is designed to scale horizontally, making it easier to scale out across multiple servers, while MySQL traditionally scales vertically, by adding more resources to a single server.

ACID Transactions: MySQL supports ACID (Atomicity, Consistency, Isolation, Durability) transactions, while MongoDB supports multi-document transactions only in recent versions.

Complexity: MySQL is typically seen as more complex due to its relational nature and the need to define schemas and relationships, while MongoDB is often simpler to set up and use, especially for applications with evolving requirements.

When to Choose:

Choose MongoDB if you need a flexible schema, have large volumes of unstructured or semi-structured data, or require high scalability and performance for read-heavy workloads.

Choose MySQL if you need ACID compliance, have complex relationships between data, or require strong transactional support for financial applications or e-commerce platforms.

Comments

Popular posts from this blog

CST438 Week 6 Journal

CST439 Week 10 Journal

CST499 Week 14 Journal