mbruker/Cockatrice — comment on commit 50e53fbe5395ef698d1ca78ac6308533dd3c6c15
File:  line 0
By mbruker:

At some point, we are going to need multiple servers to improve latency for overseas players and to make the system more scalable. However, I don't want that to create a gap between players, which is why I would like to have a decentralized network of servers that will appear to be stand-alone to the outside but that will let players play with and talk to others who live on other servers in that network transparently.
When a server starts that is supposed to be part of the network, it registers itself with the other servers and caches all pieces of public information that is provided by them (rooms, games, users online). All commands, responses and events related to data structures maintained by other servers must be forwarded.
We need to consider the following points.
- Encryption of the intra-server connections is needed, so is a strong means of authentication. I propose SSL with client+server public key authentication.
- The bottleneck is going to be the database, both security and performance wise. A central database, as we're having it now, poses not only a SPOF issue but also deteriorates performance of the "slave" servers (possibly to the point where they aren't any use). For a decentralized database, special care must be taken to properly synchronize the records to avoid race conditions.
If the database contains the public keys of all servers, additional database accounts with limited access rights are needed.