Abstract
Aim: To evaluate the performance of Relational and NoSQL databases in terms of execution time and memory consumption during operations involving structured data.
Objective: To outline the criteria that decision makers should consider while making a choice of the database most suited to an application. Methods: Extensive experiments were performed on MySQL, MongoDB, Cassandra, and Redis using the data for an IMDB movies schema prorated into 4 datasets of 1000, 10000, 25000 and 50000 records. The experiments involved typical database operations of insertion, deletion, update read of records with and without indexing as well as aggregation operations. Databases’ performance has been evaluated by measuring the time taken for operations and computing memory usage. Results: Redis provides the best performance for write, update and delete operations in terms of time elapsed and memory usage, whereas MongoDB gives the worst performance when the size of data increases, due to its locking mechanism. For the read operations, Redis provides better performance in terms of latency than Cassandra and MongoDB. MySQL shows the worst performance due to its relational architecture. On the other hand, MongoDB shows the best performance among all databases in terms of efficient memory usage. Indexing improves the performance of any database only for covered queries. Redis and MongoDB give good performance for range based queries and for fetching complete data in terms of elapsed time whereas MySQL gives the worst performance. MySQL provides better performance for aggregate functions. NoSQL is not suitable for complex queries and aggregate functions. Conclusion: It has been found from the extensive empirical analysis that NoSQL outperforms SQL based systems in terms of basic read and write operations. However, SQL based systems are better if queries on the dataset mainly involve aggregation operations.Keywords: Relational model, NoSQL MongoDB, cassandra, redis, structured data, query execution.
Graphical Abstract