(→change tracking) |
(added ideas for sending only UIDs in contact view and setting EBook query flags) |
||
| Line 25: | Line 25: | ||
# extend EDS query language with a flag that suppresses sending existing data when the view is opened | # extend EDS query language with a flag that suppresses sending existing data when the view is opened | ||
# implement for local contact and calendar backend, reject with error in others | # implement for local contact and calendar backend, reject with error in others | ||
| + | # contacts: implement special case where view with "requested_fields = UID" only returns UID | ||
| + | |||
| + | One possibility for adding the flag is to (ab)use the existing query language with a match for special fields: | ||
| + | * in the client: query = e_book_query_orv(e_book_query_field_exists("X-EDS-QUERY-FLAG-SKIP-DATA-DUMP"), <real query>, NULL); | ||
| + | * in the server: "if (query is OR-Query and first clause is exists("X-EDS-QUERY-FLAG-SKIP-DATA-DUMP")) { skip_data_dump = TRUE; query = second clause; } | ||
== optional parsing of data in client == | == optional parsing of data in client == | ||
This page describes improvements that are desirable or even essential for good performance of Evolution Data Server (EDS) as PIM storage in MeeGo.
All of these changes should be developed for the EDS master branch, reviewed by upstream maintainers and then back-ported to EDS 2.32, the version in MeeGo.
Contents |
Only authorized applications (= processes) with the necessary permissions should be able to read/write data. Exact permissions and mechanisms for verifying them to be defined as part of the (revised?) MeeGo architecture.
This can be added as follows:
EDS is based on the model/view/controller principle: an app opens a database (calendar or addresbook) and requests a view with server-side filtering, then is sent:
Applications modify data with asynchronous requests (controller) and keep showing the old data until the change notification comes in. The exact changes made to the data are determined by the server (for example when meeting invitations are sent).
QtContacts and KCalCore do not have such a strict model. With QtContacts the app simply loads and stores contacts and is responsible for maintaining its own view. Changes are sent for changes made after the database was opened. KCalCore is based on the concept of loading a calendar (partially) into the client, modifying it there, then writing it back. Changes are also sent while the storage is open.
TODO:
One possibility for adding the flag is to (ab)use the existing query language with a match for special fields:
libebook/ecal provide different functionality:
QtContacts and KCalCore replace the second part. An obvious performance improvement is to only do the second part if the additional C APIs are really called. The following calls then transfer data without any additional parsing in libebook/libecal:
TODO:
PROBLEM:
This was discussed a while ago: [[http://www.mail-archive.com/evolution-hackers@gnome.org/msg03029.html [Evolution-hackers] concurrent modifications of items in GUI and EDS database]]
Data synchronization only needs to know which items exist (list of local IDs) and which revision of each item is currently stored. Revisions can be identified with a string which changes for each modification. Restoring an older revision should (but doesn't have to) restore the revision string.
For calendar, UID+RECURRENCE-ID and LAST-MODIFIED can be used. For contacts, UID + REV.
By comparing a stored list against the current one, changes can be detected without relying on journals in the daemon or comparison of time stamps. Journals are hard to maintain (how many of them, how long?). Comparison of time stamps has problems when changes are allowed while a sync runs and assumes that system time is linear (which is not always true).
As an additional use case, local ID + revision string could be used to prevent overwriting stale data in the server, as in HTTP PUT eTag checks.
TODO:
Even quicker than listing items and comparing their revisions strings would be a comparison of a revision string for the whole database. The semantic would be this:
The modification time stamp of the .ics or .db files could be used. Probably need a new "query property" API. e_cal_get_static_capability() only returns bool. Same with e_book_get_static_capabilities()/e_book_check_static_capability().
Transfering PHOTO data over D-Bus as base64 encoded data in each vCard has obvious performance issues. Instead the PHOTO property should be a link to a local file (supported by vCard), with utility code available to libebook users to convert between the different representations.
Goals:
Proposal:
Open: