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!
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.
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.
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!
Thanks Akos. And yes, materialized view is a pretty good practical example for CQRS.
Keep those amazing articles coming 👊
Thanks Saurabh! 🙂
For CQRS, if we are using an SQL database for write replicas, can we use a NoSQL database for read replicas?"
Yes definitely Suman
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
Great point Raul.
Can't wait to read your article brother 👊
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.
If you want to dig a little bit deeper I recommend:
https://learn.microsoft.com/en-us/azure/architecture/patterns/cqrs