Which companies in India are using Mongodb

MySQL or MongoDB: which database system is better?

MySQL or MongoDB: which database system is better?

MySQL (SQL) and MongoDB (noSQL) are the two best-known representatives of two database models, the SQL and NoSQL databases. The former is a popular relational database management system (RDBMS) that is developed, sold, and supported by Oracle Corporation, a US software company. MongoDB, on the other hand, is a newer database management system, a non-relational database developed by MongoDBInc. was developed.

It offers a rich query language, highly functional secondary indexes (including text search and geospatial data), a powerful aggregation framework for data analysis, faceted search, chart processing and more. It has its own query interface and uses a JSON format that is easy to learn. Many of the concepts of the two databases have similar properties. Both also have an extensive search function.

The biggest difference, however, is that the former is a relational, SQL-based database and the latter is a NoSQL system that has JSON-based communication for reading and storing data. Although many relational databases have now added support for JSON, simply adding a JSON data type does not necessarily bring the productivity benefits of a document database based on NoSQL.

Because this is based on a distributed system architecture and not on a monolithic single node design.

What do SQL and NoSQL mean?

The database language SQL is not a full-fledged programming language. SQL stands for "Structured Query Language" and describes a language for communication with relational databases. SQL commands make finding, inserting, changing or deleting relatively easy.

SQL can easily be combined with other programming languages ​​or embedded in programs. As part of the query, it enables the result to be output in tabular form and the data to be reused or edited as a new table. With the Apache web server, for example, PHP scripts are stored on the web server, which the user then calls up with his browser. The web server creates an HTML page from the PHP commands and the content from the SQL database.

There is no comprehensive positive definition of the term NoSQL, only negative ones that make a difference to SQL databases. The term, in the sense of “no”, was first used for a simple open source database that appeared in 1998 and did not provide any SQL access.

While relational databases use tables with columns and rows for data storage, available NoSQL databases use value pairs, objects, documents or lists and rows for data organization. Simple key-value stores are therefore a simple type of database. This can be a string, text, or list, and an array can contain nested data types.

Today's widespread NoSQL and “not-only SQL databases” are intended to solve problems for which relational systems appear unsuitable or for which they simply fail. NoSQL databases deal with problems for which relational databases are not suitable, especially when it comes to topics such as big data and cloud computing.

However, each NoSQL database has specific functions that serve a very specific purpose. Some NoSQL systems are completely dependent on non-relational functions, while others only dispense with certain elements such as fixed table schemas. However, it is not about replacing relational databases, but about supplementing them.


It is one of the most widely used database systems on the Internet. The popular open source tool LAMP (as well as XAMPP and MAMP) offers a web development platform that uses Linux as the operating system, Apache as the web server, MySQL as the database management system and PHP as the programming language. The development of the database system began in 1994 by the Swedish company MySQLAB and from 1998 by Sun Microsystems under the direction of Michael Widenius, the former founder, and David Axmark. The source code is written in C and C ++.

It is one of the world's most popular relational database management systems and thus contributed to the spread of PHP. The system, originally published as freeware, is freely available and ideal for storing and accessing data.

In many content management systems it forms the basis for storing data and is available as open source software and as a commercial version. It is also compatible with many different operating systems.


It is a powerful, document-oriented NoSQL database that was also developed in the C ++ programming language. It was first published in February 2009. It is the most widely used NoSQL database (as of February 2019). The non-relational database can be an interesting solution for web application developers.

Businesses of all sizes use it because they generate applications faster, process vastly different types of data, and manage large-scale applications more efficiently. It is based on the JSON format and is based on an ordered set of key / value pairs, whereby arrays or documents are also stored under a key. The name is derived from Engl. "Humongous" from, which means gigantic, insanely big. Since it is document-oriented, it can manage collections of JSON-like documents.

A process can manage multiple databases, and a database can contain multiple collections. The DB and the collection form a namespace that is separated by a period. Like other NoSQL databases, the NoSQL database also supports dynamic schema design so that documents in a collection can have different fields and structures.

The database uses the so-called BSON format for document storage and data exchange, which enables a binary representation of JSON-like documents. In general, it works best for applications with a lot of very unstructured data.

Summary pros and cons

Advantages of MySQL

  • It is the most popular open source database in the world and the standard for online databases.
  • It is part of the preconfigured Apache server and available for almost all platforms and systems.
  • It is the ideal embedded database for PHP developers and software manufacturers to develop read-intensive applications.
  • SQL enables search in a natural way.

Benefits of MongoDB

  • It is particularly suitable for unstructured data, for big data, data mining and cloud applications.
  • It is better and more flexible for unknown data structures, especially when the amount and type of data cannot be predicted.
  • Changes to the data structure can be made more easily.
  • NoSQL databases can effectively store large, disparate dimensions such as space, time, and place.


MySQL is the better solution for classic web development applications with manageable data and data structures. It is pre-installed in the common web configurations and servers and can be used directly. There is also a large community. MongoDB is better suited for applications in the context of big data and machine learning, especially when data from different origins and sources have to be merged. It is also more flexible and can be used more universally.

Interesting links:
The different database systems are described in Computerwoche
MongoDB and MySQL are compared in table format

Images: Canva

The author: Sascha Thattil works at YUHIRO and helps entrepreneurs and companies to easily set up programming teams in India. YUHIRO is a German-Indian company which provides IT companies, agencies and IT departments with software developers.

By author on April 25, 2019 / web development / 1 Comment