The way that commercial chat server vendors pitch their products these days is for customer service. Joe User is presumed to be using a computer and his one phone line. So he can't just pick up the phone and call them because he'd have to drop his Internet connection. Also, a customer service person can handle four or five sessions at once if done via something like AOL Instant Messenger rather than via the telephone.
A second limitation to the "just use AIM" approach for customer service is that AIM doesn't provide convenient canned responses. In theory, you might be able to come up with 10 or 15 canned responses that would cover 50% of the inquiries. Then the same staff can handle more customers.
A third limitation to the "just use AIM" approach is that you can't have rich content, e.g., in-line images, because AIM is not a Web browser and can't render HTML.
A fourth reasons that AIM isn't adequate is that it is tough to measure the effectiveness of your staff. The conversations aren't centrally logged (though your staff could save them individually to disk). The conversations aren't tied to your users table.
A good example of a company that has addressed many of these issues is liveperson.com. For $250 per customer service agent per month (prices as of April 1999), they will just do everything for you on their server farm. There are a few problems with LivePerson:
topic. This has the virtue of simplicity. This has the virtue of cleanliness in that all the identically structured data in the system is in a single table. This has the virtue of easy searchability since Oracle is designed to build indices on one table at a time. This has the virtue of transactionality for creation of bboard topics and deletion of bboard topics; no tables are created or dropped when topics are created or dropped.
A bad thing about the one-table structure is fragmentation and lack of
recovery of disk space when postings are deleted. For example, suppose
that you drop an entire bboard topic with 2000 archived messages. This
will result in 2000 random deletions from perhaps 1000 Oracle blocks.
The table won't shrink any, i.e., it will still consume just as many
disk blocks. The free space might not even be used on subsequent
inserts, depending on what percentage of the block is now free.
According to Oracle8 Tuning, page 146, index entries for
deleted rows aren't reclaimed until you do an
***index_name*** rebuild. In practice, it seems that the
bboard table on photo.net hasn't suffered too badly from
this problem (after three months).
Oracle has b-tree indices that are a maximum of four levels deep (header, two intermediate levels, leaf nodes). So you don't get O(log n) access time through an index if the table has an outrageous number of rows. The most important thing that we'll want to do is query by chat room key and date-time. If we were to build a concatenated index on these values, we'd probably have the header block taken up with all the chat room names. Then the next level would be ranges of times for a particular chat room. Then the third level could be more ranges of times. Then the leaf nodes would point to the rowids for specific dates. This could be pretty darn selective if Oracle is smart about building the index.
A disadvantage of archiving is that it chews up disk space. Suppose we're America Online and 1 million subscribers chat or AIM every day. Let's further assume that each person types 50 rows of stuff, 100 bytes each. That means our table will grow by 50 million rows and 5 GB every day. After 20 days, we'll begin to bump up against the billion-row table size that data warehouse experts suggest as a practical limit.
Does that mean we scrap our simple one-table system? Not yet. Designing systems for the highest volume sites is gratifying in a nerd ego sense, but it is a mistake if it leads to fewer features for the user and the publisher. Remember that the future is not mass media but personalized content and lots of interesting mid-sized communities.
Let's reconsider a community like photo.net where the public bboards get no more than 2000 new messages per day, each one an average of 650 characters. That's an average of 1.3 Mbytes of new content every day, implying 8000 days before a 9 GB hard drive is filled up and 500,000 days before we've built a billion-row table. Obviously this isn't going to be a problem to archive indefinitely.
Let's look at the photo.net community another way. We have about 25,000 daily visits. Suppose that each of those 25,000 people used a photo.net chat or instant messaging service to send as much communication as they send via email. Assume 100 messages per day and 200 bytes per message and all 25,000 people participating. That's 0.5 Gbytes per day. We fill up a modern (April 1999) 36 GB disk drive after two months.
So it seems that on popular public sites we won't be able to store everything that users type. At the same time, a real customer's interaction with a real customer service person ought to be archived forever (so that you can ask questions like "show me how many users who talked to Kathy eventually bought an item").
chat_msgsand insert it into
drop table chat_msgs
alter table chat_msgs_new rename to chat_msgs
Following this operation, the chat table will be as compact as possible.
users_activeview. For moderation, we check perms using the permissions package (where module = "chat" and submodule = **chat_room_id**).
Private chat rooms. These are open to people in particular user groups. We check perms using the permissions package.
For either kind of chat room, we should support moderated chat. That is, a posting doesn't go live until it has been approved by someone who has the "moderator" or "administrator" role in user group associate with a private chat room or, in the case of a public chat room, by someone who is a member of the appropriate chat moderation group.
We want to support 1:1 messages for customer support, if nothing else. We need one layer on top of this to make sure that users can find an appropriate chat partner. For example, if Bill User says that he needs support for his widget, the system has to find the least busy authorized widget support person and start a 1:1 chat session between Bill and that person.
For public community sites where nothing is being sold or supported, a publisher might wish to limit the load on the server from all of this 1:1 chatting. In that case, we set an ad.ini file parameter to just bounce users over to the AOL Instant Messenger infrastructure.
util_memoize. When a new posting is made, we force a cache update with
util_memoize_flush. More than 95% of the time, a user is getting results from AOLserver's virtual memory and not from the database.
Kind of makes you feel that all those long hours spent programming and maintaining Unix and Oracle were worthwhile...
Justin (06:42:14) Anyone there? Justin (06:46:41) alright...I'll assume everyone is asleep. Sleep well. Goodnight. Tommy (06:55:33) anyone here? Tommy (06:58:09) so this is supposed to be a camera shopping chat room... Justin (07:27:04) I'm here. Justin (07:28:25) But...I guess you were here...like a half hour ago, so I'm going to take my circadain rhythm problem to the donut shop. Lim (09:59:23) hi Lim (09:59:51) anybody around? Eve (10:19:10) Hi there. Eve (10:24:14) anybody around? Are you still there Lim?