Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News QCon London: Spreading Ownership and Delivering Value at Spotify with Backstage Plugins

QCon London: Spreading Ownership and Delivering Value at Spotify with Backstage Plugins

At QCon London, Pia Nilsson and Mike Lewis from Spotify led a session entitled "Everything Is a Plugin: How the Backstage Architecture Helps Platform Teams at Spotify and Beyond Spread Ownership and Deliver Value". This session explained how they have evolved the plugin architecture of Backstage to enable easier extensibility.

Pia Nilsson (director of engineering) has led the Spotify Backstage project since its inception in 2017, and Mike Lewis (staff engineer) used Backstage every day before joining the team as technical lead on the project.

Nilsson explained the background of Backstage's inception and how It has emerged as a technology that can meaningfully change the way 3000 employees work. Back in 2017, productivity metrics for engineers were trending in the wrong direction. For example, an onboarding measure was the number of days it took a new starter to get their tenth pull request merged and live, which was as high as 60 days.

Spotify ran an autonomous engineering culture -- where engineers would run what they built -- but engineers and teams were expected to deploy their code and build the required infrastructure themselves. Each team built things in the way they thought was the right way. They used different languages and libraries, and documentation was inconsistent and saved in various places.

"What are we going to do to help our engineers through the Wild West?" - Pia Nilsson

The team began a series of interviews and observations of the teams' ways of working. They found that backend engineers seemed slightly happier because they had a component catalogue for their backend components, so the team decided to expand on that.

The team also found several productivity blockers: engineers having difficulty finding things, switching between tasks and responsibilities, and toiling over building and maintaining infrastructure. CI/CD pipelines were reinvented over and over across 500 teams. Paraphrased quotes from the teams suggested that standards are boring and the opposite of freedom". They saw people being seemingly productive, but without standards amongst the fragmented teams, this didn't translate to effective software delivery.

Thus, Backstage was born as a service catalogue, a single pane of glass for their infrastructure.

"Any infrastructure tool is only as useful as its adoption" - Pia Nilsson

Reflecting on tactics to ensure the platform was used, Nilsson described how the project used and exploited Infrastructure as Code from the outset, taking advantage of existing infrastructure but adding extra metadata to decrease the burden of adoption.

Lewis explained that the core of Backstage is a React frontend, with a horizontally scalable ExpressJS backend communicating with third-party APIs. Plugins are bundles of TypeScript code published either privately or publicly. Lewis said Spotify wants to increase contributions to the code, but currently, people are discouraged because it is too hard to build plugins and modules.

He explained how writing plugins for Backstage used to be like wiring a plug - adding multiple lines of code and adapting them as things change. They are moving to a new declarative integration model that uses yarn to add packages, though this is still alpha quality and not yet the recommended method. This technique allows plugin owners to allow other plugin writers to extend their plugins through direct API connections, thus enabling nested extensibility. Lewis discussed an example of this: an access control plugin could be split into "decision" and "enforcement" as separate plugins.

This change to the plugin architecture aims to empower distributed ownership, transfer expertise between plugins, and allow people to work independently.

The key takeaways from the talk were to encourage plugin authors to move code from adopter instances into plugins and to move code from plugins into a framework - all to reduce repetition of effort - and to maximize flexibility by using nested extensibility.

The recording of Nilsson and Lewis's QCon London talk will be made available on InfoQ over the coming months.

Access recorded QCon London talks with a Video-Only Pass.

About the Author

Rate this Article