The short answer is that it depends on the type of table. If you use MyISAM, by default, there really are no transactions, so it should not affect performance.
But you should use them anyway . Without transactions, there is no demarcation of work. If you go to InnoDB or a real database such as PostgreSQL, you still want to add these transactions to your maintenance methods, so you can also make it a habit while you are worth nothing.
In addition, you should already be using a transaction store. How do you clean if the maintenance method does not currently work? If you write some information to a database, and then your service method throws an exception, how do you clear this incomplete or erroneous information? If you used transactions, you would not have to - the database would throw back the data for you. Or what do you do if I am halfway through a method and another request arrives and finds my semi-recorded data? Will it explode when he searches for the other half, which is not there yet? The transaction store will handle this for you: your transactions will be isolated from each other so that no one else can see the partially written transaction.
Like all databases, testing with realistic data and realistic workloads will be the only final answer. I recommend that you always do this, no matter what you suspect, because when it comes to databases, very different code codes are activated when the data is large or not. But I strongly suspect that the cost of using transactions even with InnoDB is low. In the end, these systems are constantly used constantly, every day, by large and small organizations that depend on successful transactions. MVCC adds very little overhead. The benefits are huge, the costs are low.
source share