MySQL vs MongoDB, a NoSQL Database and Coding

996 Words2 Pages

Introduction.

The introduction of the computer has significantly changed our lives in a very short period of time.

Originally the computers were designed to help a person calculate numbers and nowadays a computer allows huge amounts of information to be stored in a small place, calculate mathematical problems easily and communicate with other people via the social networks.

Between the 1960’s and the 1970’s emerged different types of databases in order to satisfy the need of storing and retrieving data in an organised and consistent manner.

The growing needs in industry and he huge amount of data collected by software nowadays is becoming a real problem to business/organizations due that the storage technologies are not advancing and performing as expected.

There is a huge amount of data which require be organising, analysing and storing in databases to be accessed by multiple users/applications at the same time. Also databases are prepared to conserve all the data stored in case of failure or disaster.

The aim of this report is to compare two different databases, one relational database such as MySQL, considered as a well-defined concept and based on a solid and mature theory, with MongoDB the most popular NoSQL database defined as a new concept of database used for complicated queries(ability to handle very fast unrelated and unstructured data). This report will include:

• Overview of Transaction Management theory
• Brief Introduction to both databases.
• Analysis of recovery and concurrency
• Advantages and disadvantages
• Brief conclusion.

Definitions, Acronyms, and Abbreviations

Database
Relational Database
Oracle
SQL
MySQL
MomgoDB
RDMS
DML and DDL
ACID - Atomicity, Consistency, Isolation and Durability

...

... middle of paper ...

...mmits the current transaction and starts a new transaction.
Here is a simple test code on the default transaction:

Output:

Observe that:
• How InnoDB is specified as the storage engine for the table.
• How to turn off the auto-commit flag.
• How uncommitted changes can be rolled back.
• Uncommitted changes are rolled back at the end of the session.

Here is another simple test code on non-default transactions:

Output:

Observe that:
• "jack" is in the table because the previous commit statement ends the non-default transaction. The insert statement on "jack" is automatically committed.
• "user1" and "user2" are in the table because transactions cannot be nested. A "start transaction" statement commits the changes and ends the current transaction.
• "user4" is in the table because the previous rollback statement ends the non-default transaction.

More about MySQL vs MongoDB, a NoSQL Database and Coding

Open Document