9 Comments

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

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

Keep those amazing articles coming 👊

Expand full comment

Thanks Saurabh! 🙂

Expand full comment

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

Expand full comment

Yes definitely Suman

Expand full comment

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

Great point Raul.

Can't wait to read your article brother 👊

Expand full comment

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

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

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

Expand full comment