How Spotify uses automation and microservices to gain speed advantage on larger rivals

Putting code into production quickly and effectively is key to its operations

Spotify is relatively small, however, when compared to rivals in the online music market like Google, Apple and Amazon.

Read next: Spotify opts for Hortonworks to further personalise music experience

So how does it ensure that it can keep pace with the development of new features, while scaling operations globally to meet customer demand?

Speaking at an EMC-hosted event in Gothenburg last week, Spotify's principal engineer, Niklas Gustavsson said that putting code into production quickly and effectively is key to its operations, and the way that the business organises its development teams is crucial.

"We have chosen to optimise for speed of delivery," said Gustavsson. "The main reason behind this is that we are in a highly competitive and complicated market and we think that we can win by being faster than our competitors."

"Some of our competitors are much bigger companies, so we can't beat them on that. The way that we can be faster than we otherwise could is by having highly autonomous delivery teams."

Gustavsson said that this involves giving each team a well-defined mission they can act on: "That might be to make the best search product in the world, or the best music stream quality product in the world. Or it might be things like growing our subscriber base or building APIs for third parties."

Spotify splits its development teams into groups on a number of levels - the three main ones being 'squads', 'tribes' and 'chapters'. "The most important team we optimise for is the squad. A squad is the team that produces a feature - so the search team or the audio quality. In your usual agile methodology this would be a scrum team."

'Squads' are designed to operate independently of each other to avoid bottlenecks in development. "That is the man idea - by making teams as independent as we can, they won't be blocking each other. Each team can execute on their own."

'Chapters' focus on each individual's personal development. "That is where we are trying to build strong engineers or strong QA, for example," said Gustavsson - while 'tribes' arrange both of these group into a wider project, and "are supposed to work independently as a startup within the company".

Individual 'squads' are also held responsible for the code that they put into production, building and deploying software, then managing the machine it is running on.

"A very common theme in the way we evolve our organisation is the way we go from centralised teams to distributed functionality," Gustavsson said. "A good example is the way we run our operations and make sure that our production and live environment stays up and working."

"This also solves another problem, which is that they have a good feedback cycle, where, if you produce shitty software, [the creator] will be the one being woken up in the middle of the night, as opposed to someone else."

Another way to allow its developers to move quickly is to adopt microservice architectures for applications, breaking them down into smaller, interlinking components. This allows the business to move "much, much faster" than it would otherwise. Read next: Microservices explained - Is microservices just tweaked SOA, or something much bigger?

"The nice thing is that this decouples teams," Gustavsson explained. "When I deploy a new version of my software [] I don't need to go coordinate with a bunch of other teams and figure out when we are able to find a good time to deliver. I can deliver whenever I want."

"So a team at Spotify might be deploying into production tens or hundreds of times per day if they like."

The microservices approach fits in with one of Spotify's main goals - to automate as many processes it can.

"When it comes to the way that we build things technologically-wise, we want to automate as much as possible, basically everything," he said. "We don't want to do manual provisioning of servers, we don't want to do manual employment of software, everything should be automated."

There are also benefits for site reliability: "It also raises quality quite a bit because humans can be pretty stupid, so we will fail much more often. If there is something that we can automate, then that will dramatically reduce the failure rate, so that is what we are trying to do."

Join the PC World newsletter!

Error: Please check your email address.

Our Back to Business guide highlights the best products for you to boost your productivity at home, on the road, at the office, or in the classroom.

Keep up with the latest tech news, reviews and previews by subscribing to the Good Gear Guide newsletter.

By Matthew Finnegan

Computerworld UK
Show Comments

Essentials

Lexar® JumpDrive® S57 USB 3.0 flash drive

Learn more >

Microsoft L5V-00027 Sculpt Ergonomic Keyboard Desktop

Learn more >

Mobile

Lexar® JumpDrive® S45 USB 3.0 flash drive 

Learn more >

Exec

HD Pan/Tilt Wi-Fi Camera with Night Vision NC450

Learn more >

Audio-Technica ATH-ANC70 Noise Cancelling Headphones

Learn more >

Lexar® JumpDrive® C20c USB Type-C flash drive 

Learn more >

Lexar® Professional 1800x microSDHC™/microSDXC™ UHS-II cards 

Learn more >

Budget

Back To Business Guide

Click for more ›

Most Popular Reviews

Latest News Articles

Resources

PCW Evaluation Team

Azadeh Williams

HP OfficeJet Pro 8730

A smarter way to print for busy small business owners, combining speedy printing with scanning and copying, making it easier to produce high quality documents and images at a touch of a button.

Andrew Grant

HP OfficeJet Pro 8730

I've had a multifunction printer in the office going on 10 years now. It was a neat bit of kit back in the day -- print, copy, scan, fax -- when printing over WiFi felt a bit like magic. It’s seen better days though and an upgrade’s well overdue. This HP OfficeJet Pro 8730 looks like it ticks all the same boxes: print, copy, scan, and fax. (Really? Does anyone fax anything any more? I guess it's good to know the facility’s there, just in case.) Printing over WiFi is more-or- less standard these days.

Ed Dawson

HP OfficeJet Pro 8730

As a freelance writer who is always on the go, I like my technology to be both efficient and effective so I can do my job well. The HP OfficeJet Pro 8730 Inkjet Printer ticks all the boxes in terms of form factor, performance and user interface.

Michael Hargreaves

Windows 10 for Business / Dell XPS 13

I’d happily recommend this touchscreen laptop and Windows 10 as a great way to get serious work done at a desk or on the road.

Aysha Strobbe

Windows 10 / HP Spectre x360

Ultimately, I think the Windows 10 environment is excellent for me as it caters for so many different uses. The inclusion of the Xbox app is also great for when you need some downtime too!

Mark Escubio

Windows 10 / Lenovo Yoga 910

For me, the Xbox Play Anywhere is a great new feature as it allows you to play your current Xbox games with higher resolutions and better graphics without forking out extra cash for another copy. Although available titles are still scarce, but I’m sure it will grow in time.

Featured Content

Latest Jobs

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?