Rethink your architecture with CQRS Pieter Joost van de Sande Passionated software developer, Atos pjvds.

Slides:



Advertisements
Similar presentations
MARKETPLACE TRANSITION FROM CLASSIC INTERFACE TO PHOENIX INTERFACE.
Advertisements

Creating and Submitting Orders Remy Order Management System.
WELCOME to an Introduction of the Monitoring the end-to-end Transport/Distribution Chain B2B Version V.
ITSF STORE BUSINESS SOLUTION PRESENTATION. STORE MODULE INCLUDES: Material Management Purchasing Components Handling Shipments Receiving of parts Store.
© 2012 Entrinsik, Inc. Informer Administration Exploring the system menu and functions PRESENTER: Jason Vorenkamp| Informer Software Engineer| March 2012.
Fox Scientific, Inc. ONLINE ORDERING 101. Welcome to our website On our main page you can find current promotions, the vendors we offer, technical references.
© 2010 Bennett, McRobb and Farmer1 Use Case Description Supplementary material to support Bennett, McRobb and Farmer: Object Oriented Systems Analysis.
Inter-Warehouse Transfers An Enhancement For iSeries 400 DMAS from  Copyright I/O International, 2004, 2005, 2007, 2010 Skip Intro.
Facebook for RSVP’ers You can do it!. What Questions Do You Have? What are you wanting to learn at this training?
General Financial Supply Website & E-Commerce Solutions This presentation will demo the GFS corporate website and On-Line Order Inquiry options available.
Craig Berntson
Internet Sellouts Final Presentation Enterprise Architecture Group.
Once on the internet: type in the URL box: ntrl.ntis.gov (this is the screen you should see) on) Click here to create your account.
Layered Architectures The objectives of this chapter are: To understand the principles and importance of Layered Architectures To explain the structure.
1 ERP  What are Enterprise Resource Planning (ERP) Systems? Incredibly large, extensive software packages used to manage a firm’s business processes.
1 Classification: Genpact Internal.  Tool From Oracle  Works with Oracle Database  PL/SQL Based  Widely Used with Oracle Applications  Can be Used.
Inventory Management System With Berkeley DB 1. What is Berkeley DB? Berkeley DB is an Open Source embedded database library that provides scalable, high-
Student Information Masthead Changes 1 August 6 & 7.
The Design Discipline.
©Silberschatz, Korth and Sudarshan18.1Database System Concepts - 5 th Edition, Aug 26, 2005 Buzzword List OLTP – OnLine Transaction Processing (normalized,
Entity Framework Code First End to End
WNS1.com Online Training How to use the Western Nevada Supply online store and tools.
Your on-line connection to Ferraz Shawmut; Getting Started Login / out Contact Us Home Page, Account Inquiry My E-Account Account Status Ordering Options.
Aitons’ Equipment. Type in your user name and password And click sign in Hit enter for next page.
What is Architecture  Architecture is a subjective thing, a shared understanding of a system’s design by the expert developers on a project  In the.
Elliott eOrders.Net Edward M. Kwang, President Rachel R. Locklair, Project Lead.
Scalable Architecture for the Cloud. What????  Command Query Responsibility Segregation  What is it?  What kinds of apps is it for?  What are the.
Building an Offline Smart Client using Domain-Driven Design Principles Tim McCarthy.
Company LOGO Permit Tracking System. CTPermits  Our Mission Statement: To offer the most cost-effective, intelligent, and achievable Data Technology.
Architectures of distributed systems Fundamental Models
Copyright 2002 Prentice-Hall, Inc. Chapter 2 Object-Oriented Analysis and Design Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey.
Learningcomputer.com SQL Server 2008 – Administration, Maintenance and Job Automation.
© Copyright 2010 Imaginet. All rights reserved. Distributed Architecture Patterns CQRS & Event Sourcing.
Chapter 13 Logical Architecture and UML Package Diagrams 1CS6359 Fall 2012 John Cole.
Architectural Patterns Support Lecture. Software Architecture l Architecture is OVERLOADED System architecture Application architecture l Architecture.
Domain and Persistence Patterns. Fundamental Pattern Types Design Patterns Business Logic Patterns.
GTR Data Inc. Welcome to our EDI Demonstration G.T.R. Data Inc. August 1997.
INFO1408 Database Design Concepts Week 15: Introduction to Database Management Systems.
Access Forms and Queries. Entering Data in Your Table  You can add data to your table in Datasheet view, by typing in the columns and rows.  This.
Order the featured book of the day Estimated effort: 2.
Enterprise Integration Patterns CS3300 Fall 2015.
MDS Data Flow User Group Core System Files ORDER RELEASE PRODUCT INVENTORY CUSTOMER INVOICE AR SALES.
Udi Dahan – The Software Simplist Session Code: ARC 304.
GUARD / RESERVE ON-SITE SALES How Do I Find Scheduled Events? Log on to From the Home Page Click on Guard/Reserve.
User Interface Screen Shots Iron Wind Metals Shopping Cart Project.
Expense Tracking System Developed by: Ardhita Maharindra Muskan Regmi Nir Gurung Sudeep Karki Tikaprem Gurung Date: December 05 th, 2008.
Get up and running quickly with common tasks. When you choose the Main Menu from the nav bar, you can access your work areas, records, or other items.
Use Case Diagrams A Detailed Description. Use Case Diagrams Use case diagrams describe relationships between users and use cases A use case is a (usually.
Fox Scientific, Inc. ONLINE ORDERING 101. Welcome to our website On our main page you can find current promotions, the vendors we offer, technical references.
Application architectures. Objectives l To explain the organisation of two fundamental models of business systems - batch processing and transaction processing.
Elaboration popo.
Inspecting Software Requirement Document
Web Development Web Servers.
iShop Training Module Secured Browsing
Parts.cat.com Client training 2016.
PHP / MySQL Introduction
MontaVida ORDERING PROCESS.
Transition from Classic Interface Phoenix Interface to
Database Driven Websites
Pragmatic Event-Driven Microservices
DUCKS – Distributed User-mode Chirp-Knowledgeable Server
ARCH-1: Application Architecture made Simple
Starting Design: Logical Architecture and UML Package Diagrams
Mail Order.
Saravana Kumar CEO/Founder - Kovai Atomic Scope – Product Update.
Kudler Fine Foods Frequent Shopper Program
Federation Partnership Marketing Kit: Step by Step Guide
CQRS & Event Sourcing Distributed Architecture Patterns
Grocery Store Outline csc242 – web programming.
Software Architecture & Design
Presentation transcript:

Rethink your architecture with CQRS Pieter Joost van de Sande Passionated software developer, Atos pjvds

This is meant to be a take away!

Architecture

Presentation Domain Data

Presentation Domain Data Why do we love it?

model Domain Driven Design Eric Evans

The value of a structured Model

Who believes in this?

Structured models are always created from a single viewpoint!

A model can only be optimized for one thing… and one thing only!

Presentation layer Data layer Domain layer Send DTO Map DTO Write data Map DTO Write data Send DTO Request DTO Map DTO Request DTO Map DTO Query data Request data Map DTO Query data Request DTO Send update Update screen

TWO FUNDAMENTALS

Information

Transitions

WRITING != READING

From 3-tier to CQRS Presentation layer Domain layer Data layer

Presentation layer Domain layer Data layer Just re-order the tiers

Presentation layer Domain layer Data layer Switch dependency

Presentation layer Domain layer Data layer CQRS! Query side Command side

FROM CONCEPT TO ARCHITECTURE HERE WE GO!

User interface

Demand for information

User interface Read side

We read a lot

We have multiple screens to fill

Data should be close to us

Relational databases are sub optimal for view data!

SELECT CCUS.CUST_FIRST_NAME, CCUS.CUST_LAST_NAME, CINT.CUST_INTEREST_RANK, CILO.CUST_INTERST FROM CUST_CUSTOMER AS CCUS, CUST_INTEREST_LOOKUP AS CILO, CUST_INTEREST AS CINT WHERE ( CCUS.CUST_CITY = 'Singapore' AND CCUS.CUST_PROV_STATE = 'Singapore' AND CCUS.CUST_CODE IN ( SELECT COHE.CUST_CODE FROM CUST_ORDER_HEADER AS COHE, CUST_ORDER_STATUS AS COST WHERE ( COHE.CUST_ORDER_DATE >=' :00:00.001' AND COST.CUST_ORDER_STATUS IN( 'Shipped', 'Back-ordered', 'In-process' ) AND COHE.CUST_ORDER_STATUS_CODE = COST.CUST_ORDER_STATUS_CODE ) AND CCUS.CUST_CODE = CINT.CUST_CODE AND CINT.CUST_INTEREST_CODE = CILO.CUST_INTEREST_CODE ) ORDER BY CCUS.CUST_LAST_NAME ASC, CCUS.CUST_FIRST_NAME ASC, CINT.CUST_INTEREST_RANK ASC Evil execution plan!

Bottom line Getting data should be simple – select * from x where y Examples: – Get all products of user X – Get total price of all orders of month May

User interface Read side

User interface Read databases

Read side User interface Read databases Facade

Read side User interface Facade Read databases DTO’s

Demand for change

I want to tell the system something

Read side User interface Facade Read databases DTO’s Write side

User interface Commandhandlers Read databases Read side commands DTO’s Write side Facade

Commands Simple message contains all info needed Lower coupling (law of demeter) Causes a state transition Contains the intend of the user Exists in a bounded context Examples: – AddProductToShoppingCart – PurchaseOrder – MoveUserToNewAddress – CorrectAddressForUser – FinalizeOrder

Commands example Create Cart Add item Remove item Purchase

Users don’t make changes for nothing, intent is important!

Change has intent Users don’t make changes for nothing This intent has value! Correct the address for user X Customer X moved to new address VS.

User interface Commandhandlers Read databases Read side commands DTO’s Write side Facade

User interface Commandhandlers Read databases Read side commands DTO’s Domein Write side Repository Facade

Event Sourcing

Events Simple message that describes an event Contains intent Contains all the data related to the event Past tense CustomerMoved { CustomerId, NewAddress }

Transitional flow

User interface Commandhandlers Read databases Read side commands DTO’s Domein Write side Repository Facade

User interface Commandhandlers Read databases Read side commands DTO’s Domein Write side Repository Facade

Event store Contains all domain events Does not need to be relational Write are *awesomely* fast! Rock solid audit log Read models can (re)build themself of it The domain uses it to get the current state Can be used to build any structural model you want!

User interface Commandhandlers Read databases Read side commands DTO’s Domein Write side Repository ? Facade

User interface Commandhandlers Repository Event bus Read databases Write side Read side events commands DTO’s Domein Facade

User interface Commandhandlers Repository Event bus Denormalizers Read databases Write side Read side events commands DTO’s Domein Facade

Application flow

Wrap up Optimize for reading and writing Makes changes part of the problem domain Free rock solid audit log Capture the intent of changes Allow multiple read models

Thank you! You’ve been a great audience!