Creating an iCloud like server [closed]
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this questionSo, 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.
开发者_JAVA百科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?!
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.
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.
精彩评论