Kafka: a staff activity audit log.
Built a shared history of staff actions on an HR platform: candidate status changes, document uploads, report exports and approvals.
The challenge
The HR platform had no shared log of staff actions. Candidate status changes, document uploads, report exports and approvals needed to appear in one history without adding a synchronous audit write to every workflow.
My role
I built the backend activity log: transactional event creation, the Outbox publisher, a dedicated Kafka consumer, separate PostgreSQL history storage and permission-aware access to the records.
Engineering approach
Changes to business data and the corresponding Outbox event were committed in one transaction; report exports created a separate audit event. A polling publisher sent events to Kafka using employee_id as the message key. A dedicated consumer wrote events to a separate PostgreSQL database, with unique UUIDv7 event IDs to avoid duplicate inserts and offset commits after saving. Document-upload events contained IDs, links and metadata rather than passport files. Failed events went to a diagnostic Kafka dead-letter topic without automatic replay.
The outcome
The platform gained a production activity log accessible to staff within their permissions. Business operations could complete before the audit history was updated; pending Outbox events could be processed after temporary outages.
The result was a working audit feature, not a measured latency improvement. Kafka and RabbitMQ served separate use cases. Keying by employee_id does not guarantee a global action order for a candidate changed by different employees, and the dead-letter topic was for diagnosis rather than automatic recovery.