Gaia/Contacts/Data Refactor/mozcontactsProposal: Difference between revisions
Line 8: | Line 8: | ||
= Advantages = | = Advantages = | ||
** We keep mozContacts as the Contact authority in the system. If there is a Contact known to the system then it will be present on the mozContacts store. And any app being certified, privileged or not would be able to know about it (although not to all the data, of course, subject to the restrictions imposed by the providers datastores.). | |||
** Whenever a change is made locally it is automatically propagated and we will not need to wait for the propagation of changes to the GCDS and from there to the local IndexedDB. | |||
** We can keep very easily the existing functionality of contacts merging, import from SIM, vCard, Facebook, etc. It enables an easy migration, we don't need to migrate from mozContacts to GCDS, the data is already there. |
Revision as of 14:55, 27 November 2014
Introduction
This proposal advocates for collapsing two datastores (mozContacts and GCDS) into one. As a result the role of the GlobalContactsDatastore will played by the regular mozContacts datastore. An entry in the referred datastore could have local data and/or pointers to contacts present in the external providers datastores (Facebook, Gmail, etc.). We will be providing a library that will allow to resolve a mozContact to the real data it should have, as it has already been done with the MultiContact library.
To support this apprach the mozContact object will be extended with a 'sources' attribute (vcard standard) that will allow us to store the datastore provider and the id of the "linked" contacts. There can be contacts in the system that only exist in the external service and in that case all the mozContact attributes will be empty apart from the referred 'sources' attribute.
How it works
Advantages
- We keep mozContacts as the Contact authority in the system. If there is a Contact known to the system then it will be present on the mozContacts store. And any app being certified, privileged or not would be able to know about it (although not to all the data, of course, subject to the restrictions imposed by the providers datastores.).
- Whenever a change is made locally it is automatically propagated and we will not need to wait for the propagation of changes to the GCDS and from there to the local IndexedDB.
- We can keep very easily the existing functionality of contacts merging, import from SIM, vCard, Facebook, etc. It enables an easy migration, we don't need to migrate from mozContacts to GCDS, the data is already there.