Matthew Kong

Case studies/BambooHR, 2021 to 2022

Performance review cycles and developer webhooks

Tenant-isolated, HMAC-signed webhook delivery behind a change outbox, so one slow customer endpoint cannot stall anyone else.

Laptop screen with code under blue light
  1. Review-cycle scheduler
  2. Assessment records
  3. Change outbox
  4. Per-tenant delivery queue
  5. Signed webhook
  6. Audit dashboard

Why this work, at that time

BambooHR's public API history shows developer webhooks landing in April 2022 and multiple performance-review cycles in September 2022. This is the problem space around those releases.

The problem

Administrators needed multiple review cohorts, and external systems needed permission-scoped employee change notifications. One slow webhook destination must not block other tenants or leak unrelated fields.

The team and my part

Six engineers: three backend and API, one integrations, one React, one lead, with PM, QA, a security reviewer and a customer-integration liaison shared. I designed the event-delivery contract and backpressure policy, coordinated the release, wrote the integration guide and reviewed junior PRs.

Data and index design

review_cycle(tenant, id, filter, window); review_assessment(tenant, employee, cycle, state); webhook_subscription(tenant, id, url, scope, secret_ref); outbox_event(tenant, event_id, record_version); delivery_attempt(event_id, subscriber, attempt, status).

API and event contract

POST /review-cycles; POST /webhooks; outbound POST to the customer endpoint with event_id, changed_fields and a signature. Tenant-scoped events employee.updated and review.completed.

Core logic

Evaluate cycle membership as scheduled snapshots. Emit the outbox event only after the employee change commits. Dispatch through tenant-isolated retries with a signed payload, check scopes at send time, and dead-letter after bounded attempts.

Implementation sequence

  1. Agree public event schemas, subscription permissions and signing rotation with partners.
  2. Create the event outbox and delivery tracking tables; isolate tenants in queue scheduling.
  3. Implement HMAC signing, exponential retry, delivery ids and a replay API for support.
  4. Build feature flags, documentation, an example webhook receiver and test payloads.
  5. Canary to opt-in tenants; monitor delivery latency, 4xx and 5xx patterns, signing failures and leakage tests.

Environments and release

Synthetic HR dataset, a staging webhook receiver and a CI contract suite. Production used encrypted secret storage, worker rate limits and logs with sensitive fields suppressed.

Failure drill

A customer endpoint returns 500 for six hours and a backlog builds. Per-tenant quotas and capped retry windows keep that customer's outage from touching anyone else.

Scale and targets

Modeled scale

  • About 1.1K tenants and 145K employees in the cohort
  • About 140K outbound events per day, 1.6 per second average
  • Bursts near 250 delivery attempts per second, with retries over 24 hours

Acceptance targets

  • 99.5% successful delivery within 24 hours
  • Zero cross-tenant payload leakage
  • Status dashboard lag under two minutes

Scale figures are the sizing model behind the design. Targets are acceptance criteria, not measured results.

The trade-off I would defend

A 2022 design should not borrow from BambooHR's later real-time webhook redesign. Scope stays with what existed at the time.