Why do SQL databases use a write-ahead log over a command log?

后端 未结 6 471
无人及你
无人及你 2021-01-30 00:26

I read about Voltdb\'s command log. The command log records the transaction invocations instead of each row change as in a write-ahead log. By recording only the invocation, the

6条回答
  •  说谎
    说谎 (楼主)
    2021-01-30 00:57

    Its really just a matter of granularity. They log operations at the level of stored procedures, most RDBMS log at the level of individual statements (and 'lower'). Also their blurb regarding advantages is a bit of a red herring:

    One advantage of command logging over ARIES style logging is that a transaction can be logged before execution begins instead of executing the transaction and waiting for the log data to flush to disk.

    They have to wait for the command to be logged too, its just a much smaller record.

    If I'm not mistaken VoltDB's unit of transaction is a stored proc. Traditional RDBMS usually need to support ad-hoc transactions containing any number of statements, so procedure-level logging is out of the question. Furthermore stored procedures are often not truly deterministic in traditional RDBMS (i.e. given params+log+data always produce same output), which they would have to be for this to work.

    Nevertheless the performance improvements would be substantial for this constrained RDBMS model.

提交回复
热议问题