next up previous contents
Next: Creating New User Accounts Up: Problems to be addressed Previous: Network Structure   Contents

Server-Database Synchronisation

In order for the network to be fully reliable and function correctly, each server must store up-to-date information about every user on the system. While a user should only be logged into one server at any one time, because of the unbounded and unpredictable nature of network communication, messages may be delivered out of order. Therefore to prevent the replicated databases becoming inconsistent, each message will be timestamped.

A further problem is that it is not possible to rely on the computers on which the server is running having an accurate clock, so a conventional timestamp is not possible. However, a clock is merely a counter which is updated at some fixed interval, so if each record in the database has its own counter which is initialised to zero when it is created and incremented each time the record is updated, this counter can be used as a timestamp instead of the actual time.

Overflow is a problem because if the counter overflowed servers would reject all update requests as being old messages. However a 32-bit counter has a maximum value of $2^{32}-1 = 4,294,967,295$. Even in the unlikely event of a user updating their status every second, this gives the account a lifetime of 136 years which was considered quite adequate for this system.


next up previous contents
Next: Creating New User Accounts Up: Problems to be addressed Previous: Network Structure   Contents
Nathan Dimmock 2001-06-20