Firefox OS/Syncto: Difference between revisions

no edit summary
(First draft.)
 
No edit summary
Line 1: Line 1:
== Syncto ==
= Syncto =


Syncto is a layer to provide the Kinto API for Firefox Sync in order to integrate with Firefox OS
Syncto is a layer to provide the Kinto API for Firefox Sync in order to integrate with Firefox OS
== High level architecture ==


=== Why Syncto? ===
== Why Syncto? ==
We have several use cases where we need to synchronize data on Firefox OS. We have browser/system related data like the one handled by Firefox Sync, but we also have data from Gaia and 3rd party applications with a very long variety of use cases including synchronizing SMS, call history, accounts configuration for Email and Calendar apps, settings, alarms, images, videos and a long etc.


I am glad you've asked because this is a really relevant question.
For browser/system related data we considered using Firefox Sync directly, but that involves implementing the Firefox Sync client on Firefox OS. We did an analysis of the [http://ferjm.github.io/fxos-sync-architecture/1-fxos-sync.html#/ potential architecture] of such a client and we even started working on it, but we stopped that work considering that Syncto looks like a better fit for Firefox OS.


Firefox OS needs to sync data (ie: Contacts, Images, Videos, Game level and preferences) with Firefox OS.
=== Lack of backup reliability ===
Firefox OS will also need to share data between Firefox OS users (ie: Contacts groups)
Firefox Sync is not a backup solution and it does not mean to be one.


If we need to sync data, we should consider using Firefox Sync that was made for that.
On a smartphone, when you lose your mobile, you expect a backup mechanism that restores your new phone to the state it had when it was lost.


==== Why not sync Firefox OS specific data into sync ? ====
Firefox Sync doesn't guarantee that your data will still be there when you restore your new phone.


Firefox Sync is not a backup solution and it does not means to be one.
This is one of the main reasons why we don't want to use Firefox Sync to sync new Firefox OS data into Sync.


On a smartphone, when you loose your mobile, you want a backup on your new phone.
Kinto is a storage solution to sync and share data that integrates with Firefox Account. Firefox OS can use Syncto which is based on Kinto to backup Firefox OS specific data.
Firefox Sync doesn't guarantee that your data will still be there when you start on your new phone.


This is the reason why we don't want to use Firefox Sync to sync new Firefox OS data into sync.
=== Client updates ===
As mentioned above, we studied the possibility of implementing a [http://ferjm.github.io/fxos-sync-architecture/1-fxos-sync.html#/ Firefox Sync client on Firefox OS] and we decided that the best approach could be to reuse some of the parts that were already implemented on the platform (Firefox Accounts client, HAWK client, Token server client, etc). That would save us some development time, but would also tie us to Gecko, which means potentially less frequent updates (which are specially rare on Firefox OS). Having a content side solution opens the door to easier updates. Moving most part of the Sync client logic to the server side means mostly seamless updates.


Kinto is a storage solution to sync and share data that integrates with Firefox Account.
=== Client uniformity ===
Firefox OS can use syncto to backup Firefox OS specific data.
As mentioned above as well, we have a lot of use cases for synchronizing data on Firefox OS. But we'd like to avoid implementing a specific solution for each use case whenever it's possible. We should aim to have a standard and uniform way of synchronizing data on FirefoxOS. And Kinto looks like the best candidate to provide that. We were already planning to use Kinto to synchronize in-app data, which is the biggest set of use cases for FirefoxOS, so having the chance to also synchronize browser/system related data with the same API makes a lot of sense.
 
There is already a [Kinto client (kinto.js) https://github.com/mozilla-services/cliquetis/] written in JS that empowers synchronization between a server and an local IndexedDB database with offline first support and that's exactly what we need on Firefox OS. Having this client on Firefox OS will allow us to fulfill most part of the use cases we identified so far.
==== How do I sync my browser data (in Firefox Sync) into Firefox OS ====
 
To start with it is important to note that Firefox Sync is not yet integrated into Firefox OS.
 
Also Firefox OS needs Firefox Sync for Forms, History, Password and later Bookmarks (they are no bookmarks yet in the Firefox OS browser)
 
We need some effort to intergrate a JavaScript client for Firefox Sync in the browser.
 
===== Problems =====
 
'''Today's Firefox Sync doesn't integrate with Firefox OS Oauth bearer tokens'''
 
In order to use Firefox Sync with Firefox OS we need to implement the Browser ID protocol inside Firefox OS in order to connect to sync.
 
'''They are no Javascript Client for Sync in Javascript yet'''
 
We need to build a client :
 
* for the Firefox Account BrowserID deprecated protocol
* for the Firefox Sync protocol (and talk to the token server, etc.)
 
===== Syncto =====
 
Syncto is a service that will add the Kinto protocol for Sync.
 
* There is already a [http://Kinto.js client https://github.com/mozilla-services/cliquetis/] that empower synchronization between a server and an local IndexDB database
* Kinto already supports Firefox Account Bearer Tokens
* If we integrates a Kinto client on Firefox OS, we could benefit from it for other Firefox OS data synchronization needs.
* We don't need to integrates with the deprecated Browser ID protocol with the Firefox Sync / Token server protocol
 
===== To conclude =====


=== Push Kinto and Firefox Accounts ecosystem forward ===
* The id behind Syncto is to build around the Kinto ecosystem.
* The id behind Syncto is to build around the Kinto ecosystem.
* Concentrate the effort on building the Kinto.js library that will be used for other Firefox OS synchronization and sharing needs.
* Concentrate the effort on building the Kinto.js library that will be used for other Firefox OS synchronization and sharing needs.
Confirmed users
483

edits