I am thinking about creating a json/xml/text when something is inserted to mysql database, so that php page will read this instead of mysql queries. When a data has updated in mysql database, it will update json/xml files too. Is this a good idea? It seems, this will has less mysql queries so I think this can be good.
I am thinking about creating a json/xml/text when something is inserted to mysql database,
Share
It depends. Probably not.
What you plan to do is a form of caching. If the queries used on a page are really, really complex and take a long time when benchmarking, it is sometimes a good thing to store the result in a cached file, and updating that if data changes.
But having some simple SELECT queries running on every request is nothing to worry about performance-wise. If you’re not seeing any actual performance issues, you’re probably best off sticking with SQL queries. A properly indexed database is really, really fast.