I'm currently working on a personal project, a chess repertoire API. Users should be able to store positions, games, commenting each move, adding variant lines on games (eg., possible answers for openings).
In addition to basic CRUD operations, I'd like to add an import feature, to let users copy stuff from other users, so they can modify them. Of course, updating / deleting a position or a game should have no impact on the repertoire of other users, whether they own the imported data or they imported it too.
The dumb way to do this is just to duplicate the data in persistence, but it will multiply the persistence size, I tend to choose a way to reduce this effect: by importing, I could add an access flag, modifying would duplicate the data, and deletion would remove the access flag, or delete the data if user is owner and is the only accessor.
That's a persistence optimization, is it a leak if the interactor runs a query to check which case applies ? Should this logic be in the persistence layer and interactor only run an update/delete query ?
I have no persistence yet, I'll use one at the very end, but I need to know what to write in the interactor.