Skip to contentমূল লেখায় যান

Topic 35 · Courseটপিক 35 · Course

Event Sourcing

A bank statement lists every deposit and every withdrawal, not only the balance. You can work out the balance from the list. Event sourcing stores data in this way. This comparison is the tutorial's own.

7 min read7 মিনিটে পড়া যায় · 8 sections8টি সেকশন · 1 source1টি সোর্স · updated Oct 2026আপডেট: Oct 2026

Replay events to rebuild stateইভেন্ট রিপ্লে করে স্টেট আবার তৈরি

Rebuild an order from its events and cut replay time with snapshots.ইভেন্ট থেকে স্টেট আবার তৈরি করুন আর স্ন্যাপশট দিয়ে রিপ্লের সময় কমান।

3 min3 মিনিট8 steps8টি ধাপ
  • Rows storedজমা সারি1
  • Old values keptরাখা পুরোনো মান0
Commandকমান্ডhandlerহ্যান্ডলারheld: 3ধরা: 3CRUD: new value replaces oldCRUD: নতুন মান পুরোনোকে সরায়old value: lostপুরোনো মান: হারিয়ে গেছে

You’ll learnআপনি শিখবেন

  • Why events are never changedকেন ইভেন্ট কখনো বদলানো হয় না
  • How replay rebuilds the stateরিপ্লে কীভাবে স্টেট আবার তৈরি করে
  • How a compensating event undoes a changeক্ষতিপূরণমূলক ইভেন্ট কীভাবে পরিবর্তন বাতিল করে
  • How a snapshot cuts replay timeস্ন্যাপশট কীভাবে রিপ্লের সময় কমায়
  • How a clashing append is rejectedসংঘর্ষের অ্যাপেন্ড কীভাবে প্রত্যাখ্যাত হয়

In plain words

Most applications store only the latest state of the data. They read a row, change it, and write the new values back. This is the CRUD model. It keeps no history unless you add a separate audit log Source 1সোর্স 1.

Event sourcing does the opposite. It keeps every action on an object, in order, in a store that only accepts new records. That store is the system of record Source 1সোর্স 1. Each event is one logical change, such as AddedItemToOrder or OrderCanceled Source 1সোর্স 1. Every entity gets a separate eventstream: its changes, in order Source 1সোর্স 1.

The source calls it a complex pattern with significant trade-offs. It is costly to move to or from, and it limits later design choices Source 1সোর্স 1.

সহজ English

Most applications store only the latest state of the data. They read a row, change it, and write the new values back. This is the CRUD model. It keeps no history unless you add a separate audit log Source 1সোর্স 1.

Event sourcing does the opposite. It keeps every action on an object, in order, in a store that only accepts new records. That store is the system of record Source 1সোর্স 1. Each event is one logical change, such as AddedItemToOrder or OrderCanceled Source 1সোর্স 1. Every entity gets a separate eventstream. The eventstream holds the changes of the entity, in order Source 1সোর্স 1.

The source calls it a complex pattern with significant trade-offs. It is costly to move to or from. It also limits later design choices Source 1সোর্স 1.

বাংলা ব্যাখ্যা

বেশিরভাগ অ্যাপ্লিকেশন ডেটার শুধু সর্বশেষ স্টেট রাখে। তারা একটি রো (row) পড়ে, বদলায় এবং নতুন মান আবার লেখে। এটি CRUD মডেল। আলাদা অডিট লগ যোগ না করলে এতে কোনো হিস্ট্রি থাকে না Source 1সোর্স 1।

ইভেন্ট সোর্সিং (event sourcing) উল্টোটা করে। এটি একটি অবজেক্টের প্রতিটি অ্যাকশন ক্রমানুযায়ী এমন একটি স্টোরে রাখে, যা শুধু নতুন রেকর্ড নেয়। সেই স্টোরই সিস্টেম অব রেকর্ড (system of record) Source 1সোর্স 1। প্রতিটি ইভেন্ট একটি যৌক্তিক পরিবর্তন, যেমন AddedItemToOrder বা OrderCanceled Source 1সোর্স 1। প্রতিটি এন্টিটির (entity) আলাদা একটি ইভেন্টস্ট্রিম (eventstream) থাকে। ইভেন্টস্ট্রিমে এন্টিটির পরিবর্তনগুলো ক্রমানুযায়ী থাকে Source 1সোর্স 1।

সোর্স একে উল্লেখযোগ্য ট্রেড-অফসহ একটি জটিল প্যাটার্ন বলে। এতে যাওয়া বা এখান থেকে সরে আসা ব্যয়বহুল। এটি পরের ডিজাইনের পছন্দও সীমিত করে Source 1সোর্স 1।

How it works

Rebuild the state. An application works out the state of an entity by replaying every event in its stream. The source calls this rehydration, and it can happen on demand Source 1সোর্স 1. A command handler first loads the eventstream and replays it. Then it runs the business logic. Then it raises new events Source 1সোর্স 1.

Append, never change. Events are immutable and are added with append-only operations Source 1সোর্স 1. You never update event data. To undo a change, you add a compensating event. For example, ReservationCanceled compensates for an earlier SeatsReserved. The old event stays in the stream Source 1সোর্স 1.

Pass events on. In most designs the events go to a queue or topic, so the producers and the consumers do not depend on each other Source 1সোর্স 1. Event handlers then write the events to the store, update a read-only store, or call external systems Source 1সোর্স 1.

Use views for reading. Reading and replaying events is costly. So applications usually build materialized views, which are read-only views built from the event store and shaped for queries Source 1সোর্স 1.

Use snapshots for long streams. A long stream makes replay slow. A snapshot is a saved copy of the entity state at one point in the stream, for example after every N events. The application loads the newest snapshot and replays only the later events Source 1সোর্স 1. You choose how often to snapshot by balancing storage cost against time saved Source 1সোর্স 1. A snapshot is an optimization. The stream stays the source of truth, and you can make the snapshots again from it Source 1সোর্স 1.

Guard against clashes. Two handlers can load the same entity at once. The event store can use optimistic concurrency control. It rejects an append if the stream changed after the handler read it. The handler then reloads, checks again, and retries Source 1সোর্স 1.

সহজ English

Rebuild the state. An application works out the state of an entity by replaying every event in its stream. The source calls this rehydration. It can happen on demand Source 1সোর্স 1. A command handler first loads the eventstream and replays it. Then it runs the business logic. Then it raises new events Source 1সোর্স 1.

Append, never change. Events are immutable. They are added with append-only operations Source 1সোর্স 1. You never update event data. To undo a change, you add a compensating event. For example, ReservationCanceled compensates for an earlier SeatsReserved. The old event stays in the stream Source 1সোর্স 1.

Pass events on. In most designs the events go to a queue or topic, so the producers and the consumers do not depend on each other Source 1সোর্স 1. Event handlers then write the events to the store, update a read-only store, or call external systems Source 1সোর্স 1.

Use views for reading. Reading and replaying events is costly. So applications usually build materialized views. A materialized view is read-only. It is built from the event store and shaped for queries Source 1সোর্স 1.

Use snapshots for long streams. A long stream makes replay slow. A snapshot is a saved copy of the entity state at one point in the stream, for example after every N events. The application loads the newest snapshot and replays only the later events Source 1সোর্স 1. You choose how often to snapshot by balancing storage cost against time saved Source 1সোর্স 1. A snapshot is an optimization. The stream stays the source of truth. You can make the snapshots again from it Source 1সোর্স 1.

Guard against clashes. Two handlers can load the same entity at once. The event store can use optimistic concurrency control. It rejects an append if the stream changed after the handler read it. The handler then reloads, checks again, and retries Source 1সোর্স 1.

বাংলা ব্যাখ্যা

স্টেট আবার তৈরি করা। একটি অ্যাপ্লিকেশন একটি এন্টিটির স্ট্রিমের প্রতিটি ইভেন্ট রিপ্লে করে তার স্টেট বের করে। সোর্স এটিকে রিহাইড্রেশন (rehydration) বলে। এটি চাহিদা অনুযায়ী ঘটতে পারে Source 1সোর্স 1। একটি কমান্ড হ্যান্ডলার (command handler) প্রথমে ইভেন্টস্ট্রিম লোড করে এবং রিপ্লে করে। তারপর বিজনেস লজিক চালায়। তারপর নতুন ইভেন্ট তৈরি করে Source 1সোর্স 1।

শুধু যোগ করুন, কখনো বদলাবেন না। ইভেন্ট অপরিবর্তনীয় (immutable)। এগুলো শুধু যোগ করার (append-only) অপারেশন দিয়ে যোগ করা হয় Source 1সোর্স 1। আপনি ইভেন্টের ডেটা কখনো আপডেট করেন না। কোনো পরিবর্তন বাতিল করতে একটি ক্ষতিপূরণমূলক ইভেন্ট (compensating event) যোগ করুন। যেমন, ReservationCanceled আগের SeatsReserved-কে ক্ষতিপূরণ দেয়। পুরোনো ইভেন্ট স্ট্রিমেই থাকে Source 1সোর্স 1।

ইভেন্ট এগিয়ে দেওয়া। বেশিরভাগ ডিজাইনে ইভেন্ট একটি কিউ বা টপিকে যায়, তাই প্রোডিউসার ও কনজিউমার একে অপরের ওপর নির্ভর করে না Source 1সোর্স 1। এরপর ইভেন্ট হ্যান্ডলার ইভেন্টগুলো স্টোরে লেখে, একটি রিড-অনলি স্টোর আপডেট করে বা বাইরের সিস্টেমকে কল করে Source 1সোর্স 1।

পড়ার জন্য ভিউ ব্যবহার করুন। ইভেন্ট পড়া ও রিপ্লে করা ব্যয়বহুল। তাই অ্যাপ্লিকেশন সাধারণত ম্যাটেরিয়ালাইজড ভিউ (materialized view) তৈরি করে। ম্যাটেরিয়ালাইজড ভিউ রিড-অনলি। এটি ইভেন্ট স্টোর থেকে তৈরি এবং কোয়েরির জন্য সাজানো Source 1সোর্স 1।

লম্বা স্ট্রিমের জন্য স্ন্যাপশট ব্যবহার করুন। লম্বা স্ট্রিম রিপ্লে ধীর করে। স্ন্যাপশট (snapshot) হলো স্ট্রিমের একটি বিন্দুতে এন্টিটির স্টেটের সংরক্ষিত কপি, যেমন প্রতি N ইভেন্ট পরপর। অ্যাপ্লিকেশন সর্বশেষ স্ন্যাপশট লোড করে এবং শুধু পরের ইভেন্টগুলো রিপ্লে করে Source 1সোর্স 1। স্টোরেজ খরচ ও বাঁচানো সময়ের মধ্যে ভারসাম্য রেখে আপনি ঠিক করেন কত ঘন ঘন স্ন্যাপশট নেবেন Source 1সোর্স 1। স্ন্যাপশট একটি অপটিমাইজেশন। স্ট্রিমই সত্যের উৎস (source of truth) থাকে। আপনি তা থেকে স্ন্যাপশট আবার তৈরি করতে পারেন Source 1সোর্স 1।

সংঘর্ষ থেকে রক্ষা। দুটি হ্যান্ডলার একই সময়ে একই এন্টিটি লোড করতে পারে। ইভেন্ট স্টোর অপটিমিস্টিক কনকারেন্সি কন্ট্রোল (optimistic concurrency control) ব্যবহার করতে পারে। হ্যান্ডলার পড়ার পরে স্ট্রিম বদলে গেলে এটি অ্যাপেন্ড প্রত্যাখ্যান করে। তখন হ্যান্ডলার আবার লোড করে, আবার যাচাই করে এবং রিট্রাই করে Source 1সোর্স 1।

When you need it

The source lists these reasons to use the pattern Source 1সোর্স 1:

  • You want to keep the intent or reason behind a change.
  • You must avoid conflicting updates.
  • You want a history, an audit log, or the ability to replay events and roll back.
  • You want to separate the input of data from the tasks that act on it.

It is often combined with CQRS, which splits reads from writes Source 1সোর্স 1. See the page CQRS for that pattern.

When not to use it. The source says the pattern may not suit these cases Source 1সোর্স 1:

  • Simple CRUD work that needs no audit, replay, or history.
  • Prototypes, minimum viable products, or systems with a short life.
  • Systems that need consistent, real-time views of the data.
  • Data that is mostly static, such as lookup tables.
  • Teams with no experience of event-driven systems.

For most systems, traditional data management is enough Source 1সোর্স 1. You can use event sourcing in one part only, such as a payment ledger Source 1সোর্স 1.

সহজ English

The source lists these reasons to use the pattern Source 1সোর্স 1:

  • You want to keep the intent or reason behind a change.
  • You must avoid conflicting updates.
  • You want a history, an audit log, or the ability to replay events and roll back.
  • You want to separate the input of data from the tasks that act on it.

Teams often combine it with CQRS, which splits reads from writes Source 1সোর্স 1. See the page CQRS for that pattern.

When not to use it. The source says the pattern may not suit these cases Source 1সোর্স 1:

  • Simple CRUD work that needs no audit, replay, or history.
  • Prototypes, minimum viable products, or systems with a short life.
  • Systems that need consistent, real-time views of the data.
  • Data that is mostly static, such as lookup tables.
  • Teams with no experience of event-driven systems.

For most systems, traditional data management is enough Source 1সোর্স 1. You can use event sourcing in one part only, such as a payment ledger Source 1সোর্স 1.

বাংলা ব্যাখ্যা

সোর্স এই প্যাটার্ন ব্যবহারের কারণগুলো তালিকাভুক্ত করে Source 1সোর্স 1:

  • আপনি একটি পরিবর্তনের পেছনের উদ্দেশ্য বা কারণ রাখতে চান।
  • আপনাকে সংঘাতপূর্ণ আপডেট এড়াতে হবে।
  • আপনি একটি হিস্ট্রি, একটি অডিট লগ, অথবা ইভেন্ট রিপ্লে ও রোল ব্যাক করার ক্ষমতা চান।
  • আপনি ডেটার ইনপুটকে তার ওপর কাজ করা টাস্ক থেকে আলাদা করতে চান।

টিমগুলো প্রায়ই এটিকে CQRS-এর সাথে মেলায়, যা রিডকে রাইট থেকে আলাদা করে Source 1সোর্স 1। সেই প্যাটার্নের জন্য CQRS পাতা দেখুন।

কখন ব্যবহার করবেন না। সোর্স বলে, এই ক্ষেত্রগুলোতে প্যাটার্নটি নাও মানাতে পারে Source 1সোর্স 1:

  • সহজ CRUD কাজ, যেখানে অডিট, রিপ্লে বা হিস্ট্রি লাগে না।
  • প্রোটোটাইপ, মিনিমাম ভায়েবল প্রোডাক্ট (minimum viable product), বা স্বল্পায়ু সিস্টেম।
  • যে সিস্টেমে ডেটার সামঞ্জস্যপূর্ণ, রিয়েল টাইম ভিউ দরকার।
  • প্রায় অপরিবর্তিত ডেটা, যেমন লুকআপ টেবিল।
  • যে টিমের ইভেন্ট-ড্রিভেন সিস্টেমের অভিজ্ঞতা নেই।

বেশিরভাগ সিস্টেমের জন্য প্রচলিত ডেটা ম্যানেজমেন্টই যথেষ্ট Source 1সোর্স 1। আপনি ইভেন্ট সোর্সিং শুধু একটি অংশে ব্যবহার করতে পারেন, যেমন একটি পেমেন্ট লেজার Source 1সোর্স 1।

Trade-offs

Gains. The store gives an audit trail, and you can rebuild views by replay at any time Source 1সোর্স 1. Adding events does not need the row locks that in-place updates need, and this avoids lock contention, so write throughput can improve Source 1সোর্স 1.

Eventual consistency. Views built from events are only eventually consistent. A delay exists between a request, the publishing of its events, and the handling by consumers. Customers need to understand this Source 1সোর্স 1.

Event versioning. If a bug writes wrong events, fixing the code does not fix the old events Source 1সোর্স 1. A schema change can make old and new events hard to combine Source 1সোর্স 1. The source lists four ways to cope, which you can mix Source 1সোর্স 1:

WayIdea
Tolerant deserializationReaders ignore unknown fields and use defaults for missing ones
Event versioningEach event carries a version identifier
UpcastingOld events are converted to the current schema when read, and the stored events stay as they are
In-place migrationOld events are rewritten. This breaks immutability, so it is a last resort

Other costs. There is no standard query tool like SQL. You read a stream by its event identifier and replay it Source 1সোর্স 1. Delivery is usually at least once, so handlers must be idempotent, or duplicates can change the result Source 1সোর্স 1. The immutable store can conflict with laws that require deletion of personal data Source 1সোর্স 1. The source says a given-when-then test style suits these systems best, and you also need integration tests for views, duplicates, and schema changes Source 1সোর্স 1.

সহজ English

Gains. The store gives an audit trail. You can rebuild views by replay at any time Source 1সোর্স 1. Adding events does not need the row locks that in-place updates need. This avoids lock contention, so write throughput can improve Source 1সোর্স 1.

Eventual consistency. Views built from events are only eventually consistent. A delay exists between a request, the publishing of its events, and the handling by consumers. Customers need to understand this Source 1সোর্স 1.

Event versioning. If a bug writes wrong events, fixing the code does not fix the old events Source 1সোর্স 1. A schema change can make old and new events hard to combine Source 1সোর্স 1. The source lists four ways to cope. You can mix them Source 1সোর্স 1:

  • Tolerant deserialization: readers ignore unknown fields and use defaults for missing ones.
  • Event versioning: each event carries a version identifier.
  • Upcasting: old events are converted to the current schema when they are read. The stored events stay as they are.
  • In-place migration: old events are rewritten. This breaks immutability, so it is a last resort.

Other costs. There is no standard query tool like SQL. You read a stream by its event identifier and replay it Source 1সোর্স 1. Delivery is usually at least once, so handlers must be idempotent. If not, duplicates can change the result Source 1সোর্স 1. The immutable store can conflict with laws that require deletion of personal data Source 1সোর্স 1. The source says a given-when-then test style suits these systems best. You also need integration tests for views, duplicates, and schema changes Source 1সোর্স 1.

বাংলা ব্যাখ্যা

সুবিধা। স্টোর একটি অডিট ট্রেইল দেয়। আপনি যেকোনো সময় রিপ্লে করে ভিউ আবার তৈরি করতে পারেন Source 1সোর্স 1। ইভেন্ট যোগ করতে সেই রো লক লাগে না, যা জায়গায়-আপডেটে (in-place update) লাগে। এতে লক কনটেনশন (lock contention) এড়ানো যায়, তাই রাইট থ্রুপুট বাড়তে পারে Source 1সোর্স 1।

ইভেন্চুয়াল কনসিসটেন্সি। ইভেন্ট থেকে তৈরি ভিউ কেবল ইভেন্চুয়ালি কনসিসটেন্ট। একটি রিকুয়েস্ট, তার ইভেন্ট পাবলিশ এবং কনজিউমারের হ্যান্ডলিংয়ের মধ্যে একটি দেরি থাকে। কাস্টমারদের এটি বুঝতে হবে Source 1সোর্স 1।

ইভেন্ট ভার্সনিং। কোনো বাগ ভুল ইভেন্ট লিখলে কোড ঠিক করলে পুরোনো ইভেন্ট ঠিক হয় না Source 1সোর্স 1। স্কিমা বদলালে পুরোনো ও নতুন ইভেন্ট মেলানো কঠিন হতে পারে Source 1সোর্স 1। সোর্স মোকাবিলার চারটি উপায় তালিকাভুক্ত করে। আপনি এগুলো মিশিয়ে ব্যবহার করতে পারেন Source 1সোর্স 1:

  • টলারেন্ট ডিসিরিয়ালাইজেশন (tolerant deserialization): রিডার অজানা ফিল্ড উপেক্ষা করে এবং না থাকা ফিল্ডের জন্য ডিফল্ট ব্যবহার করে।
  • ইভেন্ট ভার্সনিং (event versioning): প্রতিটি ইভেন্ট একটি ভার্সন আইডেন্টিফায়ার বহন করে।
  • আপকাস্টিং (upcasting): পড়ার সময় পুরোনো ইভেন্টকে বর্তমান স্কিমায় রূপান্তর করা হয়। সংরক্ষিত ইভেন্ট যেমন ছিল তেমনই থাকে।
  • ইন-প্লেস মাইগ্রেশন (in-place migration): পুরোনো ইভেন্ট আবার লেখা হয়। এতে অপরিবর্তনীয়তা ভাঙে, তাই এটি শেষ উপায়।

অন্যান্য খরচ। SQL-এর মতো কোনো স্ট্যান্ডার্ড কোয়েরি টুল নেই। আপনি ইভেন্ট আইডেন্টিফায়ার দিয়ে একটি স্ট্রিম পড়েন এবং রিপ্লে করেন Source 1সোর্স 1। ডেলিভারি সাধারণত অ্যাট লিস্ট ওয়ান্স (at least once) হয়, তাই হ্যান্ডলারকে আইডেমপটেন্ট (idempotent) হতে হবে। না হলে ডুপ্লিকেট ফলাফল বদলে দিতে পারে Source 1সোর্স 1। অপরিবর্তনীয় স্টোর এমন আইনের সাথে সংঘাতে পড়তে পারে, যেগুলো ব্যক্তিগত ডেটা মুছে ফেলতে বলে Source 1সোর্স 1। সোর্স বলে, গিভেন-হোয়েন-দেন (given-when-then) টেস্ট স্টাইল এই সিস্টেমগুলোর জন্য সবচেয়ে মানানসই। এছাড়া ভিউ, ডুপ্লিকেট ও স্কিমা পরিবর্তনের জন্য ইন্টিগ্রেশন টেস্টও দরকার Source 1সোর্স 1।

A real-life example

This example is the tutorial's own and is simplified. A test management app records each test run as events: TestRunStarted, StepPassed, StepFailed, TestRunAborted. The app replays the events to show the status of a run. The same list answers "when did step 3 first fail?" A table with only a "status" column could not.

সহজ English

This example is the tutorial's own and is simplified. A test management app records each test run as events: TestRunStarted, StepPassed, StepFailed, TestRunAborted. The app replays the events to show the status of a run. The same list answers "when did step 3 first fail?" A table with only a "status" column could not answer it.

বাংলা ব্যাখ্যা

এই উদাহরণটি টিউটোরিয়ালের নিজের এবং সরলীকৃত। একটি টেস্ট ম্যানেজমেন্ট অ্যাপ প্রতিটি টেস্ট রান ইভেন্ট হিসেবে রাখে: TestRunStarted, StepPassed, StepFailed, TestRunAborted। অ্যাপ ইভেন্ট রিপ্লে করে একটি রানের স্ট্যাটাস দেখায়। একই তালিকা "step 3 প্রথম কখন ফেইল করেছিল?" প্রশ্নের উত্তরও দেয়। শুধু একটি "status" কলামওয়ালা টেবিল তা দিতে পারত না।

Common mistakes

  • Storing only the new state in an event. An event such as "remaining seats changed to 42" tells you the result but not what happened. An event such as "two seats reserved" records the intent Source 1সোর্স 1.
  • Treating a message broker as the event store. The source says a broker such as Apache Kafka usually cannot query one entity's stream or apply optimistic concurrency. It suits spreading events out, not storing them Source 1সোর্স 1.
  • Forgetting duplicate events. Without idempotent handlers, projections can drift, and payments or notices can happen twice Source 1সোর্স 1.

সহজ English

  • Storing only the new state in an event. An event such as "remaining seats changed to 42" tells you the result but not what happened. An event such as "two seats reserved" records the intent Source 1সোর্স 1.
  • Treating a message broker as the event store. The source says a broker such as Apache Kafka usually cannot query one entity's stream or apply optimistic concurrency. It suits spreading events out, not storing them Source 1সোর্স 1.
  • Forgetting duplicate events. Without idempotent handlers, projections can drift. Payments or notices can happen twice Source 1সোর্স 1.

বাংলা ব্যাখ্যা

  • ইভেন্টে শুধু নতুন স্টেট রাখা। "remaining seats changed to 42"-এর মতো ইভেন্ট ফলাফল বলে, কিন্তু কী ঘটেছিল তা বলে না। "two seats reserved"-এর মতো ইভেন্ট উদ্দেশ্য রেকর্ড করে Source 1সোর্স 1।
  • মেসেজ ব্রোকারকে ইভেন্ট স্টোর মনে করা। সোর্স বলে, Apache Kafka-র মতো ব্রোকার সাধারণত একটি এন্টিটির স্ট্রিম কোয়েরি করতে বা অপটিমিস্টিক কনকারেন্সি প্রয়োগ করতে পারে না। এটি ইভেন্ট ছড়িয়ে দেওয়ার জন্য মানানসই, জমা রাখার জন্য নয় Source 1সোর্স 1।
  • ডুপ্লিকেট ইভেন্ট ভুলে যাওয়া। আইডেমপটেন্ট হ্যান্ডলার না থাকলে প্রজেকশন সরে যেতে পারে। পেমেন্ট বা নোটিশ দুবার হতে পারে Source 1সোর্স 1।

What a tester can check

Tutorial advice

These test ideas are the tutorial's own advice, not a claim of the source.

  • Replay. Rebuild an entity from its events. Compare the result with the view the app shows.
  • Lag. Add an event, then read the view at once and again after a wait. Check that the app handles the old value in between.
  • Duplicates. Send the same event twice. Check that the count, the payment, or the message does not repeat.
  • Old events. Keep a sample of events from an older version. Check that the new code still reads them.
  • Clashes. Send two commands to one entity at once. Check that one succeeds and the other retries or fails with a clear error.

সহজ English

These test ideas are the tutorial's own advice. They are not a claim of the source.

  • Replay. Rebuild an entity from its events. Compare the result with the view the app shows.
  • Lag. Add an event, then read the view at once and again after a wait. Check that the app handles the old value in between.
  • Duplicates. Send the same event twice. Check that the count, the payment, or the message does not repeat.
  • Old events. Keep a sample of events from an older version. Check that the new code still reads them.
  • Clashes. Send two commands to one entity at once. Check that one succeeds and the other retries or fails with a clear error.

বাংলা ব্যাখ্যা

এই টেস্টের ধারণাগুলো টিউটোরিয়ালের নিজের পরামর্শ। এগুলো সোর্সের দাবি নয়।

  • রিপ্লে। একটি এন্টিটি তার ইভেন্ট থেকে আবার তৈরি করুন। ফলাফলকে অ্যাপের দেখানো ভিউর সাথে তুলনা করুন।
  • ল্যাগ (lag)। একটি ইভেন্ট যোগ করুন, তারপর সাথে সাথে ভিউ পড়ুন এবং কিছুক্ষণ অপেক্ষার পর আবার পড়ুন। দেখুন মাঝখানের পুরোনো মান অ্যাপ ঠিকভাবে সামলায় কি না।
  • ডুপ্লিকেট। একই ইভেন্ট দুবার পাঠান। দেখুন কাউন্ট, পেমেন্ট বা মেসেজ পুনরাবৃত্তি হয় না।
  • পুরোনো ইভেন্ট। পুরোনো ভার্সনের কিছু ইভেন্টের নমুনা রাখুন। দেখুন নতুন কোড এখনও সেগুলো পড়তে পারে।
  • সংঘর্ষ। একই সময়ে একটি এন্টিটিতে দুটি কমান্ড পাঠান। দেখুন একটি সফল হয় এবং অন্যটি রিট্রাই করে বা স্পষ্ট এরর-সহ ব্যর্থ হয়।

Key words

WordMeaning
EventA record of one logical change to an object Source 1সোর্স 1
Event storeAn append-only store that is the system of record Source 1সোর্স 1
EventstreamThe ordered events of one entity Source 1সোর্স 1
RehydrationRebuilding the current state by replaying the events Source 1সোর্স 1
SnapshotA saved state at one point in a stream, so replay can start there Source 1সোর্স 1
Materialized viewA read-only projection of the event store, made for queries Source 1সোর্স 1
Compensating eventA new event that reverses or corrects an earlier one Source 1সোর্স 1
UpcastingConverting old event schemas to the current one when reading Source 1সোর্স 1
IdempotentSafe to run again with the same event, with no change in the result Source 1সোর্স 1
  1. [1]
    Event Sourcing pattern

    Azure Architecture Center, Microsoft Learn · accessed 2026-10-22দেখা হয়েছে: 2026-10-22