Real-time chat with database support