Vibe Engines
YouTube

Vibe Engines is free, interactive AI engineering & system design — runs in your browser. Pick a learning path

Forward Deployed Engineer  /  Integration Patterns
FDE Track 03~15 min readIntermediate
Where POCs Die

Integration is where
the demo becomes real.

A prototype on sample data impresses no one for long. The moment that matters — and the moment most deployments stall — is when you wire your solution into the customer’s actual systems, with their auth, their data, and their network. This is the FDE’s core craft. Here’s the menu, and how to survive it.

01

The truth: integration is where POCs die

Your prototype worked beautifully on the sample CSV. Then you pointed it at the customer’s real system and everything the sample data hid showed up at once: fields that are sometimes null and sometimes “N/A”, an auth flow stricter than your test key, an API that 403s from inside their network, and a service that times out one call in fifty. This is the moment most deployments stall — not because the idea was wrong, but because the last mile to real data is genuinely hard.

The FDE response is counter-intuitive: attempt a real connection early, before the solution is polished. Getting one live system connected in week one — even read-only, even ugly — surfaces the auth, network, and data-shape realities while you still have time to design around them. Saving integration for the end is how a great demo becomes a dead POC.

→ The de-risking rule

The riskiest part of a deployment is rarely the model or the UI — it’s the integration and the security approval. Do the scariest connection first, not last.

02

The integration menu

Almost every connection you’ll build falls into one of five families. Pick by latency, volume, and — crucially — what access the customer will actually grant.

PatternShapeUse whenWatch out for
REST / GraphQLYou call them, request/responseReal-time reads/writes, moderate volumeRate limits, pagination, auth scopes
WebhooksThey push events to youReact to changes as they happenSignature verification, duplicates, your endpoint must be reachable
Files / SFTP / object storageBatch drops of dataLegacy systems, nightly bulk exportsSchema drift, partial files, encoding, PII in the clear
Database / CDCRead their store, or stream changesThey’ll grant direct DB access; you need history or high fidelityLoad on prod DB, permissions, keeping in sync
Message queueStream of events (Kafka, etc.)High-volume, decoupled, event-drivenOrdering, consumer lag, replay, at-least-once delivery

The choice is as much political as technical. The cleanest design is worthless if the customer won’t grant the access it needs. Often you’ll take the second-best integration because it’s the one their security team will approve this quarter — a nightly SFTP drop instead of live DB access, say. Design for what you can actually get.

03

Getting in the door: auth

Before any data flows, you have to authenticate into systems that were built to keep strangers out. The mechanism varies, and matching it correctly is half the battle.

The common mechanisms

  • API key — simplest; put it in a header, scope it tightly, rotate it.
  • OAuth — client-credentials (service-to-service) or authorization-code (on behalf of a user). Standard for SaaS.
  • mTLS — they require a client certificate; verify the chain and that it’s actually being sent.
  • Service account — a least-privilege identity in their cloud/DB with only the roles you need.

The rules that keep you safe

  • Request the minimum scope — security says yes faster to a small ask.
  • Secrets live in a vault/KMS + env injection, never in code or logs.
  • Prefer short-lived credentials over long-lived keys.
  • Expect a security review for anything touching production data — start it early.

When auth fails — and it will — it’s almost always one of a few things: the token in the wrong place or format, a missing scope, clock skew breaking a signed request, or the customer’s network not allow-listing you. The integration debugging playbook is the checklist; OAuth specifically is worth a deep read in the auth handbook.

04

Reliability at the edge

A demo runs once on a good day. A deployment runs thousands of times against systems that fail intermittently. A handful of patterns is the whole difference.

Every external call can fail — time out, rate-limit, 500, or silently double-deliver. Design as if they will, and a fragile integration becomes a durable one. These patterns are so central to FDE work that each has a hands-on challenge in the track.

The five patterns that make an integration survive real traffic
IdempotencyA retried request doesn’t double-write. Dedupe by a client-supplied key so a re-sent payment or re-delivered webhook happens once.
Retries + jitterRetry transient failures with exponential backoff and full jitter so a recovering service isn’t stampeded by a synchronized herd.
Webhook verifyVerify the signature over the raw body and reject stale events (a timestamp window) to stop replays.
Validate at the edgeReject or quarantine bad input before it corrupts anything downstream.
Dead-letterSend what you can’t process to a DLQ for inspection and replay, instead of dropping it or blocking the pipeline.

None of these is exotic. Together they’re the line between “it worked in the demo” and “it’s been running at the customer for six months.” If you internalize one thing from this handbook, internalize idempotency: it’s the pattern that makes every other retry safe.

05

Making sense of their data

Once bytes are flowing, they’re rarely in the shape you want. Customer data is a museum of history: inconsistent field names, mixed date formats, nulls that mean five different things, and encodings from three decades of systems. Two jobs recur on every deployment.

JobWhat it meansThe FDE reflex
MappingCoerce their messy rows onto a clean, canonical schema your solution understands.Validate and coerce at the boundary; quarantine bad rows rather than dropping them silently.
ReconciliationProve the data that left the source actually landed in the target — and flag what didn’t.Diff by key: report added / removed / changed so “it’s not syncing” becomes a fact, not an argument.

Both jobs are deceptively important. A silent mapping bug corrupts trust in the whole system; a good reconciliation report is often the artifact that convinces a skeptical customer the migration actually worked. Practice both in the CSV schema mapper and reconciliation diff challenges — they’re modeled on exactly this work.

06

Debugging the customer’s edge

Finally, a truth every FDE learns the hard way: it works on your laptop and fails from the customer’s box. The environment is different — different network, different egress rules, different clock, different certificates. So debug from where the code actually runs, not from your machine.

→ The debugging reflexes

Reproduce from the deploy host (egress rules differ). Read the status code first (401/403 = auth, 429 = rate limit, timeout = network). Capture the API’s request-id — it’s your ticket when you escalate to their team. Binary-search the stack: DNS → TCP/TLS → auth → payload, confirming each layer before blaming the next.

Integration is unglamorous, and it’s the FDE’s highest-value skill precisely because it’s where the value gets real. Get through it and you’ve earned the right to the fun parts: the demo, and turning the POC into something the customer depends on. Next in the track: turning a working integration into a scoped, demoable deliverable — and beyond, deployment in the customer’s own environment.

Deep dive

The retry that quietly duplicates, and the consumer that survives it

Every integration you build against a customer system will be retried — by their gateway, by your queue, by a human clicking twice. Correctness under replay is not an optimisation.

At-least-once delivery is the default of every queue, webhook and HTTP retry you will meet in a customer environment, and it means your consumer will see the same message twice. The failure is rarely dramatic: an invoice posts twice, a ticket gets two comments, a reconciliation report double-counts a week. It is found in month three by an accountant, not by a monitor.

the four places a duplicate is created
↻

Their retry

Their gateway timed out at 30s; your handler finished at 31s and the write landed. They retry. Two writes, one request.

↻

Queue redelivery

The consumer crashed after the side effect and before the ack. The broker redelivers, correctly, by design.

↻

Overlapping pages

A paginated crawl over a dataset being written to returns the same record on two pages.

Three different causes, one defence: make the effect idempotent rather than trying to make delivery exactly-once.
# the consumer shape that survives all three
def handle(msg):
    key = msg.get("idempotency_key") or stable_hash(msg)  # never a timestamp

    # claim the key and do the work in ONE transaction, or the
    # crash between them recreates the problem you are solving
    with db.transaction():
        if db.seen(key):
            return db.result_for(key)   # replay -> the FIRST result
        result = apply(msg)
        db.record(key, result)
    return result

# retry policy for calls you make outbound
delay = min(cap, base * 2 ** attempt) * random()  # full jitter
# retry 5xx and 429. never retry 4xx — you will just burn their quota.

Three details do the work. The key must be stable — derived from the content, never from a timestamp or a random value, or a replay generates a new key and defeats the whole mechanism. The claim and the effect must be in one transaction, or a crash between them reproduces the duplicate. And a replay must return the first result rather than recomputing, because the caller is entitled to a consistent answer to a request it believes it made once.

→ The jitter line people delete

Exponential backoff without jitter synchronises every retrying client onto the same schedule, so a recovering service is hit by a coordinated wave at exactly the moment it is weakest. The multiply-by-random is one character of code and it is the difference between a recovery and a second outage. Practise both halves: idempotency and backoff with jitter.

By the numbers

Worked example: backfilling 250,000 records through a REST API

The customer’s API returns 100 records a page and allows 10 requests a second. One call in fifty times out, the rate this page started with. Retries use its own formula, min(cap, base × 2^attempt) × random(), with base 0.5 s and cap 30 s. The workload is illustrative.

StepQuestionArithmeticAnswer
1Requests needed250,000 ÷ 100 per page2,500
2Fastest possible run2,500 ÷ 10 per second250 s, about 4 minutes
3Timeouts to expect2,500 ÷ 5050
4Wait before retry 1min(30, 0.5 × 2^0) × random()0 to 0.5 s, mean 0.25 s
5Wait before retry 4min(30, 0.5 × 2^3) × random()0 to 4 s, mean 2 s
6Wait before retry 7min(30, 0.5 × 2^6 = 32) × random()capped: 0 to 30 s
7Worst case, one call fails 7 times0.5 + 1 + 2 + 4 + 8 + 16 + 3061.5 s of ceilings, about 31 s expected
8The job dies at page 1,800resume from the saved cursor; upsert by record id0 duplicates, 700 pages left
9Prove it landedcount and diff by key, source against target250,000 = 250,000, or a list of the gaps

Step 2 is the number to tell the customer before you start. A backfill can never run faster than the rate limit. Step 6 shows why the cap exists: without it, the seventh retry could wait over 30 s and the next one over a minute. Step 8 is idempotency doing its job. The rerun writes nothing twice because every row lands through an upsert keyed on the source id, and the cursor was saved after each committed page. Step 9 turns “I think it worked” into a report you can show.

Trade-offs

Cost and trade-offs across the integration menu

Here Time means freshness: how stale your copy can get. Space means what you must run or store to make the pattern safe.

CaseTimeSpaceWhy
REST pollingUp to one poll interval staleA cursor per resourceCalls grow with how often you poll, not with how much changes. Simple, and you control it.
WebhooksNear real timeA reachable endpoint plus a store of seen event idsAn outage longer than their retry window loses events, so keep a reconciling poll behind it.
Nightly file dropUp to a day staleEvery file kept for replayYou must spot a partial or missing file: wait for a done marker or check a row count.
Direct database readAs fresh as your queryQuery load on their production databaseFastest to agree and the easiest to hurt them with. Read from a replica if one exists.
Log-based CDCSecondsA connector plus replication permissionsDebezium-style tools read the binlog or WAL rather than querying tables, so load stays low and deletes are captured.
Message queueSecondsConsumer offsets plus your dedupe storeAt-least-once delivery means the consumer must be idempotent, as in the deep dive above.

Fresher patterns push the work to the edges: a public endpoint, a connector, a dedupe store. Staler ones push it into reconciliation. Pick the freshness the workflow actually needs, then pay the matching cost on purpose.

Watch for

Common mistakes

  • Offset pagination over a live table

    ?offset=200 on a table that is being written to shifts under you. An insert pushes a row onto two pages, and a delete pulls a row back so that no page ever returns it. The skip is the dangerous one, because nothing errors. Page by a keyset cursor such as (updated_at, id) instead.

  • Cursoring on your own clock

    WHERE updated_at > :last_run, with last_run taken from your clock, misses rows. A transaction can stamp a row before your run starts and commit after your query reads. Use the largest value you actually received, re-read a small overlap window, and let the idempotent upsert absorb the repeats.

  • Doing the work inside the webhook handler

    A slow handler makes the sender time out and retry, so you get duplicates plus a growing backlog. Verify the signature, store the raw event, return 2xx, and process it from a queue.

  • Blind retries on a non-idempotent POST

    A timeout does not mean the write failed; it may have landed, as the deep dive shows. Send an idempotency key if the API supports one, or look the record up by your own reference before you retry.

  • Spending the customer’s quota

    A rate limit is often shared across every app that uses the same credentials. A backfill that runs flat out can starve the customer’s own production integrations. Throttle below the limit, honour Retry-After on a 429, and schedule bulk work for off-hours.

In the wild

Where this shows up in production and interviews

  • Payments

    Payment APIs build idempotency into the contract. Stripe, for one, accepts an Idempotency-Key header on POST requests and returns the original result when the same key is retried. Copy that shape for any write your integration exposes.

  • CDC into a warehouse

    The usual way to mirror an operational database is log-based CDC into a stream, then into the warehouse. A row’s changes stay in order because they are keyed by primary key, and deletes arrive as events instead of quietly vanishing.

  • Legacy batch files

    Many older systems export only flat files on a schedule. The production version adds a done-marker or row-count convention, an archive of every file for replay, and quarantine for rows that fail mapping, so that one bad row never blocks the night.

  • The interview version

    “Sync a customer’s CRM into our system.” Name the pattern you would choose and why, given the access you are likely to get. Then cover the cursor, the idempotent upsert keyed on the source id, the retry policy, where the poison rows go, and the reconciliation that proves it works. Do the step 1 to 3 arithmetic out loud.

Self-check

Check yourself

Your webhook handler calls a slow API before returning, and the sender starts delivering every event two or three times. What do you change?

Return fast. Verify the signature, persist the raw event keyed by its event id, reply 2xx, and process it asynchronously. The duplicates come from the sender’s timeouts, so a fast ack stops most of them. Dedupe by event id catches the rest.

Security will approve a nightly file drop this quarter and database access next quarter. Which do you build?

The file drop, now. Put the mapping into your canonical schema behind a source adapter, so swapping the file reader for a database or CDC reader later changes one component and nothing downstream. Shipping on what you can get beats waiting for the ideal integration.

A POST that creates an invoice times out. Should the client retry?

Only if the retry is safe. With an idempotency key, yes: the server returns the first result if the write already landed. Without one, look the invoice up by your own reference first. A blind retry is how one invoice gets posted twice.

In the worked example, the cursor is saved after each page commits. The crash lands between page 1,800’s commit and its cursor write. What happens on rerun?

Page 1,800 is fetched and written again, because the saved cursor still points at it. That is harmless, because every row is an upsert keyed by source id. Saving the cursor and the rows in one transaction would make the resume exact. That is the same rule as the deep dive’s claim-and-effect transaction.

Frequently asked

Quick answers

What are the main ways to integrate with a customer’s systems?

Five families cover almost everything: synchronous APIs (REST/GraphQL) for request/response; webhooks for the customer’s system to push events to you; file drops (SFTP/object storage) for batch data; database and change-data-capture (CDC) connectors for reading their store directly; and message queues for high-volume streaming. You choose based on latency needs, data volume, and what access the customer will actually grant.

Why do proofs of concept fail at integration?

A POC on clean sample data hides everything real: the customer’s data is messy and inconsistent, their auth is stricter than a test key, their network blocks your egress, and their systems fail intermittently. Integration is where those realities land all at once. FDEs de-risk it by attempting a real connection early — even to just one system — rather than saving integration for the end.

How do you handle authentication with a customer’s API?

It depends on their setup: API keys (simplest, scope them tightly), OAuth client-credentials or authorization-code flows (common for SaaS), mutual TLS (mTLS, where they require a client certificate), or a service account with least-privilege roles. Always request the minimum scope needed, keep secrets in a vault rather than code, and expect a security review for anything touching production data.

How do you make an integration reliable?

External calls fail, so build for it: make operations idempotent (a retried request doesn’t double-write), retry transient failures with exponential backoff and jitter, dedupe redelivered webhooks by an id, validate input at the edge, and send what you can’t process to a dead-letter queue for later. These few patterns turn a fragile demo into a system that survives the customer’s real traffic.

Customer Integration Patterns · part of the FDE track · Vibe Engines · 2026
Finished this one? 0 / 209 Handbooks done
NextAI App Patterns for FDEs Next on the “The deployment loop” ladder · rung 5 of 8

Explore the topic

See this alongside everything else on the same subject — handbooks, system designs, challenges and tools, in one place.

More Handbooks