Page 1 of 1

Implementing a chess game database

Posted: Tue Aug 09, 2011 3:47 am
by kevinfat
Does anyone know how chess game databases are implemented? What kind of on disk representations are used? What kind of in-memory data structures are used? And what are the tradeoffs that one needs to consider in regards to optimizing performance?

Re: Implementing a chess game database

Posted: Wed Aug 10, 2011 3:34 pm
by trojanfoe
This is a good question. The database needs to use a binary format that is efficient to update/insert/delete/search etc. You cannot use a text format, like PGN. There are a couple of formats already being used by free programs (like SCID), but I have no idea if they have any limitations.

If I were going to start a new format (and I have considered it in the past) I would consider using sqlite3 to provide the framework for player/event searching and perhaps storing the game data within a blob. All that would be required then is some method of improving position searching.

Andy