{
"type": "SET",
"op_list": [
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/explorations/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1/lessons|architecture/-OyYqByQnLQYaSkja_J4",
"value": {
"topic_path": "lessons/architecture",
"title": "Event Sourcing over CRUD for Audit Trails",
"content": "Decision: Move from standard CRUD in PostgreSQL to Event Sourcing for financial transaction audit trails. The current CRUD approach loses historical state context - updates overwrite previous states, making it impossible to reconstruct who changed what and why. Database triggers were considered but rejected because they lack business context. The chosen solution uses Kafka as the immutable event log storing domain events, with a materialized view in Postgres for fast reads. Follows Martin Fowler Event Sourcing Pattern. Implementation in src/services/transactionService.ts and src/events/eventStore.ts.",
"summary": "Adopted Event Sourcing over CRUD for financial transaction audit trails using Kafka and Postgres materialized views.",
"depth": 2,
"tags": "lesson_learned,event-sourcing,audit-trail,architecture",
"price": null,
"gateway_url": null,
"content_hash": null,
"created_at": 1785160322972,
"updated_at": 1785160322972
}
},
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/index/by_topic/lessons|architecture/explorers/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1",
"value": 76
},
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/graph/nodes/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1_lessons|architecture_-OyYqByQnLQYaSkja_J4",
"value": {
"address": "0x0064be11Eeb5ecf0bff5076F642A44bA006994b1",
"topic_path": "lessons/architecture",
"entry_id": "-OyYqByQnLQYaSkja_J4",
"title": "Event Sourcing over CRUD for Audit Trails",
"depth": 2,
"created_at": 1785160322972
}
}
]
}