Scaling Personalized Marketing for Multi-Tenant Commerce Platforms
Instacart extended its Marketplace marketing automation to 350+ Storefront Pro white-label retailers by giving each retailer its own isolated workspace in a third-party provider, fronted by Instacart-built React tooling. Per-customer events from the Campaigns Engine are rebatched by a stream consumer into groups of up to 50 to match provider API limits. A Rails/Sidekiq CRM Service then handles idempotency checks, workspace routing, personalization and vendor abstraction. Operational pieces include a shared sending domain, automated IP warming over 4–6 weeks, Liquid templates deployed per retailer via CI/CD, and workspace-level failure isolation, yielding 99.9% delivery success and zero cross-tenant leakage.
Related posts
- How OrderServ achieved up to 64% cost savings with multi-tenant ECS
AWS Architecture Blog mediumAdeptCognizant's OrderServ food-ordering platform moved from one dedicated ECS Fargate cluster per brand (21 microservices each) to a shared multi-tenant cluster. Isolation is enforced by a .NET tenancy library that resolves tenant context per request with AsyncLocal, routes data access with tenant prefixes and fails closed, backed by STS session-tag scoped credentials and per-tenant Valkey RBAC. Switching from Fargate to EC2 Auto Scaling warm pools on Bottlerocket cut scale-out from 5–7 minutes to 30–60 seconds and compute cost by 47–64% with Savings Plans, using a five-layer scaling strategy that includes per-tenant throttling. A FireLens and EventBridge crash-observability pipeline with EFS-persisted .NET mini dumps costs about $10/month per service, and passkeys replaced SMS OTP to cut authentication costs by 80%.
- Husky: Exactly-once ingestion and multi-tenancy at scale
Datadog Engineering hardMasterHusky, Datadog's columnar event store, achieves exactly-once ingestion and cost-efficient multi-tenancy by routing events deterministically to Kafka partition groups (shards), so deduplication only has to happen within a shard. Time-bounded, immutable Shard Placements are allocated per tenant by a Sharding Allocator that uses FoundationDB transactions to give every Shard Router node the same answer. An Autosharder resizes each tenant's shard count from byte-throughput metrics. Consistent hashing with wraparound and shard exclusions keeps placement churn minimal, and a balancer counters hotspots. Limiting how many tenants each writer handles also cuts the number of blob-storage files and compaction work.
- How We Built Oxygen: Hydrogen’s Counterpart for Hosting Custom Storefronts
Shopify Engineering easyNoviceOxygen, Shopify's hosting platform for Hydrogen custom storefronts, assembles GitHub, GitHub Actions and Cloudflare Workers with first-party Shopify services such as the CDN, Admin API and identity. Shopify briefly built its own V8-isolate infrastructure but chose Cloudflare's Workers for Platforms instead to ship faster and reduce scale and security risk. A Gateway Worker checks authorization and routes requests to per-storefront workers via the Dynamic Dispatch API, and a Trace Worker forwards logs and metrics to a separate Grafana/Loki/Cortex/Tempo stack that keeps merchant-facing telemetry apart from internal metrics.
- Infrastructure patterns for agentic applications
Render mediumAdept
Agents are long-running, stateful and non-deterministic, so running them inside an HTTP request handler breaks in production. The progression starts with web-queue-worker (enqueue a durable run record and return a run ID), adds idempotency for at-least-once retries and saga-style compensation for partial failures, then moves to workflow engines whose deterministic coordinators replay recorded history while non-deterministic model and tool calls live in steps. Fan-out/fan-in needs explicit partial-failure thresholds (e.g. Promise.allSettled) and concurrency caps or token buckets to avoid contention on shared rate limits. The patterns are then mapped onto Render Workflows (beta), which handles queueing, workers and retries but leaves idempotency, compensation, approvals and cost controls to the application.
- Multi-Tenant E-Commerce Architecture with Turso
Turso mediumAdeptA multi-tenant storefront architecture that shares one template codebase but gives each store its own Vercel project, environment variables (name, theme, Stripe key) and Turso database, avoiding shared-database tenant isolation. New stores are provisioned by creating a Vercel project and a database seeded from a template database (or kept in sync via Turso Multi-DB Schemas), with the database URL derived from the project's production URL so queries need no tenant filter. The tradeoff favors strong isolation, simpler debugging and per-store cost attribution over the overhead of many deployments and databases.