Salesforce Decode
Salesforcedecode
Back to questions
IntegrationArchitect (Hardest)event-sourcingplatform-eventsaudit

Architect event sourcing audit trail using Platform Events

Real World Scenario

Regulator requires immutable history of Quote discount approvals; Field Audit Trail insufficient for cross-system narrative.

Expected Answer

• Publish Quote_Approval_Event__e with actor timestamp before after values • External event store append-only S3 Kafka retention 7 years • Salesforce stores latest state; event log is authoritative history • Replay events reconstruct Quote state at any point in time • Correlation ID links related approval chain events • Tamper detection hash chain on event store optional • Separate operational CDC from domain audit events

Follow-Up Questions & Answers

Click to expand — each follow-up includes a direct, interview-ready answer

Main difference: use case and scale. Publish Quote_Approval_Event__e with actor timestamp before after values. External event store append-only S3 Kafka retention 7 years. Pick based on your integration pattern and team capability. Event sourcing for compliance needs external retention—Platform Event alone insufficient for 7-year audit. Document the decision in an ADR and align with enterprise standards.

Architect Perspective

Event sourcing for compliance needs external retention—Platform Event alone insufficient for 7-year audit.