Event-Driven Architecture
Concepts covered: dmEventSourcing
State vs Events: Two Ways to Model Reality A state-based system stores the current truth: account_balance = $1,000. An event-based system stores what happened: deposit($500), withdrawal($200), deposit($700). The current balance is derived by replaying the events. Both representations contain the same information, but events are more powerful because you can reconstruct ANY past state, not just the current one. This is the fundamental insight of event-driven data modeling: events are the source of truth. State is a projection of events at a point in time. If you store the events, you can always recompute the state. If you store only the state, the events are lost. In data engineering, you work with both. Source systems are state-based (PostgreSQL, MySQL). Your pipeline captures the changes
About This Interactive Section
This section is part of the Event Streams lesson on DataDriven, a free data engineering interview prep platform. Each section includes explanations, worked examples, and hands-on code challenges that execute in real time. SQL queries run against a live PostgreSQL database. Python runs in a sandboxed Docker container. Data modeling problems validate against interactive schema canvases. All content is framed around what data engineering interviewers actually test at companies like Meta, Google, Amazon, Netflix, Stripe, and Databricks.
How DataDriven Lessons Work
DataDriven combines four interview rounds (SQL, Python, Data Modeling, Pipeline Architecture) with adaptive difficulty and spaced repetition. Easy problems get harder as you improve. Weak concepts resurface until you master them. Your readiness score tracks progress across every topic interviewers test. Every lesson section ends with problems you solve by writing and running real code, not by picking multiple-choice answers.