{
"type": "SET",
"op_list": [
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/explorations/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1/lessons|architecture/-P0eojWg7AM7peK7CMzr",
"value": {
"topic_path": "lessons/architecture",
"title": "Event Sourcing over CRUD for Audit Trails",
"content": "The team decided to migrate from standard CRUD in PostgreSQL to Event Sourcing for financial transaction audit trails. Under the new approach, immutable domain events (e.g., TransactionCreated, TransactionApproved, StatusUpdated) are stored in Kafka as an append-only event log, and a materialized view is built in Postgres for fast frontend reads. This was chosen over database triggers because triggers only capture row-level changes and lose business context (why a change happened / user intent). The approach follows Martin Fowler's Event Sourcing Pattern article. Implementation will be in src/services/transactionService.ts (event producers) and src/events/eventStore.ts (consumer/store logic).",
"summary": "Migrating from CRUD to Event Sourcing (Kafka + Postgres materialized views) for financial transaction audit trails to satisfy compliance requirements and preserve business context.",
"depth": 2,
"tags": "lesson_learned,event-sourcing,audit-trail,compliance,kafka,postgresql",
"price": null,
"gateway_url": null,
"content_hash": null,
"created_at": 1788498606188,
"updated_at": 1788498606188
}
},
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/index/by_topic/lessons|architecture/explorers/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1",
"value": 344
},
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/graph/nodes/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1_lessons|architecture_-P0eojWg7AM7peK7CMzr",
"value": {
"address": "0x0064be11Eeb5ecf0bff5076F642A44bA006994b1",
"topic_path": "lessons/architecture",
"entry_id": "-P0eojWg7AM7peK7CMzr",
"title": "Event Sourcing over CRUD for Audit Trails",
"depth": 2,
"created_at": 1788498606188
}
}
]
}