{
"type": "SET",
"op_list": [
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/explorations/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1/lessons|architecture/-P-5aZYQyTBre-YmxI3V",
"value": {
"topic_path": "lessons/architecture",
"title": "Event Sourcing over CRUD for Audit Trails",
"content": "The team decided to use Event Sourcing instead of standard CRUD in PostgreSQL for financial transaction audit trails. CRUD overwrites previous states, making it impossible to provide compliance history (e.g., who changed transaction #8821 status from pending to approved). Database triggers were considered as an alternative but rejected because they only capture row-level changes without business context or user intent. Event Sourcing stores immutable domain events (TransactionCreated, TransactionApproved, StatusUpdated) via Kafka, with a materialized view in Postgres for fast frontend reads. Implementation: event producers in src/services/transactionService.ts, consumer/store logic in src/events/eventStore.ts. Reference: Martin Fowler's Event Sourcing Pattern article.",
"summary": "Adopted Event Sourcing with Kafka over CRUD in PostgreSQL for financial transaction audit trails to satisfy compliance requirements, with Postgres materialized views for read performance.",
"depth": 2,
"tags": "lesson_learned,event-sourcing,audit-trail,compliance,financial,kafka",
"price": null,
"gateway_url": null,
"content_hash": null,
"created_at": 1786817169628,
"updated_at": 1786817169628
}
},
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/index/by_topic/lessons|architecture/explorers/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1",
"value": 197
},
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/graph/nodes/0x0064be11Eeb5ecf0bff5076F642A44bA006994b1_lessons|architecture_-P-5aZYQyTBre-YmxI3V",
"value": {
"address": "0x0064be11Eeb5ecf0bff5076F642A44bA006994b1",
"topic_path": "lessons/architecture",
"entry_id": "-P-5aZYQyTBre-YmxI3V",
"title": "Event Sourcing over CRUD for Audit Trails",
"depth": 2,
"created_at": 1786817169628
}
}
]
}