SoundCloud Popularized the BFF. Then Replaced It with Federation
SoundCloud, known for helping popularize the Backend for Frontend pattern, evolved beyond its BFF architecture with a federated GraphQL layer on WunderGraph Cosmo.
The result: 45% lower query latency and ~30% lower gateway costs.

Company Overview
SoundCloud is one of the world’s largest open audio platforms, serving both listeners and creators for over 16 years across web, mobile, and creator tooling surfaces. SoundCloud is widely known for helping popularize the Backend‑for‑Frontend (BFF) pattern as it migrated from a monolithic Rails application to a microservices architecture, using dedicated BFF services to tailor APIs for different clients and interfaces.
The Challenge
The BFF Pattern Stopped Scaling
SoundCloud adopted the Backend for Frontend pattern to break away from a single shared API.
Over time, it became a bottleneck.
As the platform grew, BFF services multiplied, making them harder to maintain. Shipping new features required coordination across services and teams, even for relatively small changes.
The team needed a way to move faster without rewriting their backend systems, which meant moving beyond the BFF pattern they had been running.
Their first federation setup introduced new constraints. Gateway infrastructure costs reached ~$14,000 per month and didn’t scale with the business, while at the same time, key capabilities were locked behind an enterprise license:
- Persistent queries, critical for performance and security
- Co-processing required for their gateway architecture
- The ability to adopt the newer router
Even though those features existed, they couldn’t use them.
“We were locked in, even though we weren't using those features, because we didn't have an alternative.”
The Solution
Open-Source Federation That Replaced the BFF
After moving away from BFF, SoundCloud needed a federation platform they could run in production without the cost and licensing constraints they had encountered.
They evaluated building in-house and other alternatives. But building federation infrastructure from scratch wasn’t realistic, and the other options would have required them to operate and maintain most of the stack themselves.
WunderGraph Cosmo provided them with a complete federation platform they could adopt without adding operational overhead or introducing new constraints.
- Everything they needed was available without requiring them to build and maintain additional infrastructure
- Persistent queries for performance and security, without enterprise licensing
- Co-processing support required for their gateway architecture
- Schema compatibility checks to prevent breaking changes
- Supergraph composition without running their own stitching infrastructure
Because Cosmo is open source, the team could inspect the code, extend it, and avoid vendor lock-in. Just as important, they weren’t adopting a tool in isolation.
WunderGraph worked directly with the SoundCloud team throughout the migration, building features they needed and helping them move in phases without disrupting production.
“What surprised me most is that WunderGraph is a small team that can do big things. It feels like working with another team inside SoundCloud, not a vendor.”
The Results
Beyond the BFF. The Results Are Measurable.
SoundCloud has replaced its BFF architecture and now runs its GraphQL platform on WunderGraph Cosmo.
The impact was immediate:
- Query latency improved, with one high-traffic query dropping from 171ms to 94ms
- 86% reduction in compute usage after migrating to Cosmo Router, leading to ~$265K in annual infrastructure savings
- Gateway costs dropped from ~$14,000 to ~$9,750 per month, even after adding a new gateway layer
- Persistent queries are now available for the first time, improving both performance and security
- The migration was completed in two phases, minimizing risk and avoiding disruption to production
“We're running a whole new gateway plus router, and it's cheaper than running just our old federated gateway.”
With the migration complete, the team is now building on top of the graph with persistent queries, rate limiting, and response caching, capabilities that were previously out of reach.
What Came Next
The BFF Reached Its Limits. This Is What Came Next.
SoundCloud ran the BFF pattern for over a decade and helped shape how teams used it.
At scale, it became a bottleneck.
They replaced it with GraphQL Federation and WunderGraph Cosmo.
The result is lower cost, better performance, and a platform they can continue to build on.
FAQ
Frequently Asked Questions (FAQ)
SoundCloud helped popularize the Backend for Frontend pattern through a widely cited blog post. Over time, their Scala-based BFFs became hard for client engineers to work in and slowed feature delivery. They moved to GraphQL Federation to make the API layer faster to build on, and chose WunderGraph Cosmo as their federation platform.
Gateway costs had reached ~$14,000 per month, and features like persistent queries and co-processing were locked behind an enterprise tier. The team couldn't even upgrade to the vendor's newer router without that license. They needed a platform where the features they needed were included, not gated.
Monthly gateway spend dropped from ~$14,000 to ~$9,750 — about 30% less. That number includes an entirely new gateway layer added during the migration, so the like-for-like savings on routing alone are larger.
In two phases. Phase one kept the existing gateway and swapped the schema source and metrics pipeline — using S3 for schema delivery and a custom plugin built with WunderGraph for usage metrics. Phase two replaced the gateway and router with Cosmo Router. No production disruption.
Building federation tooling in-house wasn't practical — it's not SoundCloud's core business, and the effort to build and maintain it long term wasn't worth it. The other options they evaluated would have required hosting and maintaining most of the infrastructure themselves. Cosmo offered a complete open-source platform with the partnership model SoundCloud wanted.
Persistent queries for security and performance, rate limiting, and response caching with custom key prefixing — features they'd wanted for years but couldn't access before the migration.
Ready to move past the BFF?
Talk to our team about how WunderGraph Cosmo can help you ship faster with GraphQL Federation.


