mark davis

I make slow systems fast
and expensive systems cheap.

Backend and platform engineer, six years, mostly logistics and payments. Austin, or remote in US timezones.

Status Open to senior backend roles

Notice Four weeks

Stack Go, Python, Postgres, AWS

Get in touch

Shipped

Dispatch matching rewrite

Freightline · 2025 · Go, Postgres, Redis

Matching drivers to loads ran as a single Postgres query with eleven joins, and it had grown a 1.4 second p99 during morning peak. Dispatch staff had started refreshing the page to force a retry, which doubled the load that was already the problem.

I split the read path off, precomputed eligibility per driver on a five second cycle, and moved the final ranking into the application where it could short-circuit. The query kept its correctness guarantees: a driver who becomes ineligible mid-cycle is filtered at assignment, not at ranking.

p99 latency
1.4s → 180ms
Timeouts
-94%
Database spend
$6.2k → $2.8kper month
Rollout
3 weeksbehind a flag

Payments pipeline that cannot double-charge

Freightline · 2024 · Go, Stripe, SQS

Carrier payouts were triggered by a webhook with no idempotency and a retry policy that assumed success. Twice in one quarter a redelivery paid a carrier twice, and both times we found out from the carrier.

Every payout now carries a deterministic key derived from the load and the settlement period, written in the same transaction as the ledger entry. A replayed webhook finds the key, returns the original result, and touches nothing.

Duplicate payouts
0in 18 months
Volume
$41Ma year
Reconciliation
4h → 6minnightly job

On-call that stopped waking people up

Freightline · 2023 · Terraform, Prometheus

The rotation was paging eleven times a week, and roughly seven of those were the same three alerts firing on thresholds nobody had revisited since the service was a third of its size.

I rewrote the alerts around symptoms customers actually notice, added the runbook link to the page body, and deleted the ones that had never once corresponded to an outage. Deleting alerts is unpopular until the first quiet week.

Pages per week
11 → 2
Missed incidents
0since the change
Runbook coverage
100%of paging alerts
Architecture diagram, dispatch matching path

How I actually write things

The idempotency key from the payouts work. The interesting part is not the hashing, it is that the key is written inside the same transaction as the effect it guards.

payout.go Go
// Key is deterministic: the same load and settlement period always produce
// the same key, so a webhook replay is a lookup rather than a payment.
func payoutKey(loadID string, period Period) string {
    sum := sha256.Sum256([]byte(loadID + "|" + period.ID()))
    return "po_" + hex.EncodeToString(sum[:16])
}

func (s *Service) Pay(ctx context.Context, load Load, p Period) (*Payout, error) {
    key := payoutKey(load.ID, p)

    // One transaction: the ledger entry and the claim on the key either
    // both land or neither does. Without this, a crash between them is a
    // double payment waiting for the next redelivery.
    return sqlx.InTx(ctx, s.db, func(tx *sqlx.Tx) (*Payout, error) {
        if existing, err := s.findByKey(tx, key); err == nil {
            return existing, nil // replay: already paid, say so and stop
        } else if !errors.Is(err, sql.ErrNoRows) {
            return nil, err
        }

        entry, err := s.writeLedger(tx, load, p, key)
        if err != nil {
            return nil, err
        }
        return s.submitToProcessor(ctx, entry)
    })
}

Stack, and how far I am with each

Open source

ratelim, a small Go library for token bucket limiting with a Redis backend. Written for work, extracted with permission, used by forty-odd projects. I still answer the issues.

Occasional Postgres documentation fixes, which is the least glamorous and most useful contribution available to anyone.

History

  1. 2022 – now Senior Backend Engineer, Freightline
  2. 2020 – 2022 Backend Engineer, Corsair Payments
  3. 2020 BS Computer Science, Texas A&M University

Hiring for a backend team?

Send me the hardest thing in your system right now. I would rather talk about that than walk through my resume, and you will learn more about how I think in ten minutes than an interview loop usually manages.

Last updated 18 September 2026

Demo site by Resume Insite →