Difference between revisions of "Projects/PIM/Akonadi/Database"

< Projects‎ | PIM‎ | Akonadi
Jump to: navigation, search
(Start Akonadi database internals documentation.)
 
m (Generic: run->running)
 
(8 intermediate revisions by 3 users not shown)
Line 13: Line 13:
  
 
== Backends ==
 
== Backends ==
 +
 +
Akonadi can use different SQL backends. The following documents backend-specific details.
 +
 +
In general, backend specific configuration and setup code can be found in server/src/storage/dbconfig*.
 +
 +
There are three possible operation modes for backends, most only support a subset:
 +
* Embedded: No server process, database is completely integrated into the Akonadi process
 +
* Internal server: Akonadi manages the database server process itself, taking care of starting/stopping and configuring it.
 +
* External server: Akonadi connects to an already running database server.
 +
 +
Selecting and configuring the different backends can be done in ~/.config/akonadi/akonadiserverrc, details on the available options can be found here: [http://api.kde.org/kdesupport-api/kdesupport-apidocs/akonadi/html/classAkonadi_1_1DataStore.html akonadiserverrc options]
  
 
=== MySQL ===
 
=== MySQL ===
Line 18: Line 29:
 
Status: working, default backend for desktop systems
 
Status: working, default backend for desktop systems
  
TODO
+
Supported modes: Internal, External
 +
 
 +
MySQL server configuration files for the internal mode can be found here: server/src/storage/mysql-global*.conf.
  
 
=== Sqlite ===
 
=== Sqlite ===
Line 24: Line 37:
 
Status: working with limitations, default backend for mobile systems
 
Status: working with limitations, default backend for mobile systems
  
TODO
+
Supported modes: Embedded
 +
 
 +
Known issues:
 +
* Requires newer version than the default Qt one.
 +
* Requires patched QtSql driver to fix concurrency issues (Akonadi ships a fork of the driver with the necessary changes)
 +
* Slower than MySQL (see e.g. http://bertjan.broeksemaatjes.nl/node/53), based on our measurments about 2-5x on the query level, but still in the milliseconds range, so that's probably not a big issue.
 +
* Mutex-based transaction serialization in Akonadi (required because SQlite's support of concurrency might not be enough) can block clients while background operations such as a IMAP sync are going on. This is the real killer here, the more clients (including background processes like indexing) are accessing the data, the more blocking you experience. Background http://www.sqlite.org/faq.html#q5 ,  http://www.somacon.com/p369.php , http://www.sqlite.org/lockingv3.html , http://www.mail-archive.com/sqlite-users%40sqlite.org/msg43873.html
  
 
=== PostgreSQL ===
 
=== PostgreSQL ===
  
Status: unknown
+
Status: Working
  
TODO
+
Supported modes: Internal, External
 +
 
 +
Known issues:
 +
* Manual dump and import are required after upgrading the Postgres server installation if the database scheme changes.
  
 
=== Virtuoso ===
 
=== Virtuoso ===
  
 
Status: not working
 
Status: not working
 +
 +
Supported modes: External
  
 
Proof-of-concept work was done during Akademy 2010, up to the point where the database could be created successfully. Known issues:
 
Proof-of-concept work was done during Akademy 2010, up to the point where the database could be created successfully. Known issues:
Line 47: Line 71:
 
Status: not working
 
Status: not working
  
Development stopped, MySQL/Embedded does not support transactions.
+
Supported modes: Embedded
  
 +
Development stopped, MySQL/Embedded does not support transactions.
  
 
== Tools ==
 
== Tools ==
Line 54: Line 79:
 
=== Generic ===
 
=== Generic ===
  
''akonadiconsole'' has support for browsing the database and run arbitrary SQL queries. See [[Development/Tutorials/Akonadi/Application]].
+
''akonadiconsole'' has support for browsing the database and running arbitrary SQL queries. See [[Development/Tutorials/Akonadi/Application]].
  
 
=== MySQL ===
 
=== MySQL ===

Latest revision as of 03:15, 3 December 2012

Contents

[edit] Akonadi Server Database Internals

This page contains information about how the Akonadi server uses its internal SQL database. This is purely for Akonadi server developers, you are NOT supposed to use the database yourself, by-passing Akonadi!

[edit] Database Schema

  • Visualization
  • Code is in server/src/storage
    • akonadidb.xml contains the schema in an XML format
    • dbinitializer* contains the code to create tables out of that
    • updatedb.xml contains schema update instructions
    • dbupdater.* executes those

[edit] Backends

Akonadi can use different SQL backends. The following documents backend-specific details.

In general, backend specific configuration and setup code can be found in server/src/storage/dbconfig*.

There are three possible operation modes for backends, most only support a subset:

  • Embedded: No server process, database is completely integrated into the Akonadi process
  • Internal server: Akonadi manages the database server process itself, taking care of starting/stopping and configuring it.
  • External server: Akonadi connects to an already running database server.

Selecting and configuring the different backends can be done in ~/.config/akonadi/akonadiserverrc, details on the available options can be found here: akonadiserverrc options

[edit] MySQL

Status: working, default backend for desktop systems

Supported modes: Internal, External

MySQL server configuration files for the internal mode can be found here: server/src/storage/mysql-global*.conf.

[edit] Sqlite

Status: working with limitations, default backend for mobile systems

Supported modes: Embedded

Known issues:

[edit] PostgreSQL

Status: Working

Supported modes: Internal, External

Known issues:

  • Manual dump and import are required after upgrading the Postgres server installation if the database scheme changes.

[edit] Virtuoso

Status: not working

Supported modes: External

Proof-of-concept work was done during Akademy 2010, up to the point where the database could be created successfully. Known issues:

  • Some column names used by Akonadi are Virtuoso keywords
  • Some of the first INSERT query fails with a signed vs. unsigned int mismatch/overflow.

Completion of Virtuoso support is considered non-trivial and probably requires a lot of work on the Akonadi side, the SQL dialect is too different from what we support so far.

[edit] MySQL/Embedded

Status: not working

Supported modes: Embedded

Development stopped, MySQL/Embedded does not support transactions.

[edit] Tools

[edit] Generic

akonadiconsole has support for browsing the database and running arbitrary SQL queries. See Development/Tutorials/Akonadi/Application.

[edit] MySQL

There are convenience scripts for running mysqld in the configuration used by Akonadi as well as (and probably more useful) running the MySQL command line client connected to the Akonadi database. See server/src/storage/akonadi-mysql-[client|server].sh.


This page was last modified on 3 December 2012, at 03:15. This page has been accessed 8,671 times. Content is available under Creative Commons License SA 3.0 as well as the GNU Free Documentation License 1.2.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V.Legal