Live data from Hacker News

Spotify Optimized the Largest Dataflow Job Ever for Wrapped 2020

engineering.atspotify.com

61–70 of 135 posts

Re: Spotify Optimized the Largest Dataflow Job Ever for Wrapped 2020

#61

Anyone wanna know how much Spotify wanna know about you? https://twitter.com/steipete/status/1025024813889478656

What's scary about this?

They're complying with GDPR. Isn't that a good thing?

The "scary" thing in that tweet is that they store the manufacturer of their bluetooth headphones?

Re: Spotify Optimized the Largest Dataflow Job Ever for Wrapped 2020

#62

I came here expecting to read about the tech in the article or how others do big data processing stuff. Instead I get off topic Spotify rants.. Did you read the article or just see Spotify in the headline and decided your gripes therefore are relevant?

Agreed to I'll bite...

> The intuition is that for datasets commonly and frequently joined on a known key, e.g., user events with user metadata on a user ID, we can write them in bucket files with records bucketed and sorted by that key. By knowing which files contain a subset of keys and in what order, shuffle becomes a matter of merge-sorting values from matching bucket files, completely eliminating costly disk and network I/O of moving key–value pairs around.

I'm actually surprised that this should be regarded as "novel" in data science.

It reminds me of something in Eric Raymonds "The Art of Unix Programming" (I don't have time to find the link right now) where it discussed an approach from the earlier days of Linux filesystems where you had a limit on the number of iNodes that could exist in a single directory and corresponding performance. The work around was to create a subdirectory structure to store files based on the filename. But then you tended to get many files starting with the same characters all in the same directories. What turned out to be a better way to distribute the files evenly in the directory structure was to take the first and _last_ character of the file name and use those to create the subdirectories. This way you were more likely to spread the files evenly across the structure.

Re: Spotify Optimized the Largest Dataflow Job Ever for Wrapped 2020

#63
post #32
post #26

Wrapped works so well because it panders to you. Everyone likes to be acknowledged for listening to the weird indie band they discovered earlier this year. I enjoy it anyways, and Spotify is still a great service for now - I wonder if it'll meet the same fate as Netflix at some point, with publishing houses going for their own streaming services instead.

I wonder if it'll meet the same fate as Netflix at some point, with publishing houses going for their own streaming services instead. I don't think so because the way that people consume music and the way they consume films and television are very different. With a film you might block out a few hours to watch that specific provider. With music you're more likely to want to interleave content from several providers a…

No.. that's how I watch TV and movies too. What person do you know says "I only want to watch Paramount shit!"?

Re: Spotify Optimized the Largest Dataflow Job Ever for Wrapped 2020

#64

Spotify is a company that feels like they want to be a "big tech company" when in reality they do not need to. All they need to do is provide a great service with as much music as possible.

I for one love discover weekly and hope they will continue working on improving it. I consider it a core feature :)

Agree 100%. I always find great songs there. A cool feature to discover new music. But I guess we are not that sophisticated. Predicting which songs I'm gonna like is probably noit that difficult.

Re: Spotify Optimized the Largest Dataflow Job Ever for Wrapped 2020

#65
I'm having a hard time understanding this article. It seems to be a bit too low level on the specifics of Beam for general consumption.

From what i undestand, Spark has the same feature built in. If the planner knows that the source data is partitioned and/or sorted appropriately, it can skip shuffling/sorting it, instead having each executor directly requesting the one file it needs.

It's a nice optimization, but it's not game changing. You often end up having to shuffle anyway, as you are joining on a different key, or for performance reason you need more executors than the set amount of partitions, or the shuffle needed to write the data doesn't justify the savings on the readers.

Maybe it's better with their additional optimizations? Spark does not do those, mostly.

Re: Spotify Optimized the Largest Dataflow Job Ever for Wrapped 2020

#66

Hi not sure if I am just completely off here but I am wondering how this relates or compares to processing things with Kafka and Kafka Streams? If I am reading things correctly with Kafka the workflow equivalent to what's written in the article would be to have your producer produce via hash-based-round-robin (the default partitioning algorithm) based on the key you are interested in into some topic and then your con…

This is the most basic pattern for distributed joins - you hash on the join key in both tables and shuffle data based on hash ranges. In some systems like Redshift you can designate the key for distribution so that "related" records are already co-located on a single shard.

> our data would already be sorted for the given keys (because within a partition Kafka has sorting guarantees)

It's been a while since I used Kafka but I don't remember "sorting guarantees". Consumers see events "in order" based on when they were produced, because each partition is a queue.

Re: Spotify Optimized the Largest Dataflow Job Ever for Wrapped 2020

#67

Earlier quoted context omitted.

Speaking of interleaving, I wish Spotify understood how to interact with Concept Albums. Changing to the middle of The Wall for one song is jarring and I usually skip it. And then I worry skipping it is going to train the algorithm that I don't like Pink Floyd.

What does this mean? I don't use spotify. Are you saying when you go to listen to an album it will put a random song into the queue?

Spotify allows both: listening to random songs (either based on a particular genre, seeded from an existing playlist, or generated from the user’s listening habits), or choosing specific songs or albums to listen to.

They probably meant listening in random mode, and Spotify randomly choosing a track that doesn’t make much sense outside the context of its album.

Re: Spotify Optimized the Largest Dataflow Job Ever for Wrapped 2020

#68
post #62

I came here expecting to read about the tech in the article or how others do big data processing stuff. Instead I get off topic Spotify rants.. Did you read the article or just see Spotify in the headline and decided your gripes therefore are relevant?

Agreed to I'll bite... > The intuition is that for datasets commonly and frequently joined on a known key, e.g., user events with user metadata on a user ID, we can write them in bucket files with records bucketed and sorted by that key. By knowing which files contain a subset of keys and in what order, shuffle becomes a matter of merge-sorting values from matching bucket files, completely eliminating costly disk and…

>It reminds me of something in Eric Raymonds "The Art of Unix Programming" (I don't have time to find the link right now) where it discussed an approach from the earlier days of Linux filesystems where you had a limit on the number of iNodes that could exist in a single directory and corresponding performance. The work around was to create a subdirectory structure to store files based on the filename. But then you tended to get many files starting with the same characters all in the same directories. What turned out to be a better way to distribute the files evenly in the directory structure was to take the first and _last_ character of the file name and use those to create the subdirectories. This way you were more likely to spread the files evenly across the structure.

Interesting. I have been pondering over filesystem performance and inode limits in servers/home-servers since a long time. This seems useful infomration

Re: Spotify Optimized the Largest Dataflow Job Ever for Wrapped 2020

#70
My off-topic rant: I'd really wish Spotify would focus on improving the core player experience. It has barely seen any improvements in years.

* Not overwrite/delete my listening history everytime I switch devices

* Allow tabs, or some way to resume what I've been listening to in different contexts

* Option to open only one instance, instead of having multiple instances that mess with each other

* Playing local files crashes/not working on Linux

* Change playback speed, not just for podcasts

* Jump back/forward, not just for podcasts

* Have some visibility when the song was last played / play count

* Liked songs not always appearing in search results

* Sorting search results not working

* Add basic functionality to the dbus interface (e.g. seeking)

* Ability to report songs (e.g. wrong titles/badly split tracks/etc.)

Post reply on HN