Proposal: Manuscript and ManuscriptSnapshot
Currently we have Manuscript
s and ManuscriptVersion
s. Manuscript
is only a container, and the data resides in each ManuscriptVersion
, the latest ManuscriptVersion
is also mutable.
In #17 (closed), Tamlyn is proposing a different approach:
Would it be better to have
Manuscript
hold all the current data and be mutable and at key points that data gets copied into aManuscriptSnapshot
which is immutable?
This has a few benefits:
-
It's clear from name and function, that a
ManuscriptSnapshot
is immutable, vs. with the currentManuscriptVersion
approach, past versions are immutable, and only the current/latestManuscriptVersion
is mutable. This can be a potential source of strange errors (maybe a client at a certain point is unsure if theManuscriptVersion
is latest, and writes to something that is supposed to be immutable, and on the other side, data is lost from the latest version). -
It's better from a performance standpoint, as to get the latest data (the most frequent request/query), you only need to
SELECT * FROM manuscripts WHERE id = x
, vs. constantly ordering theManuscriptVersions
of aManuscript
by date and getting the latest. This is probably a minimal overhead in practice, but it's significant in terms of complexity/mental overhead.
Please give your thoughts on this proposal: @John.kopanas, @bogdan, @audrey, @tamlyn, @yannis.