One Million Chessboards
a year ago
- #chess
- #scalability
- #web development
- The website 'One Million Chessboards' features one million chessboards where moves are instantly visible to everyone, with no turns.
- Inspired by 'One Million Checkboxes', this project was designed for scalability and runs on a single server.
- The chessboard is stored in-memory as a 2D array of 64 million uint64s, with the backend written in Go.
- The system uses a single writer thread, multiple reader threads, and a mutex for coordinating access to the board.
- Frontend optimistically applies moves immediately, building a dependency graph and rolling back moves if conflicts arise before server acknowledgment.
- The optimistic move application and rollback mechanism involved 1,600 lines of code and took about 7 days of full-time work to develop.