Event Driven architecture has moved from the fringes of distributed systems design into the mainstream. As organizations scale their Microservices and decouple their monoliths, the allure of asynchronous communication becomes undeniable. However, with this adoption comes a pervasive confusion that trips up even seasoned architects. The most dangerous of these misconceptions revolves around the status of the event itself. Specifically, whether the event stream serves as the authoritative Source of Truth or merely a transient notification mechanism. This distinction is not merely academic. It fundamentally alters how an Effective Engineering Team designs data models, handles failures, and implements compliance. Getting this wrong leads to data loss, inconsistent state, and systems that are impossible to debug.
The Fundamental Confusion – State vs. Transition
To understand whether events should be the Source of Truth, we must first ruthlessly define our terms. In database theory, the State represents the current status of an entity. If you look at a user record in a SQL table, you see the current email, the current subscription plan, and the last login date. This is the present reality. In contrast, an event represents a Transition. It is a fact that occurred at a specific point in time. An event says, User changed email at 10:00 AM. It captures the intent and the delta, not necessarily the total cumulative state.
The confusion arises because you can derive the current state by replaying all past transitions. This concept is the bedrock of Event Sourcing. However, just because you can derive state from events does not automatically mean events are the Source of Truth in every architecture. An Effective Engineering Team must decide if their system relies on the event log as the primary record (Event Sourcing) or if the event is simply a signal indicating that a record in a separate Database of Record has changed.
Scenario One – Events as the Source of Truth
When events are treated as the Source of Truth, the architecture shifts from a State-oriented mindset to a Fact-oriented mindset. Here, the event stream is the permanent, immutable log of everything that ever happened. The database, if one exists, is merely a projection or a materialized view of those events.
Consider a financial ledger system or a high-scale auction platform. In these domains, the audit trail is the product. You cannot simply update a balance. You must record a transaction that resulted in that balance.
Imagine a banking system using Event Sourcing. We do not store a Balance column. We store events like MoneyDeposited and MoneyWithdrawn.
{
"eventType": "MoneyDeposited",
"aggregateId": "account-123",
"amount": 500.00,
"timestamp": "2023-10-27T10:00:00Z",
"causationId": "tx-998877"
}
To determine the current balance, the system reads all events for account-123 and applies them sequentially.
Balance = 0 + 500 (Deposited) - 200 (Withdrawn) = 300
In this scenario, the event is the Source of Truth. If the database storing the current balance crashes, we simply replay the event log to rebuild the state. This offers immense benefits for debugging and compliance. Engineering leadership often mandates this approach in industries where auditability is non-negotiable. You never lose history. You know exactly why the system is in its current state.
Use Cases for Event Sourced Truth
Collaborative document editing, similar to Google Docs, often utilizes Operational Transformation or CRDTs (Conflict-free Replicated Data Types). Here, the truth is the sequence of keystrokes and formatting commands. If you only stored the final document state, you would lose the ability to resolve conflicts when two users edit the same paragraph simultaneously.
Supply chain tracking also requires an immutable history. An item moving from Warehouse to Truck to Delivered is a lifecycle. Storing only Status: Delivered loses the context of when it left the warehouse and how long it was in transit. The event stream provides the provenance required to diagnose bottlenecks.
Scenario Two – Events as Notifications (The Database is Truth)
Conversely, many systems function optimally when events are treated as lightweight notifications, while a traditional database acts as the Source of Record. In this model, the event carries minimal data just enough to signal a change and directs the consumer to the authoritative data store to fetch the full context.
Consider a standard ecommerce application. When a user updates their profile picture, an event ProfilePictureUpdated might be emitted. This event notifies the image resizing service to generate thumbnails. Does this event need to be the permanent Source of Truth ? Likely not.
In this model, the User table in a relational database (PostgreSQL, MySQL) remains the Source of Truth. If the event is lost, or if the resizing service fails, we can query the User table, find users with unprocessed images, and retry the operation. The event is ephemeral, acting as a trigger for workflow, not as the ledger of record.
Use Cases for Notification Events
User notification systems rely heavily on this pattern. When a password is changed, an event PasswordChanged triggers an email service. The event does not need to be stored forever. Once the email is sent, the event has served its purpose. Storing these events indefinitely creates bloat and storage costs without corresponding value.
Cache invalidation is another prime example. Service might listen to a CacheInvalidate event. The event tells the cache to drop a specific key. The Source of Truth remains the database. If the event is missed, the cache might be stale temporarily, but a Time-To-Live (TTL) policy eventually corrects the state. The system is resilient because the database holds the authority, not the event stream.
Comparative Analysis: Making the Choice
Choosing between these two paradigms is a critical decision during the design. The wrong choice results in dual write problems where the database update succeeds but the event emission fails, leading to system-wide inconsistency.
The following table outlines the differences.
| Feature | Events as Source of Truth (Event Sourcing) | Events as Notifications (State-Based) |
| Primary Storage | Append-only Log (Kafka, EventStoreDB) | Database (PostgreSQL, MongoDB) |
| State Derivation | Calculated on the fly via replay | Direct read from tables |
| Data Retention | Indefinite / Policy-based retention | Transient / Short-lived |
| Complexity | High (requires snapshots, event versioning) | Low (standard CRUD operations) |
| Auditability | Native and inherent | Requires explicit logging implementation |
| Best Fit | Financial, Audit, Complex State Machines | Notifications, Cache Invalidation, Analytics |
The Hybrid Approach and the Outbox Pattern
In reality, most robust systems do not strictly adhere to one extreme. They often employ a hybrid approach. The Source of Record remains the database, but to solve the consistency problem between the database and the event stream, architects utilize the Transactional Outbox Pattern.
This pattern ensures that an Effective Engineering Team never faces the dilemma of a database commit succeeding while the event fails to publish. Instead of writing to the database and then publishing to a message broker, the application writes the business data and the event message into a local “Outbox” table within the same database transaction.
BEGIN TRANSACTION;-- Update the business entity UPDATE orders SET status = 'CONFIRMED' WHERE id = 'order-123';-- Insert the event into the outbox INSERT INTO outbox (id, aggregate_type, aggregate_id, payload) VALUES ('evt-456', 'Order', 'order-123', '{"status": "CONFIRMED"}');COMMIT;
Separate process (polling publisher or Debezium connector) reads the Outbox table and publishes the event to the message broker. Once successfully published, the Outbox entry is marked as processed or deleted.
This effectively bridges the gap. The database remains the Source of Truth for the service, but the event stream becomes a reliable, eventually consistent representation of that truth for the rest of the organization. This allows downstream services to react to changes without coupling themselves directly to the internal database schema of the owning service.
Real-World Failure Scenario
To illustrate the gravity of this choice, consider a logistics company that misunderstood this distinction. They treated events as Source of Truth for package location, but they did not implement proper idempotency checks on their consumers.
PackageArrived event was emitted. The consumer service failed to acknowledge the message processing successfully before crashing. The message broker, configured with at least once delivery, redelivered the message upon restart.
Because the system treated the event as the Source of Truth without transactional safeguards, the package status was updated twice. Inventory counts were skewed, showing 2 items when only 1 existed. This phantom inventory issue took weeks to debug because the engineering team assumed the event stream was inherently correct and idempotent, lacking the defensive coding required for asynchronous flows.
This highlights that treating events as the Source of Truth requires sophisticated engineering discipline regarding idempotency and event versioning. If the schema of the event changes, old events in the log must still be decipherable, or upcasters must be written to transform old formats into new ones. This maintenance burden is often underestimated.
Governance and Engineering Leadership
Design plays a pivotal role in establishing the conventions around event truthfulness. It is insufficient to leave this decision to individual developers. Without a clear directive, one team might implement Event Sourcing, storing massive JSON blobs in Kafka indefinitely, while another team might treat events as fire-and-forget notifications. This creates a fragmented architecture where service boundaries are unclear.
Standard mandate must exist. Common guideline is as follows. If the data represents a business fact that is legally binding or required for financial reconstruction, it belongs in an Event Sourced model or a dedicated ledger database. If the data represents a transient signal or a state change that can be re-fetched from a database, it should be treated as a notification.
Myth Busting – Immutability and Compaction
Persistent myth is that events, if they are the Source of Truth, must remain raw and unchangeable forever. This leads to the fear of unmanageable data growth. However, modern stream processing platforms like Apache Kafka support Log Compaction.
Log Compaction ensures that Kafka retains at least the last known value for each key within a topic. If you have a topic representing the state of a user profile, and a user updates their profile 1,000 times, compaction ensures you do not need to replay 1,000 events to get the current state. You only need to read the latest event for that user key.
This allows events to act as a Source of Truth without the heavy burden of infinite history storage for state-based entities. It essentially turns the event log into a compacted key-value store that is still distributed and append-only. This blurs the line between Event Log and Database, empowering teams to use events as the definitive record for current state while retaining the durability of a log.
Key Takeaways
Navigating the myths of Event Driven flows requires a nuanced understanding of data ownership. Events are not magic. They are data structures that require the same rigorous governance as database tables.
When deciding on the role of events, architects should evaluate the cost of replay versus the cost of query. In Event Sourcing (Events as Truth), the cost is paid during read operations (replaying state) or during complex snap shotting logic. In State-based systems (DB as Truth), the cost is paid in maintaining referential integrity and handling the dual-write problem between the database and the event stream.
An Effective Engineering Team recognizes that these patterns are not mutually exclusive. Single system might use Event Sourcing for the core financial transaction engine while using Notification Events for the user notification service. The architecture must align with the business requirements of the specific bounded context.
Conclusion
The question of whether events are the Source of Truth is not a binary yes or no, but rather a strategic architectural decision that dictates data flow, storage strategy, and system reliability. Treating events as the Source of Truth, as in Event Sourcing, provides a robust audit trail and powerful temporal debugging capabilities, making it indispensable for critical operational systems. However, it introduces complexity in terms of event versioning and state re-hydration.
Conversely, treating events as notifications, backed by a database as the Source of Record, simplifies development and fits naturally with standard CRUD applications, though it requires mechanisms like the Outbox Pattern to ensure consistency.
Ultimately, the truth is defined by what your organization decides to trust as the record of authority. By understanding the trade-offs between state and transition, and by implementing patterns like Outbox and Compaction, teams can build systems that are not only scalable and reactive but also correct and auditable. Avoiding the trap of the dual write and respecting the distinct roles of events versus state is what separates a fragile distributed system from a resilient, production-grade platform.
