1

So, iCloud is still under NDA, but my question isn't so much about iCloud as it is how to implement something inspired by iCloud.

We all know iCloud is just a server based mechanism for syncing Documents. I'm just really inspired by the Documents aspect of it. It seems like a different paradigm to me to focus on syncing documents. Web APIs I have written (which isn't many) have all been SQL database driven.

An example: A simple blog post usually is something like this: A row in a database that contains the title, content, date published, author. If you want to update the title, for instance, you update that row/column in the DB. Easy, until you want to sync a bunch of clients who are making offline changes.

But if a blog post were a single document, that within itself maintained its own internal structure with a title, content, etc. all within one file. When you modify the title, the document is updated locally, then push the entire document (or a diff) up to the server. The server just replaces the old document with the new document, and voila the title is updated on the server. Obviously, this can lead to merge conflicts, but those can be handled by sending conflicting documents to the clients.

Anyway, I like that approach and I can see how it could be really useful for many web apps, especially those that want to support modifying data while offline and syncing easily once an internet connection is available, which is while its great for iOS.

My question: is there a name for what I'm talking about, and are there some useful reading materials available for learning how to implement such a technology?

In Other Words (Edit)

The iCloud API (currently under NDA) is just plain cool, and I want to start organizing the data in my iOS apps to be Documents synced with a Document Server, rather than just plain Core Data objects syncing through some REST api. How cool would it be if you could deploy an iCloud like server that was custom tailored for your iOS app?!

4

2 回答 2

0

IMPO database approach is more practical then dealing with additional files. But this can be done with PHP or C++ functions. I have done something similar, where you edit a file through C++, then put in a folder, the folder can be any folder which will be synced with the server.

于 2011-08-04T20:28:43.183 回答
0

After more research, I realized what I was looking for is called a Document-oriented Database, and I have selected Apache CouchDB as a good Document-oriented Database for use with my iPhone app. Its not exactly the same as iCloud, but has many similar features.

于 2012-02-06T21:43:46.223 回答