10.2. Implementing a Messenger User

Each user of the messenger service is represented by a distributed data structure made up of the following:

  • An account entry that holds the username and password.

  • A session entry that holds information about the user's current session and exists in the space only as long as the user is online.

  • A “friends list” entry that maintains the user's list of friends.

  • A channel that holds a user's messages.

So basically a user is represented in the space by three entries and a channel (like the channels we developed in Chapter 5). These pieces are held together by a common, unique username field: For instance, the user “duke” will have the value “duke” in the username field of his account entry, friends list entry, and session entry, and in all the entries making up his channel.

Let's cover each piece of the distributed data structure in turn.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset