We can request that a shelf be opened with writeback=True. This will track changes to mutable objects by keeping a cached version of each object in the active memory. This changes the design of the Access class. The examples of the Access class, shown in the previous sections of this chapter, forced the application to make method calls to update_blog() and update_post() to be sure a change was persisted to external files. When working in writeback mode, the application is free to mutate an object's values and the shelf module will persist the change without any extra method invocations. This automatic update will not update the ancillary indices, however, since they were made by our application's access layer.
In an application where a shelf does not make extensive use of additional index values, the writeback mode can be advantageous...