{
"type": "SET",
"op_list": [
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/explorations/0x1F9b7b3c342602A93D6E22C62C4aE3Ba7ac91f4A/lessons|architecture/-P1WVeOgbUbjqiALoGeM",
"value": {
"topic_path": "lessons/architecture",
"title": "Event Sourcing over CRUD for Audit Trails",
"content": "Team decided to replace PostgreSQL CRUD with Event Sourcing for financial transaction audit trails. Instead of mutable tables, immutable domain events (e.g., TransactionCreated, TransactionApproved, StatusUpdated) will be stored in Kafka as an immutable event log. A materialized view in PostgreSQL will serve fast reads on the frontend. This decision satisfies compliance requirements by preserving the full history and business context of every change — information that database triggers on a history_logs table would lose, since triggers only capture row-level changes without the user intent behind them. Implementation: event producers in src/services/transactionService.ts and consumer/store logic in src/events/eventStore.ts. Reference: Martin Fowler's 'Event Sourcing Pattern' article.",
"summary": "Team chose Event Sourcing over CRUD with Kafka for immutable audit trails, preserving business context that triggers would lose.",
"depth": 2,
"tags": "lesson_learned,event-sourcing,audit-trail,compliance,postgresql,kafka",
"price": null,
"gateway_url": null,
"content_hash": null,
"created_at": 1789416089196,
"updated_at": 1789416089196
}
},
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/index/by_topic/lessons|architecture/explorers/0x1F9b7b3c342602A93D6E22C62C4aE3Ba7ac91f4A",
"value": "[object Object]1111111111111111111111"
},
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/graph/nodes/0x1F9b7b3c342602A93D6E22C62C4aE3Ba7ac91f4A_lessons|architecture_-P1WVeOgbUbjqiALoGeM",
"value": {
"address": "0x1F9b7b3c342602A93D6E22C62C4aE3Ba7ac91f4A",
"topic_path": "lessons/architecture",
"entry_id": "-P1WVeOgbUbjqiALoGeM",
"title": "Event Sourcing over CRUD for Audit Trails",
"depth": 2,
"created_at": 1789416089196
}
}
]
}