On Fri, Oct 12, 2012 at 2:58 AM, Dan Kennedy <danielk1...@gmail.com> wrote:
> On 10/11/2012 11:38 PM, Nico Williams wrote:
>> There is something you can do: [...]
>
> SQLite WAL mode comes close to that if you run your checkpoints
> in the background. [...]

Right.  WAL mode comes close to being a COW on-disk format.

> Omitting the D in ACID changes everything. With the D in, you need to
> fsync() after every transaction. Without it, you need to fsync() before
> reclaiming space (i.e. when overwriting old data with new - you need
> to be sure that the old data will not be required following recovery
> from a power failure, which means an fsync()).

Exactly.  You've put it more succinctly than I.

I do think that applications should be able to request deferred
durability *and* find out when a given transaction has indeed become
durable.

A distinction between success and durability in the API might bleed
into UIs too.  Imagine a web browser interface where "submit" does
some XHR that causes a DB transaction to be run and committed, the
page to be updated to show that the transaction succeeded, and
finally, another XHR is used to find when the transaction is durable
and the page is then updated again to reflect as much.

For a user "success" and "durable" means that the opposite of success
may be that they have to update a form and try again, so knowing that
the transaction succeeded is useful, in many cases even if the
transaction is not yet durable (because D failure is extremely rare).
To the user "durable" means that the transaction is truly complete.
Is this distinction something that users can be expected to
understand?  I believe that they can understand the distinction
intuitively, so the UI presentation needs to be finely tuned, and
having the ability to build such a UI means marking this distinction
in the API.  Is it valuable to expose this distinction to the user?  I
think that depends on the application -- it just shouldn't be
precluded.

Nico
--
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to