Blogs · Database System · SQL

SQL: Going into Applications with MySQL and MongoDB

Going back to the technical details of what and how for popular SQL and NoSQL dbms

2020.09.04 · 3 min read · by Zhenlin Wang · updated 2022-09-24

Introduction

This is a blog to note down some important concepts revolving MongoDB and MySQL, two of the most popular databases reprensentative of their respective domains: NoSQL and SQL. Many people know how to use these DBMS, but fail to appreciate their characteristics, when and why they are used in certain business solutions. I try to give as much high level comparisons as possible. This ensures that People can at least answer some basic interview questions when they look for a job using these tools.

MongoDB

1. Sharding

The components of a Shard include:

  1. A Shard – A MongoDB instance which holds the subset of the data. In production environments, ALL shards need to be part of replica sets.
  2. Config server – A mongodb instance which holds metadata about the cluster, basically information about the various mongodb instances which will hold the shard data.
  3. A Router – A mongodb instance responsible to re-directing the commands send by the client to the right servers.

2. The benefits of NoSQL in MongoDB

3. The disadvantages of Non-SQL (without fixed schema) in MongoDB

MySQL

1. Disadvantages of MySQL (or traditional RDBMS)

Which to choose

CharacteristicsMongDBMySQL
Data natureA lot of unstructured dataMostly Structured data
ApplicationReal-time analytics, content management, various mobile appsApplications that requires multi-row transactions such as an accounting system
Service priorityCloud BasedSecurity and ACID/BASE rules are very improtant
Data VolumnLarge, high-speed volumn of dataStable data flow

TODO