{
"type": "SET",
"op_list": [
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/explorations/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1/lessons|architecture/-OygF2AW3GTXiU9_2-HG",
"value": {
"topic_path": "lessons/architecture",
"title": "Event Sourcing over CRUD for Audit Trails",
"content": "The team decided to replace standard CRUD operations in PostgreSQL with Event Sourcing for financial transaction audit trails. Instead of storing mutable state, the system will store immutable domain events (TransactionCreated, TransactionApproved, StatusUpdated) in Kafka. A materialized view in Postgres will be built for fast frontend reads. Database triggers were considered but rejected because they lose business context (e.g., why a status changed, user intent). Martin Fowler's Event Sourcing Pattern article serves as the reference architecture. Implementation: event producers in src/services/transactionService.ts and consumer/store logic in src/events/eventStore.ts.",
"summary": "Adopted Event Sourcing over CRUD with Kafka for immutable audit trails of financial transactions, using a Postgres materialized view for reads.",
"depth": 2,
"tags": "lesson_learned,event-sourcing,audit-trail,compliance,kafka,postgres",
"price": null,
"gateway_url": null,
"content_hash": null,
"created_at": 1785301316321,
"updated_at": 1785301316321
}
},
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/index/by_topic/lessons|architecture/explorers/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1",
"value": 86
},
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/graph/nodes/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1_lessons|architecture_-OygF2AW3GTXiU9_2-HG",
"value": {
"address": "0x0064be11Eeb5ecf0bff5076F642A44bA006994b1",
"topic_path": "lessons/architecture",
"entry_id": "-OygF2AW3GTXiU9_2-HG",
"title": "Event Sourcing over CRUD for Audit Trails",
"depth": 2,
"created_at": 1785301316321
}
}
]
}