In Dwarf Fortress, nearly everything that happens during world generation is logged and viewable in legends mode. An XML file containing that information can be exported and loaded into a utility such as Legends Viewer which can show specific events, relationships between two recorded people, what kingdoms people belonged to, etc.
My naive approach would be to add each event associated with a person to a database with a unique ID then filtering using the ID in order to view the correct events. However, this approach seems to be inflexible and adds more dependencies and complexity to my project.
My second approach would be to store these events in a JSON file in order to be able to treat each individual as an object, although this approach will probably be either be too memory intensive and not scale well since I would have to load a large file into memory or be too slow since I would have to open and modify many files at a time.
Assume the game has a simple system where each individual is tracked by a name and a UUID, belongs to a kingdom, and has some type of relationship to other individuals. Events are tracked by recording the location, date, and individuals involved. What type of file, data structure, library, etc. is generally used for something like this that is efficient enough to store up to a million or so of these simple entries?