Resumen
Con este trabajo de investigación teníamos la intención de arrojar un poco de luz sobre el tema de la comparación entre bases de datos SQL frente a NoSQL, ya que, personalmente, se trata de un tema que nos ha interesado mucho desde que supimos de él, pero sobre el que nunca habíamos tenido la ocasión de investigar seriamente y profundizar más. Por lo que decidimos enfocar este trabajo a un benchmark entre MySQL y MongoDB. Para poder llevar a cabo esta investigación, necesitábamos un entorno externo en el que alojar las BBDD para así ofrecer una comparativa lo más justa posible. Por este motivo, decidimos que íbamos a crear dos instancias de BBDD en servicios en la nube. Teníamos varias opciones, pero nos decidimos por AWS, ya que nos pareció interesante y no lo habíamos utilizado nunca antes, por lo que contribuiría a un mayor aprendizaje por nuestra parte. Después de un largo estudio, habiendo ejecutado distintos tipos de operaciones tanto en MySQL como en Mongo, pudimos llegar a una serie de conclusiones: si bien ambos gestores son muy eficientes y fáciles de usar, cada uno tiene sus ventajas e inconvenientes frente al otro. Mongo es más intuitivo y simple de utilizar para alguien no demasiado familiarizado con el mundo de las BBDD, pero este gestor posee mucha menos documentación que MySQL y por lo general la documentación existente es de peor calidad. Hemos analizado que el rendimiento de MySQL es mejor en bases de datos de gran tamaño con varias tablas, destacando también por las mejoras de rendimiento a través del uso de índices. Mientras que MongoDB llama la atención por su simple interfaz (en Compass) y su genial desempeño en consultas y operaciones de tipo INSERT, UPDATE y DELETE, que marcan una gran diferencia con el clásico de SQL. Finalmente, como pauta a la hora de elegir un SGBD para nuestra BD, hemos de tener en cuenta las necesidades y características de nuestra BD y, sobre todo, el uso que se le quiere dar. De esta forma podremos maximizar el rendimiento que obtendremos de nuestra base de datos.
Abstract:
With this research we had the intention of shedding some light on the issue of the comparison between SQL databases versus NoSQL, since, personally, it is a topic that has interested us a lot since we heard about it, but on which we have never had the opportunity to seriously investigate. So we decided to focus this work on a benchmark between MySQL and MongoDB. In order to carry out this research, we needed an external environment in which to host the databases in order to offer a comparison as fair as possible. For this reason, we decided that we were going to create two DB instances in cloud services. We had several options, but we decided on AWS, as we found it interesting and we had never used it before, so it would contribute to more learning on our part. After a long study, having executed different types of operations in both MySQL and Mongo, we were able to reach a series of conclusions: although both management systems are very efficient and easy to use, each one has its advantages and disadvantages compared to the other. Mongo is more intuitive and simpler to use for someone who is not familiar with the world of databases, but it has less documentation than MySQL and in general the existing documentation is of poorer quality. We have analysed that MySQL performance is better in large databases with several tables, also highlighting the performance improvements through the use of indexes. While MongoDB draws attention for its simple interface (in Compass) and its great performance in queries and INSERT, UPDATE and DELETE type operations, which make a big difference with the classic SQL. Finally, as a guideline when choosing a DBMS for our DB, we must take into account the needs and characteristics of our DB and, above all, the use that we want to give it. In this way we can maximize the performance that we will obtain from our database.