Design | Expose APIs with CQR
Quick Recap
Modeling Process
● Identification
○ Who (peoples, entities )use it ?
○ When they are going to do ?
○ External or internal ?
● Break into steps
● Definition
● Validation
○ Test
○ Document
● Creation
○ Find resources
○ Relation between resources
Verbs and Nouns
If you want to dining out at nice places that you have to call ahead to reserve a
table
What are the problem ?
Principles :)
Principles
● Separation of concerns
● Reusable components
● DRY
● KISS
● SOLID
● …
BTW, everything comes at a price !
Complexity comes to table
● Scalability
● Availability
● Security
● Performance
● …
● ....
● Representation(the same data using multiple models, ...)
Representation
Most important part of a business is the state of the data.
● Decisions
● Roadmap
● Application functionality
● User experience
● ….
Taking care of state ? How ?
Event Sourcing
● Capture all changes to an application state as a sequence of events
The fundamental idea of Event Sourcing is that of ensuring every
change to the state of an application is captured in an event object, and
that these event objects are themselves stored in the sequence they
were applied for the same lifetime as the application state itself.
https://martinfowler.com/eaaDev/EventSourcing.html
Event sourcing Pros (continued)
● Bypass the O-R impedance mismatch
● Easy way to undo things
● Debuggability and traceability
a. Every change to state is traceable
b. You know how the system got into the current state
c. Metadata like "who did that" and "when did it happen"
● After-the-fact data analysis of Event Streams
● Awesome for writing data
https://en.wikipedia.org/wiki/Object-relational_impedance_mismatch
Event sourcing Cons (continued)
● Takes getting used to
● Much less framework/community/vendor support
● Awkward queries (solved by CQRS) (terrible for reading)
Should I be doing Event Sourcing?
● you're building rich object-oriented domain models (e.g. DDD)
● you have a lot of behaviour that isn't CRUD
● accountability/debuggability is critical
● you need version control/undo for data (e. G. Wikis, Google Docs)
● your business derives value or competitive advantage from event data
● your domain is inherently event driven (e. G. football game tracking)
● you're building a scalable system based on the CQRS pattern
CQRS (Command Query Responsibility Segregation)
Segregate operations that read data from operations that update data by using
separate interfaces. This can maximize performance, scalability, and security.
If the problem is having multiple and disparate views, we can exclude them from
the Domain Model and start treating them as a purely infrastructural concern
https://docs.microsoft.com/en-us/azure/architecture/patterns/cqrs
Design | expose ap is with cqr
Pros
● Your system should display its entities in different representation models.
● You have to support different querying models (search, graph, documents, etc.).
● The difference between writes and reads differs greatly, and you want to scale
them independently.
Cons
● Eventual consistency (make persistence transactional)
● Still complex fellow
● Complex Monitoring and infrastructure
Design | expose ap is with cqr
Concepts
● Event Stream
● Event Store
● Snapshot Store
● Projection
● Service Bus
Example

More Related Content

PPTX
Design | expose ap is with cqrs
PDF
Collecting and Making Sense of Diverse Data at WayUp
PPT
A common meta model for data analysis based on DSM
PPTX
Using SLE for creation of data warehouses
PDF
Advance Features of Hibernate
PDF
Build an Open Source Data Lake For Data Scientists
PDF
Data Services with Bindaas: RESTful Interfaces for Diverse Data Sources
PPT
Introduction to CQRS and DDDD
Design | expose ap is with cqrs
Collecting and Making Sense of Diverse Data at WayUp
A common meta model for data analysis based on DSM
Using SLE for creation of data warehouses
Advance Features of Hibernate
Build an Open Source Data Lake For Data Scientists
Data Services with Bindaas: RESTful Interfaces for Diverse Data Sources
Introduction to CQRS and DDDD

Similar to Design | expose ap is with cqr (20)

PPTX
Cqrs and event sourcing in azure
PPT
PPT
PDF
GECon2017_Building scalable application with cqrs and event sourcing (a. hars...
PPTX
A Deep Dive into Event Sourcing: Immutable and Scalable Systems
PDF
Diving into event-sourcing and event-driven architectures
PDF
fram^ TechTalk #1 - CQRS and Event Sourcing (ES)
PPTX
Spring I_O 2024 - Flexible Spring with Event Sourcing.pptx
PDF
Events on the outside, on the inside and at the core (jfokus jfokus2016)
PDF
Microservice Architecture with CQRS and Event Sourcing
PPTX
Cqrs and Event Sourcing Intro For Developers
PDF
Implementing Event Sourcing in .NET
PPTX
Advance Microservice Patterns - Event Souring , CQRS
PPTX
Lessons learned from applying Event sourcing and CQRS
PPTX
Real World Event Sourcing and CQRS
PDF
CQRS + Event Sourcing
PDF
An Abridged Guide to Event Sourcing
PDF
CQRS and Event Sourcing with PHP
PDF
Events on the outside, on the inside and at the core (jaxlondon)
PDF
Events on the outside, on the inside and at the core - Chris Richardson
Cqrs and event sourcing in azure
GECon2017_Building scalable application with cqrs and event sourcing (a. hars...
A Deep Dive into Event Sourcing: Immutable and Scalable Systems
Diving into event-sourcing and event-driven architectures
fram^ TechTalk #1 - CQRS and Event Sourcing (ES)
Spring I_O 2024 - Flexible Spring with Event Sourcing.pptx
Events on the outside, on the inside and at the core (jfokus jfokus2016)
Microservice Architecture with CQRS and Event Sourcing
Cqrs and Event Sourcing Intro For Developers
Implementing Event Sourcing in .NET
Advance Microservice Patterns - Event Souring , CQRS
Lessons learned from applying Event sourcing and CQRS
Real World Event Sourcing and CQRS
CQRS + Event Sourcing
An Abridged Guide to Event Sourcing
CQRS and Event Sourcing with PHP
Events on the outside, on the inside and at the core (jaxlondon)
Events on the outside, on the inside and at the core - Chris Richardson
Ad

Recently uploaded (20)

PDF
The influence of sentiment analysis in enhancing early warning system model f...
PPTX
GROUP4NURSINGINFORMATICSREPORT-2 PRESENTATION
PDF
Improvisation in detection of pomegranate leaf disease using transfer learni...
PDF
sustainability-14-14877-v2.pddhzftheheeeee
PDF
sbt 2.0: go big (Scala Days 2025 edition)
PDF
OpenACC and Open Hackathons Monthly Highlights July 2025
PDF
Credit Without Borders: AI and Financial Inclusion in Bangladesh
PPT
Galois Field Theory of Risk: A Perspective, Protocol, and Mathematical Backgr...
DOCX
Basics of Cloud Computing - Cloud Ecosystem
PDF
4 layer Arch & Reference Arch of IoT.pdf
PPTX
Build Your First AI Agent with UiPath.pptx
PDF
CloudStack 4.21: First Look Webinar slides
DOCX
search engine optimization ppt fir known well about this
PDF
Enhancing plagiarism detection using data pre-processing and machine learning...
PDF
Early detection and classification of bone marrow changes in lumbar vertebrae...
PDF
STKI Israel Market Study 2025 version august
PDF
Transform-Quality-Engineering-with-AI-A-60-Day-Blueprint-for-Digital-Success.pdf
PDF
Produktkatalog für HOBO Datenlogger, Wetterstationen, Sensoren, Software und ...
PPTX
Configure Apache Mutual Authentication
PDF
NewMind AI Weekly Chronicles – August ’25 Week IV
The influence of sentiment analysis in enhancing early warning system model f...
GROUP4NURSINGINFORMATICSREPORT-2 PRESENTATION
Improvisation in detection of pomegranate leaf disease using transfer learni...
sustainability-14-14877-v2.pddhzftheheeeee
sbt 2.0: go big (Scala Days 2025 edition)
OpenACC and Open Hackathons Monthly Highlights July 2025
Credit Without Borders: AI and Financial Inclusion in Bangladesh
Galois Field Theory of Risk: A Perspective, Protocol, and Mathematical Backgr...
Basics of Cloud Computing - Cloud Ecosystem
4 layer Arch & Reference Arch of IoT.pdf
Build Your First AI Agent with UiPath.pptx
CloudStack 4.21: First Look Webinar slides
search engine optimization ppt fir known well about this
Enhancing plagiarism detection using data pre-processing and machine learning...
Early detection and classification of bone marrow changes in lumbar vertebrae...
STKI Israel Market Study 2025 version august
Transform-Quality-Engineering-with-AI-A-60-Day-Blueprint-for-Digital-Success.pdf
Produktkatalog für HOBO Datenlogger, Wetterstationen, Sensoren, Software und ...
Configure Apache Mutual Authentication
NewMind AI Weekly Chronicles – August ’25 Week IV
Ad

Design | expose ap is with cqr

  • 1. Design | Expose APIs with CQR Quick Recap
  • 2. Modeling Process ● Identification ○ Who (peoples, entities )use it ? ○ When they are going to do ? ○ External or internal ? ● Break into steps ● Definition ● Validation ○ Test ○ Document ● Creation ○ Find resources ○ Relation between resources
  • 3. Verbs and Nouns If you want to dining out at nice places that you have to call ahead to reserve a table
  • 4. What are the problem ? Principles :)
  • 5. Principles ● Separation of concerns ● Reusable components ● DRY ● KISS ● SOLID ● … BTW, everything comes at a price !
  • 6. Complexity comes to table ● Scalability ● Availability ● Security ● Performance ● … ● .... ● Representation(the same data using multiple models, ...)
  • 7. Representation Most important part of a business is the state of the data. ● Decisions ● Roadmap ● Application functionality ● User experience ● ….
  • 8. Taking care of state ? How ?
  • 9. Event Sourcing ● Capture all changes to an application state as a sequence of events The fundamental idea of Event Sourcing is that of ensuring every change to the state of an application is captured in an event object, and that these event objects are themselves stored in the sequence they were applied for the same lifetime as the application state itself. https://martinfowler.com/eaaDev/EventSourcing.html
  • 10. Event sourcing Pros (continued) ● Bypass the O-R impedance mismatch ● Easy way to undo things ● Debuggability and traceability a. Every change to state is traceable b. You know how the system got into the current state c. Metadata like "who did that" and "when did it happen" ● After-the-fact data analysis of Event Streams ● Awesome for writing data https://en.wikipedia.org/wiki/Object-relational_impedance_mismatch
  • 11. Event sourcing Cons (continued) ● Takes getting used to ● Much less framework/community/vendor support ● Awkward queries (solved by CQRS) (terrible for reading)
  • 12. Should I be doing Event Sourcing? ● you're building rich object-oriented domain models (e.g. DDD) ● you have a lot of behaviour that isn't CRUD ● accountability/debuggability is critical ● you need version control/undo for data (e. G. Wikis, Google Docs) ● your business derives value or competitive advantage from event data ● your domain is inherently event driven (e. G. football game tracking) ● you're building a scalable system based on the CQRS pattern
  • 13. CQRS (Command Query Responsibility Segregation) Segregate operations that read data from operations that update data by using separate interfaces. This can maximize performance, scalability, and security. If the problem is having multiple and disparate views, we can exclude them from the Domain Model and start treating them as a purely infrastructural concern https://docs.microsoft.com/en-us/azure/architecture/patterns/cqrs
  • 15. Pros ● Your system should display its entities in different representation models. ● You have to support different querying models (search, graph, documents, etc.). ● The difference between writes and reads differs greatly, and you want to scale them independently. Cons ● Eventual consistency (make persistence transactional) ● Still complex fellow ● Complex Monitoring and infrastructure
  • 17. Concepts ● Event Stream ● Event Store ● Snapshot Store ● Projection ● Service Bus