# Performance Impact of Optimization Methods on MySQL Document-Based and Relational Databases
## 7 Conclusions  
In this paper, a comparative study was conducted between document-based MySQL and relational MySQL on their performance during the execution of CRUD operations before and after optimization. Two types of optimization were considered: field optimization, and index-based optimization. The tests performed showed that document-based MySQL was much faster than relational MySQL when the number of elements increased, whether or not optimizations were applied, because predefined methods were used and not direct queries. With a small number of elements, the two databases had relatively similar response times, with small differences. Before the applied optimizations, as the number of elements increased, the differences between the two databases became larger, but after optimizations, the \begin{table}
\begin{tabular}{c c c} \hline \hline  & **Relational MySQL** & **Document-Based MySQL** \\ \hline Indexes & Indexes can be added in two ways, directly in entities or by _alter table_ statement. & Indexes are added from the application using the _createIndex_() method. \\ \hline Insert operation & The optimizations do not bring a major improvement because there is already an index on the primary key, and the field validations are still performed. & The insertion is performed much faster because no validation is performed, and the optimizations do not bring a significant improvement. \\ \hline Update operation & The improvements brought by the optimizations can be observed in the case of complex update operations on several elements, where several tables and fields are used because their search is conducted much faster by added indexes on the fields, increasing the performances by up to 60\%. The differences are much more visible as the number of elements increases, providing performance close to document-based MySQL before optimization. & The predefined update methods are already optimized, offering very good response times for both a small volume of data and a large volume of data. The optimizations conducted improve the response times, the biggest differences being in the case of the update on several columns and several elements for a large volume of data. \\ \hline Select operation & The proposed optimization methods have a great impact on relational MySQL. In the case of more complex selections, the response time before optimization is very long, but after optimization, the response time decreases greatly, in some cases by 80\%, being much faster or as fast as document-based MySQL before optimizations. & Using predefined methods that are already optimized to provide the best response speed, the optimizations conducted bring an improvement but not as significant as in the case of the other database. However, the operations are performed much faster, regardless of their complexity and volume of data, being very suitable for a large volume of data. \\ \hline Delete operation & The soft delete operation is similar to the update one, these being close in performance. The hard delete operation has a 50\% improvement after optimizations in the case of a large volume of data. For a small volume of data, there is an improvement but not as significant. Even after these optimizations, the response times are much longer than document-based MySQL. & Being an update operation, in the case of soft delete, the operation is performed quickly both before and after optimization, regardless of the data volume. For the hard delete operation, the optimizations bring a minor improvement, of about 10\%, but, nevertheless, it is much faster than relational MySQL, especially for a large volume of data. \\ \hline \hline \end{tabular}
\end{table} 
Table 15: Summary of comparative analysis. differences were considerably reduced. Thus, for relational MySQL, applying optimization methods, especially adding indexes, represents an important performance issue. Consequently, in the case of an application with a huge volume of data, document-based MySQL, with or without optimizations, represents the best solution.