You would usually deduplicate the data when you receive the NSPersistentStoreDidImportUbiquitousContentChangesNotification
notification, and you have merged the changes into your context. After merging, go through the data and dedupe.
Here is a good tutorial on deduping: http://www.atomicbird.com/blog/icloud-complications-part-2
Deduplication is one of the poorer design aspects of Core Data + iCloud in my view. Other sync solutions, like Wasabi Sync and Ensembles, allow you to provide global identifiers as an alternative to deduplication. I find it a cleaner solution. (Disclosure: I am the developer of Ensembles.)