The desired objective is to keep a single database (I simply call it "ChessAdmin opening book") containing all of the variations that I consider significant and noteworthy in the openings I use. My basic criteria for inclusion is that there should be at least a decent chance of facing the line in a tournament game someday, with the corollary that the variation itself is complex or important enough that I need to document and (theoretically) remember it. For example, I don't have anything in the database for Black defenses against 1. b4 (Sokolsky), 1. g4 (Grob's Attack), etc. However, the database is always a living document and I regularly update and refine it based on my ongoing practice and study. For example, I've started to recently encounter a Queen's Gambit Declined setup more often against the English, so have added that to the openings book database. If in the future I encountered a Grob's player on a regular basis, I'm sure I'd add something on that as well.
More specifically, I will have a "game" in the database for each major variation in an opening. For example, I currently have nine Caro-Kann games in the database, named as follows:
- Caro-Kann - 2. c4
- Caro-Kann - 2. d3
- Caro-Kann - Advance
- Caro-Kann - Exchange
- Caro-Kann - Fantasy
- Caro-Kann - Main Line - Bronstein-Larsen
- Caro-Kann - Main Line - Classical
- Caro-Kann - Panov
- Caro-Kann - Two Knights
I prefer to have the lines named and organized in the above way in the database, as it parallels how openings book authors typically organize chapters. I can then easily look up a particular major variation in the games list of the database. Conceptually and practically for me it is cleaner than trying to put everything into just a few or even one massive database game. Where one draws the line is probably a matter of personal taste, although using a "chapter" analogy is probably a good guide. For example, I decided to have two Main Line "game" variations (also happening to parallel the framework in Starting Out: The Caro-Kann) largely because they are so different from each other and the large number of branching variations made putting the two in a single database game unwieldy.
One thing that I think is very helpful about a database structure is being able to easily include variations and sub-variations that aren't main line or are never used at the professional level, but can be dangerous or annoying if you aren't aware of them. Your future opponent likely doesn't know or doesn't care if GMs play the line or not, so if something looks obvious they may just go ahead and play it. There are a fair number of these types of moves that may even be refuted by a particular sequence, which makes it worth documenting rather than just trusting myself that I can work it out over-the-board. I will also use game annotations to leave myself notes, for example when my side has a common plan in response to whatever the opponent does, rather than including all of the possible choices.
With my opening book organized per above, it's easy to immediately link from a particular position to the main database in order to look up full games and then load those separately, perform statistical operations based on the position, etc. With the above setup, I'd hesitate to merge complete games into the base "game" variation, but I've considered setting up a different "examples" database to break out those key games that are worth referring to repeatedly.