Kavex Intelligence · Developer discipline
API Design & Integrations
Connections between systems that survive retries, outages and version changes.
Architecture
Integrations fail in ordinary ways: timeouts, duplicates, out-of-order events. We design for those first.
Every write is idempotent and every external call has a timeout, a retry policy and a dead-letter path.
Implementation flow
- Map
Which system owns which field.
- Contract
Versioned schemas.
- Retry
Backoff with idempotency keys.
- Reconcile
Nightly diff of both sides.
Trade-offs
Webhooks vs polling
Webhooks are timely but can be lost; pair them with periodic reconciliation.
Schema versioning
Additive changes only; version the contract when meaning changes.
Idempotent write
Illustrative code · ts
async function upsertInvoice(evt: InvoiceEvent) {
const key = `inv:${evt.source}:${evt.id}:${evt.version}`;
if (await seen(key)) return "duplicate-ignored";
await db.invoices.upsert(evt);
await markSeen(key);
}