<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Cqrs on Aayush Bajaj's Augmenting Infrastructure</title><link>https://abaj.ai/tags/cqrs/</link><description>Recent content in Cqrs on Aayush Bajaj's Augmenting Infrastructure</description><generator>Hugo</generator><language>en</language><copyright>© 2026 Aayush Bajaj</copyright><lastBuildDate>Fri, 10 Jul 2026 08:20:16 +1000</lastBuildDate><atom:link href="https://abaj.ai/tags/cqrs/index.xml" rel="self" type="application/rss+xml"/><item><title>Event Driven</title><link>https://abaj.ai/wiki/se/architecture-design/event-driven/</link><pubDate>Thu, 09 Jul 2026 21:02:56 +1000</pubDate><guid>https://abaj.ai/wiki/se/architecture-design/event-driven/</guid><description>&lt;p>event-driven architecture inverts the direction of knowledge: instead of the caller knowing who must react, the &lt;em>reactor&lt;/em> knows what it cares about. producers announce facts; consumers subscribe. the whole style is the &lt;a
 href="https://abaj.ai/wiki/se/architecture-design/patterns/#observer"
 
 
>observer pattern&lt;/a> with a broker in the middle and a network underneath — which is exactly where the interesting failure modes come from.&lt;/p>
&lt;h2 id="events-commands-queries">events, commands, queries&lt;a href="#events-commands-queries" class="post-heading__anchor" aria-hidden="true">#&lt;/a>
&lt;/h2>
&lt;p>three message species, constantly confused:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>event&lt;/strong>: a fact about the past, named in past tense — &lt;code>OrderPlaced&lt;/code>, &lt;code>PaymentFailed&lt;/code>. immutable, owned by the producer, zero expectation about who (if anyone) reacts. broadcasting is safe because nothing is being asked.&lt;/li>
&lt;li>&lt;strong>command&lt;/strong>: a request for the future — &lt;code>PlaceOrder&lt;/code>. imperative mood, addressed to exactly one handler, can be rejected. commands express intent; events record outcome. compare the &lt;a
 href="https://abaj.ai/wiki/se/architecture-design/patterns/#command"
 
 
>command pattern&lt;/a>, which reifies exactly this.&lt;/li>
&lt;li>&lt;strong>query&lt;/strong>: a question, side-effect free, wants an answer now.&lt;/li>
&lt;/ul>
&lt;p>the classic smell is the &lt;em>command in event&amp;rsquo;s clothing&lt;/em>: &lt;code>SendWelcomeEmailRequested&lt;/code> published as an &amp;ldquo;event&amp;rdquo; that exactly one consumer must process, or the producer silently depends on a specific reaction — you have built rpc with extra steps and none of rpc&amp;rsquo;s error handling.&lt;span class="margin-note" data-note="the test: delete every consumer. if the producer&amp;#39;s correctness suffers, it was a command.">
 &lt;span class="margin-note-indicator">𐃏&lt;/span>
&lt;/span>
&lt;/p></description></item></channel></rss>