I am trying to understand how to cache databases efficiently and what to do and what not to do. Although I want to make sure that I understood correctly. Maybe you can help me?
At the moment, I do not have caching, and I do everything locally using XAMPP. For data storage, I use MySQL / PHPMyAdmin, and for capturing, adding and updating data, I just make Mysqli queries in PHP. As I said, at the moment I do not have caching, so I started looking for the best ways to do this.
After a quick search, I found Redis . So my idea is to store data using MySQL and cache it using Redis. Is this a good way to do this, or did I realize that everything is completely wrong?
If I am right, how do I implement Redis? How to cache data? I am doing a PHP check if the data I want is cached, if they then take it from the cache and then take it from the MySQL database.
I would like to know if I'm really on the right track.
source share