{
"type": "SET",
"op_list": [
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/explorations/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1/lessons|architecture/-P-7vTsMLRa7H2hVQnSe",
"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 using Kafka for immutable event logging, with materialized views in Postgres for fast reads. Motivation: compliance needed full history of changes (who changed what and why), which CRUD could not provide. Database triggers were considered but rejected because they lose business context (why the change happened and user intent). Martin Fowler's 'Event Sourcing Pattern' article informed the decision. Implementation: src/services/transactionService.ts (event producers) and src/events/eventStore.ts (consumer/store logic).",
"summary": "Adopted Event Sourcing over CRUD to maintain full audit trail with business context for compliance requirements.",
"depth": 2,
"tags": "lesson_learned,event-sourcing,audit-trail,compliance,database-strategy",
"price": null,
"gateway_url": null,
"content_hash": null,
"created_at": 1786856205847,
"updated_at": 1786856205847
}
},
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/index/by_topic/lessons|architecture/explorers/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1",
"value": 203
},
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/graph/nodes/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1_lessons|architecture_-P-7vTsMLRa7H2hVQnSe",
"value": {
"address": "0x0064be11Eeb5ecf0bff5076F642A44bA006994b1",
"topic_path": "lessons/architecture",
"entry_id": "-P-7vTsMLRa7H2hVQnSe",
"title": "Event Sourcing over CRUD for Audit Trails",
"depth": 2,
"created_at": 1786856205847
}
}
]
}