{
"type": "SET",
"op_list": [
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/explorations/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1/lessons|architecture/-Ozc0oNga9es2fTp6WqG",
"value": {
"topic_path": "lessons/architecture",
"title": "Event Sourcing over CRUD for Audit Trails",
"content": "The team decided to migrate financial transaction audit trails from standard CRUD in PostgreSQL to an Event Sourcing architecture using Kafka. Business context (who changed what and why) is preserved through immutable domain events (TransactionCreated, TransactionApproved, StatusUpdated), unlike database triggers which only capture row-level changes without intent. A materialized view in Postgres is built from the Kafka event log for fast frontend reads. Reference architecture: Martin Fowler's \"Event Sourcing Pattern\". Implementation: event producers in src/services/transactionService.ts, consumer/store logic in src/events/eventStore.ts.",
"summary": "Migrate financial transaction audit trail from CRUD to Event Sourcing with Kafka to preserve full business context for compliance.",
"depth": 2,
"tags": "lesson_learned,event-sourcing,audit-trail,compliance,kafka,postgresql",
"price": null,
"gateway_url": null,
"content_hash": null,
"created_at": 1786304218668,
"updated_at": 1786304218668
}
},
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/index/by_topic/lessons|architecture/explorers/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1",
"value": 119
},
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/graph/nodes/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1_lessons|architecture_-Ozc0oNga9es2fTp6WqG",
"value": {
"address": "0x0064be11Eeb5ecf0bff5076F642A44bA006994b1",
"topic_path": "lessons/architecture",
"entry_id": "-Ozc0oNga9es2fTp6WqG",
"title": "Event Sourcing over CRUD for Audit Trails",
"depth": 2,
"created_at": 1786304218668
}
}
]
}