Comparison
Append-only logvsEvent sourcing
Append-only log
you never update a record in place; you write the change to the end of a file and let readers work out the current state.
A structure written only by appending, so writes are sequential and history is preserved. It is the backbone of durability in databases as a write-ahead log, of replication as a change stream, and of event streaming systems as the storage model. Sequential writes are what make it fast; unbounded growth is what makes retention policy a design decision rather than an afterthought.
Full entry →Event sourcing
you stop storing the current balance and instead store every deposit and withdrawal, deriving the balance by replaying them.
Persisting state as an ordered log of immutable events, with current state as a derived projection. You get a complete audit trail and the ability to rebuild any view by replaying history. What you give up is ad-hoc querying, cheap schema change, and the ability to ever delete anything easily — events are forever, including the ones with a bug in them.
Full entry →