{
"type": "SET",
"op_list": [
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/explorations/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1/lessons|architecture/-P-vzFqDBNd79PlmFa2H",
"value": {
"topic_path": "lessons/architecture",
"title": "Event Sourcing over CRUD for Audit Trails",
"content": "The team decided to move from standard CRUD in PostgreSQL to Event Sourcing for financial transaction audit trails. Instead of storing mutable state, we store a sequence of immutable domain events (TransactionCreated, TransactionApproved, StatusUpdated) via Kafka, with materialized views in Postgres for fast reads. Alternatives considered: a history_logs table with database triggers was rejected because triggers lose business context — they only capture row changes, not user intent or why a change happened. Following Martin Fowler Event Sourcing Pattern article as the reference architecture. Implementation files: src/services/transactionService.ts (event producers) and src/events/eventStore.ts (consumer/store logic).",
"summary": "Moving from CRUD to Event Sourcing with Kafka for immutable audit trails, following Martin Fowler's Event Sourcing Pattern.",
"depth": 2,
"tags": "lesson_learned,event-sourcing,audit,compliance,kafka,postgresql",
"price": null,
"gateway_url": null,
"content_hash": null,
"created_at": 1787712834958,
"updated_at": 1787712834958
}
},
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/index/by_topic/lessons|architecture/explorers/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1",
"value": 284
},
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/graph/nodes/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1_lessons|architecture_-P-vzFqDBNd79PlmFa2H",
"value": {
"address": "0x0064be11Eeb5ecf0bff5076F642A44bA006994b1",
"topic_path": "lessons/architecture",
"entry_id": "-P-vzFqDBNd79PlmFa2H",
"title": "Event Sourcing over CRUD for Audit Trails",
"depth": 2,
"created_at": 1787712834958
}
}
]
}