id | title |
---|---|
faq |
FAQ |
Q: Where can I find information about CQRS and Event Sourcing?
A: Refer to the following resources:
- Martin Fowler's Enterprise Architecture pattern
- Greg Young classic explanation talk
- Greg Young's EventStore docs: Event Sourcing Basics
- Greg Young's DDD CQRS Class
- Event Sourcing Made Simple
- Migrating to Microservices and Event-Sourcing: the Dos and Dont’s
- CQRS.nu
- Event Sourcing: What it is and why it's awesome and other related posts at https://barryosull.com/blog
Q: What is the difference between a Read Model and a View Model?
A: Read Models implement the standard event sourcing mechanisms.
View Models are a Redux-specific extension to these mechanisms. View models are reactive and use websockets to synchronize their state with the redux state on the client.
Q: How to implement a Read Model with direct access to the underlying store?
A: Implement a custom Read Model. Custom Read Models allow you to use custom logic to communicate with a Read Model store.
Q: How to send an aggregate command?
A: To send a command from a client browser, use the standard HTTP API:
$ curl -X POST "http://localhost:3000/api/commands"
--header "Content-Type: application/json" \
--data '
{
"aggregateName":"Todo",
"type":"createItem",
"aggregateId":"root-id",
"payload": {
"id":`date +%s`,
"text":"Learn reSolve API"
}
}
On the server side, you can send a command from an API Handler or Saga:
await sideEffects.executeCommand({
aggregateName: 'User',
aggregateId: event.aggregateId,
type: 'requestConfirmUser',
payload: event.payload
})
Q: How to perform validation to ensure input values are unique?
A: In a distributed application, it is not possible to perform reliable checks. You should detect value duplicates in a Read Model or Saga projection code and mark duplicated values as incorrect.
Q: How to implement a frontend?
A: There are three main approaches to frontend development in reSolve: