Share friendship (roster) for 30 thousand users

Hey guys, I am implementing a Chat System for a very large school group. The requirements are:

  1. Every user must be “friend” of other users (It is not necessary add new connections);

  2. There are groups, Teachers, Managers, Students …

I thought the following: I create the groups, add the users in their respective groups and share the contacts between them.

But what to do with the offline users? XMPP send a list with every contact, offline or online on connection (Correct me if I am wrong).

I am talking about 30 thousands users, yes it is a huge amount.

Do you have any suggestions?

Thank you very much.