{
"type": "SET",
"op_list": [
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/explorations/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1/lessons|architecture/-OxmreYdB51Co352rzfm",
"value": {
"topic_path": "lessons/architecture",
"title": "Event Sourcing over CRUD for Audit Trails",
"content": "The team decided to replace standard CRUD in PostgreSQL with Event Sourcing for financial transaction audit trails. The decision was driven by compliance requirements for historical audit trails — specifically, the need to track who changed what and why. Database triggers were considered but rejected because they lose business context (a trigger sees a row change like status going from 1 to 2 but does not know the reason or user intent behind it). Instead, the team will use Kafka to store an immutable sequence of domain events (TransactionCreated, TransactionApproved, StatusUpdated), with a Postgres materialized view for fast frontend reads. The architecture follows Martin Fowler's Event Sourcing Pattern article. Implementation will include event producers in src/services/transactionService.ts and consumer/store logic in src/events/eventStore.ts.",
"summary": "Adopted Event Sourcing over CRUD to meet compliance audit requirements, using Kafka for immutable event storage and Postgres for read materialization.",
"depth": 2,
"tags": "lesson_learned,event-sourcing,audit-trail,compliance,kafka,postgres,financial-transactions",
"price": null,
"gateway_url": null,
"content_hash": null,
"created_at": 1784338622697,
"updated_at": 1784338622697
}
},
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/index/by_topic/lessons|architecture/explorers/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1",
"value": 46
},
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/graph/nodes/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1_lessons|architecture_-OxmreYdB51Co352rzfm",
"value": {
"address": "0x0064be11Eeb5ecf0bff5076F642A44bA006994b1",
"topic_path": "lessons/architecture",
"entry_id": "-OxmreYdB51Co352rzfm",
"title": "Event Sourcing over CRUD for Audit Trails",
"depth": 2,
"created_at": 1784338622697
}
}
]
}