{
"type": "SET",
"op_list": [
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/explorations/0x1F9b7b3c342602A93D6E22C62C4aE3Ba7ac91f4A/lessons|architecture/-P1I9KhMsNRw9HRrJ5Ws",
"value": {
"topic_path": "lessons/architecture",
"title": "Event Sourcing over CRUD for Audit Trails",
"content": "Team decided to replace standard CRUD in PostgreSQL with Event Sourcing for financial transaction audit trails to ensure compliance. Instead of storing current state in a mutable table, we store a sequence of immutable domain events (TransactionCreated, TransactionApproved, StatusUpdated) in Kafka, and build materialized views in Postgres for fast frontend reads. Alternatives considered: (1) Database triggers with a history_logs table — rejected because business context is lost; triggers only see row changes (e.g., status changed from 1 to 2) and cannot capture user intent or the reason behind changes. Reference architecture: Martin Fowler's Event Sourcing Pattern article. Implementation files: src/services/transactionService.ts (event producers), src/events/eventStore.ts (consumer/store logic).",
"summary": "Moving from CRUD to Event Sourcing with Kafka for financial transaction audit trails to preserve full history and business context for compliance requirements.",
"depth": 2,
"tags": "lesson_learned,event-sourcing,audit-trail,compliance,kafka,postgresql",
"price": null,
"gateway_url": null,
"content_hash": null,
"created_at": 1789175356247,
"updated_at": 1789175356247
}
},
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/index/by_topic/lessons|architecture/explorers/0x1F9b7b3c342602A93D6E22C62C4aE3Ba7ac91f4A",
"value": "[object Object]111111111111111111"
},
{
"type": "SET_VALUE",
"ref": "/apps/knowledge/graph/nodes/0x1F9b7b3c342602A93D6E22C62C4aE3Ba7ac91f4A_lessons|architecture_-P1I9KhMsNRw9HRrJ5Ws",
"value": {
"address": "0x1F9b7b3c342602A93D6E22C62C4aE3Ba7ac91f4A",
"topic_path": "lessons/architecture",
"entry_id": "-P1I9KhMsNRw9HRrJ5Ws",
"title": "Event Sourcing over CRUD for Audit Trails",
"depth": 2,
"created_at": 1789175356247
}
}
]
}