Remote / An event-sourced domain behind Remote
Rows or Events
Both are authorities a declared domain can run on. The page's code is the same
Remote.make either way; what differs is what the server keeps.
| Rows in a database | An event-sourced model | |
|---|---|---|
| The record | the current row | every Event; the row is a fold of them |
| A write lands as | an UPDATE the writer derives from the declared write | a Command an Aggregate decides, appending Events |
| A read after a write | sees the write | may come from a View that has not folded it yet |
| Packages | foldkit-remote-server, foldkit-remote-drizzle | @alchemy.run/domain, foldkit-remote-domain |
| You also get | SQL constraints, a write ledger, joins | the history, and Domain's Policies, Sagas and Projections reacting to Events |
Choose Events when the history is itself something the business reads or reacts to, or when a Domain model already exists. Choose rows otherwise: declared writes over a table give the page the same predictions and refusals with no View to wait for.