Junior From PDF SQL SQL & Databases

What is event sourcing in databases?

Short answer: Event sourcing is a pattern where the state of an application is determined by a sequence of events, rather than storing the current state directly in the database.

Explain a bit more

How it works: Instead of storing the current state of an entity, each change to that entity (event) is stored as an immutable event in an event store. The state can be reconstructed by replaying the events. Advantages: You have a complete audit trail of changes. Enables eventual consistency and can scale well in distributed systems. Use cases: CQRS (Command Query Responsibility Segregation), systems requiring full audit logs, and systems that need to capture historical data changes.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details