> For the complete documentation index, see [llms.txt](https://stephen-tsoi.gitbook.io/stephen-tsoi-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://stephen-tsoi.gitbook.io/stephen-tsoi-docs/event-driven-architecture/event-governance-the-foundation-of-successful-event-driven-architecture/day-5-14-message-multiple-records-vs.-event-single-record.md).

# Day 5/14 Message (Multiple Records) vs. Event (Single Record)

Day 5 of 14: Analyze the critical performance differences between multi-record batch messages and single-record real-time events to optimize system bandwidth.

Developers often find the distinction between **messages** (multiple records) and **events** (single record) perplexing when implementing event-driven architecture (EDA) or data-driven architecture (DDA). This confusion can significantly impact system performance. To address this, it is crucial to clearly define a single record, validate the event payload during the design phase, and establish the maximum event size on the event broker.

In contrast to the traditional request-driven architecture (RDA) with a request/reply pattern handling snapshots of records processed in batches, EDA and DDA trigger events immediately after they occur, enabling real-time processing. Events contain only the essential data related to the specific change, ensuring a compact size. This approach optimizes resource and bandwidth utilization for both publishers and consumers, enhancing real-time event processing and ultimately improving user experience.

Consider the example of login static analysis. In a conventional setup, customer login and logout times are gathered from the previous day's channel server database post an end-of-day process, then transmitted to the data warehouse for behavioral analysis in a file format via SFTP. This file typically comprises millions of records exceeding 5 GB, necessitating hours for processing and impacting network bandwidth, database performance, and concurrent server processes, resulting in a one-day delay in statistical reporting.

In an EDA framework, login and logout events are instantly published to the data warehouse in asynchronous mode. Stateless microservices can swiftly insert these records into the database within a second, even accommodating a high frequency of login activities. This real-time approach circumvents the constraints of batch processing, offering enhanced scalability and efficiency.

<figure><img src="https://2617374589-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcQN1DZY6gJZPxlsQf9Re%2Fuploads%2FuNanBDb1jtETRf8LDnln%2Fimage.png?alt=media&amp;token=fa21a7c0-2e39-4c9d-84cd-162ee2dd775d" alt=""><figcaption></figcaption></figure>

## 🚀 Let's Connect Beyond GitBook!

If you found this article helpful, you can find more of my technical insights, daily discussions, and deep dives across these platforms:

* **Read more of my work:** Check out my articles on [dev.to](https://dev.to/stephen_tsoi_5b2c4055f3a9) and [Hashnode](https://stephentsoi.hashnode.dev/).
* **Join the daily conversation:** Connect with me directly on [LinkedIn](https://www.linkedin.com/in/stephen-tsoi-16309730/).

***

#### 📬 Stay Ahead of the Curve

Enjoyed this piece? I break down complex technical topics into bite-sized, actionable insights every week.

👉 **Subscribe to my** [**LinkedIn Newsletter**](https://www.linkedin.com/build-relation/newsletter-follow?entityUrn=7487299517642612736) to never miss an update and get the latest articles delivered straight to your feed!


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://stephen-tsoi.gitbook.io/stephen-tsoi-docs/event-driven-architecture/event-governance-the-foundation-of-successful-event-driven-architecture/day-5-14-message-multiple-records-vs.-event-single-record.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
