That is Doing It Wrong, which he'll see when he gets to scale. Real time chat needs real-time systems. Too bad gTalk, Facebook Chat, AIM or MSN Messenger aren't available on the market. The closest is ejabberd, which is nowhere near perfect.
At least he moved away from a database, but the fact that he even considered that means that he did no research up front.