Achieving performance at scale
When designing C++ applications, performance is usually a key factor. While using the language can go a long way in the scope of a single application, the proper high-level design is also essential to achieving optimal latency and throughput at scale. Let's discuss a few crucial patterns and aspects that help with this.
CQRS and event sourcing patterns
There are many ways to scale compute but scaling data access can be tricky. However, it's often necessary when your userbase grows. Command-query responsibility segregation (CQRS) is a pattern that can help here.
Command-query responsibility segregation
In traditional CRUD systems, both reads and writes are performed using the same data model and the data flows the same way. The titular segregation basically means to treat queries (reads) and commands (writes) in two separate ways.
Figure 4.16: CRUD (Create, Read, Update, Delete) service
Many applications have a strongly biased ratio of reads...