letra de hello world - nooney
you can insert a comment marker in the text itself. this marker is not displayed. as text is being changed, the marker stay embedded in the text itself and moves around as text is being edited. if the paragraph is removed then the comment can be orphaned and garbage collected later. of course, this has nothing to do with dbs, is just pure text processing
if you want a db centric approach then the paragraphs are -ssigned primary keys during creation and the comments reference this primary key. as pk, of course, they never change. order of paragraphs within text can be persisted as a relation previous-current-next (implemented as a separate table, or as next_id and prev_id fields. you can also throw in versioning (history). i’m not a editable text storage expert so i don’t know what is the state of the art
your problem, as you state it, is not a problem of text processing but a problem arrise from the use of a natural primary key (paragraph position or paragraph hash). of course, we all know that natural keys are bad because they change. in your example they change very frequently. using surrogate keys solve the problem of pk volatility. the rest is just a modeling exercise on storing the relations (order of paragraphs in text, paragraph changes as text evolves etc). i’m letting as an exercise to you the problem of paragraph split during edit (which shard inherits which comments) and the problem of paragraph merge
letras aleatórias
- goldman › letra de purple rarri - goldman
- zombina and the skeletones › letra de flaming skull - zombina and the skeletones
- mike mangione the union › letra de endless - mike mangione & the union
- lil west › letra de heart4orever - lil west
- neo › letra de gluposti - neo
- mez uk › letra de open the door - mez (uk)
- jurie els › letra de the river - jurie els
- dope lxrd › letra de heathens - dope lxrd
- tim rogers the twin set › letra de hi, we're the support band - tim rogers & the twin set
- diabolic › letra de pyrex - diabolic