---
"title": "47. Working with an Event-Driven Architecture"
"description": "One factor to consider when designing an application is how to represent information about events that occur. One traditional way is to use a database: as new events occur, a row in a table is updated. Another approach is to use an event log: every event that occurs is retained in a serialized format, so that app's state at any point in time is preserved. \r\n\r\nOn this episode Alexey Syomichev talks with host Robert Blumen about enterprise architecture organized around an immutable event log. The discussion covers the notion of events - what are they, what do they contain, event data, event schema, event formats; producers and consumers of events; the event log; time stamps versus event log time; immutability; durability of event logs; organizing enterprise architecture around the event log; the log-centric approach to integration compared to point-to-point; in place updates versus append only; extracting event logs from an RDBMS; reconstructing RDBMS change logs as business events; the event log as the system of record; making the event log highly available; scaling the event log."
"date": "2019-12-04"
"authors":
  -
    "name": "Robert Blumen"
"url": "https://wp-www-staging.heroku.com/codeish-podcasts/47-working-with-an-event-driven-architecture/"
---

# 47\. Working with an Event-Driven Architecture

Robert Blumen is a Dev Ops engineer at Salesforce. He's interviewing Alexey Syomichev, a software engineering principle architect at Salesforce, with over 25 years of experience. Their conversation begins with what constitutes an event (an immutable record encoding something that happened to an app). They then move on to describe consumers of those events, whether they're internal to an app or external to other services and business departments. Finally, they discuss ways in which you can store that event, either in a database or a running event log.

Databases and event logs each have their strengths and weaknesses, which Alexey enumerates. Event logs, for example, are easier to write to; but databases are easier to query for information. In general, Alexey believes that it can be important to organize your larger systems around an event log.

The conversation concludes with a discussion on how to use an event log in practical ways. First, you'll need to decide the schema to use when representing an event. State transitions are another reality to consider. If multiple events representing the same action come in, you need to make sure that the event log is atomic. Finally, there's a question of precisely how many events to retain, how far back you store your application's state.

## Links from this episode

- [OK Event Log (the architecture files episode 3)](https://engineering.salesforce.com/the-architecture-files-ep-3-ok-event-log-56ab8060c546) by Ian Varley
- [Apache Kafka](https://kafka.apache.org/)
- [CQRS Pattern](https://martinfowler.com/bliki/CQRS.html) by Martin Fowler
- [Event-driven architecture](https://en.wikipedia.org/wiki/Event-driven_architecture)
- [How Apache Kafka Inspired Our Platform Events Architecture](https://engineering.salesforce.com/how-apache-kafka-inspired-our-platform-events-architecture-2f351fe4cf63) by Alexey Syomichev
- [About event-driven driven\_architecture](https://en.wikipedia.org/wiki/Event-driven_architecture)
- [Protobufs](https://developers.google.com/protocol-buffers/) and [Apache Avro](https://avro.apache.org/) are two ways in which you can serialize an event.