zied-ellouze / gears

Automatically exported from code.google.com/p/gears
1 stars 0 forks source link

Allow temporary "session" databases. #136

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Provide a way to open named databases which can be shared across an origin,
but which are not persistent across browser restarts.  Such a database
could have default settings like PRAGMA synchronous = OFF, because they
won't be re-used after a browser or OS crash, so consistency is not an issue.

The initial use-case would be for synchronization.  New data would be
synchronized to the session database.  Once a threshold is met, the data is
shifted to the main database using a single transaction and things like
INSERT INTO ... SELECT (an insert statement who's data comes from a select
statement), then cleared from the session database.

Inserts and updates into the session database will be faster due to running
async.  In some cases it would also be faster due to targetting a smaller
database for things with a lot of churn (we can already partially achieve
that, though).  The final update to the primary database will be faster due
to having a large transaction, and because the data coming out of the
select may be more optimally organized (perhaps sorted).

See also http://code.google.com/p/google-gears/issues/detail?id=51 , which
proposes to add ATTACH functionality to the Database API.  Session
databases would be implicitely using that.

Also, note that this is not the existing temporary SQLite database. 
Perhaps some of this could be done using that, but SQLite temporary
databases are per-handle, so you could not share them across a WorkerPool
or across pages, which may negate much of the advantage of this.

Original issue reported on code.google.com by Scott.Hess on 27 Jun 2007 at 6:34

GoogleCodeExporter commented 8 years ago

Original comment by Scott.Hess on 27 Jun 2007 at 6:35

GoogleCodeExporter commented 8 years ago

Original comment by gears.te...@gmail.com on 29 Jun 2007 at 12:08

GoogleCodeExporter commented 8 years ago

Original comment by othman@gmail.com on 5 Sep 2007 at 7:56

GoogleCodeExporter commented 8 years ago

Original comment by gears.te...@gmail.com on 21 Jan 2008 at 6:20