{
"type": "SET",
"op_list": [
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/explorations/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1/lessons|architecture/-P0-Seni0Qw_tpoEZdTN",
"value": {
"topic_path": "lessons/architecture",
"title": "Event Sourcing over CRUD for Audit Trails",
"content": "The team decided to replace standard CRUD operations in PostgreSQL with Event Sourcing using Kafka for financial transaction audit trails. The current CRUD approach overwrites previous states, making it impossible to provide compliance teams with historical audit information. Database triggers were considered as an alternative but rejected because they only capture row-level changes without business context or user intent. The chosen approach stores immutable domain events in Kafka, with materialized views built in Postgres for fast reads. Implementation: event producers in src/services/transactionService.ts and consumer/store logic in src/events/eventStore.ts. Reference: Martin Fowler Event Sourcing Pattern article.",
"summary": "The team decided to migrate from CRUD-based PostgreSQL to Event Sourcing with Kafka for financial transaction audit trails, preserving full change history and user intent for compliance.",
"depth": 2,
"tags": "lesson_learned,event-sourcing,audit-trail,compliance,kafka,postgres,financial-transactions",
"price": null,
"gateway_url": null,
"content_hash": null,
"created_at": 1787787914478,
"updated_at": 1787787914478
}
},
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/index/by_topic/lessons|architecture/explorers/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1",
"value": 294
},
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/graph/nodes/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1_lessons|architecture_-P0-Seni0Qw_tpoEZdTN",
"value": {
"address": "0x0064be11Eeb5ecf0bff5076F642A44bA006994b1",
"topic_path": "lessons/architecture",
"entry_id": "-P0-Seni0Qw_tpoEZdTN",
"title": "Event Sourcing over CRUD for Audit Trails",
"depth": 2,
"created_at": 1787787914478
}
}
]
}