7 ms·
> isn't Audit Log supposed to be consumed by customers directly? Hence it's a domain entity. And DB table is implementation detail that may or may not corelate
by potamic 4y ago
> isn't Audit Log supposed to be consumed by customers directly? Hence it's a domain entity. And DB table is implementation detail that may or may not corelate to domain entity?
You could return an abstraction of the audit log and decouple consumers from your table schema?
Triggers give you a simple way to ensure the log tracks the changes. Another popular approach is change-data-capture which allows you to record logs in a different store.