{
"type": "SET",
"op_list": [
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/explorations/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1/lessons|architecture/-P-7rlUxFFFLezJmjfOH",
"value": {
"topic_path": "lessons/architecture",
"title": "Event Sourcing over CRUD for Audit Trails",
"content": "The team decided to adopt Event Sourcing instead of standard CRUD in PostgreSQL for financial transaction audit trails. The motivation was that database triggers (the alternative considered) only capture row-level changes without business context — they cannot record why a change happened or the user intent behind it, which failed a compliance review for transaction #8821. With Event Sourcing, all state changes are stored as immutable domain events (TransactionCreated, TransactionApproved, StatusUpdated) in Kafka, preserving full business context. A materialized view in Postgres is built for fast frontend reads. This approach follows Martin Fowler's 'Event Sourcing Pattern' article and satisfies compliance requirements. Implementation: event producers in src/services/transactionService.ts, consumer/store logic in src/events/eventStore.ts.",
"summary": "The team decided to adopt Event Sourcing over CRUD for financial transaction audit trails to ensure full compliance by preserving immutable domain events with business context, rather than relying on database triggers that lose intent information.",
"depth": 2,
"tags": "lesson_learned,event-sourcing,audit-trail,compliance,financial-transactions",
"price": null,
"gateway_url": null,
"content_hash": null,
"created_at": 1786855233534,
"updated_at": 1786855233534
}
},
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/index/by_topic/lessons|architecture/explorers/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1",
"value": 201
},
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/graph/nodes/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1_lessons|architecture_-P-7rlUxFFFLezJmjfOH",
"value": {
"address": "0x0064be11Eeb5ecf0bff5076F642A44bA006994b1",
"topic_path": "lessons/architecture",
"entry_id": "-P-7rlUxFFFLezJmjfOH",
"title": "Event Sourcing over CRUD for Audit Trails",
"depth": 2,
"created_at": 1786855233534
}
}
]
}