Software Architecture · Design Principles
Event-Driven Architecture
Communicating through events instead of direct calls.
1 min readPublished Updated
- events
- architecture
Event-driven systems communicate through asynchronous events rather than direct calls.
sql
CREATE TABLE outbox_events (
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
event_type text NOT NULL,
payload jsonb NOT NULL,
created_at timestamptz NOT NULL DEFAULT now()
);The outbox pattern keeps event publication consistent with the originating database transaction.
Write the business row and the outbox row in one transaction; a relay publishes the outbox rows later.