<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Michel Bruchet</title>
    <description>The latest articles on DEV Community by Michel Bruchet (@michel_bruchet_bf6e14dbc7).</description>
    <link>https://dev.to/michel_bruchet_bf6e14dbc7</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3527363%2F4733227e-8074-42f8-8797-b048ea9ec9b4.png</url>
      <title>DEV Community: Michel Bruchet</title>
      <link>https://dev.to/michel_bruchet_bf6e14dbc7</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/michel_bruchet_bf6e14dbc7"/>
    <language>en</language>
    <item>
      <title>Why We Built NFlux: Simplifying Real-Time Orchestration and Domain-Driven Design in .NET</title>
      <dc:creator>Michel Bruchet</dc:creator>
      <pubDate>Wed, 24 Sep 2025 17:27:53 +0000</pubDate>
      <link>https://dev.to/michel_bruchet_bf6e14dbc7/why-we-built-nflux-simplifying-real-time-orchestration-and-domain-driven-design-in-net-5f01</link>
      <guid>https://dev.to/michel_bruchet_bf6e14dbc7/why-we-built-nflux-simplifying-real-time-orchestration-and-domain-driven-design-in-net-5f01</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F169ypsy03o5fiostgj5q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F169ypsy03o5fiostgj5q.png" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I built NFlux after years of struggling with boilerplate event code in trading platforms. My goal is to help others avoid the same pitfalls and accelerate their journey into event-driven architectures.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Nflux?
&lt;/h2&gt;

&lt;p&gt;Designing real-time systems is one of the hardest challenges in modern software engineering.&lt;/p&gt;

&lt;p&gt;Whether you’re building trading platforms, IoT applications, or high-throughput APIs, you need low-latency, fault-tolerant, event-driven architectures that can scale.&lt;/p&gt;

&lt;p&gt;That’s exactly what NFlux was created for.&lt;/p&gt;

&lt;p&gt;NFlux is an open-source framework built on .NET 9 that makes it easier to design, orchestrate, and observe event-driven domains. Instead of writing endless boilerplate code, you can focus on your business logic, while NFlux handles orchestration, lifecycle management, observability, and integration patterns.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why NFlux?
&lt;/h2&gt;

&lt;p&gt;Let’s face it:&lt;/p&gt;

&lt;p&gt;Writing event publishers and consumers by hand is repetitive.&lt;/p&gt;

&lt;p&gt;Keeping track of domain cycles, retries, and orchestration timers is tricky.&lt;/p&gt;

&lt;p&gt;Adding metrics, logs, and tracing on top of that often becomes an afterthought.&lt;/p&gt;

&lt;p&gt;NFlux removes that friction. It gives you a structured way to:&lt;/p&gt;

&lt;p&gt;✅ Define domains that react to events and commands&lt;br&gt;
✅ Orchestrate tenant cycles with built-in timers (inactivity, recycle, retry)&lt;br&gt;
✅ Normalize and process data in real-time pipelines&lt;br&gt;
✅ Expose endpoints with automatic discovery&lt;br&gt;
✅ Collect metrics out of the box using OpenTelemetry&lt;/p&gt;

&lt;p&gt;Core Concepts&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Domains&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In NFlux, a domain represents a self-contained business capability.&lt;br&gt;
Each domain reacts to events and executes commands.&lt;/p&gt;

&lt;p&gt;This maps naturally to DDD (Domain-Driven Design): your trading engine, your symbol watcher, or your risk manager can all become independent domains.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Events &amp;amp; Commands&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Events describe what happened.&lt;/p&gt;

&lt;p&gt;Commands describe what should happen next.&lt;/p&gt;

&lt;p&gt;NFlux makes publishing and handling these objects trivial, while providing in-memory event stores for testing and QA.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Orchestrators&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Every real-time system needs orchestration.&lt;/p&gt;

&lt;p&gt;NFlux provides BaseSocketOrchestratorHostedService, which manages:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Start/stop lifecycle&lt;/li&gt;
&lt;li&gt;Inactivity timers&lt;/li&gt;
&lt;li&gt;Recycling cycles&lt;/li&gt;
&lt;li&gt;Triggered cycles (via events)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This ensures domains keep running without manual babysitting.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Observability First&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;NFlux integrates with IMeterFactory and OpenTelemetry.&lt;br&gt;
Every endpoint call, event handling, and cycle is tracked with metrics.&lt;/p&gt;

&lt;p&gt;That means you get latency histograms, error counters, and symbol metrics without writing a single line of plumbing code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example Use Case: Real-Time Symbol Monitoring
&lt;/h2&gt;

&lt;p&gt;Imagine you need to monitor crypto trading pairs in real-time.&lt;/p&gt;

&lt;p&gt;With NFlux, you:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Define a DownloadSymbols domain that fetches raw market data.&lt;/li&gt;
&lt;li&gt;Normalize symbols into consistent business objects (close price, volume, sparkline, technical indicators).&lt;/li&gt;
&lt;li&gt;Orchestrate real-time tickers via a RealtimeSymbolsOrchestrator.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Expose QA endpoints:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;/qa/metrics → view system health and counts&lt;/li&gt;
&lt;li&gt;/qa/registry/{TenantId} → view current registry state&lt;/li&gt;
&lt;li&gt;/qa/watcher/publish → inject fake tickers for E2E testing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Your devs can test the full pipeline by publishing fake tickers and observing the updates flow through the system.&lt;/p&gt;

&lt;p&gt;Developer Experience&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;One of the biggest strengths of NFlux is developer productivity.&lt;/li&gt;
&lt;li&gt;Integration tests validate domains in isolation&lt;/li&gt;
&lt;li&gt;End-to-End tests (E2E) run against Aspire environments with QA endpoints&lt;/li&gt;
&lt;li&gt;In-memory registries and event stores simplify local testing&lt;/li&gt;
&lt;li&gt;Auto-discovery of endpoints keeps controllers minimal&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This means faster iteration cycles, less boilerplate, and more confidence in production deployments.&lt;/p&gt;

&lt;p&gt;Benefits at a Glance&lt;/p&gt;

&lt;p&gt;🔹 Strongly-typed events and commands (no weakly typed messaging)&lt;br&gt;
🔹 Event-driven orchestration with tenant awareness&lt;br&gt;
🔹 Plug-and-play observability with OpenTelemetry metrics&lt;br&gt;
🔹 Built-in support for QA and testing endpoints&lt;br&gt;
🔹 Works seamlessly with .NET 9 and Aspire&lt;/p&gt;

&lt;p&gt;Next steps for NFlux&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Publish stable builds on NuGet.org&lt;/li&gt;
&lt;li&gt;Expand documentation with case studies&lt;/li&gt;
&lt;li&gt;Provide ready-to-use templates for Aspire projects&lt;/li&gt;
&lt;li&gt;Grow the community with contributions and plugins&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Github: &lt;a href="https://github.com/startpointcorporate/Nflux?tab=readme-ov-file" rel="noopener noreferrer"&gt;https://github.com/startpointcorporate/Nflux?tab=readme-ov-file&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Conclusion&lt;/p&gt;

&lt;p&gt;NFlux is not just another .NET library.&lt;br&gt;
It’s a framework for building reliable, event-driven systems where domains, orchestration, and observability come together.&lt;/p&gt;

&lt;p&gt;If you’ve ever struggled with boilerplate event code, missing metrics, or orchestration hacks, NFlux is here to change that.&lt;/p&gt;

&lt;p&gt;👉 Explore the repo on GitHub&lt;br&gt;
👉 Install from NuGet (coming soon)&lt;br&gt;
👉 Join the community and contribute&lt;/p&gt;

&lt;p&gt;Have you already built event-driven systems in .NET? What were the biggest challenges you faced? Leave a comment — I’d love to hear your experiences and start a discussion&lt;/p&gt;

</description>
      <category>dotnet</category>
      <category>architecture</category>
      <category>webdev</category>
      <category>eventdriven</category>
    </item>
  </channel>
</rss>
