Distributed Chess Team Battle
| |
|
This report presents ‘Distributed Team Chess’, a cooperative version of Chess designed to demonstrate fundamental principles of Distributed Systems within an interactive environment.
Unlike traditional turn-based games, this system introduces a new gameplay mechanic based on Role Sharding and Distributed Consensus. Players are organized into teams where each node holds exclusive write permissions over a specific subset of game resources (specific chess pieces). To execute a state transition (a move), the team must reach a consensus through a voting protocol, transforming the game into a distributed coordination challenge. This way to play chess encourages collaboration, communication, and strategic planning among team members, giving the game a new dynamic and engaging dimension.
From an architectural perspective, the system adopts a Broker-Based Hybrid Peer-to-Peer model. A scalable .NET backend, orchestrating communication via SignalR and persisting state on Redis, acts as a coordination bus and transaction log. This design choice prioritizes Strong Consistency and Partition Tolerance (CP in CAP terms), ensuring a single source of truth while offloading preliminary move validation logic to client nodes to simulate P2P filtering.
The project places a strong emphasis on Fault Tolerance and High Availability. It implements automatic failure detection: in the event of a node crash or disconnection, a failover mechanism triggers a dynamic Rebalancing of the shards, transferring control of the ‘orphaned’ pieces to surviving teammates to ensure system liveness.
Furthermore, a timeout-based supervisor prevents distributed deadlocks during the voting phase. This report details the architectural decisions, the consistency models adopted, and the resilience strategies implemented to guarantee a seamless user experience in a volatile distributed environment.