Skip to content

RESOURCES / BLOG

Why Composable Commerce Is Gaining Popularity

In developer forums, you will often see teams weighing a replatform from all-in-one suites to headless and API-first stacks. The discussion usually centers on speed, control, and the ability to swap parts without a costly rewrite. 

Why is composable commerce gaining popularity, and how do I approach the architecture, integration, and rollout if I am moving from a monolithic ecommerce platform? What are the tradeoffs, what does a reference implementation look like, and how can I optimize performance across web and mobile?

Composable commerce means assembling your storefront from best-of-breed services using APIs. Instead of a single vendor for catalog, checkout, search, CMS, and media, you compose a stack with focused services that can be replaced or scaled independently. The result is faster iteration and better customer experiences if you plan the architecture carefully.

  • Speed of change: Launch or A/B test features without waiting on monolith release cycles.
  • Omnichannel: Deliver content and product data to web, apps, social, POS, and kiosks from a unified backend.
  • Performance: Smaller frontends and targeted backends reduce latency and improve Core Web Vitals. See this primer on optimized websites.
  • Scalability and resilience: Horizontal scaling per service, with fewer single points of failure.
  • Vendor flexibility: Swap search, CMS, or payments without replatforming the whole stack.
  • Storefront: SPA or SSR using Next.js, Nuxt, Astro, or similar.
  • BFF layer: A Backend for Frontend that aggregates product, pricing, inventory, promotions, CMS, and user data.
  • APIs: Headless services for catalog, search, cart, checkout, auth, and media.
  • Edge: CDN caching and edge functions for low latency.
  • Events: Webhooks or streaming for inventory, orders, and personalization.

If you are exploring decoupling and real-time page updates, this guide on dynamic websites will help ground the concepts.

Below is a simple Node serverless function that composes product details, pricing, and inventory into a single response for the storefront.

// /api/product/[id].js
import fetch from "node-fetch";

export default async function handler(req, res) {
  const { id } = req.query;

  const [product, price, stock] = await Promise.all([
    fetch(process.env.PRODUCT_API + `/products/${id}`).then(r => r.json()),
    fetch(process.env.PRICING_API + `/prices/${id}`).then(r => r.json()),
    fetch(process.env.INVENTORY_API + `/inventory/${id}`).then(r => r.json()),
  ]);

  const payload = {
    id,
    title: product.title,
    description: product.description,
    images: product.images,
    price: price.current,
    currency: price.currency,
    inStock: stock.available > 0,
    variants: product.variants,
  };

  // Cache-friendly headers for the CDN
  res.setHeader("Cache-Control", "s-maxage=120, stale-while-revalidate=300");
  res.status(200).json(payload);
}Code language: JavaScript (javascript)
  • Integration tax: More services means more observability, retries, and circuit breakers. Budget time for this.
  • Overfetching: Solve with a BFF, GraphQL, or tailored endpoints to return only what the UI needs.
  • Asset bloat: Unoptimized images and video erase performance gains. Review your image hosting and delivery strategy.

After you lock in your core services, you will need a robust way to manage and deliver media assets across channels. This is where a dedicated media service helps you keep pages lightweight and visually consistent.

With Cloudinary as the media layer in a composable build, you can upload once and deliver optimized variants on the fly using URL params or SDKs. For example, a responsive product image with automatic format and quality selection:

// Using a Cloudinary URL for responsive delivery
// f_auto selects the best format per device, q_auto tunes quality
https://res.cloudinary.com/demo/image/upload/f_auto,q_auto,w_800,c_fill,g_auto/v1/catalog/shirt-123.jpgCode language: JavaScript (javascript)

Or generate URLs in code:

// Node example
import { v2 as cloudinary } from "cloudinary";

const url = cloudinary.url("catalog/shirt-123.jpg", {
  transformation: [{ width: 800, crop: "fill", gravity: "auto", fetch_format: "auto", quality: "auto" }],
});Code language: JavaScript (javascript)

This approach keeps your BFF responses lean while the CDN serves the smallest possible assets for each device. It pairs well with dynamic rendering patterns described in the dynamic website guide.

  • Composable commerce is popular because it improves speed, performance, and flexibility.
  • Use a BFF to aggregate services, cache at the edge, and release via the strangler pattern.
  • Watch out for integration overhead and unoptimized assets.
  • Add a media layer that delivers optimized images and video on demand to keep pages fast and maintainable.

Ready to add a fast, flexible media layer to your composable stack? Register for a free Cloudinary account and start optimizing your ecommerce experience today.

Start Using Cloudinary

Sign up for our free plan and start creating stunning visual experiences in minutes.

Sign Up for Free