Vibe Engines is free, interactive AI engineering & system design — runs in your browser. Pick a learning path →
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.
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 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.
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.
| Pattern | Shape | Use when | Watch out for |
|---|---|---|---|
| REST / GraphQL | You call them, request/response | Real-time reads/writes, moderate volume | Rate limits, pagination, auth scopes |
| Webhooks | They push events to you | React to changes as they happen | Signature verification, duplicates, your endpoint must be reachable |
| Files / SFTP / object storage | Batch drops of data | Legacy systems, nightly bulk exports | Schema drift, partial files, encoding, PII in the clear |
| Database / CDC | Read their store, or stream changes | They’ll grant direct DB access; you need history or high fidelity | Load on prod DB, permissions, keeping in sync |
| Message queue | Stream of events (Kafka, etc.) | High-volume, decoupled, event-driven | Ordering, 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.
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.
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.
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.
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.
| Job | What it means | The FDE reflex |
|---|---|---|
| Mapping | Coerce 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. |
| Reconciliation | Prove 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.
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.
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.
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.
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.
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.
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.
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.
| Step | Question | Arithmetic | Answer |
|---|---|---|---|
| 1 | Requests needed | 250,000 ÷ 100 per page | 2,500 |
| 2 | Fastest possible run | 2,500 ÷ 10 per second | 250 s, about 4 minutes |
| 3 | Timeouts to expect | 2,500 ÷ 50 | 50 |
| 4 | Wait before retry 1 | min(30, 0.5 × 2^0) × random() | 0 to 0.5 s, mean 0.25 s |
| 5 | Wait before retry 4 | min(30, 0.5 × 2^3) × random() | 0 to 4 s, mean 2 s |
| 6 | Wait before retry 7 | min(30, 0.5 × 2^6 = 32) × random() | capped: 0 to 30 s |
| 7 | Worst case, one call fails 7 times | 0.5 + 1 + 2 + 4 + 8 + 16 + 30 | 61.5 s of ceilings, about 31 s expected |
| 8 | The job dies at page 1,800 | resume from the saved cursor; upsert by record id | 0 duplicates, 700 pages left |
| 9 | Prove it landed | count and diff by key, source against target | 250,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.
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.
| Case | Time | Space | Why |
|---|---|---|---|
| REST polling | Up to one poll interval stale | A cursor per resource | Calls grow with how often you poll, not with how much changes. Simple, and you control it. |
| Webhooks | Near real time | A reachable endpoint plus a store of seen event ids | An outage longer than their retry window loses events, so keep a reconciling poll behind it. |
| Nightly file drop | Up to a day stale | Every file kept for replay | You must spot a partial or missing file: wait for a done marker or check a row count. |
| Direct database read | As fresh as your query | Query load on their production database | Fastest to agree and the easiest to hurt them with. Read from a replica if one exists. |
| Log-based CDC | Seconds | A connector plus replication permissions | Debezium-style tools read the binlog or WAL rather than querying tables, so load stays low and deletes are captured. |
| Message queue | Seconds | Consumer offsets plus your dedupe store | At-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.
Common mistakes
- Offset pagination over a live table
?offset=200on 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, withlast_runtaken 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-Afteron a 429, and schedule bulk work for off-hours.
Where this shows up in production and interviews
- Payments
Payment APIs build idempotency into the contract. Stripe, for one, accepts an
Idempotency-Keyheader 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.
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.
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.
Explore the topic
See this alongside everything else on the same subject — handbooks, system designs, challenges and tools, in one place.
More Handbooks
- The Agent Evaluations HandbookA self-contained handbook on evaluating AI agents — theory, interactive widgets, and practical guidance. Trajectory evals, tool-use scoring, LLM-as-judge, observability, and reliability for PMs, engineers, and founders.Read →
- The Agent Patterns HandbookThe design patterns behind every LLM agent — the ReAct Thought–Action–Observation loop, tool/function calling, plan-and-execute, reflection, memory, multi-agent orchestration, and the failure modes (loops, hallucinated tools, recovery, human-in-the-loop) that break agents in production.Read →
- The Kubernetes HandbookThe one idea under all the YAML — declare desired state, and a control loop makes reality match. Covers the orchestration problem, pods, deployments and replicasets, services and networking, the reconciliation loop and self-healing, the scheduler, config/secrets and health probes, autoscaling, and when you actually need Kubernetes.Read →
- The Observability HandbookSeeing inside production — monitoring vs observability, the three pillars (metrics, logs, traces) and what each answers, structured logging, metric types and the cardinality trap, distributed tracing, the golden signals and SLIs/SLOs/error budgets, alerting on symptoms not causes, and correlating all three during an incident.Read →
- The AI Security HandbookYour app now reads the internet and believes it. Why prompt injection is a design problem filters cannot solve, the lethal trifecta (private data + untrusted content + exfiltration), defense in depth from least privilege to output validation, where PII actually leaks (logs, embeddings, weights), MCP/model supply-chain trust, and the red-team eval suite that gates CI.Read →
- The Docker HandbookA container is a lie told by the kernel — namespaces (what a process sees) plus cgroups (what it uses), not a VM. Image layers and the cache-ordering rule that halves build times, multi-stage Dockerfiles that ship small, volumes vs bind mounts, name-based networking, Compose, and the handoff to Kubernetes.Read →