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!

Expand full comment
Saurabh Dashora's avatar

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

Keep those amazing articles coming 👊

Expand full comment
Akos Komuves's avatar

Thanks Saurabh! 🙂

Expand full comment
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?"

Expand full comment
Saurabh Dashora's avatar

Yes definitely Suman

Expand full comment
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

Expand full comment
Saurabh Dashora's avatar

Great point Raul.

Can't wait to read your article brother 👊

Expand full comment
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.

Expand full comment
ZZIBERT's avatar

If you want to dig a little bit deeper I recommend:

https://learn.microsoft.com/en-us/azure/architecture/patterns/cqrs

Expand full comment