Event sourcing for articles (wiki)

278 views
Skip to first unread message

Daniel Plainview

unread,
May 8, 2016, 4:52:43 PM5/8/16
to DDD/CQRS
Hi,

Let's say we want to create project like wiki. Users can edit articles, revert changes, see diffs, etc.

First thought is "oh, every change of an article is an event, ES fits naturally here".

And technically, it's possible to get diff and attach it to a domain event, then apply that diff/patch to the Article.text during replaying.

But I wonder if it's even reasonable to go with this way, because I see some issues:

* potentially large events;
* events will be locked with specific diff algorithm.

Is it worth it? Probably, it's better to delegate it to git, for example?

Aryeh

unread,
May 9, 2016, 1:59:10 AM5/9/16
to DDD/CQRS
Hi Daniel,

No, I don't think ES is a solution.  Let's make something really really really simple complex.

Any wiki page is a representation of a single piece of text.  Store old ones if you want. Diff between them optionally.

Best regards,
Aryeh Hoffman

Egon Elbre

unread,
May 9, 2016, 2:37:51 AM5/9/16
to DDD/CQRS
fed-wiki does something similar with its "journal" (e.g. see in welcome page in json). Each action is targeting items rather than a article, e.g. move this paragraph down, add title here. Basically it allows to build a "distributed wiki" where you can fork/edit/pull changes and leave a trail how things were changed or where some paragraph originated from.

Of course, as Aryeh said, it will make the wiki system and editor more complicated. And, when you do it trivially (store diffs between article versions) you probably won't get any benefit, compared to just storing the old versions.

+ Egon

Daniel Plainview

unread,
May 9, 2016, 7:05:35 AM5/9/16
to DDD/CQRS
Well, you are right, I think, it's much easier to store all snapshots of an articles (git works like this, by the way).

Kijana Woodard

unread,
May 9, 2016, 10:56:41 AM5/9/16
to ddd...@googlegroups.com
You could have events for other purposes, e.g. ArticlePublished, but leave the main data as a document.

From: Daniel Plainview
Sent: ‎5/‎9/‎2016 6:05 AM
To: DDD/CQRS
Subject: [DDD/CQRS] Re: Event sourcing for articles (wiki)

--
You received this message because you are subscribed to the Google Groups "DDD/CQRS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dddcqrs+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Robert Mrobo

unread,
Apr 28, 2021, 10:12:25 PM4/28/21
to DDD/CQRS
Hi Dan, I'm very much interested in hearing how did you solve this one. I have this decision to make as well and would love to hear your insight on the matter.

Raoul Duke

unread,
Apr 28, 2021, 10:44:46 PM4/28/21
to ddd...@googlegroups.com
what did google wave do?

--
You received this message because you are subscribed to the Google Groups "DDD/CQRS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dddcqrs+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages