Old Ceylon Mudliar
Old Ceylon Mudliar

Reputation: 188

Why concurrent execution of transactions is desirable?

Can somebody please explain me why concurrent execution of transactions is desirable? I couldn't find a clear answer even though searched for hours. Thank you.

Upvotes: 1

Views: 503

Answers (2)

kaushalpranav
kaushalpranav

Reputation: 2174

Concurrency does not help in the case of a single-core/single-node case. (Except in the case when reading from disk takes a lot more time that can be used for processing something else)

Because at any time, you can only run one transaction. So you can run all the transactions one after the other without any interleaving of operations between different transactions and get the same performance.

In case of multi-core/multi-node case, you can make use of parallel processing and run multiple transactions parallelly.

If you run the transactions one by one, you can't make use of the multiple cores/nodes. So we need to run transactions in parallel on the multiple cores/nodes and make sure the concurrency control protocols are in place to keep the database consistent when multiple transactions running concurrently (simultaneously at the same time).

Upvotes: 0

David Browne - Microsoft
David Browne - Microsoft

Reputation: 88851

why concurrent execution of transactions is desirable

Without concurrent execution of transactions, your application throughput is limited to inverse of your transaction duration.

Eg if each transaction takes 50ms, your throughput limited to 20 transactions per second. Which means you can't perform a lot of transactions or support a large number of users.

Upvotes: 5

Related Questions