Case study

Observability for a move to headless commerce

Datadog observability for a move from Salesforce Commerce Cloud to headless Next.js: RUM, APM, synthetics and runbooks for 7 product teams.

Context

The client is a cosmetics retailer that sells through its web store, its app and its own stores. It is moving from Salesforce Commerce Cloud (SFCC) to a headless Next.js platform, one market at a time. The first markets went live on the new platform in January 2026, about 10 countries were live by May 2026, and the remaining markets followed in phases in July 2026.

Our role

We partnered with the client’s architecture team and supported its 7 product teams, 5 on web and 2 on the app. The product teams and an external delivery partner built the new platform, and we worked alongside them on observability, performance and code quality.

Problem

  • The legacy site had a time to first byte of about 2,800 ms in the CrUX data from May 2025, while the target was 800 ms.
  • The whole legacy frontend shipped as a single JavaScript bundle.
  • Monitoring was split over two tools, and the legacy site had no real user monitoring (RUM).
  • Web releases went out weekly at fixed times, and every release needed manual sign-offs.

What we did

  1. Assess (May to June 2025). The work started with a performance report based on CrUX data and a monitoring strategy for the new platform.
  2. Decide (November 2025). An RFC, accepted in November 2025, chose Datadog over the incumbent tool. Unlighthouse was chosen over k6 for web vitals, and Datadog SAST and SCA replaced a separate SAST tool.
  3. Pilot (November 2025). We set up tracing in production, with one product team acting as the observability pilot.
  4. Scale (January to June 2026). Together with the teams, we gave all 7 of them ownership of their services in Datadog, with standard dashboards, monitors and synthetic tests, and a shared backlog of non-functional requirements.
  5. Go-live (July 2026). We monitored the market go-lives in Datadog, using a dashboard that compared the new storefront with the legacy storefront.
  6. Hand over. We handed over SLO and rollback runbooks for each market along with the documentation, a performance champion took ownership in each team, and 4 legacy developers were onboarded to the new platform.

How the results came about

  • 5xx error rate. We set up the shared backlog of non-functional requirements, and from that backlog the teams wrote SLO and rollback runbooks for each market. In the same planning increment, the 5xx error rate fell from 0.10% to 0.024% and all synthetic tests passed.
  • Legacy vendor bundle and PageSpeed score. We fixed the barrel imports of the icon library on the legacy site and enabled tree shaking, which made the vendor bundle 62% smaller.
  • Catalog API calls. A product team now fetches the language links (hreflang) of a page through one bulk endpoint.
  • SAST findings. We tuned the rules so the teams could focus on real findings, and set the noisiest rules, each with 50 to 1,000 findings, to severity “none”.

Now: an AI-first rebuild

In 2026, the client started a second project to rebuild its digital landscape AI first. An AI agent writes most of the code while a small core team of people steers it. We are part of that core team, where we lead the frontend architecture and own the non-functional requirements.

Architecture

  • One repository holds the code, the tests, the documentation and the architecture decision records (ADRs), and the infrastructure is also code, with Terraform on Google Cloud.
  • A new API layer sits between the back-end systems and every channel, such as web and app. It prepares product data and navigation in the background and gets pages, search results, stock and prices from the systems behind it.
  • A cache cuts down on repeated calls, and ready-to-show views reduce the work each channel has to do.
  • The new API layer replaces the old one, one capability at a time.
  • The new web store renders pages on the server with Astro, with small React islands for the interactive parts, and it talks only to the API layer.
  • The UI kit, the client’s design system, follows the Figma designs, and Datadog shows the health of all services.

How the team works

  • The agent writes the code, the tests and the documentation, while people set the direction, review each change and merge it. The agent never merges code.
  • In a coding run, the agent takes one backlog item and opens a pull request for review.
  • The agent shows each action, such as a message, an issue or a pull request, on a card that a person approves first.
  • The agent connects to the team’s tools through MCP, a standard interface between AI and tools. Specialist agents handle each system, and the main agent combines their answers.
  • The agent works with the access of the person who asks, so it only sees the data that this person can see.
  • The core team decides on ADRs with a vote, and the agent records the result.

Our part

  • We asked for the branch and pull request protocol that every agent session follows, and for one required approval before a merge to the main branch.
  • We wrote the frontend proposal, which records our positions: the API layer formats prices, caches use short lifetimes instead of purges, pages prerender when a user hovers over a link, and the store uses no accessibility overlay.
  • We wrote the specification for an API client that the project owns, and another core team member built it with the agent.
  • Astro with React islands, and Google Cloud with Terraform, were decisions of the whole team.

The first step is the browse pages: home, category and product. Cart, checkout and account come next, followed by the app, email and the other customer touchpoints.

Results

MetricBeforeAfterPeriod
5xx error rate0.10%0.024%One planning increment, 2026
Legacy JavaScript vendor bundle4.56 MB1.75 MBFebruary 2026
Legacy PageSpeed score3950February 2026
Catalog API calls per page request54242026
SAST findings38334January to March 2026
Let's connect

Talk about your project

Tell us about your team and your problem. In 30 minutes we find out whether one of our offers fits, and if none does, we tell you.

Book a 30-minute call