1. YouTube Summaries
  2. Mastering Event Sourcing: From Domain-Driven Design to Building Reactive Applications

Mastering Event Sourcing: From Domain-Driven Design to Building Reactive Applications

By scribe 3 minute read

Create articles from any YouTube video or use our API to get YouTube transcriptions

Start for free
or, create a free article to see how easy it is.

The Integration of DDD and BDDD in Event Sourced Applications

Anita, working at Equinor, a leading Energy Solution company headquartered in Norway, shares her enthusiasm for working with software design, particularly in building Event Sourced applications. This approach, combining Domain-Driven Design (DDD) and Behavior-Driven Development (BDDD), not only fuels her work-life dream but also addresses the complexities of distributed solutions and data-driven decision-making.

Building Blocks for Event Sourcing

Anita introduces four fundamental building blocks derived from a talk by Sebastian from Conrad, essential for constructing Event Sourced applications:

  • Commands: User actions are captured as commands, affecting an aggregate and resulting in events and an updated aggregate state.
  • Queries or Read Models: Events are projected onto read models, updating their state to provide current information to the user.
  • Reactors: Handle all other processes, including side effects and API calls, based on event-driven rules.
  • Event Store: The architecture's backbone, where events are stored for processing. Equinor uses Azure's Cosmos DB for this purpose.

The Power of Domain Modeling

Domain modeling plays a crucial role in understanding and solving business problems. It involves abstracting concepts from the business to build models that are fit for purpose. By continuously collaborating with business stakeholders and employing event storming, Anita and her team can refine their domain models to better reflect the business and its needs. This collaborative approach, coupled with BDDD, allows for iterative refinement and modeling based on real requirements and scenarios.

Challenges and Strategies in Event Sourcing

Anita discusses several challenges encountered in building Event Sourced applications, such as error handling, duplicate event processing, and the infamous dual-write problem. Strategies like domain event migration, compensating events for error correction, and leveraging reactors for automation and digitalization initiatives are highlighted as effective solutions.

Reactors: The Game Changer

Reactors emerge as a particularly powerful building block, enabling flexible, modular architecture within and across bounded contexts. Their ability to handle side effects and integrate seamlessly with other components underlines the importance of maintaining simple arrangements of these modular parts to avoid complexity.

Event Sourced Applications in Digitalization

The digitalization and automation agenda at Equinor benefits significantly from the event sourcing approach. It not only fosters data-driven decision-making but also empowers users with near real-time information through efficient read models. The flexibility and scalability offered by event sourcing align well with the company's digital transformation goals, allowing Anita and her team to innovate and deliver solutions that are both robust and user-centric.

Conclusion

Anita's journey in building Event Sourced applications at Equinor illustrates the transformative power of combining DDD with BDDD and event sourcing. By embracing these methodologies, software developers can tackle complex distributed systems, enhance digitalization efforts, and create applications that are both scalable and responsive to user needs. As Anita continues to live her work-life dream, her experiences serve as a testament to the potential of event sourcing in driving the future of software development.

Watch the full presentation by Anita on YouTube.

Ready to automate your
LinkedIn, Twitter and blog posts with AI?

Start for free