|
|
|
|
|
by raeldc
2581 days ago
|
|
We use NestJS/CQRS in our property management app. Here's how we implement it: 1. There are 2 event handlers for "writes". One handler writes normalized data in a PostgreSQL DB. The other handler writes denormalized data into Firestore.
2. Our frontend uses Firestore so mutations are reflected realtime in the frontend. We never found a need for the command to return data. There is also no need for complex queries in Firestore since our data is denormalized and optimized for reads.
3. The PostgreSQL DB is useful for reporting and complex queries. Our frontend app displays this data only in the reports area. So far, I don't see how things can get confusing with this pattern. |
|