How does Spotify manage 20+ million lines of code? Agent architecture and engineering scaling tools

MarGib July 14, 2026
🌐 🇵🇱 Polski · 🇬🇧 EN

Spotify is one of the largest digital systems in the world—its codebase spans over 20 million lines. How does the company handle the challenges of scaling, security, and performance? Discover the technologies, architectures, and teams behind this engineering behemoth.

In a digital world where applications must serve millions of users, code scalability is no longer a luxury—it is a necessity. As a streaming giant, Spotify has spent years developing systems that allow it to manage a massive codebase without losing control over quality, security, and performance. In 2026, with the number of lines of code in the company's core projects exceeding 20 million, the question is no longer "does it work?", but "how does it work at this scale?".

The answer lies in a combination of modern tools, decentralized architecture, and automation—primarily driven by agent systems that act as "digital assistants" for engineers. But what does this look like in practice? Which technologies underpin such a system, and what challenges must be overcome to maintain operational fluidity?

Technologies keeping 20+ million lines of code in check

Spotify does not rely on a single technology; it uses a mosaic of tools, languages, and frameworks that complement each other. The key components of this puzzle are:

  • Programming languages: The company still maintains some legacy systems in Javie, but newer components are built primarily in Scali, Kotlinie (for mobile apps), and Go (for high-performance microservices). Python is used mainly for automation scripts and data analysis.
  • Version control system: Git is the foundation, but Spotify takes it a step further—some projects use a monorepo, a single, massive repository containing the entire application code and its dependencies. This approach simplifies dependency management but requires robust build and test tooling.
  • Build and test: To manage the monorepo, the company adopted Bazel—a build system that allows for incremental compilation of only the changed parts of the code. This is crucial when dealing with millions of lines that must be compiled in a reasonable timeframe.
  • Orchestration and deployment: Kubernetes acts as the "engine" that runs microservices and manages their lifecycle. To simplify deployment processes, Spotify uses GitOps—an approach where the cluster state is synchronized directly from a Git repository, for example, using Argo CD.

All these tools are integrated into a cohesive ecosystem where a code change can be deployed to production within minutes—provided, of course, it passes all tests and reviews.

Agent architecture: from microservices to "digital assistants"

Agent systems at Spotify are not individual applications, but a distributed network of microservices, each serving a specific role. This architecture is based on several key principles:

1. Autonomous microservices

Each agent acts as a separate microservice, communicating with others via gRPC or REST. Examples of such agents include:

  • Validation agents: Automatically review pull requests, checking for code quality, standard compliance, and potential security issues.
  • Deployment agents: Manage the rollout of changes to production environments using GitOps and Kubernetes.
  • Monitoring agents: Collect performance metrics, alerts, and logs, helping SRE teams maintain system stability.
  • Automation agents: Handle simple tasks, such as automatically merging PRs after all tests pass.

This model allows for flexibility and resilience—the failure of one agent does not block the entire system, and new features can be added without disrupting the existing structure.

2. Central "control plane" — Backstage

Although agent systems are distributed, their management is facilitated by Backstage—an open-source platform created by Spotify that acts as a "command center." Backstage integrates with:

  • Git (for code review and dependency management),
  • Kubernetes (for monitoring cluster state),
  • CI/CD (e.g., GitHub Actions or Jenkins),
  • Bazel (for building and testing).

Thanks to Backstage, engineers have one place where they can find documentation, deployment status, and even trigger automated workflows. This tool is critical for maintaining consistency in such a complex ecosystem.

You could say that Backstage is the "operating system" for agent systems—without it, managing such a large number of components would be significantly more difficult.

Scaling challenges: how to handle millions of lines of code?

A scale of 20+ million lines of code is not just a technical challenge, but an organizational one as well. Spotify faces several key issues:

1. CI/CD performance in a monorepo

Building the entire codebase on every change would be unthinkable. The solution is incremental building via Bazel, which compiles only the changed parts of the project. Additionally, Spotify uses self-hosted GitHub Actions runners to offload public servers and accelerate processes.

2. Data consistency and code quality

To ensure that changes do not introduce bugs, Spotify employs automated code reviews using validation agents. These tools check for:

  • Compliance with coding standards,
  • Common errors (e.g., null pointers in Java),
  • Security issues (e.g., vulnerabilities in dependencies).

Additionally, the company uses automated dependency updates (e.g., using Renovate) to avoid outdated libraries.

3. Security at scale

As the codebase grows, so does the attack surface. Spotify employs multi-stage security scanning:

  • Automated dependency scanning (e.g., using Snyk),
  • Real-time vulnerability monitoring,
  • Restricting microservice permissions (principle of least privilege).

This approach minimizes the risk of a single dependency vulnerability going undetected.

4. Teams responsible for system maintenance

To keep everything running like clockwork, Spotify relies on specialized teams:

  • Platform Engineering: Responsible for Backstage, Bazel, and Kubernetes—the tools that enable agent systems to function.
  • Site Reliability Engineering (SRE): Ensures stability, monitoring, and incident response. Their work is critical when dealing with millions of users streaming music globally.
  • Developer Productivity: Focuses on improving the developer experience, for instance, by automating repetitive tasks.

All these teams collaborate to create a seamless engineering ecosystem where code changes are deployed quickly without losing control over quality.

Public resources and the future of agent systems

Spotify does not keep its solutions secret—some of its knowledge is shared publicly. You can find:

As for the future, Spotify plans to further implement AI-driven development. They are already experimenting with AI-powered automated code review tools that can suggest fixes or even repair simple bugs. Such an approach could further accelerate development processes.

Summary: what can we learn from Spotify's approach?

Agent systems, monorepo, GitOps, and distributed architecture—these are all pieces of the puzzle that allow Spotify to keep over 20 million lines of code in check. Key takeaways for other companies developing software at scale include:

  1. Choose the right tools for the scale: Bazel, Kubernetes, and GitOps are essential, but every project requires an individual approach.
  2. Automate everything possible: From code reviews to deployments—the more repetitive tasks you offload to agents, the fewer bugs will reach production.
  3. Maintain consistency via central platforms like Backstage, which simplify the management of complex systems.
  4. Invest in teams and culture: Without the right SRE, DevOps, and Platform Engineering teams, even the best tools will not be enough.

Spotify proves that scale does not have to mean chaos. With the right architecture, tools, and approach to automation, even the largest systems can run efficiently without losing control over quality and security.

One might ask: "Will this approach work in my company?" The answer depends on many factors—code size, number of teams, and development speed expectations. But one thing is certain: if you want to scale software, you must start by scaling your processes and tools. And that is exactly where agent systems excel.

Sources

Facebook X E-mail

Comments

Dodaj komentarz

Explore

Labels

automation 11 news 11 Anthropic 10 Windows 10 browsers 10 Automation 9 Opera 9 Security 9 Technology 9 facebook 8 web applications 8 LLM 7 Software 7 chrome 7 coaching 7 curiosities 7 technology 7 www 7 AI ethics 6 Docker 6 Microsoft 6 Mind 6 OpenAI 6 Programming 6 Red Hat 6 Web browser 6 entertainment 6 new technologies 6 Claude AI 5 Cybersecurity 5 God 5 Productivity 5 algorithms 5 books 5 cybersecurity 5 education 5 machine learning 5 AI 2026 4 CentOS 4 ChatGPT 4 Claude 4 Open Source 4 RedHat 4 Ubuntu 4 Vivaldi 4 Windows 10 4 Windows system administration 4 applications 4 containers 4 future of work 4 health 4 n8n 4 network 4 people 4 photography 4 programming 4 psychology 4 security 4 system administration 4 trivia 4 AI agents 3 AI safety 3 Administration 3 Android 3 BIG DATA 3 Business 3 FAQ 3 FIFA 3 Firefox 3 Google projects 3 Homelab 3 Local AI 3 Personal Development 3 Personal Finance 3 Privacy 3 Programs 3 Python 3 bash 3 communication 3 computer science 3 extensions 3 faith 3 future of technology 3 games 3 good movie 3 help 3 human 3 interesting websites 3 interface 3 language models 3 media 3 mindfulness 3 money 3 open source 3 opensource 3 personal competencies 3 personal development 3 privacy 3 reading 3 religion 3 tools 3 virtualization 3 web browser 3 websites 3 AGI 2 AI assistant 2 Asus 2 AutoGen 2 Career 2 Centos 2 Cloud 2 Codex 2 Configuration 2 Debian 2 Debugging 2 DevOps 2 Docker Machine 2 Drones 2 Education 2 Fable 2 Free Red Hat 2 GDPR 2 Guide 2 Hardware 2 IT security 2 Intel 2 Intelligence 2 Japan 2 JavaScript 2 Job Market 2 Kernel 2 Kubernetes 2 Machine Learning 2 Medicine 2 Mythos 2 Navy SEALs 2 Netflix 2 Performance 2 Poland 2 Psychology 2 Puppeteer 2 RHEL7 2 RSS 2 Rocky Linux 2 Rust 2 Sakana AI 2 Self-hosting 2 Servers 2 Software Engineering 2 Ubuntu Server 2 Windows administration 2 Windows errors 2 ansible 2 better life 2 brain 2 brain-computer interfaces 2 chat 2 children 2 cloud storage 2 communicator 2 communities 2 computer intelligence 2 computers 2 conferences 2 creativity 2 curl 2 cyberattacks 2 data 2 death 2 developer tools 2 documentary 2 earning 2 emotions 2 file storage 2 fix 2 free application 2 free courses 2 free knowledge from the internet 2 free training 2 future skills 2 genius 2 hacker 2 investments 2 knowledge 2 labor market 2 learning 2 local AI 2 macOS 2 mental health 2 mind manipulation 2 mind programming 2 mobile 2 mobile apps 2 mobile phones 2 motivation 2 movie 2 multimedia 2 neurotechnology 2 open-source 2 operating systems 2 performance 2 personal thoughts 2 philosophy 2 photos 2 plugin 2 podcast 2 prompt 2 self-development 2 shell 2 social media 2 software 2 technological innovations 2 technology addiction 2 terminal 2 torrent 2 trick 2 wealth 2 weather 2 web 2 wisdom 2 youtube 2 (Treści etykiet nie zostały podane w treści wejściowej) 1 120B models 1 21st Century Skills 1 2FA 1 2nm processors 1 3D printing 1 5 GHz 1 6 GHz 1 64 bit 1 7 1 ACT therapy 1 AF_ALG 1 AGAT 1 AI API key theft 1 AI Agents 1 AI Frameworks 1 AI History 1 AI Safety 1 AI agent attack 1 AI at work 1 AI autonomy 1 AI benchmarks 1 AI censorship 1 AI chatbots 1 AI collaboration 1 AI cyber threats 1 AI cybersecurity 1 AI future 1 AI governance 1 AI in Linux 1 AI in education 1 AI in healthcare 1 AI in school 1 AI in sports 1 AI integration 1 AI interaction 1 AI on mobile devices 1 AI optimization 1 AI regulation 1 AI security 1 AI superchips 1 AI threats 1 AI tool attacks 1 AI tools 1 AI workflows 1 AIMP 1 AMD ROCm 1 AMLD6 1 API 1 API key protection 1 Acquisition 1 Agentjacking 1 Alan Watts 1 Alexander Gerst 1 Alfred 1 AlmaLinux 1 Alpine Linux 1 Amazon Kuiper 1 Andrej Karpathy 1 Anonymous 1 Apache 1 Apple 1 Apple 2025 1 Apple Silicon 1 Aria AI 1 Audacity 4 1 AutoJack 1 BCI 1 Backstage 1 Banking 1 Bash 1 Bazel 1 Bible 1 Big Data 1 Bill Warner 1 Biotechnology 1 Black Mirror 1 Blackwell B100 1 Blockchain 1 Bonding 1 Bono 1 Business and Finance 1 C++ 1 CCPA 1 CPU 1 CUA 1 CUDA 1 Career Development 1 Chat GPT 1 Chemtrails 1 ChildOnlineSafety 1 Claude 3.5 Sonnet 1 Claude Cowork 1 Claude Fable 1 Claude Sonnet 5 1 Coaching 1 Computer-Using Agent 1 Constitutional AI 1 Copilot 1 Copilot for Finance 1 Couching 1 CrewAI 1 Cryptocurrencies 1 Cyberbullying 1 DFS 1 DMA 1 DNS 1 DORA 1 DSA 1 Dario Amodei 1 Darwin 1 Data Science 1 Deep Learning 1 DeepSeek 1 Deepseek 1 Deluge 1 Devin AI 1 Diagnostics 1 Digitalization 1 Docker containers 1 Drivers 1 Dystrybucje 1 E2EE 1 E2EE vulnerabilities 1 EA GAMES 1 EA SPORTS 1 Earth AI 1 Economics 1 Email 1 Emigration 1 Enterprise Linux 1 Entrepreneurship 1 Epicureanism 1 Error 1 European Funds 1 European Union 1 Excel 1 FIFA 16 1 Facebook 1 Fact-checking 1 Fake News 1 Flannel 1 Flynn Effect 1 Football 1 Formoza 1 Foundation 1 Free 1 Free Software 1 Free software 1 Fugu Ultra 1 Future 1 Future of Finance 1 Future of Work 1 GLM-5.2 1 GPT 1 GPT-4 1 GPT-4.5 1 GPT-Live 1 GPU Cloud 1 GROM 1 GUI 1 Gemini 1 Gemma 4 1 Generation Z 1 GitHub 1 GitOps 1 Golden Gate 1 Google Assistant 1 Google DeepMind 1 Google Gemma 4 12B 1 Google Research 1 Google activity 1 GoogleFamilyLink 1 Goose 1 Got Talent 1 Gregory Kurtzer 1 Guides 1 HTML 1 Hardware Requirements 1 Health Intelligence 1 Hygge 1 IAM 1 IBM 1 IDE 1 IDE security 1 IQ 1 ISIS 1 ISS 1 IT 1 IT automation 1 IT history 1 Innovation 1 Intelligent email 1 Internet Browser 1 Internet browser 1 InternetEducation 1 Interview 1 Islam 1 Islamic State 1 Jacquard 1 Jboss 1 JetBrains Marketplace 1 Jetson Thor price 1 Joel Pearson 1 Kali Linux 1 Karen Hao 1 Khan Academy 1 Kylian Mbappé 1 LLM Deployment 1 Labor Market 1 LangChain 1 Legal regulations 1 LibreOffice 1 Linux 7.3 1 Linux automation 1 Linux diagnostics 1 Linux for business 1 Linux system tools 1 Linux task management 1 Linux task scheduling 1 Logs 1 Londoners 1 MAS 1 MCP 1 MFA 1 MLX 1 Maps 1 MarGib_Film 1 Marek Jankowski 1 Mars helicopter 1 Material Design 1 Matt Pocock 1 Microsoft 365 1 Military 1 Mindfulness 1 Miłosz Brzeziński 1 Model Context Protocol 1 Monitoring 1 MrBallen 1 Multi-Agent Systems 1 My take 1 NATO 1 NIS2 1 NTFS 1 NVIDIA 1 NVIDIA Blackwell 1 NVIDIA Jetson Thor 1 National security 1 Neural Networks 1 New 1 Nginx 1 No comment 1 Node.js 1 Non-profit 1 Notion 1 Nvidia 1 Odysseus 1 OneTrust 1 OpenSSL 1 Opera Air 1 Opera Neon 1 Opera Touch 1 Operating Systems 1 P2P 1 PARP 1 Pac-Man 1 Pekao S.A 1 Peperclips 1 Perceptron 1 Personal development 1 Philosophy 1 Photoshop 1 Playwright 1 Poland 2026 1 Poles 1 Polish universities 1 PostgreSQL 1 PowerShell 1 Project Maven 1 Project TANGO 1 Proton Drive 1 PyTorch 1 Qt Creator 1 Quotes 1 RHEL 1 RHEL8 1 Raspberry PI 1 Raspberry Pi 1 Raspbian 1 Raycast 1 Red Hat 8 1 Red Hat Enterprise Linux Developer Suite 1 RedHat 8 1 Regex 1 Robo-advisors 1 SMEs 1 SUSE 1 SafeInternet 1 SaferInternetDay 1 Safety 1 Sakana Fugu 1 Search 1 Sector 3.0 Festival 1 Security Auditing 1 September 23 2017 1 Server Administration 1 Signal 1 Smart City 1 Snip. 1 Social Media 1 Soli 1 Solo Projects 1 Solopreneurship 1 Something from myself 1 Sound 1 Sovereign AI 1 Sport 1 Spotify 1 Starlink 1 Steam Deck 1 Stoicism 1 SysAdmin 1 System Administration 1 Tech 1 Tech Weekly 1 Telegram 1 TensorFlow 1 The Shack 1 Time Management 1 Tips 1 Tokenomics 1 Tools 1 Tribler 1 Tutorial 1 U.S. 1 U.S. government 1 U2 1 UI testing 1 USB 1 UV 1 Ubuntu 26.04 1 VentuSky 1 VirtualBox 1 Virtualization 1 WBC 1 WSL 3 1 WWDC 2026 1 WWDC26 1 Warsaw 1 Weave 1 Web Scraping 1 Websites 1 WhatsApp 1 Wi-Fi 6 1 Wi-Fi 6E 1 Wi-Fi channels 1 Windows update 1 Work 1 Workflow 1 World Cup 1 World Cup 2026 1 World Cup AI 1 World Wide Web 1 X-Files 1 X-files 1 YouTube 1 Yuval Noah Harari 1 ZUS 1 ZenFone 1 Zero-Touch OAuth 1 Zorin OS 1 a drop of motivation 1 about this blog 1 academic fraud 1 account security 1 achieving goals 1 ad blocking 1 addiction 1 administrator 1 agent systems 1 aids 1 ampere altra 1 animations 1 application prototyping 1 arm servers 1 arm64 1 assertiveness 1 at one-time tasks 1 at vs cron 1 atd daemon 1 audio 1 audio editing 1 authorization 1 automateit 1 automation security 1 automation system attack 1 autonomous cars 1 awareness 1 aws graviton 1 bank 1 bash on windows 1 bat files 1 batch 1 battery 1 beliefs 1 beta 1 better living 1 better quality 1 big data 1 bin/bash 1 biodiversity 1 blocking 1 blogger 1 body language 1 bookmarks 1 boot 1 bootable usb 1 boxing 1 browser automation 1 business intelligence 1 c# 1 calc 1 campaign 1 cards 1 centralized platforms 1 chemistry 1 child psychology 1 children's emotional development 1 city design 1 clearance 1 cli tools 1 climate change 1 clothing industry 1 cmd 1 code editor 1 cognitive psychology 1 coldplay 1 command history 1 command line 1 command prompt 1 commando training 1 comments 1 compliance automation 1 compliance tools 1 computer interaction 1 computer performance 1 concentration 1 configuration management 1 conntrack 1 console 1 conspiracy 1 conspiracy theories 1 controversial 1 converter 1 corporate world 1 cost optimization 1 courage 1 courses 1 courses for free 1 critical thinking 1 cryptography 1 cynics 1 dark mode 1 data security 1 database 1 datasette 1 date and time 1 deep brain stimulation 1 deep learning 1 democracy 1 desertification 1 design patterns 1 design systems 1 developers 1 digital addiction 1 digital clothing 1 digital competencies 1 digital detox 1 digital education 1 digital ethics 1 digital hygiene 1 digital manipulation 1 digitalization 1 disqus 1 document 1 document conversion 1 dreams 1 drop of motivation 1 drought 1 dubai 1 dying 1 e-book 1 eBPF 1 ecology 1 economy 1 ecosystem restoration 1 edge computing 1 elections 1 end of the world 1 end of world 1 end-to-end encryption 1 energy 1 energy efficiency 1 environment and health 1 ethical AI 1 evolution 1 excel 1 exploitation 1 extreme 1 file sharing 1 file size 1 film zone 1 flash drive 1 flat earth 1 flying 1 food 1 football 1 for sale 1 format change 1 free 1 free software 1 friend location 1 future of AI 1 future of architecture 1 future of education 1 future of humanity 1 future of medicine 1 future of the brain 1 future of the internet 1 future of transport 1 game 1 geoengineering 1 global connectivity 1 google chat 1 graphics 1 graphics editors 1 growing up 1 hacking 1 happiness 1 hard-link 1 hashing 1 hedonic adaptation 1 helion 1 history 1 hobby 1 home hosting 1 hostname 1 hostnamectl 1 how many people live on earth 1 humanity 1 humor 1 hybrid cloud 1 iOS 1 iPhone 18 Pro 1 iPhone launch 1 iftop 1 image generation 1 immortality 1 influencer criticism 1 information manipulation 1 infrastructure 1 infrastructure scalability 1 innovation 1 installation 1 integrations 1 intelligence 1 internet applications 1 investigative journalism 1 investing 1 jailbreaking 1 javascript 1 job market 1 kernel security 1 kuba wojewódzki 1 light 1 linux kernel 1 livepatch 1 login 1 loop-audit 1 loop-cost 1 loop-init 1 macOS Sequoia 1 magic 1 make life harder 1 making money 1 malicious JetBrains plugins 1 malware in IDE 1 markdown 1 markitdown 1 material design 1 meditation 1 memory 1 message security 1 messenger 1 meteorology 1 microsoft 1 microtargeting 1 military ethics 1 mobile applications 1 mobile photography 1 model interpretability 1 modern technologies 1 monorepo 1 mounting 1 mp3 player 1 multimodality 1 music 1 music player 1 mysteries 1 n8n security 1 national defense 1 nature conservation 1 net use 1 nethogs 1 network monitoring 1 network resources 1 network security 1 networking 1 neurobiology 1 neuroenhancement 1 neuroplasticity 1 neuropsychology 1 new life 1 new player 1 new things 1 nftables 1 office 1 onboarding 1 one-time cron 1 onestep4red 1 online 1 online courses 1 online privacy 1 outage 1 overstimulation 1 package manager 1 paper clips 1 paradox of the fulfilled dream 1 parenting 1 parents 1 password 1 password change 1 password policy 1 password recovery 1 password security 1 pdf 1 penetration testing 1 perseverance 1 personal data 1 phishing 1 php 1 plagiarism detection 1 plague 1 player 1 poison 1 police 1 predictions 1 productivity 1 productivity tools 1 promissory notes 1 protection 1 python 1 questions 1 radar 1 raspberry pi 5 1 real-time AI 1 red 1 regulations 1 relax 1 relaxation 1 remote work 1 reportage 1 rest 1 risk 1 robotaxi 1 root 1 router 1 routing 1 satellite data 1 satellite internet 1 science 1 scientific facts 1 scraping 1 screen 1 screenshot 1 series 1 show 1 skills 1 skydive 1 sleep 1 small big company 1 smart clothing 1 smartphone 1 smartphones 1 social engineering 1 society 1 software engineering 1 space 1 space technology 1 special forces 1 sport 1 sports 1 spreadsheet 1 sqlite 1 stalking 1 statistics 1 streaming 1 sub-millimeter sensor 1 success 1 symbolic link 1 syngrapha 1 sysctl 1 system acceleration 1 system diagnostics 1 systemd 1 tablet 1 talk show 1 technical documentation 1 technology ethics 1 technology future 1 technology regulations 1 television 1 terrorism 1 testing 1 the world in numbers 1 theology and science 1 threats 1 time management 1 time travel 1 timelapse 1 tips 1 two-factor authentication 1 ubuntu 1 udev 1 upbringing 1 updates 1 user interface 1 users 1 violence in the military 1 viral 1 virtualbox 1 walking 1 walking meetings 1 water retention 1 weather forecasting 1 webmaster 1 wellbeing 1 windows automation 1 wireless network 1 word processing 1 work 1 work automation 1 world 1 world cup 2026 1 world wide web 1 you are a miracle 1 zeitgeist 1

Blog archive

Table of contents