{
"type": "SET",
"op_list": [
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/explorations/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1/lessons|architecture/-P-9ZCkautzrKGO9cNvx",
"value": {
"topic_path": "lessons/architecture",
"title": "Event Sourcing over CRUD for Audit Trails",
"content": "The team discussed database strategy for financial transaction audit trails to ensure compliance. Current standard CRUD in PostgreSQL overwrites previous states, making it impossible to provide audit history (e.g., who changed status from pending to approved for transaction #8821). Alternative considered: database triggers with a history_logs table — rejected because triggers only see row changes, not the business context or user intent behind changes. Decision: Move to Event Sourcing — storing a sequence of immutable domain events (TransactionCreated, TransactionApproved, StatusUpdated) instead of mutable current state. Kafka will serve as the immutable event log, with a materialized view in Postgres for fast frontend reads. Reference: Martin Fowler's 'Event Sourcing Pattern' article. Implementation: event producers in src/services/transactionService.ts, consumer/store logic in src/events/eventStore.ts.",
"summary": "Team decided to implement Event Sourcing over CRUD for financial transaction audit trails, using Kafka for immutable event logging and Postgres materialized views for read performance, satisfying compliance requirements.",
"depth": 2,
"tags": "lesson_learned,event-sourcing,audit-trail,compliance,financial-transactions,kafka,postgresql",
"price": null,
"gateway_url": null,
"content_hash": null,
"created_at": 1786883660838,
"updated_at": 1786883660838
}
},
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/index/by_topic/lessons|architecture/explorers/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1",
"value": 209
},
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/graph/nodes/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1_lessons|architecture_-P-9ZCkautzrKGO9cNvx",
"value": {
"address": "0x0064be11Eeb5ecf0bff5076F642A44bA006994b1",
"topic_path": "lessons/architecture",
"entry_id": "-P-9ZCkautzrKGO9cNvx",
"title": "Event Sourcing over CRUD for Audit Trails",
"depth": 2,
"created_at": 1786883660838
}
}
]
}