SlideShare uma empresa Scribd logo
Spotify: P2P music-on-
demand streaming
Ricardo Santos – Spotify
@ricardovice
Basic requirements
• Lots of music
• Available everywhere, with great user interfaces
• More convenient than piracy
• Fast start of playback
• High availability (enough nines to put CDs in the
basement)
• Large scale (many many users)
The music
• Over 10 million tracks
• Growing every day, around 10k per day
• 96-320 kbps audio streams, most are Ogg
Vorbis q5, 160kbps
Accessibility
• People should always be able to access
music
• Whenever they want
• Wherever they are
but enough with the
marketing talk...
Latency matters
• High latency can be a problem, not only in
First Person Shooters
• Increased latency of Google searches by 100
– 400ms decreased usage by 0.2 – 0.6% (Jake
Brutlag, 2009)
• Slow performance is one of the major
reasons users abandon services
• Users don't come back
Latency matters
• Focus on low latency
• On average, the human notion of “instantly” is 200ms
• The median latency to begin play a track in Spotify is
265ms
• Due to disk lookup, at times it's actually faster to start
playing a track from network than from disk
• The SLA is maintained by monitoring latency in the client
Playing a track
• Check local cache
• Request first piece from Spotify servers
• Meanwhile, search P2P for remainder
• Switch between servers & P2P as needed
• Towards the end of a track, start pre-
fetching the next one via P2P rather than
our servers
When to start playing?
• Trade off between stutter & latency
• Look at last 15 min of transfer rates
• Model as Markov chain and simulate
• Coupled with some heuristics
• Production storage is a cache with fast drives &
lots of RAM
• Serves the most popular content
• A cache miss will generate a request to master
storage
• User will experience longer latency
• Production storage is available in several data
centers to ensure closeness to the user (latency
wise)
Production storage
Master storage
• Works as a DHT, with some redundancy
• Contains all available tracks but has slower
drives and access
• Tracks are kept in several formats, adding
up to around 290TB
P2P helps
• Easier to scale
• Less servers
• Less bandwidth
• Better uptime
• Less costs
• Fun!
P2P overview
• Not a piracy network, all tracks are added
by Spotify
• Used on all desktop clients (no mobile)
• Each client connected to <= 60 others
• All nodes are equals (no super nodes)
• A track is downloaded from several peers
P2P custom protocol
• Ask for most urgent pieces first
• If a peer is slow, re-request from new peers
• When buffers run low, download from
central servers
• If loading from servers, estimate at what
point P2P will catch up
• If buffers are very low, stop uploading
P2P finding peers
• Partial central tracker (BitTorrent-style)
• Broadcast query in small neighborhood
(Gnutella-style)
• Two mechanisms results in higher
availability
• Limited broadcast for local (LAN) peer
discovery (cherry on top...)
P2P security
• The client needs to be able to play music, but we have to
prevent reverse engineering from doing the same
• Therefor we can't openly discuss the details (Security
Trough Obscurity) but...
• Closed environment
• Verify integrity of downloaded files
• Data transfers are encrypted
• Usernames are not exposed in P2P network, all peers
assigned pseudonym
So, what's the
outcome?
• At over 10 million users the responses are
• 55.4% from client cache
• 35.8% from the P2P network
• 8.8% from the servers
I'd like to know more...
• Get in touch with us
• Checkout Gunnar Kreitz's slides and
academic papers on the subject:
http://www.csc.kth.se/~gkreitz/spotify-p2p10/
Oh, and
we have
cake as
well! :D
spotify.com/jobs
jobs@spotify.com

Mais conteúdo relacionado

Mais procurados

NANOG 84: DNS Openness
NANOG 84: DNS OpennessNANOG 84: DNS Openness
NANOG 84: DNS Openness
APNIC
 
SPDY Talk
SPDY TalkSPDY Talk
SPDY Talk
Bojan Babic
 
APRICOT 2015 - NetConf for Peering Automation
APRICOT 2015 - NetConf for Peering AutomationAPRICOT 2015 - NetConf for Peering Automation
APRICOT 2015 - NetConf for Peering Automation
Tom Paseka
 
Layer 7 denial of services attack mitigation
Layer 7 denial of services attack mitigationLayer 7 denial of services attack mitigation
Layer 7 denial of services attack mitigation
Ammar WK
 
What every successful open source project needs
What every successful open source project needsWhat every successful open source project needs
What every successful open source project needs
Steven Francia
 
BSides: BGP Hijacking and Secure Internet Routing
BSides: BGP Hijacking and Secure Internet RoutingBSides: BGP Hijacking and Secure Internet Routing
BSides: BGP Hijacking and Secure Internet Routing
APNIC
 
The curse of the open recursor
The curse of the open recursorThe curse of the open recursor
The curse of the open recursor
Tom Paseka
 
FVCP 20200610
FVCP 20200610FVCP 20200610
FVCP 20200610
Lorin Olsen
 
Message:Passing - lpw 2012
Message:Passing - lpw 2012Message:Passing - lpw 2012
Message:Passing - lpw 2012
Tomas Doran
 

Mais procurados (9)

NANOG 84: DNS Openness
NANOG 84: DNS OpennessNANOG 84: DNS Openness
NANOG 84: DNS Openness
 
SPDY Talk
SPDY TalkSPDY Talk
SPDY Talk
 
APRICOT 2015 - NetConf for Peering Automation
APRICOT 2015 - NetConf for Peering AutomationAPRICOT 2015 - NetConf for Peering Automation
APRICOT 2015 - NetConf for Peering Automation
 
Layer 7 denial of services attack mitigation
Layer 7 denial of services attack mitigationLayer 7 denial of services attack mitigation
Layer 7 denial of services attack mitigation
 
What every successful open source project needs
What every successful open source project needsWhat every successful open source project needs
What every successful open source project needs
 
BSides: BGP Hijacking and Secure Internet Routing
BSides: BGP Hijacking and Secure Internet RoutingBSides: BGP Hijacking and Secure Internet Routing
BSides: BGP Hijacking and Secure Internet Routing
 
The curse of the open recursor
The curse of the open recursorThe curse of the open recursor
The curse of the open recursor
 
FVCP 20200610
FVCP 20200610FVCP 20200610
FVCP 20200610
 
Message:Passing - lpw 2012
Message:Passing - lpw 2012Message:Passing - lpw 2012
Message:Passing - lpw 2012
 

Destaque

Absolute Radio - RAJAR Q2 09
Absolute Radio - RAJAR Q2 09Absolute Radio - RAJAR Q2 09
Absolute Radio - RAJAR Q2 09
Adam Bowie
 
The Future of Radio
The Future of RadioThe Future of Radio
The Future of Radio
Adam Bowie
 
Rajar 2009 Q4
Rajar 2009 Q4Rajar 2009 Q4
Rajar 2009 Q4
Adam Bowie
 
Peer Sim (P2P network)
Peer Sim (P2P network)Peer Sim (P2P network)
Peer Sim (P2P network)
Sijo Emmanuel
 
Radio Days Sweden
Radio Days SwedenRadio Days Sweden
Radio Days Sweden
Adam Bowie
 
Absolute Radio - RAJAR Q2 09
Absolute Radio - RAJAR Q2 09Absolute Radio - RAJAR Q2 09
Absolute Radio - RAJAR Q2 09
Adam Bowie
 
Social Media is a human p2p network. And Uber and AirBnb are the Napster of t...
Social Media is a human p2p network. And Uber and AirBnb are the Napster of t...Social Media is a human p2p network. And Uber and AirBnb are the Napster of t...
Social Media is a human p2p network. And Uber and AirBnb are the Napster of t...
Xavier Damman
 
Future Of Online Radio Middle East Glance
Future Of Online Radio   Middle East GlanceFuture Of Online Radio   Middle East Glance
Future Of Online Radio Middle East Glance
Khaled Husseini
 
Future of radio for today generation
Future of radio for today generationFuture of radio for today generation
Future of radio for today generation
Hemat Dwi Nuryanto
 
Rajar radio academy - adam bowie
Rajar   radio academy - adam bowieRajar   radio academy - adam bowie
Rajar radio academy - adam bowie
Adam Bowie
 
Future of the broadcasting spectrum
Future of the broadcasting spectrum Future of the broadcasting spectrum
Future of the broadcasting spectrum
Communication Research Centre
 
Google July 2010
Google July 2010Google July 2010
Google July 2010
Adam Bowie
 
Fjord@ The Future of Broadcasting
Fjord@ The Future of BroadcastingFjord@ The Future of Broadcasting
Fjord@ The Future of Broadcasting
Fjord
 
Absolute Radio Presentation
Absolute Radio PresentationAbsolute Radio Presentation
Absolute Radio Presentation
Adam Bowie
 
The Future of Radio and Broadcasting (Gerd Leonhard, The Futures Agency)
The Future of Radio and Broadcasting (Gerd Leonhard, The Futures Agency)The Future of Radio and Broadcasting (Gerd Leonhard, The Futures Agency)
The Future of Radio and Broadcasting (Gerd Leonhard, The Futures Agency)
Gerd Leonhard
 
Internet radio presentation
Internet radio presentationInternet radio presentation
Internet radio presentation
tjbacon530
 
2020 global digital transformation communicasia Gerd Leonhard Futurist Speake...
2020 global digital transformation communicasia Gerd Leonhard Futurist Speake...2020 global digital transformation communicasia Gerd Leonhard Futurist Speake...
2020 global digital transformation communicasia Gerd Leonhard Futurist Speake...
Gerd Leonhard
 
The future of marketing, advertising and the Internet: Futurist Speaker Gerd ...
The future of marketing, advertising and the Internet: Futurist Speaker Gerd ...The future of marketing, advertising and the Internet: Futurist Speaker Gerd ...
The future of marketing, advertising and the Internet: Futurist Speaker Gerd ...
Gerd Leonhard
 
News Media 2017: Trends & Forecasts in headlines
News Media 2017: Trends & Forecasts in headlines News Media 2017: Trends & Forecasts in headlines
News Media 2017: Trends & Forecasts in headlines
Tatiana Repkova
 
Technology vs Humanity: key themes from Futurist Gerd Leonhard's new book
Technology vs Humanity: key themes from Futurist Gerd Leonhard's new bookTechnology vs Humanity: key themes from Futurist Gerd Leonhard's new book
Technology vs Humanity: key themes from Futurist Gerd Leonhard's new book
Gerd Leonhard
 

Destaque (20)

Absolute Radio - RAJAR Q2 09
Absolute Radio - RAJAR Q2 09Absolute Radio - RAJAR Q2 09
Absolute Radio - RAJAR Q2 09
 
The Future of Radio
The Future of RadioThe Future of Radio
The Future of Radio
 
Rajar 2009 Q4
Rajar 2009 Q4Rajar 2009 Q4
Rajar 2009 Q4
 
Peer Sim (P2P network)
Peer Sim (P2P network)Peer Sim (P2P network)
Peer Sim (P2P network)
 
Radio Days Sweden
Radio Days SwedenRadio Days Sweden
Radio Days Sweden
 
Absolute Radio - RAJAR Q2 09
Absolute Radio - RAJAR Q2 09Absolute Radio - RAJAR Q2 09
Absolute Radio - RAJAR Q2 09
 
Social Media is a human p2p network. And Uber and AirBnb are the Napster of t...
Social Media is a human p2p network. And Uber and AirBnb are the Napster of t...Social Media is a human p2p network. And Uber and AirBnb are the Napster of t...
Social Media is a human p2p network. And Uber and AirBnb are the Napster of t...
 
Future Of Online Radio Middle East Glance
Future Of Online Radio   Middle East GlanceFuture Of Online Radio   Middle East Glance
Future Of Online Radio Middle East Glance
 
Future of radio for today generation
Future of radio for today generationFuture of radio for today generation
Future of radio for today generation
 
Rajar radio academy - adam bowie
Rajar   radio academy - adam bowieRajar   radio academy - adam bowie
Rajar radio academy - adam bowie
 
Future of the broadcasting spectrum
Future of the broadcasting spectrum Future of the broadcasting spectrum
Future of the broadcasting spectrum
 
Google July 2010
Google July 2010Google July 2010
Google July 2010
 
Fjord@ The Future of Broadcasting
Fjord@ The Future of BroadcastingFjord@ The Future of Broadcasting
Fjord@ The Future of Broadcasting
 
Absolute Radio Presentation
Absolute Radio PresentationAbsolute Radio Presentation
Absolute Radio Presentation
 
The Future of Radio and Broadcasting (Gerd Leonhard, The Futures Agency)
The Future of Radio and Broadcasting (Gerd Leonhard, The Futures Agency)The Future of Radio and Broadcasting (Gerd Leonhard, The Futures Agency)
The Future of Radio and Broadcasting (Gerd Leonhard, The Futures Agency)
 
Internet radio presentation
Internet radio presentationInternet radio presentation
Internet radio presentation
 
2020 global digital transformation communicasia Gerd Leonhard Futurist Speake...
2020 global digital transformation communicasia Gerd Leonhard Futurist Speake...2020 global digital transformation communicasia Gerd Leonhard Futurist Speake...
2020 global digital transformation communicasia Gerd Leonhard Futurist Speake...
 
The future of marketing, advertising and the Internet: Futurist Speaker Gerd ...
The future of marketing, advertising and the Internet: Futurist Speaker Gerd ...The future of marketing, advertising and the Internet: Futurist Speaker Gerd ...
The future of marketing, advertising and the Internet: Futurist Speaker Gerd ...
 
News Media 2017: Trends & Forecasts in headlines
News Media 2017: Trends & Forecasts in headlines News Media 2017: Trends & Forecasts in headlines
News Media 2017: Trends & Forecasts in headlines
 
Technology vs Humanity: key themes from Futurist Gerd Leonhard's new book
Technology vs Humanity: key themes from Futurist Gerd Leonhard's new bookTechnology vs Humanity: key themes from Futurist Gerd Leonhard's new book
Technology vs Humanity: key themes from Futurist Gerd Leonhard's new book
 

Semelhante a Spotify: P2P music-on-demand streaming

Talk on Spotify: Large Scale, Low Latency, P2P Music-on-Demand Streaming
Talk on Spotify: Large Scale, Low Latency, P2P Music-on-Demand StreamingTalk on Spotify: Large Scale, Low Latency, P2P Music-on-Demand Streaming
Talk on Spotify: Large Scale, Low Latency, P2P Music-on-Demand Streaming
Sameera Horawalavithana
 
P2P Lecture.ppt
P2P Lecture.pptP2P Lecture.ppt
P2P Lecture.ppt
JohnRebenRequinto1
 
P2P Forensics
P2P ForensicsP2P Forensics
P2P Forensics
Brian Baskin
 
PeerShark - Detecting Peer-to-Peer Botnets by Tracking Conversations
PeerShark - Detecting Peer-to-Peer Botnets by Tracking ConversationsPeerShark - Detecting Peer-to-Peer Botnets by Tracking Conversations
PeerShark - Detecting Peer-to-Peer Botnets by Tracking Conversations
Pratik Narang
 
ProjectTox: Free as in freedom Skype replacement
ProjectTox: Free as in freedom Skype replacementProjectTox: Free as in freedom Skype replacement
ProjectTox: Free as in freedom Skype replacement
Wei-Ning Huang
 
Network latency - measurement and improvement
Network latency - measurement and improvementNetwork latency - measurement and improvement
Network latency - measurement and improvement
Matt Willsher
 
Spotify architecture - Pressing play
Spotify architecture - Pressing playSpotify architecture - Pressing play
Spotify architecture - Pressing play
Niklas Gustavsson
 
How to video.
How to video.How to video.
How to video.
Cotap Engineering
 
Bit torrent seminar
Bit torrent seminarBit torrent seminar
Bit torrent seminar
balu0503
 
Bittorrent
BittorrentBittorrent
Bittorrent
sonangrai
 
Janus Workshop pt.2 @ ClueCon 2021
Janus Workshop pt.2 @ ClueCon 2021Janus Workshop pt.2 @ ClueCon 2021
Janus Workshop pt.2 @ ClueCon 2021
Lorenzo Miniero
 
WebRTC, RED and Janus @ ClueCon21
WebRTC, RED and Janus @ ClueCon21WebRTC, RED and Janus @ ClueCon21
WebRTC, RED and Janus @ ClueCon21
Lorenzo Miniero
 
Bittorrent
BittorrentBittorrent
Bittorrent
sravan3637
 
BitTorrent Protocol
BitTorrent ProtocolBitTorrent Protocol
BitTorrent Protocol
ArunKumar7374
 
E-commerceG1-C1 P2P
E-commerceG1-C1 P2PE-commerceG1-C1 P2P
E-commerceG1-C1 P2P
newnwan
 
JamRTC @ Wonder WebRTC unConference
JamRTC @ Wonder WebRTC unConferenceJamRTC @ Wonder WebRTC unConference
JamRTC @ Wonder WebRTC unConference
Lorenzo Miniero
 
Bittorrent
BittorrentBittorrent
Bittorrent
Anush Shenoy
 
Introduction to Computer Networking
Introduction to Computer NetworkingIntroduction to Computer Networking
Introduction to Computer Networking
Amit Saha
 
Peer to peer(p2 p)
Peer to peer(p2 p)Peer to peer(p2 p)
Peer to peer(p2 p)
Mukesh Pilaniya
 
Digitizing and Delivering Audio and Video
Digitizing and Delivering Audio and VideoDigitizing and Delivering Audio and Video
Digitizing and Delivering Audio and Video
Jenn Riley
 

Semelhante a Spotify: P2P music-on-demand streaming (20)

Talk on Spotify: Large Scale, Low Latency, P2P Music-on-Demand Streaming
Talk on Spotify: Large Scale, Low Latency, P2P Music-on-Demand StreamingTalk on Spotify: Large Scale, Low Latency, P2P Music-on-Demand Streaming
Talk on Spotify: Large Scale, Low Latency, P2P Music-on-Demand Streaming
 
P2P Lecture.ppt
P2P Lecture.pptP2P Lecture.ppt
P2P Lecture.ppt
 
P2P Forensics
P2P ForensicsP2P Forensics
P2P Forensics
 
PeerShark - Detecting Peer-to-Peer Botnets by Tracking Conversations
PeerShark - Detecting Peer-to-Peer Botnets by Tracking ConversationsPeerShark - Detecting Peer-to-Peer Botnets by Tracking Conversations
PeerShark - Detecting Peer-to-Peer Botnets by Tracking Conversations
 
ProjectTox: Free as in freedom Skype replacement
ProjectTox: Free as in freedom Skype replacementProjectTox: Free as in freedom Skype replacement
ProjectTox: Free as in freedom Skype replacement
 
Network latency - measurement and improvement
Network latency - measurement and improvementNetwork latency - measurement and improvement
Network latency - measurement and improvement
 
Spotify architecture - Pressing play
Spotify architecture - Pressing playSpotify architecture - Pressing play
Spotify architecture - Pressing play
 
How to video.
How to video.How to video.
How to video.
 
Bit torrent seminar
Bit torrent seminarBit torrent seminar
Bit torrent seminar
 
Bittorrent
BittorrentBittorrent
Bittorrent
 
Janus Workshop pt.2 @ ClueCon 2021
Janus Workshop pt.2 @ ClueCon 2021Janus Workshop pt.2 @ ClueCon 2021
Janus Workshop pt.2 @ ClueCon 2021
 
WebRTC, RED and Janus @ ClueCon21
WebRTC, RED and Janus @ ClueCon21WebRTC, RED and Janus @ ClueCon21
WebRTC, RED and Janus @ ClueCon21
 
Bittorrent
BittorrentBittorrent
Bittorrent
 
BitTorrent Protocol
BitTorrent ProtocolBitTorrent Protocol
BitTorrent Protocol
 
E-commerceG1-C1 P2P
E-commerceG1-C1 P2PE-commerceG1-C1 P2P
E-commerceG1-C1 P2P
 
JamRTC @ Wonder WebRTC unConference
JamRTC @ Wonder WebRTC unConferenceJamRTC @ Wonder WebRTC unConference
JamRTC @ Wonder WebRTC unConference
 
Bittorrent
BittorrentBittorrent
Bittorrent
 
Introduction to Computer Networking
Introduction to Computer NetworkingIntroduction to Computer Networking
Introduction to Computer Networking
 
Peer to peer(p2 p)
Peer to peer(p2 p)Peer to peer(p2 p)
Peer to peer(p2 p)
 
Digitizing and Delivering Audio and Video
Digitizing and Delivering Audio and VideoDigitizing and Delivering Audio and Video
Digitizing and Delivering Audio and Video
 

Último

Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
Postman
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Jeffrey Haguewood
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 

Último (20)

Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 

Spotify: P2P music-on-demand streaming

  • 1. Spotify: P2P music-on- demand streaming Ricardo Santos – Spotify @ricardovice
  • 2. Basic requirements • Lots of music • Available everywhere, with great user interfaces • More convenient than piracy • Fast start of playback • High availability (enough nines to put CDs in the basement) • Large scale (many many users)
  • 3. The music • Over 10 million tracks • Growing every day, around 10k per day • 96-320 kbps audio streams, most are Ogg Vorbis q5, 160kbps
  • 4. Accessibility • People should always be able to access music • Whenever they want • Wherever they are
  • 5.
  • 6.
  • 7.
  • 8. but enough with the marketing talk...
  • 9. Latency matters • High latency can be a problem, not only in First Person Shooters • Increased latency of Google searches by 100 – 400ms decreased usage by 0.2 – 0.6% (Jake Brutlag, 2009) • Slow performance is one of the major reasons users abandon services • Users don't come back
  • 10. Latency matters • Focus on low latency • On average, the human notion of “instantly” is 200ms • The median latency to begin play a track in Spotify is 265ms • Due to disk lookup, at times it's actually faster to start playing a track from network than from disk • The SLA is maintained by monitoring latency in the client
  • 11. Playing a track • Check local cache • Request first piece from Spotify servers • Meanwhile, search P2P for remainder • Switch between servers & P2P as needed • Towards the end of a track, start pre- fetching the next one via P2P rather than our servers
  • 12. When to start playing? • Trade off between stutter & latency • Look at last 15 min of transfer rates • Model as Markov chain and simulate • Coupled with some heuristics
  • 13.
  • 14. • Production storage is a cache with fast drives & lots of RAM • Serves the most popular content • A cache miss will generate a request to master storage • User will experience longer latency • Production storage is available in several data centers to ensure closeness to the user (latency wise) Production storage
  • 15. Master storage • Works as a DHT, with some redundancy • Contains all available tracks but has slower drives and access • Tracks are kept in several formats, adding up to around 290TB
  • 16.
  • 17. P2P helps • Easier to scale • Less servers • Less bandwidth • Better uptime • Less costs • Fun!
  • 18. P2P overview • Not a piracy network, all tracks are added by Spotify • Used on all desktop clients (no mobile) • Each client connected to <= 60 others • All nodes are equals (no super nodes) • A track is downloaded from several peers
  • 19. P2P custom protocol • Ask for most urgent pieces first • If a peer is slow, re-request from new peers • When buffers run low, download from central servers • If loading from servers, estimate at what point P2P will catch up • If buffers are very low, stop uploading
  • 20. P2P finding peers • Partial central tracker (BitTorrent-style) • Broadcast query in small neighborhood (Gnutella-style) • Two mechanisms results in higher availability • Limited broadcast for local (LAN) peer discovery (cherry on top...)
  • 21. P2P security • The client needs to be able to play music, but we have to prevent reverse engineering from doing the same • Therefor we can't openly discuss the details (Security Trough Obscurity) but... • Closed environment • Verify integrity of downloaded files • Data transfers are encrypted • Usernames are not exposed in P2P network, all peers assigned pseudonym
  • 22. So, what's the outcome? • At over 10 million users the responses are • 55.4% from client cache • 35.8% from the P2P network • 8.8% from the servers
  • 23.
  • 24. I'd like to know more... • Get in touch with us • Checkout Gunnar Kreitz's slides and academic papers on the subject: http://www.csc.kth.se/~gkreitz/spotify-p2p10/
  • 25. Oh, and we have cake as well! :D spotify.com/jobs jobs@spotify.com