Comparison of the Performance of PostgreSQL and Redis Databases for Data Analysis Using Artificial Intelligence

Software Computing

Študent: Michel Velkov

Michel Velkov is a graduate of the Computer Science - Software Engineering module study program at Academia, College of Short-Cycle Higher Education. He successfully defended his thesis paper in December 2024.

PDF

Diploma paper Michel Velkov

In this thesis, we analyzed the performance of two popular databases, PostgreSQL and Redis, in the context of artificial intelligence and data processing. The research aimed to determine which database is better suited for specific tasks such as fast data filtering, training AI models, and ensuring stability and reliability of results.

We formulated four hypotheses, which were tested through experimental comparisons of query speed, model training times, and result stability.

The results confirmed that Redis excels at simple queries, such as lookup operations, thanks to its in-memory data storage architecture. However, it was not faster for complex data filtering queries, contrary to the H2 hypothesis.

PostgreSQL performed better in handling complex queries, whereas its advanced query optimization and indexing capabilities resulted in significantly shorter execution times. This indicates that PostgreSQL is better suited for scenarios where large amounts of data must be filtered with complex conditions.

When it comes to training AI models, Redis showed an advantage with simpler models like Ridge regression, as its training speed slightly outpaced PostgreSQL. For more complex models such as random forest and gradient boosting, both PostgreSQL and Redis proved to be equally effective, contradicting the H4 hypothesis, which claimed PostgreSQL’s superior stability.

The research also demonstrated that PostgreSQL enjoys greater community support and higher demand in the job market, while Redis leads in open-source projects on GitHub. Based on these findings, we recommend PostgreSQL for applications that require extensive data processing and Redis for scenarios where speed is of critical importance.

In addition to these key findings, we examined the impact of the database choice on overall application architecture and scalability. We found that PostgreSQL offers better scalability options in environments where data requirements dynamically change, while Redis facilitates easier integration into real-time systems due to its exceptional speed.

These additional insights allow for a more informed decision when selecting a database based on specific project needs and will contribute to greater efficiency and reliability of the final solutions.


 

Diploma paper Michel Velkov

PDF

Diploma paper Michel Velkov

Želite biti obveščeni o novicah na Academii?

Ko bo kaj novega vam to enostavno sporočimo na vaš e-naslov.

X