Earlier this week I released Unread 3.0 with Unread Cloud. Unread Cloud is a new syncing and article retrieval system for Unread.
I have written before that Local accounts use the Unread Cloud infrastructure to efficiently retrieve articles. I want to give more detail about what that means. What is a “Local” account if it uses Unread Cloud? This is a look behind the scenes at how Local accounts work in Unread 3.
A Local account operates like an Unread Cloud account in these ways:
- Creating a Local account creates an account with my authentication service for use with Unread Cloud.
- A Local account saves its subscriptions to Unread Cloud. Unread Cloud needs to know which feeds to poll, and which new articles to return when a Local account is looking for new articles.
- Local accounts retrieve articles from Unread Cloud.
Since Local accounts do not keep multiple devices in sync, Local accounts do not store this information to Unread Cloud:
- Which articles are marked read.
- Which articles are saved.
That information is stored locally and does not sync for a Local account.
Device Backups
Unread excludes its database files from iCloud Backups. For an Unread Cloud account or a feed service (such as Feedly) account, the data can be downloaded again.
Under some circumstances iCloud Backups exclude keychain entries such as those storing login credentials. If you restore a device from iCloud Backup and your credentials for an Unread Cloud account or a feed service account are missing, Unread will ask you to log in again.
Since there is no way to ask a user to log in to a Local account, more information needs to be incorporated into backups of a Local account. I considered including database files for Local accounts in iCloud Backups, but that would have consumed an excessive amount of iCloud storage. Content of recent articles and cached webpage text can be downloaded again, and the article database contains a bulky full text index of article content.
Instead Unread maintains an on-device export of Local account data in compressed JSON files that contain:
- The list of subscriptions.
- Identifiers of articles that have been marked read.
- Saved articles.
The compressed export files are backed up. When Unread is opened on a device after being restored from an iCloud Backup, it creates a new server account and restores its data using the JSON export files. The process is seamless. It looks like you are just downloading your articles again.
Handling Abandoned Accounts
Unread Cloud accounts are never deleted except at a user’s explicit request. As long as you can log in to your Apple ID, you can log in to your Unread Cloud account using Sign in with Apple.
However if a customer creates a Local account on a device and then deletes Unread from that device, my service has no way to know that the account cannot be used again. For the sake of both preserving customer privacy and minimizing the sizes of my databases, I felt it important to delete Local accounts that are likely abandoned.
It is also important that if a customer creates a Local account and does not use it for a very long time, it continues to work if and when the customer returns to it. Therefore after a Local account goes 90 days without being accessed, that account will be deleted from my servers. If the app later tries to access that account, it will see that the account has been deleted and will recreate it. This process is seamless. Creating a replacement server-side account with the same subscriptions happens quickly at the start of an account refresh.
I did a considerable amount of work to avoid storing data for accounts that are abandoned, to avoid storing data that does not need to sync, and to minimize the iCloud storage required for a backup of a Local account. But I also ensured that Local accounts work as one would expect:
- A Local account will continue to work after going unused for a long period of time.
- If your device is backed up and later restored via iCloud Backup, the restored device will have your data including: subscriptions, current articles, saved articles, and which articles are marked read.
- If you restore a new device from a backup of an old device, Local accounts from the old device will be cloned to the new device.
If you have not yet tried Unread 3, you can download it from the App Store.