Monday, June 18, 2007

The Rip Van Winkle effect in Kerika

A user writes in:
Sometimes when wake my laptop I get a dialogue suggesting that Kerika is trying to connect to a gmail account. Can you say something about what is going on as it looks rather suspicious.
The dialog box looks like this:


Here's whats happening:
  • Remember, Kerika is a peer-to-peer application, which means that your machine connects directly to every other Kerika user who happens to be online. (This is similar to how other P2P applications work, like Skype and instant messaging.)
  • The way your computer finds every other Kerika user who happens to be online is simple: when you start up Kerika, it automatically checks in with the central rendezvous server that we maintain at our data center.
  • The rendezvous server lets your Kerika know who else is online, and how to reach them (i.e. their IP addresses). If you look at the Network Status area, on the lower-right corner of your Kerika application window, you will occasionally see these messages go by as your Kerika connects with other online users. However, the IP addresses of other Kerika users are never shown to you!
So, let's say you have been running Kerika for a while. While you were active, Kerika was keeping track of other users as they came online and left. But when your computer goes to sleep because of inactivity, things can go awry and it could end up waking in a confused state:
  • While your Kerika was asleep, some of the other Kerika users may have gone away. But your Kerika missed these goodbye messages while it was sleeping.
  • Also, the connection that your computer was maintaining with our rendezvous server was dropped because the rendezvous hadn't hear from your computer in a while and assumed that you had gone away.
  • So when your Kerika wakes up, it may find itself in a confused state, just like Rip Van Winkle waking up from his long sleep: things aren't as they were before he took his little nap!
  • Some users that he thought were around don't seem to be responding to him, and even the rendezvous server seems to have disappeared. Oh, dear! And like old Rip waking up, Kerika can sometimes be a little incoherent until she gets her bearings.
  • The best thing to do in this situation is to simply restart Kerika: that will quickly synch up your machine with the rest of the world.
These error messages are quite rare, and obviously not very helpful in this particular context. We can try to eliminate them in a future version of Kerika.

Update: our user wrote back to ask another good question:
Thanks. I'm intrigued how this scales. If you get a million or so customers online does my client end up caching a table with a million or so email address/ip address entries although the community I am sharing with might only be a few tens of people?
The answer is No, because of the way JXTA works: you can set up several rendezvous servers, each of which knows how to connect to the other rendezvous [OK, I admit it: I don't know what the plural of rendezvous is...], either directly or through another rendezvous. Right now we don't have a million or so users, so we have just a single rendezvous ;-) but as we scale up, we can add more rendezvous.

Another feature of JXTA that we haven't fully exploited yet is the ability to create private groups. Right now we have just one big private group for all Kerika users; in the future we could create more fine-grained groups that create mini-communities.

0 Comments:

Post a Comment

<< Home