What If OpenDocument Used SQLite?

Jos van den Oever jos.van.den.oever at kogmbh.com
Mon Aug 24 23:59:28 BST 2015


On 08/25/2015 12:42 AM, Jaroslaw Staniek wrote:
> Hi,
> "What If OpenDocument Used SQLite?"
>
> Well, Many great features: https://www.sqlite.org/affcase1.html
>
> All of them are in .kexi files (SQLite container), not in .od*. It
> could be interesting to see the container supported by us, at least
> I'd use it.
>
> O(1) save in a big spreadsheet...
>

You can put it in ODF Extended. OpenDocument allows extensions.

Sqlite is a fantastic database library. Thinking out of the box should 
be encouraged. Perhaps a database file is good way to store office 
documents.

The problems cited on the webpage do not exist in real life though.

1) Incremental update is hard.
    So what? Just save the file again.

2) Startup is slow.
    Most of the time is spent in layout of the pages, not in parsing the 
XML.

3) More memory is required.
    None of the Office suites use ODF as the internal memory model. They 
translate the ODF content into the runtime memory model. Using sqlite 
for storage would not change that. Most ODF implementations do not read 
ODF files completely in memory but stream the zip streams and parse them 
e.g. with SAX. (Calligra does load most in memory, in a compressed DOM)

4) Crash recovery is difficult.
    Doing background snapshots could be handled in a thread.

5) Content is inaccessible.
    XML matches office documents much closer than SQL. Formatting XML is 
easy and automatically done by most viewers.

The code base required to understand an sqlite file is larger and more 
complex than the one required to read ODF files.

Translating all the elements in ODF to a database file format with lossy 
typing is a lot of work.

Cheers,
Jos






More information about the calligra-devel mailing list