An event is a record that something has happened. It is a fact about the past. Events are immutable — once something happens, you can't un-happen it.
Real-world analogy: When you place an order on Amazon, the event OrderPlaced happens. Amazon doesn't delete that fact — it just moves forward from there.
Code Example (JSON event):
{
"eventType": "OrderPlaced",
"eventId": "evt-001",
"timestamp": "2024-01-15T10:30:00Z",
"data": {
"orderId": "ord-123",
"userId": "usr-456",
"items": ["book", "pen"],
"totalAmount": 29.99
}
}
---