{
"type": "SET",
"op_list": [
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/explorations/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1/lessons|architecture/-P-A_I7XfPqH8bO24Hhq",
"value": {
"topic_path": "lessons/architecture",
"title": "Event Sourcing over CRUD for Audit Trails",
"content": "Team decided to adopt Event Sourcing pattern instead of standard CRUD in PostgreSQL for financial transaction audit trails. The alternative of using database triggers with a history_logs table was rejected because triggers only capture row changes without capturing business context — why the change happened or user intent, which compliance requires. With Event Sourcing, all changes are stored as immutable domain events (TransactionCreated, TransactionApproved, StatusUpdated) via Kafka, preserving full audit trail with context. Materialized views in Postgres serve fast frontend reads. Implementation: event producers in src/services/transactionService.ts, consumer/store logic in src/events/eventStore.ts. Informed by Martin Fowler's Event Sourcing Pattern article.",
"summary": "Adopt Event Sourcing with Kafka for immutable event logging instead of CRUD with triggers to preserve full audit trail with business context for compliance.",
"depth": 2,
"tags": "lesson_learned,event-sourcing,audit-trail,compliance,financial-transactions,kafka,postgresql",
"price": null,
"gateway_url": null,
"content_hash": null,
"created_at": 1786900722210,
"updated_at": 1786900722210
}
},
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/index/by_topic/lessons|architecture/explorers/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1",
"value": 220
},
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/graph/nodes/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1_lessons|architecture_-P-A_I7XfPqH8bO24Hhq",
"value": {
"address": "0x0064be11Eeb5ecf0bff5076F642A44bA006994b1",
"topic_path": "lessons/architecture",
"entry_id": "-P-A_I7XfPqH8bO24Hhq",
"title": "Event Sourcing over CRUD for Audit Trails",
"depth": 2,
"created_at": 1786900722210
}
}
]
}