From the course: Designing Highly Scalable and Highly Available SQL Databases

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Distributing workload: Command Query Response Separation (CQSR)

Distributing workload: Command Query Response Separation (CQSR)

From the course: Designing Highly Scalable and Highly Available SQL Databases

Start my 1-month free trial

Distributing workload: Command Query Response Separation (CQSR)

- [Instructor] Another design pattern we sometimes use with scalable databases is called CQRS, which stands for Command Query Responsibility Separation. And here the idea is, okay, databases do two things, they accept commands, that cause us to manipulate data, update data, and we query it, we ask questions of the data, and we get answers back. Well, those are really two distinct things, updating the data and giving answers. So, what CQRS does is kind of takes advantage of those distinct natures of those two things and allows us to optimize both of them independently. And the way it does it does it, is because what's it's doing is it's basically separating reads from write operations. And this CQRS kind of works really well with Event Sourcing, you often see them together. And again, the key is that what you can do now is you can scale the read and writes separately, so if you have a very read-heavy model, you can scale up…

Contents