9 Comments
User's avatar
Akos Komuves's avatar

The closest thing I've used to a CQRS pattern is a materialized view: https://www.postgresql.org/docs/current/sql-creatematerializedview.html, which contained read-optimized data. 😄 But I haven't used a system where the Query was a separate application processing only Query commands. Thanks for teaching us something new again, Saurabh! Also, thanks for the mention!

Saurabh Dashora's avatar

Thanks Akos. And yes, materialized view is a pretty good practical example for CQRS.

Keep those amazing articles coming 👊

Suman Ghosh's avatar

For CQRS, if we are using an SQL database for write replicas, can we use a NoSQL database for read replicas?"

Saurabh Dashora's avatar

Yes definitely Suman

Raul Junco's avatar

One thing that I learned:

Any design where data is written to one table and then transformed and inserted into another table is an example of CQRS, too. If you think about it, message brokers and ETL jobs are examples of CQRS.

Coincidentally, I'm writing about the relationship between CQRS and Event Sourcing, but from a different perspective.

Thanks for sharing, Saurabh

Saurabh Dashora's avatar

Great point Raul.

Can't wait to read your article brother 👊

Parag Garg's avatar

if the database is replicated in real time to another database, can we use one db for write and another for read, will there be any performance issues.