SqlBackends

= SQL-Support =

Current developer is Paul Eggleton (bluelightning). Original developer was Stefan Eilers (eilers).

General Information
Since release 1.1.3, Opie supports SQLite for storing PIM data. Due to the fact that it is in a beta state and we haven't supported syncing with it, we have not publicised this feature very loudly. However in 1.2.5 the remaining portions were completed and SQL backends are used by default in version 1.2.5 onwards.

The main advantage of this new feature is its lower memory footprint (the XML-backends hold the entire content in memory) and its great scalability: The XML backends need a lot of time to open a new database due to the fact that they parse the complete XML file and load the data into memory. Especially, if you have a lot of information you will love the fast startup-time.

However, there is no such thing as a free lunch! Having all of the data in memory is the fastest way to work with it. Therefore, the access times are slower than they are with the XML database. SQLite has to load the data from storage on demand, which will always be slower that accessing it in memory. To decrease this disadvantage, we use a cache architecture, which holds some of the last PIM records in memory. The other advantage is look ahead loading, which is going to be implemented in the backends (currently implemented in todo, only). This will increase linear loading of data, which occurs for instance, if you load tables. There is a lot of possible tuning to do in future releases.

The other disadvantage is storage: While you will need less heap memory (RAM), you need more memory on the disk storage (flash) as you need index-files to provide fast access to the data.

Switching between SQL / XML Support
To activate the SQL-Support, you need - beside SQLite - Opie with included libOpieDB2 and libOpiePim2 with added SQL-Classes. Then, either use Opie-PimConverter from 1.2.5 or alternatively modify the file "pimaccess.conf" in the settings-directory:

[contact] usebackend = sql [datebook] usebackend = sql [todo] usebackend = sql

You can switch back to xml by replacing "sql" with "xml".