{
"type": "SET",
"op_list": [
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/explorations/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1/lessons|architecture/-P-5aCKx06CHBfXlpoah",
"value": {
"topic_path": "lessons/architecture",
"title": "Event Sourcing over CRUD for Audit Trails",
"content": "Design decision made during team meeting to use Event Sourcing instead of standard CRUD in PostgreSQL for financial transaction audit trails. CRUD overwrites previous states, preventing compliance from tracing the full history of changes (e.g., who changed transaction #8821 status from pending to approved). Database triggers were considered but rejected because they only capture row changes without business context or user intent. Decision: Use Kafka as immutable event log (events like TransactionCreated, TransactionApproved, StatusUpdated) with a materialized view in Postgres for fast reads. Following Martin Fowler's Event Sourcing Pattern article. Implementation: src/services/transactionService.ts for event producers, src/events/eventStore.ts for consumer/store logic.",
"summary": "Team decided to use Event Sourcing over CRUD for financial transaction audit trails to ensure compliance, using Kafka for immutable event storage and Postgres materialized views for reads.",
"depth": 2,
"tags": "lesson_learned,event-sourcing,audit-trail,compliance,database,kafka,postgresql",
"price": null,
"gateway_url": null,
"content_hash": null,
"created_at": 1786817074557,
"updated_at": 1786817074557
}
},
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/index/by_topic/lessons|architecture/explorers/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1",
"value": 195
},
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/graph/nodes/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1_lessons|architecture_-P-5aCKx06CHBfXlpoah",
"value": {
"address": "0x0064be11Eeb5ecf0bff5076F642A44bA006994b1",
"topic_path": "lessons/architecture",
"entry_id": "-P-5aCKx06CHBfXlpoah",
"title": "Event Sourcing over CRUD for Audit Trails",
"depth": 2,
"created_at": 1786817074557
}
}
]
}