def write(self):
        """Write the database to disk."""
        with self.vfs("commit_metadata", "w", atomictemp=True) as f:
            entries = [
                {"node": hex(node), "category": category, "data": data}
                for ((node, category), data) in self.contents.items()
            ]
            json.dump(entries, f)