Hi Everyone,
I'm building a centralized Audit Log application in OutSystems Developer Cloud (ODC).
Current Design
To optimize write performance, I'm using two audit tables:
Is this a better approach than storing the data directly in main table.
For each audit event, I'm storing:
Requirement
I want to identify exactly what changed between the two JSON payloads, such as:
Before JSON JSON{ "Name": "John", "Email": "john@test.com", "Status": "Active"}
After JSON JSON{ "Name": "John", "Email": "john.doe@test.com", "Status": "Inactive"}
Expected result:
Questions
Additional Context
The audit framework is intended to be reusable across multiple applications and entities, so I'm looking for a scalable and performant approach that can handle large volumes of audit records while still allowing users to see which fields changed and their corresponding old/new values.
Thanks,
Gowtham
ODC has JSON serialization tools, but no built-in field-level JSON diff action. You can use DiffEntity for ODC, which compares two JSON objects and returns their differences. For the architecture, I would write directly to the main audit table unless performance tests prove it is a bottleneck. Store Before, After, and the calculated differences when logging, since recalculating every time the audit screen opens will become expensive at scale.