Database Reference
In-Depth Information
CHAPTER 11
Distributed Core Data
Imagine if all the users in a family had our recipe application and wanted to
be able to see everyone else's recipes. You can probably come up with many
such scenarios for sharing data across a local area network. If your application
sits on a user's desktop and laptop, there is a fair chance the user wants to
keep that data in sync. Of course, this can be done with iCloud for a single
user, but imagine a small office environment or family of computers. Not every
user has the same iCloud account, and you may not want to share the entire
data set to every user. Being able to set up a local area sharing can solve the
need to share partial or complete data in a local environment.
Core Data is generally considered to be a single-user/single-application per-
sistent store. However, as we explored in Chapter 6, Using iCloud , on page
99 , Core Data can be used beyond the single-user/single-application design
with iCloud along more than one application and/or device to access the
same data. In this chapter, we are going to explore using Core Data with
distributed objects. Distributed objects enable a Cocoa application to call an
object in a different Cocoa application (or a different thread in the same
application). The applications can even be running on different computers
on a network.
To take this idea one step further, we are going to add Bonjour into the design.
Bonjour, also known as zero-configuration networking , enables automatic
discovery of computers, devices, and services on IP networks. With this
combination, we can provide access to a Core Data repository to any client
on the network “automatically”—without user interaction.
Before we go into the details, let's examine the cons for this design.
Scalability : This design does not scale well at all. When we are working
with a couple of clients on a network, the design performs just fine. But
 
 
 
Search WWH ::




Custom Search