{
"type": "SET",
"op_list": [
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/explorations/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1/lessons|architecture/-P-WMYpf2QGtxjZy4ltW",
"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. Database triggers on a history_logs table were considered but rejected because they capture only row changes without business context or user intent. Instead, immutable domain events (TransactionCreated, TransactionApproved, StatusUpdated) will be stored in Kafka, with a materialized view in Postgres for fast frontend reads. This satisfies compliance requirements to trace the full history and reasoning behind state changes. Implementation: event producers in src/services/transactionService.ts, consumer/store logic in src/events/eventStore.ts. Reference: Martin Fowler's 'Event Sourcing Pattern' article.",
"summary": "The team chose Event Sourcing over CRUD for financial transaction audit trails, using Kafka for immutable event storage and Postgres materialized views for reads, to fully satisfy compliance requirements.",
"depth": 2,
"tags": "lesson_learned,event-sourcing,audit-trails,compliance,kafka,postgresql",
"price": null,
"gateway_url": null,
"content_hash": null,
"created_at": 1787266219371,
"updated_at": 1787266219371
}
},
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/index/by_topic/lessons|architecture/explorers/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1",
"value": 237
},
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/graph/nodes/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1_lessons|architecture_-P-WMYpf2QGtxjZy4ltW",
"value": {
"address": "0x0064be11Eeb5ecf0bff5076F642A44bA006994b1",
"topic_path": "lessons/architecture",
"entry_id": "-P-WMYpf2QGtxjZy4ltW",
"title": "Event Sourcing over CRUD for Audit Trails",
"depth": 2,
"created_at": 1787266219371
}
}
]
}