Week 7 – CST– 363 Introduction to Database Systems

Compare MongoDB with MySQL. What are some similarities? 

Now that the course has introduced MongoDB, I can see there are a few similarities between it and MySQL. They both offer a GUI interface for users to manipulate data with ease through the use of queries. For our lab 19 project, we used JDBC to program a web application using MySQL and for lab 21, we are also using Java to program the same application with MongoDB. That is because they are both compatible with many of the same languages including Java, Python, and Node.js. Lastly, both DBMS have the capability to improve query speeds by indexing frequently used data.

What are some differences? 

The main difference between MySQL and MongoDB is that MySQL is a relational database while MongoDB is document-oriented database. MySQL uses schemas with tables made up of columns and rows. These tables use keys and foreign keys to establish relationships with other tables. MongoDB stores data objects as documents inside a collection. A collection is a group of documents. It uses BSON documents which are single data objects that are composed of field/value pairs.

 When would you choose one over the other? 

MySQL is ACID-compliant which means that transactions are atomic, consistent, isolated, and durable. This makes MySQL ideal for use in fields where data is highly structured, and transactions are complex like e-commerce or financial transactions. MongoDB, on the other hand, is a NoSQL database that is unstructured and does not require a schema. This makes it ideal for use with data generated by the internet of things, Email, or social media.

Comments

Popular posts from this blog