CardDAV – your contacts, everywhere you need them
Post categories
![Profile picture for Rob N ★](/assets/images/robn_profile_picture-CBUFebI40n-42.png)
Alum
After much work and testing – and then some more work and testing – we’re delighted to announce the release of CardDAV support in FastMail. With CardDAV, you can access your FastMail contacts on your mobile phone, tablet or smart watch, with any changes you make on any device kept in sync – just like IMAP works with your email.
This is available now for all Full, Enhanced or Premier personal/family users, and all Standard, Professional or Enterprise business users. Setup instructions for iOS, Android, and more can be found in our help. If you have a Lite or Basic account, or legacy Guest/Member account, why not upgrade today to get access to CardDAV and so much more?!
For the technical minded amongst you, here’s a brief history of how CardDAV came to be at FastMail.
CardDav – a development history
In mid-2014, not long before we released our calendar, we started seriously working on building CardDAV into our contacts system. We knew we could use a lot of the technology already developed for our calendar, as the CalDAV protocol has a lot of similarities to CardDAV.
With Carnegie Mellon University (the original developer of Cyrus IMAP) adding support for CardDAV to Cyrus, it looked like it would be fairly straightforward to change to this for our contacts storage. We knew it had to be done carefully – contacts are an important part of our mail delivery processes as well as the user interface (they’re used as part of spam recognition and filtering rules). But knowing our own systems well it didn’t seem like it would be too difficult.
We started by making the contacts code support other storage mechanisms, instead of being tied to our MySQL database. With that in place, we wrote a CardDAV connector and hooked it up, and voila! Our contacts were stored alongside mail and calendar data in Cyrus. There was some tweaking to make sure that the quirks of different CardDAV clients could be represented properly, but the core code seemed pretty solid in testing.
To help us understand where things could go wrong, we needed to gather feedback from real users, so in December last year we made this available to customers in a beta release. That’s when we started getting reports of certain contacts operations being extremely slow with large address books. Clearly we weren’t quite production ready.
After a lot of testing and analysis, we discovered that performance was significantly affected by constantly converting between the CardDAV format and our own internal formats. We needed to step back and reevaluate.
As it turned out, we already knew what we needed: JMAP. We realised that if Cyrus supported JMAP for contacts access, then our client could use it directly and we’d never need to cache or manipulate any data in between. This turned out to be an enormous amount of work, as a lot of the data conversion code that we’d already built in our middleware had to be re-implemented in Cyrus itself. But, it was worth the effort, resulting in a much simpler and faster architecture.
With the performance problem fixed, we were able to look at the second stage of the beta: making CardDAV available to our business and family account users. These have a second address book of contacts, shared between all users in the account. We wanted both shared and personal contacts to be available via CardDAV, which meant separate address book collections. However, both types of contacts still had to be visible in the web client, which presents a single unified view of shared and personal contacts.
To do all of this properly, we first had to build a new layer between the web client and Cyrus to transparently handle manipulating contacts in two address books at the same time, including moving them between those address books. Then it was time for more testing with our brave beta users, and finally, when we were happy, migrating all users over to the new CardDAV backend.
While it’s taken a considerable amount of time to get right, we’re very satisfied with the end result. We think it’s been worth the wait, and we hope you do too! As ever, we’d love to hear what you think via our support team or on Twitter.