Let's take a look at how iCloud works.

Source: Internet
Author: User

ICloud is about to meet the fans of broad fruit. I believe many fans have been waiting for this service for a long time. How does iCloud, one of the most important iOS 5 updates, serve users? The following describes the internal structure of iCloud.

The simplest form of iCloud is actually a specific folder, which is located in the/private/var/mobile/Library/Mobile Documents/directory of iOS devices. This directory stores all application data shared by applications to the cloud.

The application has partial read/write permissions on the directory, which is unique to developers. For Password Key Strings, developers can share cloud data between applications. For example, all applications developed by Company X can share, view, and update the same file set. You cannot share data other than your developer account, so my application cannot see Company X files, and vice versa.

The iOS system monitors the Mobile Documents folder. When files are changed, the device automatically uploads these changes to the cloud. These changes can be transmitted to all devices bound to the same account. These operations are handled by the local operating system service, and applications are not directly involved.

Instead, applications subscribe to different types of notifications to let the application know the latest changes. Then, they can deal with data version conflicts by comparing local and iCloud data.

It's just what developers do. They can select the "recently modified valid" policy. Or they can combine some other changes. The role of an application is to ensure that data on different hardware device units is consistent and that available network connections are required to handle this consistency.

When a user loses the network connection, the problem arises. For example, you may edit the to-do list on a flight without a network connection, and your partner is updating the same to-do list in his or her city. Developers have been working for this for several months to study how to combine these changes and update the policy of the target file while accepting the changes made by both parties at the same time.

Finally, there may be few ways to use the iCloud API. It is actually a storage folder for remote synchronization. For developers, the trick is to consider the effect of time, space, and connection on folders because the folder must be adapted to user updates.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.