Modern serialization frameworks solve this via (assigning a temporary local ID to the new object, like temp_id_123 , and referencing that ID in nested objects rather than re-serializing the whole structure). This transforms a hydra of data into a clean, directed acyclic graph (DAG).