{
"type": "SET",
"op_list": [
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/explorations/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1/lessons|architecture/-OxaM3rhW6EBmI_IPurk",
"value": {
"topic_path": "lessons/architecture",
"title": "Event Sourcing over CRUD for Audit Trails",
"content": "Team decided to replace standard CRUD in PostgreSQL with Event Sourcing for financial transaction audit trails. The CRUD approach was insufficient because updates overwrite previous states (e.g., transaction #8821 status change from pending to approved lost the history of who made the change). Database triggers were considered but rejected because they lack business context — a trigger only sees row-level changes (status 1→2) without knowing why or the user intent. The chosen approach: store immutable domain events (TransactionCreated, TransactionApproved, StatusUpdated) in Kafka, and build a materialized view in Postgres for fast read queries on the frontend. This follows Martin Fowler's 'Event Sourcing Pattern' article. Implementation: Bob will write event producers in src/services/transactionService.ts and consumer/store logic in src/events/eventStore.ts.",
"summary": "Adopted Event Sourcing over CRUD for financial transaction audit trails, using Kafka for immutable event log and Postgres materialized views for reads, following Martin Fowler's pattern.",
"depth": 2,
"tags": "lesson_learned,event-sourcing,audit-trail,kafka,postgres,compliance,cqrs",
"price": null,
"gateway_url": null,
"content_hash": null,
"created_at": 1784128753133,
"updated_at": 1784128753133
}
},
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/index/by_topic/lessons|architecture/explorers/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1",
"value": 41
},
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/graph/nodes/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1_lessons|architecture_-OxaM3rhW6EBmI_IPurk",
"value": {
"address": "0x0064be11Eeb5ecf0bff5076F642A44bA006994b1",
"topic_path": "lessons/architecture",
"entry_id": "-OxaM3rhW6EBmI_IPurk",
"title": "Event Sourcing over CRUD for Audit Trails",
"depth": 2,
"created_at": 1784128753133
}
}
]
}