The ever-increasing volume of data demands efficient storage solutions. This research investigates optimizing cloud data storage using Artificial Intelligence (AI) monitoring to achieve high query processing rates (Queries Per Second). We compare the performance of MariaDB and MongoDB database engines, focusing on data compression, query execution time and CPU usage. Our approach utilizes AI for real-time monitoring and potential optimization strategies. Employing the TPC-H benchmark, we demonstrate that MongoDB achieves an average compression rate that is 43% superior to that of MariaDB. Conversely, MariaDB outperforms MongoDB in query execution speed, exhibiting an average performance that is 2.7 times faster, as well as in CPU usage, where it demonstrates an average reduction of 5.9 times lower consumption. These findings suggest a trade- off between compression efficiency and query performance when choosing between these database engines.