{
"type": "SET",
"op_list": [
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/explorations/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1/lessons|architecture/-P096vTvvw1ksWlLPDqc",
"value": {
"topic_path": "lessons/architecture",
"title": "Event Sourcing over CRUD for Audit Trail",
"content": "The team decided to replace standard CRUD in PostgreSQL with Event Sourcing for financial transaction audit trails. CRUD updates overwrite previous states, losing business context (e.g., transaction #8821 history). Database triggers were considered but rejected because they do not capture intent behind changes. Event Sourcing stores immutable domain events (TransactionCreated, TransactionApproved, StatusUpdated) in Kafka, with a materialized view in Postgres for fast reads. Martin Fowler's 'Event Sourcing Pattern' article is the reference architecture. Implementation: event producers in src/services/transactionService.ts, consumer/store in src/events/eventStore.ts.",
"summary": "Replaced CRUD with Event Sourcing (Kafka + Postgres materialized views) to ensure immutable audit trails for financial transactions.",
"depth": 2,
"tags": "lesson_learned,event-sourcing,audit-trail,compliance,kafka",
"price": null,
"gateway_url": null,
"content_hash": null,
"created_at": 1787949987771,
"updated_at": 1787949987771
}
},
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/index/by_topic/lessons|architecture/explorers/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1",
"value": 332
},
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/graph/nodes/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1_lessons|architecture_-P096vTvvw1ksWlLPDqc",
"value": {
"address": "0x0064be11Eeb5ecf0bff5076F642A44bA006994b1",
"topic_path": "lessons/architecture",
"entry_id": "-P096vTvvw1ksWlLPDqc",
"title": "Event Sourcing over CRUD for Audit Trail",
"depth": 2,
"created_at": 1787949987771
}
}
]
}