डिजिटल वस्तुओं का थोक मंच

Multi-Source Fulfilment Routing 2026: Suppliers के बीच order routing

Production multi-source routing algorithms: latency-weighted, stock-aware, cost-optimised, और B2B fulfilment के लिए failover।

Multi-Source Fulfilment Routing 2026: Suppliers के बीच order routing

Production B2B digital-goods fulfilment single supplier पर depend नहीं कर सकता। Exclusive supplier एक single point of failure है: एक outage और हर order fail। सही architectural pattern है multi-source routing जो हर request पर best option automatically select करे।

1. Latency-weighted routing

Simplest variant — supplier को lowest p95 delivery latency से pick करना। Historical metrics Redis sliding window में store करें:

type SupplierStats = { p95Ms: number; failureRate: number; stock: number };

async function pickSupplier(sku: string): Promise<string> {
  const candidates = await getSuppliersForSku(sku);
  const stats = await Promise.all(
    candidates.map(s => redis.hgetall(`sup:${s.id}:stats`))
  );
  const scored = candidates.map((s, i) => ({
    id: s.id,
    score: 1 / (parseFloat(stats[i].p95Ms) + 1),
  }));
  return scored.sort((a, b) => b.score - a.score)[0].id;
}

यह 80% scenarios cover करता है। Latency metrics हर 30 seconds real webhook timings से refresh होती हैं।

2. Stock-aware routing

अगर supplier का inventory buffer से कम है (e.g., popular SKU के लिए <50 codes) — अच्छी latency होने पर भी इसे primary की तरह avoid करें। Stock buffer "4 concurrent orders for 3 codes" race condition से बचाता है।

function isViableSupplier(s: SupplierStats, qty: number): boolean {
  const buffer = Math.max(50, qty * 3); // 3x safety margin
  return s.stock >= buffer && s.failureRate < 0.05;
}

FoxReload हर 60 seconds inventory snapshot internal cache में push करता है। GET /v1/catalog/inventory use करने वाले partners को अपनी routing के लिए same snapshot मिलता है।

3. Cost-optimised routing

अगर SLA allow करे (e.g., 5 minutes के अंदर fulfilment B2B के लिए normal है), wholesale cost पर optimise करें। Formula:

score = (1 / wholesale_cost) * sla_multiplier
where sla_multiplier = 1 if p95 < target else 0

यह hard SLA guarantee + minimum cost देता है। बड़े scale पर (>10k orders/day) यह marginal cost पर 1.5–3% बचाता है।

4. Failover और circuit breaker

Health-check pattern:

Signal Threshold Action
5xx rate 5 min में >5% Mark DEGRADED
Timeout rate >2% Mark DEGRADED
Heartbeat fail लगातार 3 Mark DOWN
Recovery 5 successful Mark HEALTHY

Circuit breaker pattern (Polly/resilience4j-style):

import CircuitBreaker from 'opossum';

const breaker = new CircuitBreaker(callSupplier, {
  timeout: 8000,
  errorThresholdPercentage: 50,
  resetTimeout: 120000, // 2 min
});

breaker.fallback(() => fallbackSupplier());

Open state में 100% traffic fallback पर जाता है — 2-minute cooldown, फिर half-open canary check, फिर recovery।

CTA

FoxReload single API के नीचे 40+ supplier pools auto-routing और failover के साथ aggregate करता है। Access पाएं और अपना fulfilment multi-source पर ले जाएँ।

अक्सर पूछे जाने वाले प्रश्न

FoxReload default में कौन सा routing algorithm use करता है?
Weighted score: 50% current stock availability, 30% p95 latency, 20% wholesale cost। Enterprise partners dashboard में routing_policy से weights tune कर सकते हैं। 15 minutes में >5% failure rate वाले suppliers automatically pool से remove हो जाते हैं।
Primary supplier down हो जाए तो क्या होगा?
हर 10 seconds health checks (heartbeat + sample order)। 3 consecutive failures के बाद supplier DEGRADED flag होता है और traffic secondary पर shift होता है। Recovery के लिए 5 consecutive successful checks चाहिए।
क्या मैं specific supplier पर SKU pin कर सकता हूँ?
हाँ। Dashboard में Routing → Pinned SKUs से हर SKU पर supplier_id set करें। Exclusive contracts या regional compliance के लिए useful — e.g., Russian game keys सिर्फ Russian supplier से।
Multi-source end-customer latency को कैसे affect करता है?
Routing decision के लिए 80–120ms add होते हैं (internal lookup) पर failover की वजह से p99 delivery 40–60% कम हो जाती है। बिना multi-source p99 = 90s; multi-source के साथ p99 = 38s।
FoxReload API एक्सेस पाएं

संबंधित लेख