Mysql like other services (SQL Server, Oracle, etc.), as you just explained in your description, allows multiple queries. That is, the database engine receives the connections with the orders and these are processed in queue, in order of arrival, including the longest. There is a way to improve, you can analyze here techniques that exist, but we’ll get to that.
Let’s separate the problem into parts, you want to be able to run high-CPU, RAM and time-consuming routines when the retail outlets are using? If yes, you need to review the server hosting the Mysql engine (+RAM, +CPU, +Disk-SSD), but before that, you need to review queries to be optimized, sometimes a poorly done query increases the execution time from a query to hours, when it should take seconds. Another alternative would be to review your architecture, and the heavy queries should be performed during a period that does not affect sales and this data should be stored in a separate data store from the operational database, you can still partition your data. In short, there are many ways to solve your problem, but only with more details about the whole architecture, you get more concrete help.
Thanks for the feedback. I had already found the problem. There really was a Query here that was taking 7 minutes. I checked that there was no index created and after creating them the query took no more than 2 seconds. Thanks for your attention.
– Abrahão Vendramini