Databases and Deep Copy

后端 未结 4 540
花落未央
花落未央 2021-01-19 19:32

If I find myself wanting to do a deep copy of an object stored in my relational database, have I necessarily done something fundamentally wrong architecturally? This is a di

4条回答
  •  無奈伤痛
    2021-01-19 20:02

    Not necessarily. I have done this myself with much success to implement a versioning scheme. Basically entire graphs could be versioned (using a compite key, where one part of the key was the thing id and the other was the version number), and we would have access to all previous version of the graph or sub graphs easily.

    To be clear, the DB Architect recommended this scheme; his opinion had a lot of weight, and the solution wasn't my first choice. But in the end it worked really well.

提交回复
热议问题