the changes Trigger Based • Dedicated Trigger on each table to monitor insert/update/delete • Tightly coupled with the main transactional updates • Also interferes with the transactional updates and may cause performance issues Periodic polling for changes in a table Query Based • Use Created / Modified Timestamp to query recently updated records • Far from efficient & correctness • Interferes with the transactional updates and may cause lock contentions
Populating Analytical Data Store Database Replication Update Search Index Cache Update / Invalidation Update CQRS Read Model Outbox Microservices Pattern
• Use de-duplication id / idempotency logic to avoid duplicates • Make use of an enrichment service to enrich audit data with additional context or to format data • Maintain configuration to include / exclude any columns from audit • Design a generic table for holding Audit Data. NoSQL DB is an option too • Make use of a schema registry