What is Event Sourcing?
Turkish: Event Sourcing
Event sourcing stores application state as ordered, immutable records of changes rather than only keeping the latest value.
What is Event Sourcing?
Event sourcing records how a piece of data reached its current state, not just what the latest state is. For an order, the system may store events such as “created”, “payment captured”, “address changed”, and “shipped” in an append-only log.
How Does It Work?
The application receives a command, checks business rules, and writes a new event if the command is valid. The event is not overwritten or deleted; it is appended to the event store. To show current state, the system replays the relevant events in order or reads from projections built from those events.
Large streams often use snapshots so the application does not replay thousands of events from the beginning. Event sourcing is commonly paired with CQRS, where write models and read models are separated. In event-driven architectures, stored events can also notify other services, while DDD teams usually name events in business language.
Business Use
Event sourcing is valuable in payments, accounting, inventory, booking, and financial transaction systems where audit history matters. The answer to “why is this balance here?” lives in the event history, not only in the final row.
The trade-off is operational complexity. Event schemas, versioning, rollback behavior, privacy requirements, and projection rebuilds need deliberate design. For simple CRUD screens, event sourcing is often heavier than the problem requires.
Related Terms
CQRS separates commands from queries so write models and read models can be designed, scaled, and secured for different needs.
DDD (Domain-Driven Design)DDD models complex business domains through domain language, bounded contexts, and software structures aligned with real rules.
Event-Driven ArchitectureEvent-driven architecture lets systems react through independent components when events such as orders, payments, or stock changes occur.