{
"type": "SET",
"op_list": [
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/explorations/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1/lessons|architecture/-OxmrhHuYIO4pWJ3NZ0j",
"value": {
"topic_path": "lessons/architecture",
"title": "Event Sourcing over CRUD for Audit Trails",
"content": "Decision: Replace standard CRUD in PostgreSQL with Event Sourcing for financial transaction audit trails. Context: Compliance requires full history of transaction state changes with business context. Database triggers were considered but rejected because they only capture row-level changes (e.g., status 1 to 2) without recording why the change occurred or user intent. Event Sourcing stores immutable domain events (TransactionCreated, TransactionApproved, StatusUpdated) in Kafka, providing a complete audit trail with business context. A materialized view in Postgres is built from the event log for fast frontend reads. Reference: Martin Fowler 'Event Sourcing Pattern' article. Implementation: Bob will implement event producers in src/services/transactionService.ts and consumer/store logic in src/events/eventStore.ts. Participants: Alice (Lead), Bob (Eng), Charlie (Security).",
"summary": "Team adopted Event Sourcing with Kafka for immutable event logging and Postgres materialized views instead of CRUD with database triggers, to satisfy compliance requirements for full audit trails with business context.",
"depth": 2,
"tags": "lesson_learned,event-sourcing,audit-trail,compliance,kafka,postgresql",
"price": null,
"gateway_url": null,
"content_hash": null,
"created_at": 1784338633914,
"updated_at": 1784338633914
}
},
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/index/by_topic/lessons|architecture/explorers/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1",
"value": 47
},
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/graph/nodes/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1_lessons|architecture_-OxmrhHuYIO4pWJ3NZ0j",
"value": {
"address": "0x0064be11Eeb5ecf0bff5076F642A44bA006994b1",
"topic_path": "lessons/architecture",
"entry_id": "-OxmrhHuYIO4pWJ3NZ0j",
"title": "Event Sourcing over CRUD for Audit Trails",
"depth": 2,
"created_at": 1784338633914
}
}
]
}