Se dicessi "CQRS+ES"? ...se state già cercando su wikipedia questo talk è per voi. Introduzione a CQRS ed Event Sourcing per persone che odiano gli acronimi. 100% fluff free.
Intervento tenuto al meeting #programmersinpadua il 15 settembre 2015
6. is an architectural pattern proposed by Greg
Young that segregates reads and writes of a
system into two separate subsystems.
CQRS
7. writes are usually asynchronous and
stored in a transactional storage while
reads are eventually consistent and
retrieved from de-normalised views
CQRS (details)
8. BERTRAND MAYER
Designer of Eiffel
programming language
Coined “open/closed
principle” and “design
by contract”
Introduced command
query separation
(CQS)
9. Use of commands and queries separates write and read concerns
11. COMMAND
? Command is the message to change state
? Message handled by a CommandHandler
? Returns void (so nothing)
? Describes business intent
? Immutable
13. QUERY
? Read state from data store
? Does not change state
? Has a return value
14. WHY SHOULD I USE CQRS?
? Scalability
? Reduced complexity
? Flexibility
? Focus on the business
15. ? Fear of change
? Mental leap
? All-Or-Nothing approach
BE AWARE OF
16. CQRS MYTHS
? is easy
? CQRS = Event Sourcing and vice versa
? requires an eventual consistent read store
? requires a bus/queues/asynchronous messaging
17. – Udi Dahan
“Most people using CQRS (and event sourcing too)
shouldn't have done so”
– GregYoung
“It's important to note though, that these are things you
can do, not necessarily things you should do.
Separating the read and write models can be quite costly”
WHEN SHOULD I AVOID IT?