sql - What are the problems of using transactions in a database? -
from this post. 1 obvious problem scalability/performance. other problems transactions use provoke?
could there 2 sets of problems, 1 long running transactions , 1 short running ones? if yes, how define them?
edit: deadlock problem, data inconsistency might worse, depending on application domain. assuming transaction-worthy domain (banking, use canonical example), deadlock possibility more cost pay ensuring data consistency, rather problem transactions use, or disagree? if so, other solutions use ensure data consistency deadlock free?
it depends lot on transactional implementation inside database , may depend on transaction isolation level use. i'm assuming "repeatable read" or higher here. holding transactions open long time (even ones haven't modified anything) forces database hold on deleted or updated rows of frequently-changing tables (just in case decide read them) otherwise thrown away.
also, rolling transactions can expensive. know in mysql's innodb engine, rolling big transaction can take far longer committing (we've seen rollback take 30 minutes).
another problem database connection state. in distributed, fault-tolerant application, can't ever know state database connection in. stateful database connections can't maintained fail @ moment (the application needs remember in middle of doing , redo it). stateless ones can reconnected , have (atomic) command re-issued without (in cases) breaking state.
Comments
Post a Comment