The persistence mechanisms we looked at in Chapter 10, Serializing and Saving – JSON, YAML, Pickle, CSV, and XML, focused on reading and writing a compact file with the serialized representation of one or more objects. If we wanted to update any part of the file, we were forced to replace the entire file. This is a consequence of using a compact notation for the data: it's difficult to reach the position of an individual object within a file, and it's difficult to replace an object if the size changes. Rather than addressing these difficulties with smart, complex algorithms, all of the data was serialized and written.
When we have a larger problem domain with many persistent, independent, and mutable objects, we introduce some additional depth to the use cases:
- We may not want to load all of the objects into the memory at...